query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Adding a store with unit price
public function addStore(Store $store, $unitprice = 0) { $this->addInfo(ProductInfoType::get(ProductInfoType::ID_STORE), $store, $unitprice, true); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_store($store)\n {\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function add($receipt){\n\tDatabase::add('SOLD_ITEMS', array($receipt, $this->id,$this->quantity,$this->total));\n\tSales_Item::update($this->id,'SELL',$this->quantity);\n}", "function add_store()\n {\n\tglobal $template;\n\tglobal $connect;\n\n\t$sys_connect = sys_db_connect();\n\t$product_id = $_REQUEST[product_id];\n\t$product_name = addslashes($_REQUEST[product_name]);\n\t$shop_price = $_REQUEST[shop_price];\n\t$options = $_REQUEST[options];\n\t$memo = addslashes($_REQUEST[memo]);\n\n\n\t$sql = \"select product_id from ez_store \n\t\t where domain = '\"._DOMAIN_.\"' \n\t\t and product_id = '$product_id'\";\n\t$list0 = mysql_fetch_array(mysql_query($sql, $sys_connect));\n\n\n\t$sql = \"select * from products where product_id = '$product_id'\";\n\t$list = mysql_fetch_array(mysql_query($sql, $connect));\n\t\n\t////////////////////////////////////////\n\t// make thumb image\n\tif ($list[img_500] && file_exists(_save_dir.$list[img_500]))\n\t{\n\t $img_150 = _save_dir . str_replace(\"_500\", \"_150\", $list[img_500]);\n\t if (!file_exists($img_150))\n\t {\n\t\t$cmd = \"/usr/local/bin/convert -resize 150x150 \"._save_dir.$list[img_500].\" \".$img_150;\n\t\texec($cmd);\n\t }\n\t $img_250 = _save_dir . str_replace(\"_500\", \"_250\", $list[img_500]);\n\t if (!file_exists($img_250))\n\t {\n\t\t$cmd = \"/usr/local/bin/convert -resize 250x250 \"._save_dir.$list[img_500].\" \".$img_250;\n\t\texec($cmd);\n\t }\n\t}\n\n\tif ($list0[product_id])\t\t// update\n\t{\n\t $upd_sql = \"update ez_store set\n\t\t\t\tname = '$product_name',\n\t\t\t\tshop_price = '$shop_price',\n\t\t\t\toptions = '$options',\n\t\t\t\tmemo = '$memo',\n\t\t\t\tis_sale = 1\n\t\t\t where domain = '\"._DOMAIN_.\"'\n\t\t\t and product_id = '$product_id'\";\n\t mysql_query($upd_sql, $sys_connect) or die(mysql_error());\n\t}\n\telse\t\t\t\t// insert\n\t{\n\t ////////////////////////////////////////\n\t $ins_sql = \"insert into ez_store set\n\t\t\tdomain \t\t= '\" . _DOMAIN_ . \"',\n\t\t\tproduct_id \t= '$list[product_id]',\n\t\t\tname\t\t= '$list[name]',\n\t\t\torigin\t\t= '$list[origin]',\n\t\t\tbrand\t\t= '$list[brand]',\n\t\t\toptions\t\t= '$list[options]',\n\t\t\tshop_price\t= '$list[shop_price]',\n\t\t\ttrans_fee\t= '$list[trans_fee]',\n\t\t\tproduct_desc\t= '$list[product_desc]',\n\t\t\timg_500\t\t= '$list[img_500]',\n\t\t\timg_desc1\t= '$list[img_desc1]',\n\t\t\timg_desc2\t= '$list[img_desc2]',\n\t\t\timg_desc3\t= '$list[img_desc3]',\n\t\t\timg_desc4\t= '$list[img_desc4]',\n\t\t\timg_desc5\t= '$list[img_desc5]',\n\t\t\timg_desc6\t= '$list[img_desc6]',\n\t\t\treg_date \t= now(),\n\t\t\treg_time \t= now(),\n\t\t\tis_sale \t= 1\n\t \";\n\t mysql_query($ins_sql, $sys_connect) or die(mysql_error());\n\t}\n\n\t// add by sy.hwang 2007.5.4\n\t$sql = \"select seq from ez_store \n\t\t where domain = '\"._DOMAIN_.\"'\n\t\t and product_id = '$product_id'\";\n\t$list = mysql_fetch_array(mysql_query($sql, $sys_connect));\n\n\t$store_id = sprintf(\"A%05d\", $list[seq]);\n\t$upd_sql = \"update ez_store set store_id = '$store_id' \n\t\t where domain = '\"._DOMAIN_.\"'\n\t\t and product_id = '$product_id'\";\n\tmysql_query($upd_sql, $sys_connect) or die(mysql_error());\n\n\t$upd_sql = \"update products set is_store = 1 where product_id = '$product_id'\";\n\tmysql_query($upd_sql, $connect) or die(mysql_error());\n\t\n $this->redirect(\"popup.htm?template=CK18&product_id=$product_id\");\n exit;\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "function add_item( $params ) {\n\t\textract( $params );\n\n\t\tif( empty( $cart_id ) )\n\t\t\treturn false;\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, sales_price WRITE, stock WRITE\" );\n\n\t\t// In case of quote, no need to look up price in sales_price table, it's already provided\n\n\t\t// There are 3 sort of prices: customer price group, customer price, bodyshop. In cart the first 2 are taken into account.\n\t\t// The latter is to indicate to bodyshop what would be the price when reselling the item. Bodyshop prices are known by\n\t\t// customer_group CHOUT, customer override is by the user_no else customer group.\n\t\tif( !empty( $price ) )\n\t\t\t$prices = array( 'price' => $price, 'charge_out' => 0 );\n\t\telse {\n\t\t\t// Retrieve the unit price of the product based on the user and customer group\n\t\t\t$res = $this->db->query( \"SELECT GROUP_CONCAT(CONCAT(customer_group,';',price) SEPARATOR '|')price FROM sales_price WHERE sku='\".$item_id.\"' AND (customer_group='\".$user_no.\"' OR customer_group IN ('\".$customer_group.\"') OR ('\".$user_no.\"' LIKE '1%' AND customer_group='CHOUT'))\" )->row_array();\n\n\t\t\t$prices = misc::get_available_prices( $res[ 'price' ], $user_no, $vat );\n\t\t}\n\n\t\t$quote_no = empty( $quote_no ) ? '' : $quote_no;\n\t\t// Apply the changes against the database\n\t\t$qry = \"INSERT INTO cart_items SET cart_id='\".$cart_id.\"', sku='\".$item_id.\"', user='\".$user_no.\"', qty='\".$qty.\"', pu=\".$prices[ 'price' ].\", ebay_shipping='\".$ebay_shipping.\"', creation_date=DATE_FORMAT(NOW(),'%Y%m%d'), quote_no='\".$quote_no.\"' ON DUPLICATE KEY UPDATE qty=qty+'\".$qty.\"', ebay_shipping='\".$ebay_shipping.\"'\";\n\n\t\t$this->db->query( $qry );\n\t\n\t\t// Update the qty of the stock\n\t\t// It's only executed when the order is not created from a quote\n\t\tif( $quote_no == '' )\n\t\t\t$this->db->query( \"UPDATE stock SET qty=qty-\".$qty.\" WHERE sku='\".$item_id.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\n\t\treturn $prices;\n\t}", "function addItem($itemName, $unitPrice, $parNumber, $salesPrice){\n global $db;\n $success=false;\n $stmt=$db->prepare(\"INSERT INTO inventory (name, amount, unitPrice, salesPrice, parAmount) Values (:itemName, 0, :unitPrice, :salesPrice, :parNumber)\");\n \n $binds = array(\n \":itemName\" => $itemName,\n \":unitPrice\" => $unitPrice,\n \":parNumber\" => $parNumber,\n \":salesPrice\"=>$salesPrice\n );\n \n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $success=true;\n }\n return($success);\n }", "public function testCreateStore() {\n $this->drupalGet('admin/commerce/config/stores');\n $this->getSession()->getPage()->clickLink('Add store');\n\n // Check the integrity of the form.\n $this->assertSession()->fieldExists('name[0][value]');\n $this->assertSession()->fieldExists('mail[0][value]');\n $this->assertSession()->fieldExists('address[0][address][country_code]');\n $this->assertSession()->fieldExists('billing_countries[]');\n $this->assertSession()->fieldExists('is_default[value]');\n\n $this->getSession()->getPage()->fillField('address[0][address][country_code]', 'US');\n $this->getSession()->wait(4000, 'jQuery(\\'select[name=\"address[0][address][administrative_area]\"]\\').length > 0 && jQuery.active == 0;');\n\n $name = $this->randomMachineName(8);\n $edit = [\n 'name[0][value]' => $name,\n 'mail[0][value]' => \\Drupal::currentUser()->getEmail(),\n 'default_currency' => 'USD',\n 'timezone' => 'UTC',\n ];\n $address = [\n 'address_line1' => '1098 Alta Ave',\n 'locality' => 'Mountain View',\n 'administrative_area' => 'CA',\n 'postal_code' => '94043',\n ];\n foreach ($address as $property => $value) {\n $path = 'address[0][address][' . $property . ']';\n $edit[$path] = $value;\n }\n $this->submitForm($edit, t('Save'));\n $this->assertSession()->pageTextContains(\"Saved the $name store.\");\n }", "public function addSale(string $instrumentName, int $quantity, float $price): ValuationMethodInterface\n {\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function addSkuUnits ( $data )\n {\n return $this->db->insert( 'tbld_unit', $data );\n }", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function add_unit_to_army($unit_id, $army_id)\n\t{\n\t\t$result = pg_prepare(\"point_query\", \"SELECT init_point_cost FROM warhammer.unit_list WHERE unit_id=$1\");\n\t\t$result = pg_execute(\"point_query\", array($unit_id));\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\t$points = $result_a[\"init_point_cost\"];\n\t\t$result = pg_prepare(\"add_query\", \"INSERT INTO warhammer.user_army VALUES (DEFAULT,$1,null,$2)\");\n\t\t$result = pg_execute(\"add_query\", array($unit_id,$points));\n\t\tpg_free_result($result);\n\t}", "public function addToOrder($product, $currency = '')\n {\n $params = $this->getOrder();\n\n $prod = is_object($product) ? $product->getData() : $product;\n if (!isset($prod['product'])) {\n $prod['product'] = $prod;\n }\n $prod['quantity'] = isset($prod['quantity']) ? $prod['quantity'] : 1;\n\n $merge = false;\n $ignore_service = array();\n // Проверяем есть ли такой товар в корзине, если имеется, то увеличиваем количество\n foreach ($params['order']['items'] as $k => $item) {\n if ($item['sku_id'] == $prod['sku_id']) {\n $params['order']['items'][$k]['quantity'] += $prod['quantity'];\n $merge = true;\n $item_id = $k;\n }\n // Если в заказе имеется услуга и, мы ее же пытаемся добавить с новым товаром, \n // устанавливаем флаг, чтобы игнорировать повторное добавление услуги\n if ($item['type'] == 'service' && $prod['sku_id'] == $item['sku_id'] && isset($prod['services'][$item['service_variant_id']])) {\n $ignore_service[$item['service_variant_id']] = true;\n }\n }\n\n $prod['currency'] = $currency ? $currency : $params['order']['currency'];\n if (!$merge) {\n $params['order']['items'][] = $prod;\n end($params['order']['items']);\n $item_id = key($params['order']['items']);\n reset($params['order']['items']);\n }\n // Добавляем услуги к заказу\n if (!empty($prod['services'])) {\n foreach ($prod['services'] as $variant_id => $variant) {\n if (empty($ignore_service[$variant_id])) {\n $params['order']['items'][] = array(\n 'type' => 'service',\n 'service_id' => $variant['service_id'],\n 'service_variant_id' => $variant_id,\n 'parent_id' => $item_id,\n 'price' => $variant['price'],\n 'currency' => $variant['currency']\n );\n }\n // Изменяем общую цену заказа\n $params['order']['total'] += (float) $variant['price'] * $prod['quantity'];\n }\n }\n\n // Добавляем товары в общую выборку при динамическом обновлении информационных блоков\n if (waRequest::isXMLHttpRequest()) {\n $data_class = new shopFlexdiscountData();\n $data_class->setShopProducts($params['order']['items']);\n }\n\n // Изменяем общую цену заказа\n $product_price = (float) shop_currency((float) $prod['price'] * $prod['quantity'], $prod['currency'], $params['order']['currency'], false);\n $params['order']['total'] += shopRounding::roundCurrency($product_price, $params['order']['currency']);\n\n return $params;\n }", "public function addItem(string $sku, int $qty): Cart;", "public function AddProduct () {\n $piece1 = '(';\n \t$piece2 = '';\n\t\t\n\t\tif(isset($SKU)) {\n\t\t\t$piece1 .= 'ProductSKU,';\n\t\t\t$piece2 .= \"'\" . $this->SKU . \"'\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: SKU Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$productTable = 'Products';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $productResults = OrderData::InsertData($productTable, $productPiece);\n\t\t\n\t\tif($productResults === false)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(isset($Qty)) {\n\t\t\t$piece1 .= 'TotalAMT,';\n\t\t\t$piece2 .= \"\" . $this->initialquantityStock . \"\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: Quantity Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$piece1 .= 'CommittedAMT,';\n\t\t$piece2 .= $this->committedStock . ',';\n\n \t\t$piece1 .= 'AvailableAMT';\n $piece2 .= $this->availableStock . ')';\n\t\t\n\t\t$piece1 .= ') VALUES (';\n\n $inventoryPiece = $piece1 . $piece2;\n\t\t\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $inventoryResults = OrderData::InsertData($inventoryTable, $inventoryPiece);\n\t\t\n\t\tif($inventoryResults === false)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "function update($units, $total){}", "public function addNewItemToStock($branchId, $itemId, $quantity, $baseUnitId, $showUnitId, $price)\n {\n $stock = stock::where('branch_id',$branchId)\n ->where('item_id',$itemId)\n ->first();\n\n if (!$stock) {\n\n $addNewItemToStockId = stock::create([\n 'branch_id'=>$branchId,'item_id'=>$itemId\n ,'quantity'=>$quantity,'base_unit_id'=>$baseUnitId\n ,'show_unit_id'=>$showUnitId,'price'=>$price\n ])->id;\n\n return $this->getStockById($addNewItemToStockId);\n\n } else {\n \n $msg = 'item exist';\n return $this->generalResponse(false,409,$msg, null,null);\n \n }\n \n \n }", "public function addItem($name, $description, $unitPrice, $quantity, $weight = 0, $type = 'Asset', $sku = '') {\n\n $this->jsonData['Cart']['Items'][] = array(\n 'Name' => $name,\n 'Description' => $description,\n 'UnitPrice' => $this->validateNumber($unitPrice, 18),\n 'Quantity' => $this->validateNumber($quantity, 9),\n 'Weight' => $this->validateNumber($weight, 9),\n 'Type' => $this->validateType($type, 'Item'),\n 'Sku' => $this->validateString($sku, 32) // Whatever the hell it is\n );\n\n }", "function add_product_to_order($id_order,$id_product,$sauce){\r\n $bdd = Database3Splus::getinstance();//connexion();\r\n $amount = 1;\r\n $req = \"INSERT INTO order_details VALUES (:id_order, :id_product, :amount, :sauce)\";\r\n $result = $bdd->prepare($req);\r\n $result->bindParam(':id_order', $id_order);\r\n $result->bindParam(':id_product', $id_product);\r\n $result->bindParam(':amount', $amount);\r\n $result->bindParam(':sauce', $sauce);\r\n $result->execute();\r\n $count = $result->rowCount();\r\n\t\tif($count != 0){return TRUE;}\r\n\t\telse{return FALSE;}\r\n\t}", "abstract function total_price($price_summary);", "public function testCreateProductStore()\n {\n\n }", "public function addToAllStore()\n\t{\n\t\t$store = new Store();\n\t\t$store->setId(0);\n\t\t$this->addInfo(ProductInfoType::get(ProductInfoType::ID_STORE), $store, 0, true);\n\t\treturn $this;\n\t}", "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function add(){\n\n\t\t$db = new dbconnection();\n\t\t$conn = $db->startconnection();\t\n\n\t\t$query = $conn->prepare(\"INSERT INTO item(`item_code`,`item_category`,`item_subcategory`,`item_name`,`quantity`,`unit_price`) values (?,?,?,?,?,?)\");\n\n\t\t$query->bind_param(\"ssssss\",$this->itemcode,$this->category,$this->subcategory,$this->itemname,$this->quantity,$this->uprice);\n\t\t\t\n\t\t\tif($query->execute()){\n\n\t\t\treturn 1;\n\n\t\t}else{\n\n\t\t\treturn 0;\n\n\t\t}\n\n\n\t\t}", "public function addSale($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "function add_cart_item( $cart_item ) {\n\t\t\t\tif (isset($cart_item['addons'])) :\n\t\t\t\t\t\n\t\t\t\t\t$extra_cost = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($cart_item['addons'] as $addon) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($addon['price']>0) $extra_cost += $addon['price'];\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t\t$cart_item['data']->adjust_price( $extra_cost );\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\treturn $cart_item;\n\t\t\t\t\n\t\t\t}", "function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}" ]
[ "0.67356503", "0.6298378", "0.6246536", "0.62045646", "0.6179257", "0.59505224", "0.5869652", "0.58398336", "0.5825429", "0.58190084", "0.5813217", "0.5813217", "0.5793717", "0.57617974", "0.5745196", "0.5732005", "0.57174885", "0.57118416", "0.57090354", "0.5707987", "0.5699718", "0.56934726", "0.56371546", "0.5616349", "0.56053674", "0.56017697", "0.5578369", "0.55762154", "0.55524576", "0.5534994" ]
0.6863115
0
Adding this product to all stores
public function addToAllStore() { $store = new Store(); $store->setId(0); $this->addInfo(ProductInfoType::get(ProductInfoType::ID_STORE), $store, 0, true); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionAddProductList()\n\t{\n\t\t$order_id=Yii::app()->request->getQuery('id');\n\t\t$model = $this->_loadModel($order_id);\n\t\t$dataProvider = new StoreProduct('search');\n\n\t\tif(isset($_GET['StoreProduct']))\n\t\t\t$dataProvider->attributes = $_GET['StoreProduct'];\n\n\t\t$this->renderPartial('_addProduct', array(\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'order_id' => $order_id,\n\t\t\t'model' => $model,\n\t\t));\n\t}", "public function addStore ($data) {\n $output = array();\n $sh_result = exec('sudo '.STORE_BUILD_DIR.'build_store.sh ' . $data['code'] . ' '. $data['final_domain'] . ' ' . $data['code'] , $output); \n\n\t $store_productsets = $data['store_productsets'];\n\t unset($data['store_productsets']);\n\t \n\t $this->db->add('store', $data);\n\t $store_id = $this->db->get_last_insert_id();\n\t \n\t $store_productsets_data['store_id'] = $store_id;\n\t \n\t $this->load->model('user/productset');\n\t \t \n \t\tforeach ($store_productsets as $productset_id) {\n \t\t \n \t\t if ($this->model_user_productset->is_own_or_core_productset($productset_id, $data['user_id'])) {\n \t\t \n \t\t $store_productsets_data['productset_id'] = $productset_id;\n \t\t $this->db->add('store_productsets', $store_productsets_data);\n \t\t }\n \t\t}\n\n // KMC : New 06/28/2010 :\n $this->buildNewStoreData($data['code'], $store_productsets); \n $template_output = $this->buildSiteTemplatePieces($data['code'], $data['user_id']);\n $output = array_merge($output, $template_output);\n return $output;\n\t}", "function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}", "public function storeProduct();", "public function add_store($store)\n {\n }", "public function add()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare')?$this->View()->getSession('compare'):array();\n\n if (!in_array($product_id, $compareProducts)) {\n $compareProducts[] = $product_id;\n }\n // set products to session\n $this->View()->setSession('compare', $compareProducts);\n\n // for ajax request\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_set'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }", "function add_store()\n {\n\tglobal $template;\n\tglobal $connect;\n\n\t$sys_connect = sys_db_connect();\n\t$product_id = $_REQUEST[product_id];\n\t$product_name = addslashes($_REQUEST[product_name]);\n\t$shop_price = $_REQUEST[shop_price];\n\t$options = $_REQUEST[options];\n\t$memo = addslashes($_REQUEST[memo]);\n\n\n\t$sql = \"select product_id from ez_store \n\t\t where domain = '\"._DOMAIN_.\"' \n\t\t and product_id = '$product_id'\";\n\t$list0 = mysql_fetch_array(mysql_query($sql, $sys_connect));\n\n\n\t$sql = \"select * from products where product_id = '$product_id'\";\n\t$list = mysql_fetch_array(mysql_query($sql, $connect));\n\t\n\t////////////////////////////////////////\n\t// make thumb image\n\tif ($list[img_500] && file_exists(_save_dir.$list[img_500]))\n\t{\n\t $img_150 = _save_dir . str_replace(\"_500\", \"_150\", $list[img_500]);\n\t if (!file_exists($img_150))\n\t {\n\t\t$cmd = \"/usr/local/bin/convert -resize 150x150 \"._save_dir.$list[img_500].\" \".$img_150;\n\t\texec($cmd);\n\t }\n\t $img_250 = _save_dir . str_replace(\"_500\", \"_250\", $list[img_500]);\n\t if (!file_exists($img_250))\n\t {\n\t\t$cmd = \"/usr/local/bin/convert -resize 250x250 \"._save_dir.$list[img_500].\" \".$img_250;\n\t\texec($cmd);\n\t }\n\t}\n\n\tif ($list0[product_id])\t\t// update\n\t{\n\t $upd_sql = \"update ez_store set\n\t\t\t\tname = '$product_name',\n\t\t\t\tshop_price = '$shop_price',\n\t\t\t\toptions = '$options',\n\t\t\t\tmemo = '$memo',\n\t\t\t\tis_sale = 1\n\t\t\t where domain = '\"._DOMAIN_.\"'\n\t\t\t and product_id = '$product_id'\";\n\t mysql_query($upd_sql, $sys_connect) or die(mysql_error());\n\t}\n\telse\t\t\t\t// insert\n\t{\n\t ////////////////////////////////////////\n\t $ins_sql = \"insert into ez_store set\n\t\t\tdomain \t\t= '\" . _DOMAIN_ . \"',\n\t\t\tproduct_id \t= '$list[product_id]',\n\t\t\tname\t\t= '$list[name]',\n\t\t\torigin\t\t= '$list[origin]',\n\t\t\tbrand\t\t= '$list[brand]',\n\t\t\toptions\t\t= '$list[options]',\n\t\t\tshop_price\t= '$list[shop_price]',\n\t\t\ttrans_fee\t= '$list[trans_fee]',\n\t\t\tproduct_desc\t= '$list[product_desc]',\n\t\t\timg_500\t\t= '$list[img_500]',\n\t\t\timg_desc1\t= '$list[img_desc1]',\n\t\t\timg_desc2\t= '$list[img_desc2]',\n\t\t\timg_desc3\t= '$list[img_desc3]',\n\t\t\timg_desc4\t= '$list[img_desc4]',\n\t\t\timg_desc5\t= '$list[img_desc5]',\n\t\t\timg_desc6\t= '$list[img_desc6]',\n\t\t\treg_date \t= now(),\n\t\t\treg_time \t= now(),\n\t\t\tis_sale \t= 1\n\t \";\n\t mysql_query($ins_sql, $sys_connect) or die(mysql_error());\n\t}\n\n\t// add by sy.hwang 2007.5.4\n\t$sql = \"select seq from ez_store \n\t\t where domain = '\"._DOMAIN_.\"'\n\t\t and product_id = '$product_id'\";\n\t$list = mysql_fetch_array(mysql_query($sql, $sys_connect));\n\n\t$store_id = sprintf(\"A%05d\", $list[seq]);\n\t$upd_sql = \"update ez_store set store_id = '$store_id' \n\t\t where domain = '\"._DOMAIN_.\"'\n\t\t and product_id = '$product_id'\";\n\tmysql_query($upd_sql, $sys_connect) or die(mysql_error());\n\n\t$upd_sql = \"update products set is_store = 1 where product_id = '$product_id'\";\n\tmysql_query($upd_sql, $connect) or die(mysql_error());\n\t\n $this->redirect(\"popup.htm?template=CK18&product_id=$product_id\");\n exit;\n }", "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function addProducts(array $products);", "public function store(ProductStoreRequest $request)\n {\n $this->productService->store($request);\n }", "public function add_product_to_basket_post() {\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $special_id = (int) $this -> post('special_id') ? (int) $this -> post('special_id') : 0;\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $product_count = (int) $this -> post('product_count') ? (int) $this -> post('product_count') : \"1\";\n $addToShoppingList = trim($this -> post('add_to_shopping_list')) ? strtolower($this -> post('add_to_shopping_list')) : \"no\";\n $retailer_id = $this -> post('retailer_id') ? $this -> post('retailer_id') : \"\";\n $store_id = $this -> post('store_id') ? $this -> post('store_id') : \"\";\n $remove_previous = trim($this -> post('remove_previous')) ? trim( strtolower($this -> post('remove_previous'))) : \"no\";\n \n $allToAdd = \"No\";\n $isProductExist = \"No\";\n \n # Get Store details\n $storeDetails = $this -> basketmodel ->get_store_details($store_id);\n if($storeDetails)\n {\n $storeTypeId = $storeDetails['StoreTypeId'];\n \n # Get products StorePrice \n $productStorePrice = $this -> productmodel ->get_product_store_price($product_id,$retailer_id,$storeTypeId,$store_id);\n \n if($productStorePrice > 0 )\n {\n $allToAdd = \"Yes\"; \n }\n }\n \n if($allToAdd == \"Yes\")\n {\n # Remove all products from user's basket\n if( $remove_previous == 'yes')\n {\n $isRemoved = $this -> basketmodel -> remove_user_basket($user_id); \n }\n \n $result = $this -> basketmodel -> add_product_to_basket($special_id, $product_id, $user_id, $product_count,$retailer_id,$store_id);\n \n # Add to shopping list starts\n if($addToShoppingList == 'yes'){ \n \n # Get shopping list\n $shopping_list = $this -> quickshoppingmodel -> get_list($user_id);\n\n $shopping_list_array = array();\n if (!empty($shopping_list['ShoppingList'])) {\n $shopping_list_array = explode(\",\", $shopping_list['ShoppingList']);\n }\n\n $item_details = array();\n if (!empty($shopping_list_array)) {\n foreach ($shopping_list_array as $item) {\n $item = str_replace('|||', ',', $item);\n $item_array = explode(':::', $item);\n\n $item_array['name'] = $item_array[0];\n $item_array['product_id'] = $item_array[1];\n $item_array['retailer_id'] = $item_array[2];\n $item_array['store_type_id'] = $item_array[3];\n $item_array['store_id'] = $item_array[4];\n \n if( $item_array['product_id'] == $product_id){\n $item_array['count'] = $product_count;\n $isProductExist = \"Yes\";\n }else{\n $item_array['count'] = $item_array[5];\n }\n \n $item_array['bought'] = isset($item_array[6]) ? $item_array[6] : '0';\n\n unset($item_array[0], $item_array[1], $item_array[2], $item_array[3], $item_array[4], $item_array[5], $item_array[6]);\n $item_array['is_special'] = \"0\";\n\n $user_pref_retailer = $this -> basketmodel -> get_user_preferred_retailer($user_id);\n $product = $this -> productmodel -> product_details($item_array['product_id'], $user_pref_retailer -> Id, $user_id,$special_id);\n\n $product_price = $product['store_price'];\n if ($product['SpecialPrice'] > 0) {\n $product_price = $product['SpecialPrice'];\n $item_array['is_special'] = \"1\";\n }\n if ($product['SpecialPrice'] > 0 && $product['SpecialQty'] > 1) {\n $product_price = $product['SpecialPrice'] / $product['SpecialQty'];\n }\n if ($item_array['count'] > 1) {\n $product_price = $product_price * $item_array['count'];\n }\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n\n if ($product_price <= 0) {\n $product_price = '0.00';\n }\n else {\n $product_price = $product_price . '.00';\n }\n $item_array['price'] = $product_price;\n }\n else {\n $product_price = round($product_price, 2);\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n $product_price = $product_price . '.00';\n }\n elseif(strlen($prod_price_arr[1]) === 1){\n $product_price = $prod_price_arr[0].'.'.$prod_price_arr[1].'0';\n }\n $item_array['price'] = $product_price.'';\n }\n\n $item_details[] = $item_array;\n }\n }\n \n # Add new Item\n if( $isProductExist == \"No\" )\n { \n $userPreferrences = $this -> basketmodel -> get_user_preferred_retailer($user_id);\n $productDetails = $this -> productmodel -> product_details($product_id, $userPreferrences -> Id, $user_id,$special_id);\n\n $new_item_array = array ();\n $new_item_array['name'] = $productDetails['ProductName'];\n $new_item_array['product_id'] = $product_id;\n $new_item_array['retailer_id'] = $userPreferrences -> Id;\n $new_item_array['store_type_id'] = $userPreferrences -> StoreTypeId;\n $new_item_array['store_id'] = $userPreferrences -> StoreId;\n $new_item_array['count'] = $product_count;\n $new_item_array['bought'] = '0';\n $new_item_array['is_special'] = '0';\n\n $product_price = $productDetails['store_price'];\n if ($productDetails['SpecialPrice'] > 0) {\n $product_price = $productDetails['SpecialPrice'];\n $new_item_array['is_special'] = \"1\";\n }\n if ($productDetails['SpecialPrice'] > 0 && $productDetails['SpecialQty'] > 0) {\n $product_price = $productDetails['SpecialPrice'] / $productDetails['SpecialQty'];\n }\n if ($new_item_array['count'] > 1) {\n $product_price = $product_price * $new_item_array['count'];\n }\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n if ($product_price <= 0) {\n $product_price = '0.00';\n }\n else {\n $product_price = $product_price . '.00';\n }\n $new_item_array['price'] = $product_price;\n }\n else {\n $product_price = round($product_price, 2);\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n $product_price = $product_price . '.00';\n }\n elseif(strlen($prod_price_arr[1]) === 1){\n $product_price = $prod_price_arr[0].'.'.$prod_price_arr[1].'0';\n }\n $new_item_array['price'] = $product_price.'';\n }\n $item_details[] = $new_item_array;\n }//if( $isProductExist = \"No\" )\n\n $shopping_list_string = '';\n $i = 0;\n foreach($item_details as $singleItem)\n {\n if ($i == 0) {\n $shopping_list_string .= $singleItem['name'] . ':::' . $singleItem['product_id'] . ':::' . $singleItem['retailer_id'] . ':::' . $singleItem['store_type_id'] . ':::' . $singleItem['store_id'] . ':::' . $singleItem['count'] . ':::' . $singleItem['bought'];\n }\n else {\n $shopping_list_string .= ',' . $singleItem['name'] . ':::' . $singleItem['product_id'] . ':::' . $singleItem['retailer_id'] . ':::' . $singleItem['store_type_id'] . ':::' . $singleItem['store_id'] . ':::' . $singleItem['count'] . ':::' . $singleItem['bought'];\n }\n $i++; \n }\n\n $shoppingListData = array(\n 'UserId' => $user_id,\n 'ShoppingList' => $shopping_list_string,\n 'CreatedOn' => date('Y-m-d H:i:s'),\n );\n //Save the user shopping list\n $resultShoppingList = $this -> quickshoppingmodel -> save_list($user_id, $shoppingListData);\n \n } //if($addToShoppingList == 'yes')\n # Add product to shopping list ends\n \n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailer_id,$store_id);\n \n if ($result == 'duplicate') {\n $message = \"Product already added to basket\";\n $result = 0;\n }\n else {\n $message = \"Product added to basket successfully\";\n }\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['message'] = $message;\n $retArr['basket_count'] = $basket_count;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = $message;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n \n }else{\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Not allow to add this product.\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die; \n }\n }", "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }", "public function addProducts()\n {\n $this->_rootElement->find($this->addProducts)->click();\n }", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function actionAddProductList()\n {\n\n $order_id = Yii::app()->request->getQuery('id');\n $model = $this->_loadModel($order_id);\n if ($order_id) {\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/update', 'id' => $order_id));\n }\n }\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/index'));\n }\n\n $dataProvider = new ShopProduct('search');\n\n if (isset($_GET['ShopProduct']))\n $dataProvider->attributes = $_GET['ShopProduct'];\n\n $this->renderPartial('_addProduct', array(\n 'dataProvider' => $dataProvider,\n 'order_id' => $order_id,\n 'model' => $model,\n ));\n }", "public function add_to_basket_new_post() {\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $special_id = (int) $this -> post('special_id') ? (int) $this -> post('special_id') : 0;\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $product_count = (int) $this -> post('product_count') ? (int) $this -> post('product_count') : \"1\";\n $addToShoppingList = trim($this -> post('add_to_shopping_list')) ? strtolower($this -> post('add_to_shopping_list')) : \"no\";\n $retailerId = (int) $this->post('retailer_id') ? (int)$this->post('retailer_id') : 0;\n $storeId = (int) $this->post('store_id') ? (int) $this->post('store_id') : 0;\n \n $allToAdd = \"No\";\n $isProductExist = \"No\";\n \n if($storeId > 0 )\n {\n $storeDetails = $this -> basketmodel -> get_store_retailer_details($storeId);\n $storeTypeId = $storeDetails['StoreTypeId'];\n }else{\n # Get user preference\n $user_preference = $this -> usermodel ->get_user_preference($user_id);\n\t\t\t\n if($user_preference)\n {\n $retailerId = $user_preference['RetailerId'];\n $storeTypeId = $user_preference['StoreTypeId'];\n $storeId = $user_preference['StoreId'];\n }\n }\n \n # Get products StorePrice \n $productStorePrice = $this -> productmodel ->get_product_store_price($product_id,$retailerId,$storeTypeId,$storeId);\n \n if($productStorePrice > 0 )\n {\n $allToAdd = \"Yes\"; \n }\n \n if($allToAdd == \"Yes\")\n {\n $result = $this -> basketmodel -> add_to_basket($special_id, $product_id, $user_id, $product_count);\n \n \n # Add to shopping list starts\n if($addToShoppingList == 'yes'){ \n \n # Get shopping list\n $shopping_list = $this -> quickshoppingmodel -> get_list($user_id);\n\n $shopping_list_array = array();\n if (!empty($shopping_list['ShoppingList'])) {\n $shopping_list_array = explode(\",\", $shopping_list['ShoppingList']);\n }\n\n $item_details = array();\n if (!empty($shopping_list_array)) {\n foreach ($shopping_list_array as $item) {\n $item = str_replace('|||', ',', $item);\n $item_array = explode(':::', $item);\n\n $item_array['name'] = $item_array[0];\n $item_array['product_id'] = $item_array[1];\n $item_array['retailer_id'] = $item_array[2];\n $item_array['store_type_id'] = $item_array[3];\n $item_array['store_id'] = $item_array[4];\n \n if( $item_array['product_id'] == $product_id){\n $item_array['count'] = $product_count;\n $isProductExist = \"Yes\";\n }else{\n $item_array['count'] = $item_array[5];\n }\n \n $item_array['bought'] = isset($item_array[6]) ? $item_array[6] : '0';\n\n unset($item_array[0], $item_array[1], $item_array[2], $item_array[3], $item_array[4], $item_array[5], $item_array[6]);\n $item_array['is_special'] = \"0\";\n\n $user_pref_retailer = $this -> basketmodel -> get_user_preferred_retailer($user_id);\n $product = $this -> productmodel -> product_details($item_array['product_id'], $user_pref_retailer -> Id, $user_id,$special_id);\n\n $product_price = $product['store_price'];\n if ($product['SpecialPrice'] > 0) {\n $product_price = $product['SpecialPrice'];\n $item_array['is_special'] = \"1\";\n }\n if ($product['SpecialPrice'] > 0 && $product['SpecialQty'] > 1) {\n $product_price = $product['SpecialPrice'] / $product['SpecialQty'];\n }\n if ($item_array['count'] > 1) {\n $product_price = $product_price * $item_array['count'];\n }\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n\n if ($product_price <= 0) {\n $product_price = '0.00';\n }\n else {\n $product_price = $product_price . '.00';\n }\n $item_array['price'] = $product_price;\n }\n else {\n $product_price = round($product_price, 2);\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n $product_price = $product_price . '.00';\n }\n elseif(strlen($prod_price_arr[1]) === 1){\n $product_price = $prod_price_arr[0].'.'.$prod_price_arr[1].'0';\n }\n $item_array['price'] = $product_price.'';\n }\n\n $item_details[] = $item_array;\n }\n }\n \n # Add new Item\n if( $isProductExist == \"No\" )\n { \n $userPreferrences = $this -> basketmodel -> get_user_preferred_retailer($user_id);\n $productDetails = $this -> productmodel -> product_details($product_id, $userPreferrences -> Id, $user_id,$special_id);\n\n $new_item_array = array ();\n $new_item_array['name'] = $productDetails['ProductName'];\n $new_item_array['product_id'] = $product_id;\n $new_item_array['retailer_id'] = $userPreferrences -> Id;\n $new_item_array['store_type_id'] = $userPreferrences -> StoreTypeId;\n $new_item_array['store_id'] = $userPreferrences -> StoreId;\n $new_item_array['count'] = $product_count;\n $new_item_array['bought'] = '0';\n $new_item_array['is_special'] = '0';\n\n $product_price = $productDetails['store_price'];\n if ($productDetails['SpecialPrice'] > 0) {\n $product_price = $productDetails['SpecialPrice'];\n $new_item_array['is_special'] = \"1\";\n }\n if ($productDetails['SpecialPrice'] > 0 && $productDetails['SpecialQty'] > 0) {\n $product_price = $productDetails['SpecialPrice'] / $productDetails['SpecialQty'];\n }\n if ($new_item_array['count'] > 1) {\n $product_price = $product_price * $new_item_array['count'];\n }\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n if ($product_price <= 0) {\n $product_price = '0.00';\n }\n else {\n $product_price = $product_price . '.00';\n }\n $new_item_array['price'] = $product_price;\n }\n else {\n $product_price = round($product_price, 2);\n $prod_price_arr = explode('.', $product_price);\n if (!isset($prod_price_arr[1])) {\n $product_price = $product_price . '.00';\n }\n elseif(strlen($prod_price_arr[1]) === 1){\n $product_price = $prod_price_arr[0].'.'.$prod_price_arr[1].'0';\n }\n $new_item_array['price'] = $product_price.'';\n }\n $item_details[] = $new_item_array;\n }//if( $isProductExist = \"No\" )\n\n $shopping_list_string = '';\n $i = 0;\n foreach($item_details as $singleItem)\n {\n if ($i == 0) {\n $shopping_list_string .= $singleItem['name'] . ':::' . $singleItem['product_id'] . ':::' . $singleItem['retailer_id'] . ':::' . $singleItem['store_type_id'] . ':::' . $singleItem['store_id'] . ':::' . $singleItem['count'] . ':::' . $singleItem['bought'];\n }\n else {\n $shopping_list_string .= ',' . $singleItem['name'] . ':::' . $singleItem['product_id'] . ':::' . $singleItem['retailer_id'] . ':::' . $singleItem['store_type_id'] . ':::' . $singleItem['store_id'] . ':::' . $singleItem['count'] . ':::' . $singleItem['bought'];\n }\n $i++; \n }\n\n $shoppingListData = array(\n 'UserId' => $user_id,\n 'ShoppingList' => $shopping_list_string,\n 'CreatedOn' => date('Y-m-d H:i:s'),\n );\n //Save the user shopping list\n $resultShoppingList = $this -> quickshoppingmodel -> save_list($user_id, $shoppingListData);\n \n } //if($addToShoppingList == 'yes')\n # Add product to shopping list ends\n \n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailerId,$storeId);\n \n if ($result == 'duplicate') {\n $message = \"Product already added to basket\";\n $result = 0;\n }\n else {\n $message = \"Product added to basket successfully\";\n }\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['message'] = $message;\n $retArr['basket_count'] = $basket_count;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = $message;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n \n }else{\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Not allow to add this product.\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die; \n }\n }", "public function add() {\r\n if(isset($this->data) && isset($this->data['Product'])) {\r\n $product = $this->Product->save($this->data);\r\n $this->set('response', array('Products' => $this->Product->findByProductid($product['Product']['ProductID'])));\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'view', $product['Product']['ProductID']), true);\r\n } else {\r\n $this->Links['self'] = Router::url(array('controller' => $this->name, 'action' => 'index'), true);\r\n }\r\n }", "public static function get_stores()\n {\n }", "public function store(Request $request)\n {\n\n if (!$request->keyword) {\n if (auth()->user()->role->name == 'super admin') {\n\n for ($i = 0; $i < count($request->product_ids); $i++) {\n $va = explode(' ', $request->product_ids[$i]);\n\n\n\n StoreProduct::create([\n 'store_id' => $request->store_id,\n 'product_id' => $va[0],\n 'store_price' => $request->productprices[$va[1]],\n 'qty' => $request->productquantities[$i],\n 'status' => 1,\n 'brand_id' => $request->brand_id,\n 'unit_id' => $request->unit_ids[$i]\n ]);\n }\n }\n } else {\n\n $seacrh = $request->keyword;\n $stores = Store::all();\n $brand = Brand::all();\n $units = Unit::all();\n $storeproducts = StoreProduct::where('store_id', $request->store_id)->get();\n $show = 1;\n $products = Product::where('name', 'like', '%' . $seacrh . '%')->paginate(25)->setPath('');\n $bcategories = BCategory::all();\n\n $pagination = $products->appends(array(\n 'keyword' => $request->keyword\n ));\n\n return view('admin.store_product.create', compact('products', 'stores', 'brand', 'units', 'storeproducts', 'seacrh', 'show', 'bcategories'));\n }\n return redirect()->route('storeproducts.index');\n }", "public function updateAllStoreAssociations() {\n\n $allstores = $this->getStores(null, 1);\n $this->load->model('user/productset');\n\n //echo count($allstores);\n\n //print_r($allstores);\n foreach ($allstores as $store_info) {\n //KMC new category management, disabled all categories first.\n //\n // ???? SHOULD I DELETE CATEGORIES FOR THE STORE/PRODUCTSETS FIRST??\n // Yes, I think we should otherwise we will not pick up good changes.\n $this->db->query(\"DELETE FROM \". DB_PREFIX . \"category WHERE store_code='\".$store_info['code'].\"'\");\n \n unset($productset_ids);\n\n // This picks up whatever is already set (checked in their catalog list) for a dealer.\n $productset_array = $this->model_user_productset->getProductsetsForStoreId($store_info['store_id']);\n\n foreach ($productset_array as $pset)\n {\n $productset_ids[] = $pset['productset_id'];\n }\n print_r($productset_ids);\n \t \n // For each productset ...\n if ($productset_ids) {\n \t\tforeach ($productset_ids as $productset_id) {\n // Make sure that we have categories defined for this productset, \n // else we have to add them based on our ZZZ store which holds the defaults.\n $this->load->model('catalog/category');\n $this->model_catalog_category->createStoreCategoriesIfNeeded($store_info['code'], $productset_id);\n \t\t}\n \n // Create the product_to_category associations.\n $this->load->model('productset/product');\n $this->model_productset_product->buildProductToCategoryAssociations($store_info['code'], $productset_ids);\n \n // Re-build related products for the dealer based no the default set of ZZZ.\n $this->model_productset_product->buildRelatedProductAssociations($store_info['code'], $productset_ids);\n \n // Now update the store_product table.\n $this->load->model('store/product');\n $this->model_store_product->createUnjunctionedProductRecords($store_info['code']);\n }\n }\n }", "public function storesAction()\n {\n\n /**\n * @var $stores Mage_Core_Model_Mysql4_Store_Collection\n * @var $storeItem Mage_Core_Model_Store\n * @var $category Mage_Catalog_Model_Category\n */\n\n $stores = Mage::getResourceModel('core/store_collection');\n// $stores = Mage::app()->getStore()->getCollection();\n\n foreach ($stores as $storeItem)\n {\n echo \"<h2>Store info: {$storeItem->getName()}:{$storeItem->getCode()}</h2><br/>\";\n $category = Mage::getModel('catalog/category')\n ->load( $storeItem->getRootCategoryId() );\n echo \"<h2>Root category info: {$category->getName()}</h2><br/>\";\n echo \"<hr/>\";\n }\n\n }", "public function stores();", "public function store(StoreProductRequest $request)\n {\n $product = new Product();\n $product->product_type_id = 0;\n $product->title = $request->input('title');\n $product->description = $request->input('description');\n $product->price = $request->input('price');\n $product->sku = $request->input('sku');\n $product->save();\n\n foreach ($request->input('options') as $option) {\n $product->options()->sync($option);\n }\n }", "function add_product($product){\n if($this->_check_product_in_db($product)){\n return False; // Product already in database\n }else{\n array_push($this->db, $product);\n return True;\n }\n }", "public function add_to_basket_post() {\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $special_id = $this -> post('special_id') ? $this -> post('special_id') : \"\";\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $product_count = (int) $this -> post('product_count') ? (int) $this -> post('product_count') : \"1\";\n \n $retailerId = (int) $this->post('retailer_id') ? (int)$this->post('retailer_id') : 0;\n $storeId = (int) $this->post('store_id') ? (int) $this->post('store_id') : 0;\n \n \n $allToAdd = \"No\";\n \n if($storeId > 0 )\n {\n $storeDetails = $this -> basketmodel -> get_store_retailer_details($storeId);\n $storeTypeId = $storeDetails['StoreTypeId'];\n }else{\n # Get user preference\n $user_preference = $this -> usermodel ->get_user_preference($user_id);\n if($user_preference)\n {\n $retailerId = $user_preference['RetailerId'];\n $storeTypeId = $user_preference['StoreTypeId'];\n $storeId = $user_preference['StoreId'];\n }\n }\n \n # Get products StorePrice \n $productStorePrice = $this -> productmodel ->get_product_store_price($product_id,$retailerId,$storeTypeId,$storeId);\n \n if($productStorePrice > 0 )\n {\n $allToAdd = \"Yes\"; \n }\n \n if($allToAdd == \"Yes\")\n {\n $result = $this -> basketmodel -> add_to_basket($special_id, $product_id, $user_id, $product_count);\n\n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailerId,$storeId);\n \n if ($result == 'duplicate') {\n $message = \"Product already added to basket\";\n $result = 0;\n }\n else {\n $message = \"Product added to basket successfully\";\n }\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['message'] = $message;\n $retArr['basket_count'] = $basket_count;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = $message;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n \n }else{\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Not allow to add this product.\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die; \n }\n }", "private function addMoreStoreToBa()\n {\n $this->ba->store()->attach($this->newStore);\n $baCount = count($this->ba->fresh()->store);\n if ($baCount > 1) $this->ba->update(['status' => 'mobile']);\n $this->ba->fresh()->store->map(function ($item) use ($baCount) {\n $updateBrand = $this->alokasiBa(Brand::find($this->brandUpdate)->name);\n $updateData = [];\n $updateAllocation = ( $item[$updateBrand] == 0 ) ? 1 / $baCount : (1 / $baCount) + ($item[$updateBrand] - 1 );\n $updateData[$updateBrand] = $updateAllocation;\n\n if ($updateBrand != $this->request->get('brandId') && $item->id != $this->newStore) {\n $reduceBrand = $this->alokasiBa($this->request->get('brand'));\n $updateData[$reduceBrand] = $item[$reduceBrand] -= 1;\n $this->triggerRolling($item->id, 0, $this->ba, false, true, true);\n } else if ($item->id == $this->newStore && $updateBrand != $this->request->get('brandId') && BaSummary::hasEmptySpot($item->id, $updateBrand)->first() == null ) {\n $this->triggerRolling(0, $this->newStore, $this->ba, false, true);\n } else if ($item->id == $this->newStore && BaSummary::hasEmptySpot($item->id, $updateBrand)->first() != null) {\n $this->triggerRolling(0, $this->newStore, $this->ba, false);\n }\n\n Store::find($item->id)->update($updateData);\n });\n }", "public function store(StoreRequest $request)\n {\n $purchase = Purchase::create($request->all());\n\n foreach ($request->product_id as $key=>$product){\n $results[] = array(\"product_id\" => $request->product_id[$key],\n \"quantity\" => $request->quantity[$key],\n \"price\" => $request->price[$key]);\n }\n\n $purchase->purchaseDetails()->createMany($results);\n return redirect()->route('purchases.index');\n }", "private function addProduct($product) \r\n\t{\r\n\t\t$this->newProducts[] = $product;\r\n\t}", "public static function productLists()\n {\n array_push(self::$products, \n [\n CART::ID => self::$id,\n CART::NAME => self::$name,\n CART::PRICE => self::$price,\n CART::QUANTITY => self::$quantity\n ]);\n }", "public function store($productId)\n\t{\n\t\tProduct::findOrFail($productId)->suppliers()->sync(Input::all());\n\t}" ]
[ "0.66454977", "0.6511548", "0.6442422", "0.6417949", "0.6407415", "0.6299583", "0.62730306", "0.61970973", "0.6175132", "0.6136131", "0.61177796", "0.61101836", "0.6098767", "0.6098754", "0.6096483", "0.6090005", "0.60883933", "0.6039972", "0.6019496", "0.6006595", "0.59965956", "0.59952146", "0.5979046", "0.5975019", "0.5926189", "0.5925106", "0.5912287", "0.59078187", "0.5854382", "0.585385" ]
0.734458
0
Lists all TblSupervisores models.
public function actionIndex() { $searchModel = new TblSupervisoresSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->pagination->pageSize = 30; return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function getAllSupervisors()\n {\n return $this->getMineListSupervisors();\n }", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $superficies = $em->getRepository('EncuestaBundle:Superficie')->findAll();\n\n return $this->render('superficie/index.html.twig', array(\n 'superficies' => $superficies,\n ));\n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function models()\n {\n $this->_display('models');\n }", "public static function vistasModel($tabla)\n\t{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\"); \n\t\t//Si la ejecucion de la consulta es exitosa se aocia el array conlos resultados para mostrar todas las categorias\n\t\tif($stmt->execute())\n\t\t{\n\t\t\treturn $stmt->fetchAll();\n\t\t}\n\t\t$stmt->close(); \n\t}", "public static function vistaPremiosModel($tabla)\n\t{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\"); \n\t\t//Si la ejecucion de la consulta es exitosa se aocia el array conlos resultados para mostrar todas las categorias\n\t\tif($stmt->execute())\n\t\t{\n\t\t\treturn $stmt->fetchAll();\n\t\t}\n\t\t$stmt->close(); \n\t}", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "function index_superusuarios() {\n\t\t$conditions = array('Administrativo.perfil' => '0'); \n\t\t$order = array('Administrativo.nombre' => 'ASC');\n\t\t$administrativos=$this->Administrativo->find('all', array ('conditions' => $conditions, 'order' => $order));\t\t\n\t\t$perfil=$this->Perfil->find('all');\n\t\tforeach ($perfil as $p){\n\t\t\t$perfiles[$p['Perfil']['id']]=$p['Perfil']['perfil'];\n\t\t}\n\t\t$perfiles[0]='SuperAdministrador';\n\t\t$this->set('perfiles', $perfiles);\n\t\t$this->set('administrativos', $administrativos);\n\t}", "public function index()\n {\n return Procliente::all();\n }", "public function display_all_supervisor()\n {\n \n if ( ! file_exists(APPPATH.'views/pages/list.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 50)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits d\\'administrateur');\n redirect($_SERVER['HTTP_REFERER']); \n } \n \n $data['title'] = 'Liste des superviseurs'; // Capitalize the first letter\n $data['membres'] = $this->member_model->get_by_type('name = \"Superviseur\"');\n \n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs('liste');\n \n $this->load->template('pages/list_members',$data);\n }", "public function model()\n {\n return TipoNivelSistema::class;\n }", "function listaEstablecimientos() {\n\t\t$establecimiento = new Establecimiento();\n\t\treturn $establecimiento->listar();\n\t}", "public function getModels();", "public function getModels();", "public static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}", "function showAllServiciosMVC()\n {\n $servicios = $this->serviciosModel->getServicios();\n $this->viewservices->showAllServicesPrint($servicios);\n }", "public function listes()\n { \n /*! Requete pour charger le model */\n $this->load->helper('url');\n $this->load->model('produits_model');\n $aListe = $this->produits_model->listes();\n \n $aView[\"listes\"] = $aListe;\n $this->load->view('listes', $aView);\n \n // suite de la fontion sans le model\n /* $resultats = $this->db->query(\"select * from produits\");\n $aListe = $resultats->result();\n $aView['liste_produits'] = $aListe;\n $this->load->view(\"listes\", $aView);*/\n }", "public function vistaTutoriasModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\t\r\n\t\t$stmt->execute();\r\n\r\n\t\treturn $stmt->fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function listar(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "static function getAllVoitures(){\r\n $req = Model1::$pdo->query('SELECT * From voiture');\r\n $req->setFetchMode(PDO::FETCH_CLASS,\"ModelVoiture\");\r\n $tab_voit=$req->fetchall();\r\n return $tab_voit;\r\n }", "public function index()\n {\n // Entrega las Comunas, Provincias y Regiones\n\n $comunas= ComunasModel::all();\n\n return $this->showAll($comunas);\n }", "public function index()\n {\n return $this->tipoServico->with('categorias','categorias.servicos')->orderBy('id','DESC')->get();\n }", "public function actionIndex()\n {\n $searchModel = new Devolucion_salas_granelSearch();\n $params = Yii::$app->request->queryParams;\n $params[$searchModel->formName()]['DE_SOBRAN'] = 1;\n $dataProvider = $searchModel->search($params);\n $dataProvider->setSort(false);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getList(){\n\t\t$model=new Model();\n\t\treturn $model->select(\"SELECT * FROM tb_usuarios ORDER BY idusuario\");\n\t}" ]
[ "0.5974931", "0.5927432", "0.58521515", "0.58154815", "0.57602525", "0.57504964", "0.57447493", "0.5737523", "0.57164246", "0.56481904", "0.56472", "0.5641924", "0.5638558", "0.5603866", "0.55656064", "0.5543701", "0.55134815", "0.5510637", "0.5510637", "0.550394", "0.5497821", "0.54953533", "0.5493606", "0.5451665", "0.5435393", "0.543354", "0.5432246", "0.5426067", "0.5414146", "0.54135215" ]
0.7137508
0
Creates a new TblSupervisores model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new TblSupervisores(); $tiposDocumento = \app\models\TblTiposDocumentos::find()->all(); $departamentos = \app\models\TblDepartamentos::find()->all(); $model->id_matricula_fk = 1; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'id' => $model->id_supervisor]); } else { return $this->render('create', [ 'model' => $model, 'tiposDocumento' => ArrayHelper::map($tiposDocumento, 'id_tipo_documento', 'nombre'), 'departamentos' => ArrayHelper::map($departamentos, 'id_departamento', 'nombre_departamento'), ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKInfoPasienLamaV;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function actionCreate()\n {\n $model = new Devolucion_salas_granel();\n $model->scenario = \"create_sobrante\";\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->validate() ){ \n $model->DE_SOBRAN = 1;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n //Se guarda encabezado Devolucion\n if ($model->save()){\n $this->guardar_renglones($model);\n }\n\n $this->generarPdf($model->DE_NRODEVOL);\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n \n }\n else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n \n } else {\n $model->DE_FECHA = date('Y-m-d');\n $model->DE_HORA = date('H:i:s');\n $model->DE_CODOPE = Yii::$app->user->identity->LE_NUMLEGA; //El usuario logueado\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new MaterialesServicios();\n //Desplegables\n $unidad_medida = UnidadMedida::find()->all();\n $presentacion = Presentacion::find()->all();\n //autocompletar\n $sub_especfica = PartidaSubEspecifica::find()\n ->select(['nombre as value', 'id as id'])\n ->asArray()\n ->all();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'sub_especfica' => $sub_especfica,\n 'unidad_medida' => $unidad_medida,\n 'presentacion' => $presentacion\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Comercios();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new ARTICULOS;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ARTICULOS']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ARTICULOS'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n $model = new InfraestructuraEducativa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "public function actionCreate()\n {\n $model = new Skripsi();\n $model->scenario = \"sidang\";\n\n if ($model->load(Yii::$app->request->post())) {\n $skripsi=Yii::$app->request->post('Skripsi');\n $model = $this->findModel($skripsi['id_skripsi']);\n $model->load(Yii::$app->request->post());\n $model->scenario = \"sidang\";\n \n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->detailskripsipengujis = Yii::$app->request->post('Detailskripsipenguji', []);\n $unit = isset($_COOKIE['kodeunit'])?$_COOKIE['kodeunit']:'';\n $model->kode_unit = $unit;\n if ($model->save() && (count($model->detailskripsipengujis) > 0)) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (\\Exception $ecx) {\n $transaction->rollBack();\n throw $ecx;\n }\n if (count($model->detailskripsipengujis) == 0) {\n $model->addError('penguji', 'Data Skripsi Harus Memiliki Dosen penguji');\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new ProvCompras();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $this->layout=\"main\";\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n // $this->load->view('index', $variaveis);\n \n $variaveis['titulo'] = 'Cadastro Usuários';\n\t\t$this->load->view('usuarios_cad', $variaveis);\n\t}", "public function actionCreate()\n {\n // $model = new StSpd();\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n\n $model = new StSpd();\n $modelsAnggota = [new StSpdAnggota];\n $model->setScenario(StSpd::SCENARIO_INSERT);\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n\n }", "public function actionCreate()\n {\n $model = new DsisSystemUserMenu();\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null){\n\n $model = new Tablapresupuesto();\n\n if ($model->load(Yii::$app->request->post())) {\n $cantidad = (float) preg_replace('/[^0-9.]/', '', $model->cantidad);\n $precioUni = (float) preg_replace('/[^0-9.]/', '', $model->precioUnitario);\n $total = $cantidad * $precioUni;\n $model->costoTotal = $total.'';\n if($model->save()){\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Docingresados;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Docingresados']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Docingresados'];\n\t\t\tif($model->save()) {\n\t\t\t// if ($model->conservarvalor==0 ) \n\t\t\t\t\t\t$this->enviacorreo($model);\n\t\t\t\t$this->Creasesiones($model);\n\t\t\t\tif ($model->conservarvalor==0 )\n\t\t\t\t $this->Destruyesesiones();\n\t\t\t \n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t\t} ELSE {\n\t\t\t\t throw new CHttpException(404,'No se pudo grabar ');\n\t\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new EntOficiales();\n $model->uddi = Utils::generateToken();\n $model->fch_creacion = Calendario::getFechaActual();\n $model->txt_rol='oficial';\n $model->b_habilitado=1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function actionCreate() {\n\t\t$model = new Proyecto;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\t$model -> Usuario_id = Yii::app() -> user -> id;\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('create', array('model' => $model, ));\n\t}", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new SAAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['SAAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate() {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if ($tipo == \"1\") {\n $model = new Consultor;\n $modelUser = new User;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n \n \n \n $senha = uniqid(\"\", true);\n $modelUser->password = $senha;\n $modelUser->username = $_POST['username'];\n $modelUser->email = trim($model->email);\n $modelUser->attributes = $modelUser;\n $modelUser->id_tipoUser = 4;\n $modelUser->senha = '0';\n\n if ($modelUser->save()) {\n\n $model->id_user = $modelUser->id;\n if ($model->save()) {\n $this->redirect(array('EnviaEmail', 'nomedestinatario' => $model->nome, \"emaildestinatario\" => $model->email, \"nomedeusuario\" => $modelUser->username, \"senha\" => $modelUser->password));\n }\n }\n \n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n \n }else {\n $this->redirect(array('User/ChecaTipo'));\n }\n }", "public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Consegne;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Consegne']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Consegne'];\n\n\t\t\tif (!(empty($model->data))){\n\t\t\t\t$tmp = explode(\"/\",$model->data);\n\t\t\t\tif (count($tmp) == 3){\n\t\t\t\t\t$model->data = strtotime(\n\t\t\t\t\t\t$tmp[2] .'-'.\n\t\t\t\t\t\t$tmp[1] .'-'.\n\t\t\t\t\t\t$tmp[0]);\n\t\t\t\t}else{\n\t\t\t\t\t$model->data = time();\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$model->data = time();\n\t\t\t}\n\t\t\t$model->id_user = Yii::app()->user->objUser['id_user'];\n\t\t\t$model->codfisc = strtoupper($model->codfisc);\n\t\t\t$model->nome = strtoupper($model->nome);\n\t\t\t$model->cognome = strtoupper($model->cognome);\n\t\t\t$model->indirizzo = strtoupper($model->indirizzo);\n\t\t\t$model->note = strtoupper($model->note);\n\n\t\t\t// PRIMO INSERIMENTO\n\t\t\t$model->id_volontario = 0;\n\t\t\t$model->in_consegna = 0;\n\t\t\t$model->consegnato = 0;\n\t\t\t$model->time_inconsegna = 0;\n\t\t\t$model->time_consegnato = 0;\n\n\t\t\t// echo \"<pre>\".print_r($_POST,true).\"</pre>\";\n\t\t\t// echo \"<pre>\".print_r($model->attributes,true).\"</pre>\";\n\t\t\t// exit;\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>crypt::Encrypt($model->id_archive)));\n\t\t}\n\n\t\t// creo un criteria falso per un dataprovider vuoto\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->compare('id_stradario',0,false);\n\t\t$dataProvider=new CActiveDataProvider('Stradario', array(\n\t\t\t'sort'=>array(\n\t\t \t\t'defaultOrder'=>array(\n\t\t \t\t\t'via'=>false // viene prima la più recente\n\t\t \t\t)\n\t\t\t\t),\n\t\t 'criteria'=>$criteria,\n\t\t));\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'dataProvider'=>$dataProvider\n\t\t));\n\t}", "public function actionCreate()\n {\n // var_dump(1);\n $request = Yii::$app->request;\n $model['tintuc'] = new TinTuc();\n $model['loaitin']= DmLoaitin::find()->orderBy('ten_loai')->all();\n \n if ($request->isPost && $model['tintuc']->load($request->post()) && $model['tintuc']->validate()) {\n // $model['tintuc']->taikhoan_id= Yii::$app->user->id;\n // dd($model['tintuc']);\n $model['tintuc']->save();\n\n return $this->redirect(['view', 'id' => $model['tintuc']->id_tintuc]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'const' => $this->const,\n 'categories' => $this->getCategories(),\n ]);\n \n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKPengirimanrmT;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKPengirimanrmT']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKPengirimanrmT'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pengirimanrm_id));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function crear_nuevo(){\n //$data['recomendacion_editar'] = $this->model_admin->form_recomendacion($codigo_recomendacion);\n $this->load->view('view_librerias');\n $this->load->view('view_form_nuevo');\n }" ]
[ "0.7012784", "0.7011868", "0.69541925", "0.6941496", "0.6899311", "0.68436265", "0.6822045", "0.677756", "0.67684823", "0.6751192", "0.67271686", "0.670367", "0.6690925", "0.66862375", "0.6664823", "0.66593266", "0.6658529", "0.66523516", "0.6646831", "0.6642048", "0.6633745", "0.6633433", "0.66323906", "0.6632316", "0.66241604", "0.66160166", "0.6593078", "0.65923125", "0.6588883", "0.65864813" ]
0.79941785
0
Finds the TblSupervisores 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 = TblSupervisores::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `bestandnummer`, `mutatiekode`, `superproduktkode`, `sskkode` FROM `gs_superprodukten` WHERE `superproduktkode` = :p0 AND `sskkode` = :p1';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);\n $stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new GsSuperprodukten();\n $obj->hydrate($row);\n GsSuperproduktenPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "protected function findModel($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Sub, $No_Misi, $No_Tujuan, $No_Sasaran)\n {\n if (($model = TaSasaran::findOne(['Tahun' => $Tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Unit' => $Kd_Unit, 'Kd_Sub' => $Kd_Sub, 'No_Misi' => $No_Misi, 'No_Tujuan' => $No_Tujuan, 'No_Sasaran' => $No_Sasaran])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Prog, $Kd_Keg, $Kd_Unit, $Kd_Sub)\n {\n if (($model = TaKegiatan::findOne(['Tahun' => $Tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Prog' => $Kd_Prog, 'Kd_Keg' => $Kd_Keg, 'Kd_Unit' => $Kd_Unit, 'Kd_Sub' => $Kd_Sub])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::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 findModel($id)\n {\n if (($model = Voucher::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app','Không tồn tại trang yêu cầu'));\n }\n }", "public function loadModel($id){\r\r\n\r\r\n\t $model=OrdenConsumo::model()->findByPk($id);\r\r\n\r\r\n\t if($model===null)\r\r\n\t throw new CHttpException(404,'The requested page does not exist.');\r\r\n\t return $model;\r\r\n\r\r\n\t}", "protected function findModel($id)\n {\n if (($model = SubAkun::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "protected function findModel($tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Program, $Kd_Kegiatan)\n {\n if (($model = KegiatanSkpd::findOne(['tahun' => $tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Unit' => $Kd_Unit, 'Kd_Program' => $Kd_Program, 'Kd_Kegiatan' => $Kd_Kegiatan])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function returnDetailFindByPK($id);", "public function returnFindByPK($id);", "public function findModel($clz, $key);", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "public function loadModel($id) {\n $model = Consultor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = MarcacaoConsulta::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_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}", "public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = UserGroupMaster::findOne($id)) !== null)\n\t{\n return $model;\n }\n\telse\n\t{\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model = Sucursales::model()->findByPk($id);\n\n\t\tif($model===null)\n\t\t{\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\n\t\treturn $model;\n\t}", "public function loadModel($id)\r\n {\r\n $model=DetalleVenta::model()->findByPk($id);\r\n if($model===null)\r\n throw new CHttpException(404,'The requested page does not exist.');\r\n return $model;\r\n }", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT id, categoria_id, tipo, compania, logo, url, posicion, localidad, descripcion, how_to_apply, token, publico, activado, email, finaliza, creado FROM trabajos WHERE id = :p0';\n try {\n $stmt = $con->prepare($sql); \n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildTrabajos $obj */\n $obj = new ChildTrabajos();\n $obj->hydrate($row);\n TrabajosTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "protected function findModel($id)\n {\n if (($model = InfraestructuraEducativa::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }" ]
[ "0.6651863", "0.6264424", "0.61327195", "0.6057313", "0.5989719", "0.5979683", "0.59118915", "0.58900917", "0.5884786", "0.58519393", "0.5847284", "0.58455366", "0.58435124", "0.583567", "0.5834271", "0.5827164", "0.5822573", "0.58168244", "0.58125377", "0.57994324", "0.5792935", "0.5792016", "0.57853657", "0.57799923", "0.57715535", "0.5768077", "0.5764476", "0.5720931", "0.57196754", "0.5718473" ]
0.6948735
0
Function to generate the data that will be passed to javascript for dataTables to render Grabs all rows from the database and builds a tree structure with the CEO as the root
function generate_data() { // Boss map, employees array, queue array and ceo array $boss_map = array(); $employees = array(); $queue = array(); $ceo = array(); //Get all employees $sql = "SELECT * FROM employees"; $res = query($sql); while($j = fetch($res)) { //Map employee id to name $employees[$j['id']] = $j['name']; //Add all employees to boss_map except ceo if($j['bossId'] !== $j['id']) $boss_map[$j['bossId']][] = $j['id']; else $ceo = $j; } //If no employees or no ceo, return empty array so dataTables shows error message if(empty($employees) || empty($ceo)) return json_encode(array()); //Set up CEO obj - Root of the tree $ceoObj = new Employee($ceo['id'], $ceo['name'], $ceo['id'], 0); //Add the ceo to the queue $queue[] = $ceoObj; $i = 0; $total_employees = count($employees); //Loop through every employee while($i < $total_employees) { //If corrupt data/missing employees, return empty array if(!array_key_exists($i, $queue)) return json_encode(array()); //Get boss from queue $boss = $queue[$i]; //Set boss name $boss->setBossName($employees[$boss->getBossId()]); $subordinates = array(); //Check if bossId is in the boss_map to get all direct subordinates if(array_key_exists($boss->getId(), $boss_map)) { $subordinates = $boss_map[$boss->getId()]; } //Loop through direct subordinates and create new employee objects for each while increasing the depth from ceo by bosses depth+1 foreach ($subordinates as $subordinateId) { $employeeObj = new Employee($subordinateId, $employees[$subordinateId], $boss->getId(), $boss->getDepth()+1); //Add newly created employee objects as subordinates of current boss object $boss->addSubordinate($employeeObj); //Push the employee object on to the queue $queue[] = $employeeObj; } $i++; } //Assign numSubordinates count assign_subordinate_count($ceoObj); return json_encode($queue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BuildTree($items)\r\n\t{\r\n\t\tif (!empty($items))\r\n\t\t{\r\n\t\t\t# Columns\r\n\t\t\t# * Gather all columns required for display and relation.\r\n\t\t\t# Children\r\n\t\t\t# * Map child names to child index.\r\n\r\n\t\t\t$cols[$this->ds->table] = array($this->ds->id => 1);\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach (array_keys($this->ds->DisplayColumns) as $col)\r\n\t\t\t\t$cols[$this->ds->table][$col] = $this->ds->id == $col;\r\n\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $ix => $child)\r\n\t\t\t{\r\n\t\t\t\t$children[$child->ds->table] = $ix;\r\n\t\t\t\t$cols[$child->ds->table][$child->parent_key] = 1;\r\n\t\t\t\t$cols[$child->ds->table][$child->child_key] = 0;\r\n\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\tforeach (array_keys($child->ds->DisplayColumns) as $col)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[$child->ds->table][$col] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Flats\r\n\t\t\t# * Convert each item into separated TreeNodes\r\n\t\t\t# * Associate all indexes by table, then id\r\n\r\n\t\t\t$flats = array();\r\n\r\n\t\t\t# Iterate all the resulting database rows.\r\n\t\t\tforeach ($items as $ix => $item)\r\n\t\t\t{\r\n\r\n\t\t\t\t# Iterate the columns that were created in step 1.\r\n\t\t\t\tforeach ($cols as $table => $columns)\r\n\t\t\t\t{\r\n\t\t\t\t\t# This will store all the associated data in the treenode\r\n\t\t\t\t\t# for the editor to reference while processing the tree.\r\n\t\t\t\t\t$data = array();\r\n\t\t\t\t\t$skip = false;\r\n\r\n\t\t\t\t\t# Now we're iterating the display columns.\r\n\t\t\t\t\tforeach ($columns as $column => $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t# This column is not associated with a database row.\r\n\t\t\t\t\t\tif (is_numeric($column)) continue;\r\n\r\n\t\t\t\t\t\t# Table names are included to avoid ambiguity.\r\n\t\t\t\t\t\t$colname = $table.'_'.$column;\r\n\r\n\t\t\t\t\t\t# ID would be specified if this is specified as a keyed\r\n\t\t\t\t\t\t# value.\r\n\t\t\t\t\t\tif ($id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (empty($item[$colname]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$skip = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$idcol = $colname;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[$this->ds->StripTable($colname)] = $item[$this->ds->StripTable($colname)];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$skip)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tn = new TreeNode($data);\r\n\t\t\t\t\t\t$tn->id = $item[$idcol];\r\n\t\t\t\t\t\t$flats[$table][$item[$idcol]] = $tn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Tree\r\n\t\t\t# * Construct tree out of all items and children.\r\n\r\n\t\t\t$tree = new TreeNode('Root');\r\n\r\n\t\t\tforeach ($flats as $table => $items)\r\n\t\t\t{\r\n\t\t\t\tforeach ($items as $ix => $node)\r\n\t\t\t\t{\r\n\t\t\t\t\t$child_id = isset($children[$table]) ? $children[$table] : null;\r\n\r\n\t\t\t\t\tif (isset($children[$table]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ckeycol = $this->ds->children[$child_id]->child_key;\r\n\t\t\t\t\t\t$pid = $node->data[\"{$table}_{$ckeycol}\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $pid = 0;\r\n\r\n\t\t\t\t\t$node->data['_child'] = $child_id;\r\n\r\n\t\t\t\t\tif ($pid != 0)\r\n\t\t\t\t\t\t$flats[$this->ds->table][$pid]->children[] = $node;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tree->children[] = $node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t# Put child table children above related children, helps to\r\n\t\t\t# understand the display.\r\n\t\t\tif (count($this->ds->children) > 0) $this->FixTree($tree);\r\n\t\t\treturn $tree;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "function getCongregationCoordinators() {\n $sqlQuery = \"SELECT * FROM congregation_coordinator\";\n $result = $this->DB->executeQuery($sqlQuery, $this->Functions->paramsIsZero(), \"select\");\n $bigString = \"<table class='table'>\";\n $bigString .= \"<thead>\";\n $bigString .= \"<tr>\";\n $bigString .= \"<th scope='col'>#</th>\";\n $bigString .= \"<th scope='col'>Coordinator Name</th>\";\n $bigString .= \"<th scope='col'>Coordinator Phone</th>\";\n $bigString .= \"<th scope='col'>Coordinator Email</th>\";\n $bigString .= \"</tr>\";\n $bigString .= \"</thead>\";\n $bigString .= \"<tbody>\";\n for($i = 0; $i < sizeof($result); $i++) {\n $bigString .= \"<tr>\";\n $bigString .= \"<th scope='row'>\".($i+1).\"</th>\";\n $bigString .= \"<td>\".$this->Functions->testSQLNullValue($result[$i]['coordinatorName']).\"</td>\";\n $bigString .= \"<td>\".$this->Functions->testSQLNullValue($result[$i]['coordinatorPhone']).\"</td>\";\n $bigString .= \"<td id='coordinator-email'>\".$this->Functions->testSQLNullValue($result[$i]['coordinatorEmail']).\"</td>\";\n $bigString .= \"</tr>\";\n }\n $bigString .= \"</tbody>\";\n $bigString .= \"</table>\";\n echo $bigString;\n }", "private function getBody(){\n\t\t$tbody=\"\";\n\t\t$tfilter=\"\";\n\t\t\n\t\tif($this->renderEmptyBody){\n\t\t\treturn \"<tbody></tbody>\";\n\t\t}\n\t\t\n\t\t//Si tiene un llamado a la base de datos, obtenemos los datos\n\t\tif($this->hasCallToDataBase){\n\t\t\t$this->getData();\n\t\t}\n\t\t\n\t\tif(!empty($this->data)){\n\t\t\tforeach($this->data as $dataRow){\n\t\t\t\t$tbody.=\"<tr>\";\n\t\t\t\t$counter=0;\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al principio*/\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($dataRow as $key=>$data){\n\t\t\t\t\tif(!empty($this->bindedTypes)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$type=$this->bindedTypes[$key];\n\t\t\t\t\t\t$parameter=$this->bindedTypesParams[$key];\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($type){\n\t\t\t\t\t\t\tcase 'progressbar':\n\t\t\t\t\t\t\t\t$bar=new progressbar(array(\"id\"=>$key));\n\t\t\t\t\t\t\t\t$pje=$data*100;\n\t\t\t\t\t\t\t\t$bar->setBars(array($pje));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$bar->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\t\t\t$link=new link();\n\t\t\t\t\t\t\t\t$link->replaceFields($dataRow, $parameter);\n\t\t\t\t\t\t\t\t$link->setDisplay($data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$link->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al final*/\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tbody.=\"</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($tfilter!=\"\"){\n\t\t\t\t$tbody=$tfilter.$tbody;\n\t\t\t}\n\t\t\t\n\t\t\t$tbody=\"<tbody>$tbody</tbody>\";\n\t\t}else{\n\t\t\t$tbody=\"<tbody><tr><td colspan=\\\"{$this->cols}\\\"><div class=\\\"alert alert-error\\\">\".velkan::$lang[\"grid_msg\"][\"noDataFound\"].\"</div></td></tr></tbody>\";\n\t\t}\n\t\t\n\t\treturn $tbody;\n\t}", "public function json_table() {\n\t\t\techo json_encode($this->populate_rows());\n\t\t}", "private function tree_getRendered()\n {\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n $arr_result = array();\n\n static $firstCallDrsTreeview = true;\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n\n\n // Add first item\n // SWITCH display first item\n switch ( $conf_array[ 'first_item' ] )\n {\n case( true ):\n // Set hits\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $sum_hits = ( int ) $this->hits_sum[ $this->curr_tableField ];\n $this->pObj->cObj->data[ $hitsField ] = $sum_hits;\n // Set hits\n // Render uid and value of the first item\n $first_item_uid = $conf_array[ 'first_item.' ][ 'option_value' ];\n $tsValue = $conf_array[ 'first_item.' ][ 'cObject' ];\n $tsConf = $conf_array[ 'first_item.' ][ 'cObject.' ];\n $first_item_value = $this->pObj->cObj->cObjGetSingle( $tsValue, $tsConf );\n // Render uid and value of the first item\n $tmpOneDim = array( 'uid' => $first_item_uid ) +\n array( 'value' => $first_item_value );\n if ( !empty( $this->tmpOneDim ) )\n {\n $tmpOneDim = $tmpOneDim +\n $this->tmpOneDim;\n }\n // Render uid and value of the first item\n break;\n case( false ):\n default:\n $tmpOneDim = $this->tmpOneDim;\n break;\n }\n // SWITCH display first item\n // Add first item\n // Move one dimensional array to an iterator\n $tmpArray = $this->pObj->objTyposcript->oneDim_to_tree( $tmpOneDim );\n $rcrsArrIter = new RecursiveArrayIterator( $tmpArray );\n $iterator = new RecursiveIteratorIterator( $rcrsArrIter );\n // Move one dimensional array to an iterator\n // HTML id\n $cObj_name = $conf_array[ 'treeview.' ][ 'html_id' ];\n $cObj_conf = $conf_array[ 'treeview.' ][ 'html_id.' ];\n $html_id = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // HTML id\n //////////////////////////////////////////////////////\n //\n // Loop values\n // Initial depth\n // SWITCH display first item\n switch ( $conf_array[ 'first_item' ] )\n {\n case( true ):\n $last_depth = -1;\n break;\n case( false ):\n default:\n $last_depth = 0;\n break;\n }\n // SWITCH display first item\n // Initial depth\n // LOOP\n $bool_firstLoop = true;\n $loops = 0;\n foreach ( $iterator as $key => $value )\n {\n // CONTINUE $key is the uid. Save the uid.\n if ( $key == 'uid' )\n {\n $curr_uid = $value;\n continue;\n }\n // CONTINUE $key is the uid. Save the uid.\n\n if ( $bool_firstLoop )\n {\n $first_item_uid = $curr_uid;\n }\n\n\n // CONTINUE ERROR $key isn't value\n if ( $key != 'value' )\n {\n echo 'ERROR: key != value.' . PHP_EOL . __METHOD__ . ' (Line: ' . __LINE__ . ')' . PHP_EOL;\n continue;\n }\n // CONTINUE ERROR $key isn't value\n // Render the value\n//$this->pObj->dev_var_dump( $value )\n $item = $this->get_filterItem( $curr_uid, $value );\n //$item = '<a href=\"leglis-bid/?tx_browser_pi1%5Btx_leglisbasis_sector.brc_text%5D=1657&cHash=579a339049d1ca24815eadf0cd53371d\">\n // Baugewerbe (132)\n // </a>';\n//$this->pObj->dev_var_dump( $item );\n // CONTINUE: item is empty\n if ( empty( $item ) )\n {\n // DRS\n if ( $firstCallDrsTreeview && ( $this->pObj->b_drs_filter || $this->pObj->b_drs_cObjData ) )\n {\n $prompt = 'No value: [' . $key . '] won\\'t displayed! Be aware: this log won\\'t displayed never again.';\n t3lib_div :: devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'Maybe TS configuration for [' . $key . '] is: display it only with a hit at least.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'There is a workaround: please take a look in the manual for ' . $this->pObj->prefixId . '.flag_treeview.';\n t3lib_div :: devlog( '[HELP/FILTER] ' . $prompt, $this->pObj->extKey, 1 );\n $firstCallDrsTreeview = false;\n }\n // DRS\n continue;\n }\n // CONTINUE: item is empty\n\n $loops++;\n\n // Vars\n $curr_depth = $iterator->getDepth();\n $indent = str_repeat( ' ', ( $iterator->getDepth() + 1 ) );\n // Vars\n // Render the start tag\n switch ( true )\n {\n case( $curr_depth > $last_depth ):\n // Start of sublevel\n $delta_depth = $curr_depth - $last_depth;\n $startTag = PHP_EOL .\n str_repeat\n (\n $this->htmlSpaceLeft . $indent . '<ul id=\"' . $html_id . '_ul_' . $curr_uid . '\">' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . ' <li id=\"' . $html_id . '_li_' . $curr_uid . '\">', $delta_depth\n );\n $last_depth = $curr_depth;\n break;\n // Start of sublevel\n case( $curr_depth < $last_depth ):\n // Stop of sublevel\n $delta_depth = $last_depth - $curr_depth;\n $startTag = '</li>' . PHP_EOL .\n str_repeat\n (\n $this->htmlSpaceLeft . $indent . ' </ul>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</li>', $delta_depth\n ) .\n PHP_EOL .\n $this->htmlSpaceLeft . $indent . '<li id=\"' . $html_id . '_li_' . $curr_uid . '\">';\n $last_depth = $curr_depth;\n break;\n // Stop of sublevel\n default:\n $startTag = '</li>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '<li id=\"' . $html_id . '_li_' . $curr_uid . '\">';\n break;\n }\n // Render the start tag\n // Result array\n $arr_result[ $curr_uid ] = $startTag . $item;\n\n $bool_firstLoop = false;\n }\n // LOOP\n // Loop values\n // Render the end tag of the last item\n $endTag = '</li>' .\n str_repeat\n (\n '</ul>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</li>', $curr_depth\n ) .\n PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</ul>';\n $arr_result[ $curr_uid ] = $arr_result[ $curr_uid ] . $endTag . PHP_EOL .\n $this->htmlSpaceLeft . '</div>';\n // Render the end tag of the last item\n\n $arr_result[ $first_item_uid ] = $this->htmlSpaceLeft . '<div id=\"' . $html_id . '\">' . $arr_result[ $first_item_uid ];\n\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n\n // RETURN the result\n return $arr_result;\n }", "public function getData() {\n $data = $this->db->getAll('tree');\n\n return $this->formTree($data);\n }", "public function anyData()\n {\n $clients = Contact::select([\n 'contacts.external_id',\n 'contacts.name',\n 'contacts.email',\n 'contacts.primary_number',\n 'clients.external_id as clients_id',\n 'clients.company_name',\n ])->join('clients', 'contacts.client_id', 'clients.id');\n\n $data = DataTables::of($clients)\n ->addColumn('companynamelink', function ($clients) {\n return '<a href=\"/clients/'.$clients->clients_id.'\">'.$clients->company_name.'</a>';\n })\n ->addColumn('namelink', function ($clients) {\n return '<a href=\"/clients/'.$clients->external_id.'\" \">'.$clients->name.'</a>';\n })\n ->addColumn('view', '\n <a href=\"{{ route(\\'clients.show\\', $external_id) }}\" class=\"btn btn-link\" >'.__('View').'</a>')\n ->addColumn('edit', '\n <a href=\"{{ route(\\'clients.edit\\', $external_id) }}\" class=\"btn btn-link\" >'.__('Edit').'</a>')\n ->addColumn('delete', '\n <form action=\"{{ route(\\'clients.destroy\\', $external_id) }}\" method=\"POST\">\n <input type=\"hidden\" name=\"_method\" value=\"DELETE\">\n <input type=\"submit\" name=\"submit\" value=\"'.__('Delete').'\" class=\"btn btn-link\" onClick=\"return confirm(\\'Are you sure? All the clients tasks, leads, projects, etc will be deleted as well\\')\"\">\n {{csrf_field()}}\n </form>')\n ->rawColumns(['namelink', 'companynamelink', 'view', 'edit', 'delete'])\n ->make(true);\n\n return $data;\n }", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "public function run()\n {\n $data = [\n [\n 'type' => '1',\n 'parent_id' => '0',\n 'company_id' => '1',\n 'name' => 'Web网站'\n ],\n [\n 'type' => '1',\n 'parent_id' => '0',\n 'company_id' => '1',\n 'name' => '移动应用iOS'\n ],\n [\n 'type' => '1',\n 'parent_id' => '0',\n 'company_id' => '1',\n 'name' => '移动应用Android'\n ],\n [\n 'type' => '1',\n 'parent_id' => '0',\n 'company_id' => '1',\n 'name' => '微信小程序'\n ],\n [\n 'type' => '2',\n 'parent_id' => '1',\n 'company_id' => '1',\n 'name' => '基本功能'\n ],\n [\n 'type' => '2',\n 'parent_id' => '1',\n 'company_id' => '1',\n 'name' => '高级功能'\n ],\n [\n 'type' => '2',\n 'parent_id' => '1',\n 'company_id' => '1',\n 'name' => '电商功能'\n ],\n [\n 'type' => '3',\n 'parent_id' => '5',\n 'company_id' => '1',\n 'name' => '注册登录'\n ],\n [\n 'type' => '3',\n 'parent_id' => '5',\n 'company_id' => '1',\n 'name' => '第三方登录'\n ],\n [\n 'type' => '3',\n 'parent_id' => '6',\n 'company_id' => '1',\n 'name' => '音乐视频'\n ],\n [\n 'type' => '4',\n 'parent_id' => '8',\n 'company_id' => '1',\n 'name' => '邮箱',\n 'price_min' => '500',\n 'price_max' => '1000',\n 'day_min' => '2',\n 'day_max' => '5',\n ],\n [\n 'type' => '4',\n 'parent_id' => '8',\n 'company_id' => '1',\n 'name' => '手机',\n 'price_min' => '300',\n 'price_max' => '1000',\n 'day_min' => '2',\n 'day_max' => '5',\n ],\n [\n 'type' => '4',\n 'parent_id' => '8',\n 'company_id' => '1',\n 'name' => '密码找回',\n 'price_min' => '300',\n 'price_max' => '500',\n 'day_min' => '2',\n 'day_max' => '5',\n ],\n\n ];\n $this->table('preset_program')->insert($data)->save();\n }", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "function GetDBData($columnName, $parentValue, $parentName, $dbhandle, $drillDownLevel, $maxDrill) {\n\n $chartConfigObj = array ( \"chart\" => \n array( \n \"caption\" => \"Sales by $columnName\",\n \"xAxisName\" => $columnName,\n \"yAxisName\" => \"Total Sales\", \n \"numberSuffix\" => \"K\", \n \"theme\" => \"fusion\"\n )\n );\n\n if ($parentValue == null) {\n $strQuery = \"SELECT $columnName, SUM(`Total Sales`) as TotalSales FROM sales_record GROUP BY $columnName\";\n } else {\n $strQuery = \"SELECT $columnName, SUM(`Total Sales`) as TotalSales FROM sales_record WHERE $parentName = '$parentValue' GROUP BY $columnName\";\n }\n\n $labelValueArray = array();\n\n $result = $dbhandle->query($strQuery) or exit(\"Error code ({$dbhandle->errno}): {$dbhandle->error}\");\n if ($result) {\n while($row = mysqli_fetch_array($result)) {\n $label = $row[$columnName]; \n if (((int)$drillDownLevel) < $maxDrill - 1) {\n array_push($labelValueArray, \n array(\n \"label\" => \"$label\",\n \"value\" => $row[\"TotalSales\"],\n \"link\" => \"newchart-jsonurl-drilldown-data-handler.php?label=$label&drillLevel=$drillDownLevel\"\n )\n );\n } else {\n array_push($labelValueArray, \n array(\n \"label\" => \"$label\",\n \"value\" => $row[\"TotalSales\"]\n )\n );\n }\n }\n };\n\n\n $chartConfigObj[\"data\"] = $labelValueArray;\n\n $jsonEncodedData = json_encode($chartConfigObj);\n\n echo $jsonEncodedData;\n }", "public function run()\n {\n $data = [\n\n // Parents\n \t[\n 'nama' => 'Beranda',\n 'link' => '/beranda',\n 'icon' => 'fa-home',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Data Sekolah',\n 'link' => '/sekolah',\n 'icon' => 'fa-building',\n 'submenu' => 0\n ],\n [\n \t\t'nama' => 'Data Master',\n \t\t'link' => '#',\n 'icon' => 'fa-bars',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Data Siswa',\n 'link' => '#',\n 'icon' => 'fa-users',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Data Guru',\n 'link' => '#',\n 'icon' => 'fa-graduation-cap',\n 'submenu' => 0\n ],\n \t[\n \t\t'nama' => 'Jadwal Pelajaran',\n \t\t'link' => '/jadwal',\n \t\t'icon' => 'fa-calendar',\n \t\t'submenu' => 0\n \t],\n [\n 'nama' => 'Laporan Nilai',\n 'link' => '/laporan',\n 'icon' => 'fa-file-excel',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Pembayaran',\n 'link' => '#',\n 'icon' => 'fa-money-bill-wave',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Kirim Pesan',\n 'link' => '#',\n 'icon' => 'fa-envelope',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Editor',\n 'link' => '#',\n 'icon' => 'fa-edit',\n 'submenu' => 0\n ],\n [\n 'nama' => 'Konfigurasi',\n 'link' => '#',\n 'icon' => 'fa-cog',\n 'submenu' => 0\n ],\n\n // Childs\n [\n 'nama' => 'Mata Pelajaran',\n 'link' => '/mapel',\n 'icon' => 'fa-book',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Ruangan Kelas',\n 'link' => '/ruangan',\n 'icon' => 'fa-building',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Tahun Akademik',\n 'link' => '/tahun-akademik',\n 'icon' => 'fa-calendar-alt',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Angkatan',\n 'link' => '/angkatan',\n 'icon' => 'fa-list-alt',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Rombongan Belajar',\n 'link' => '/rombel',\n 'icon' => 'fa-users',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Kurikulum',\n 'link' => '/kurikulum',\n 'icon' => 'fa-newspaper',\n 'submenu' => 3\n ],\n [\n 'nama' => 'Peserta Didik',\n 'link' => '/peserta-didik',\n 'icon' => 'fa-pencil-alt',\n 'submenu' => 4\n ],\n [\n 'nama' => 'Seluruh Siswa',\n 'link' => '/siswa',\n 'icon' => 'fa-users',\n 'submenu' => 4\n ],\n [\n 'nama' => 'Walikelas',\n 'link' => '/walikelas',\n 'icon' => 'fa-users',\n 'submenu' => 5\n ],\n [\n 'nama' => 'Seluruh Guru',\n 'link' => '/guru',\n 'icon' => 'fa-graduation-cap',\n 'submenu' => 5\n ],\n [\n 'nama' => 'Data Pembayaran',\n 'link' => '/pembayaran',\n 'icon' => 'fa-money-check-alt',\n 'submenu' => 8\n ],\n [\n 'nama' => 'Jenis Pembayaran',\n 'link' => '/jenis-pembayaran',\n 'icon' => 'fa-dollar-sign',\n 'submenu' => 8\n ],\n [\n 'nama' => 'Form Pesan',\n 'link' => '/form-pesan',\n 'icon' => 'fa-comments',\n 'submenu' => 9\n ],\n [\n 'nama' => 'Template Pesan',\n 'link' => '/template-pesan',\n 'icon' => 'fa-sticky-note',\n 'submenu' => 9\n ],\n [\n 'nama' => 'Kontak',\n 'link' => '/kontak',\n 'icon' => 'fa-address-book',\n 'submenu' => 9\n ],\n [\n 'nama' => 'Grup Kontak',\n 'link' => '/grup-kontak',\n 'icon' => 'fa-layer-group',\n 'submenu' => 9\n ],\n [\n 'nama' => 'Peserta Didik Editor',\n 'link' => '/peserta-didik-editor',\n 'icon' => 'fa-pencil-alt',\n 'submenu' => 10\n ],\n [\n 'nama' => 'Jadwal Pelajaran Editor',\n 'link' => '/jadwal-pelajaran-editor',\n 'icon' => 'fa-calendar',\n 'submenu' => 10\n ],\n [\n 'nama' => 'Pengguna Sistem',\n 'link' => '/pengguna',\n 'icon' => 'fa-cubes',\n 'submenu' => 11\n ],\n [\n 'nama' => 'Hak Akses',\n 'link' => '/hak-akses',\n 'icon' => 'fa-lock',\n 'submenu' => 11\n ],\n ];\n\n DB::table('menu')->truncate();\n DB::table('menu')->insert($data);\n }", "public function data()\n {\n $news = News::leftJoin('company', 'news.company_id', '=', 'company.id')\n ->select([\n 'news.id',\n 'news.title',\n 'news.description',\n 'news.content',\n 'news.created_at',\n 'news.updated_at',\n 'company.name as companyname'\n ]);\n\n return $this->createCrudDataTable($news, 'admin.news.destroy', 'admin.news.edit')->make(true);\n }", "private function renderExternalSourceFieldTree()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t\r\n\t\t// HTML\r\n\t\t$html = '';\r\n\t\t\r\n\t\t// Get the external source fields in array format\r\n\t\t$external_fields_all = $this->getExternalSourceFields();\r\n\t\t\r\n\t\t// Get the external id field name\r\n\t\t$external_id_field = '';\r\n\t\tforeach ($external_fields_all as $attr) {\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$external_id_field = $attr['field'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get the external source fields already mapped in this project\r\n\t\t$external_fields_mapped = $this->getMappedFields();\r\n\t\t\r\n\t\t// Javascript\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t// Get the external id field name\r\n\t\tvar external_id_field = '<?php echo cleanHtml($external_id_field) ?>';\r\n\t\t</script>\r\n\t\t<?php\r\n\t\t// Call javascript file\r\n\t\tcallJSfile('DynamicDataPullMapping.js');\r\n\t\t\r\n\t\t## Collect categories and subcategories into an array\r\n\t\t$categories = array();\r\n\t\tforeach ($external_fields_all as $key=>$attr) \r\n\t\t{\r\n\t\t\t// Set array key as the field name so we can find their attributes faster\r\n\t\t\tunset($external_fields_all[$key]);\r\n\t\t\t$external_fields_all[$attr['field']] = $attr;\r\n\t\t\t\r\n\t\t\t// For those not in a category\r\n\t\t\tif ($attr['category'] == '') {\r\n\t\t\t\t$categories[''][] = $attr['field'];\r\n\t\t\t} \r\n\t\t\t// For those in a category\r\n\t\t\telse {\r\n\t\t\t\tif (!isset($categories[$attr['category']])) $categories[$attr['category']] = array();\r\n\t\t\t\tif ($attr['subcategory'] != '') {\r\n\t\t\t\t\t// Add to subcategory\r\n\t\t\t\t\tif (!isset($categories[$attr['category']][$attr['subcategory']])) $categories[$attr['category']][$attr['subcategory']] = array();\r\n\t\t\t\t\t$categories[$attr['category']][$attr['subcategory']][] = $attr['field'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add to category\r\n\t\t\t\t\t$categories[$attr['category']][''][] = $attr['field'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//print_array($categories);\r\n\t\t\r\n\t\t// Loop through categories and subcats and build li/ul html\r\n\t\t$tree = '';\r\n\t\t$num_fields_checked = 0;\r\n\t\tforeach ($categories as $cat=>$catattr) \r\n\t\t{\r\n\t\t\t$cat_html = '';\r\n\t\t\t$num_fields_checked_cat = 0;\r\n\t\t\t// If no cat\r\n\t\t\tif ($cat == '') {\r\n\t\t\t\t// Loop through fields\r\n\t\t\t\tforeach ($catattr as $this_field) {\r\n\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$cat_html .= RCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \")\" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t// If in a cat\r\n\t\t\telse {\r\n\t\t\t\t// Loop through subcats\r\n\t\t\t\t$subcat_html = '';\r\n\t\t\t\t// Count subcats\r\n\t\t\t\t$num_subcats = 0;\r\n\t\t\t\tforeach ($catattr as $subcat=>$subcatattr) {\r\n\t\t\t\t\t// Loop through fields\r\n\t\t\t\t\t$subcat_fields_html = '';\r\n\t\t\t\t\t$num_fields_checked_subcat = 0;\r\n\t\t\t\t\tforeach ($subcatattr as $this_field) {\r\n\t\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t\t$num_fields_checked_subcat++;\r\n\t\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$subcat_fields_html .= \tRCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \") \" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//print \"CAT: $cat, SUBCAT: $subcat<br>$subcat_fields_html\";\r\n\t\t\t\t\t// If no subcat\r\n\t\t\t\t\tif ($subcat != '') {\r\n\t\t\t\t\t\t$num_subcats++;\r\n\t\t\t\t\t\t$displaySubcat = ($num_fields_checked_subcat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t\t\t$displaySubcatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t\t\t$subcatIcon = ($num_fields_checked_subcat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t\t\t$subcat_html .= RCView::div(array('class'=>'rc_ext_subcat_name'), \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>$subcatIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $subcat) .\r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"select all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35']) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::span(array('class'=>'selectalllink_sep', 'style'=>$displaySubcatSelectAll.'color:#aaa;margin:0 5px;'), \"|\") . \r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55'])\r\n\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'rc_ext_subcat', 'style'=>$displaySubcat), $subcat_fields_html);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$subcat_html .= $subcat_fields_html;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Render this cat\r\n\t\t\t\t$displayCat = ($num_fields_checked_cat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t$displayCatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t$catIcon = ($num_fields_checked_cat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t$cat_html .= RCView::div(array('class'=>'rc_ext_cat_name'), \r\n\t\t\t\t\t\t\t\tRCView::img(array('src'=>$catIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $cat) .\r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"select all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35'])) .\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::span(array('class'=>'selectalllink_sep', 'style'=>$displayCatSelectAll.'color:#aaa;margin:0 5px;'), \"|\")) . \r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55']))\r\n\t\t\t\t\t\t\t ) .\r\n\t\t\t\t\t\t\t RCView::div(array('class'=>'rc_ext_cat', 'style'=>$displayCat), $subcat_html);\r\n\t\t\t}\r\n\t\t\t// Add cat to tree\r\n\t\t\t$tree .= $cat_html;\r\n\t\t}\r\n\t\t\r\n\t\t// Set search textbox for search input\r\n\t\t$searchTextbox = \tRCView::span(array('style'=>'margin:0 0 5px;text-align:right;'), \r\n\t\t\t\t\t\t\t\t\"Filter:\" . \r\n\t\t\t\t\t\t\t\tRCView::text(array('id'=>'source_field_search', 'class'=>'x-form-text x-form-field', 'onkeydown'=>\"if(event.keyCode == 13) return false;\",\r\n\t\t\t\t\t\t\t\t\t'style'=>'margin-left:5px;width:300px;color:#999;', 'value'=>$lang['ws_07'],\r\n\t\t\t\t\t\t\t\t\t'onfocus'=>\"if ($(this).val() == '\".cleanHtml($lang['ws_07']).\"') { $(this).val(''); $(this).css('color','#000'); }\",\r\n\t\t\t\t\t\t\t\t\t'onblur'=>\"$(this).val( trim($(this).val()) ); if ($(this).val() == '') { $(this).val('\".cleanHtml($lang['ws_07']).\"'); $(this).css('color','#999'); }\"\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t);\r\n\t\t\r\n\t\t// Render the div container for the tree\r\n\t\t$html .= RCView::div(array('id'=>'ext_field_tree'),\r\n\t\t\t\t\tRCView::form(array('method'=>'post', 'id'=>'select_mapping_fields', 'action'=>PAGE_FULL.\"?pid=\".$this->project_id, 'enctype'=>'multipart/form-data'),\r\n\t\t\t\t\t\tRCView::div(array('style'=>'font-size:15px;font-weight:bold;padding-bottom:8px;margin-bottom:8px;'),\r\n\t\t\t\t\t\t\t$lang['ws_101']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'margin-bottom:5px;'), $lang['ws_102']) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:20px 0 0;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected2', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_33']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'font-size:12px;margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t// \r\n\t\t\t\t\t\t\tRCView::div(array('style'=>'margin:25px 0 0;'), \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:left;vertical-align:middle;font-weight:bold;font-size:15px;'), \"Source Fields List\") . \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:right;vertical-align:middle;padding-bottom:2px;'), $searchTextbox) . \r\n\t\t\t\t\t\t\t\tRCView::div(array('class'=>'clear'), '')\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('id'=>'ext_field_tree_fields', 'style'=>'clear:both;padding:10px 6px;background-color:#fff;border:1px solid #ccc;'),\r\n\t\t\t\t\t\t\t$tree\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:0 0 20px;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::hidden(array('name'=>'select_fields', 'value'=>'1')) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_32']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\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\t\r\n\t\t// Return html\r\n\t\treturn $html;\r\n\t}", "function build_tree_table( $tree_id )\n\t{\n\t\n\t\t$fields = array(\n\t\t\t'node_id' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t => '8',\n\t\t\t\t'unsigned'\t\t => TRUE,\n\t\t\t\t'auto_increment' => TRUE,\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'lft' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint' => '8',\n\t\t\t\t'unsigned' =>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'rgt' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'depth' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'parent' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'moved'\t=> array(\n\t\t\t\t'type' => 'tinyint',\n\t\t\t\t'constraint'\t=> '1',\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'label'\t=> array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'entry_id' => array(\n\t\t\t\t'type' => 'int',\n\t\t\t\t'constraint' => '10', \n\t\t\t\t'null' => TRUE),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'template_path' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'custom_url' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\n\t\t\t'type' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'field_data' => array(\n\t\t\t\t'type' => 'text'\n\t\t\t)\t\t\t\n\t\t);\n\t\t\t\n\t\tee()->load->dbforge();\n\t\tee()->dbforge->add_field( $fields );\n\t\tee()->dbforge->add_key( 'node_id', TRUE );\n\t\tee()->dbforge->create_table( 'taxonomy_tree_'.$tree_id );\n\t\t\n\t\tunset($fields);\n\t\t\t\t\n\t}", "function viewRecursive($selectCol, $tablename, $page, $iscatURL, $statusAction, $urlstring = \"\") {\n $utl = SINGLETON_MODEL::getInstance(\"UTILITIES\");\n $html = SINGLETON_MODEL::getInstance(\"HTML\");\n $js = SINGLETON_MODEL::getInstance(\"JAVASCRIPT\");\n $col = array();\n foreach ($selectCol as $key => $value) {\n if (strstr($key, \"password\") == \"\" && strstr(strtolower($key), \"rewrite\") == \"\")\n $col[$key] = $value;\n }\n $ObjectDataType = $this->getMetaData($tablename);\n $arrayDataType = $ObjectDataType[1];\n $arrayDataLength = $ObjectDataType[2];\n echo \"<div id='panelView' class='panelView'>\";\n echo \"<table id='mainTable' cellpadding='1' cellspacing='1'>\n\n\n\n\n\n\n\n <tr class='titleBottom'>\";\n $i = 1;\n if (is_array($col))\n foreach ($col as $key => $value) {\n if ($i == 1) {\n echo \"<td class='itemCenter'><input type='checkbox' name='chkall' id='chkall' value='1' onclick='docheck(this.checked,0);'></td>\";\n }\n else {\n if ($arrayDataType[$key] == \"int\")\n echo \"<td class='itemCenter'>$value</td>\";\n elseif ($arrayDataType[$key] == \"real\")\n echo \"<td class='itemCenter'>$value</td>\";\n elseif (strstr(strtolower($key), \"picture\") != \"\")\n echo \"<td class='itemCenter'>$value</td>\";\n else\n echo \"<td class='itemText'>$value</td>\";\n }\n ++$i;\n }\n echo \"</tr>\";\n $i = 0;\n if ($iscatURL > 0)\n $grid = $this->recursives($tablename, \"parentid asc\", $iscatURL, $col);\n else\n $grid = $this->recursives($tablename, \"parentid asc\", 0, $col);\n if (is_array($grid))\n foreach ($grid as $k => $rowview) {\n $k = array_keys($col);\n $id = $rowview[$k[0]];\n $class_css = ($i % 2 == 0) ? \"cell2\" : \"cell1\";\n echo \"<tr class='$class_css'>\";\n $j = 1;\n if (is_array($col))\n foreach ($col as $key => $value) {\n if ($j == 1)\n echo \"<td class='itemCenter'>\" . $html->checkbox(\"chk\", \"$id\", \"\", array(\"onclick\" => \"docheckone();\")) . \"</td>\";\n else {\n if (strstr(strtolower($key), \"price\") != \"\")\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($rowview[$key]) . CURRENCY . \" </a></td>\";\n elseif (strstr(strtolower($key), \"vat\") != \"\" || strstr(strtolower($key), \"percent\") != \"\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($rowview[$key]) . VAT . \" </a></td>\";\n elseif (strstr(strtolower($key), \"picture\") != \"\") {\n if (strstr(strtolower($key), \".swf\") != \"\")\n $img = $js->flashWrite(\"../\" . $rowview[$key], 50, 20, \"flashid\", \"#ffffff\", \"\", \"transparent\");\n else\n $img = \"<img onerror=\\\"$(this).hide()\\\" src='image.php/image.jpg?image=\" . $rowview[$key] . \"&height=15&cropratio=3:1' border='0'>\";\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $img . \"</a></td>\";\n }\n elseif (strstr(strtolower($key), \"date\") != \"\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . date(\"d-m-Y\", (int) $rowview[$key]) . \"</a></td>\";\n elseif ($arrayDataType[$key] == \"int\" && $arrayDataLength[$key] <= 4)\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . strtr($rowview[$key], $statusAction) . \"</a></td>\";\n elseif ($arrayDataType[$key] == \"int\" || $arrayDataType[$key] == \"real\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $rowview[$key] . \"</a></td>\";\n else\n echo \"<td class='itemText'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->takeShortText($rowview[$key], 5) . ((strstr($key, \"percent\") != \"\") ? \"%\" : \"\") . \"</a></td>\";\n }\n ++$j;\n }\n echo \"</tr>\";\n ++$i;\n }\n echo \"</table>\";\n echo \"</div>\";\n }", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "public function actionAjaxFillTree()\n {\n \t$this->allowUser(SUPERADMINISTRATOR);\n // accept only AJAX request (comment this when debugging)\n if (!Yii::app()->request->isAjaxRequest) {\n exit();\n }\n // parse the user input\n $parentId = \"NULL\";\n if (isset($_GET['root']) && $_GET['root'] !== 'source') {\n $parentId = (int) $_GET['root'];\n }\n // read the data (this could be in a model)\n $children = Yii::app()->db->createCommand(\n \"SELECT m1.id, m1.name AS text, m2.id IS NOT NULL AS hasChildren \"\n . \"FROM cms_term AS m1 LEFT JOIN cms_term AS m2 ON m1.id=m2.parent_id \"\n . \"WHERE m1.parent_id <=> $parentId \"\n . \"GROUP BY m1.id ORDER BY m1.order ASC\"\n )->queryAll();\n\t\t\n\t\t$cnt = 0;\n\t\tforeach ($children as $child){\n\t\t//\tif ($child['hasChildren']==0) {\n\t\t//\t\t$children[$cnt]['text'] = '<a href='.Yii::app()->baseUrl.'\"/backend.php/term/update/'.$child['id'].'\">'.$child['text'].'</a>';\n\t\t//\t} else {\n\t\t\t\n\t\t\t\t$children[$cnt]['text'] = $child['text']\n\t\t\t\t.'<a href='.Yii::app()->baseUrl.'\"/backend.php/term/update/'.$child['id'].'\"> '.TbHtml::icon(TbHtml::ICON_PENCIL)\n\t\t\t\t.'</a> <a href='.Yii::app()->baseUrl.'\"/backend.php/TermDescription/update/'.$child['id'].'\"> '.TbHtml::icon(TbHtml::ICON_EDIT).'</a>';\n\t\t\t$cnt++;\t\n\t\t}\n\t\t\n\t\t\n echo str_replace(\n '\"hasChildren\":\"0\"',\n '\"hasChildren\":false',\n CTreeView::saveDataAsJson($children)\n );\n }", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public function treeDataProvider()\n {\n $catData = [\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ],\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat422',\n 'active' => true,\n 'sort' => 1,\n 'left' => 6,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat5',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat6',\n 'active' => true,\n 'sort' => 1,\n 'left' => 9,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n ];\n\n $data = [];\n foreach ($catData as $category) {\n $data[$category['id']] = $this->buildCategory($category);\n }\n\n return [['data' => $data]];\n }", "public function JsonDioceses() {\n $o_data = new Db();\n $qr_result = $o_data->query(\"select grandsparents.idno, CASE objects.status WHEN 0 THEN \\\"en attente\\\" WHEN 1 THEN \\\"en cours\\\" WHEN 2 THEN \\\"à valider\\\" WHEN 3 THEN \\\"validé\\\" ELSE \\\"valeur incohérente\\\" END as statut, count(*) as nombre from ca_objects as objects left join ca_objects as parents on parents.object_id=objects.parent_id left join ca_objects as grandsparents on parents.parent_id=grandsparents.object_id and grandsparents.type_id=261 where objects.type_id = 262 and objects.deleted=0 and parents.type_id=23 and parents.parent_id is not null and grandsparents.object_id is not null group by parents.parent_id, objects.status;\");\n $first=1;\n print \"[\";\n while($qr_result->nextRow()) {\n if(!$first) print \",\";\n print \"{\\\"idno\\\":\\\"\".$qr_result->get('idno').\"\\\",\\n\";\n print \"\\\"statut\\\":\\\"\".$qr_result->get('statut').\"\\\",\\n\";\n print \"\\\"nombre\\\":\\\"\".$qr_result->get('nombre').\"\\\"}\\n\";\n $first=0;\n }\n print \"]\\n\";\n exit;\n }", "public function tree()\n {\n return view('EmployeeTreeview.index',['employees'=>$this->makeArray(Employees::getEmployeesAll())]);\n }", "function getdata(){\n\t\t$grid = $this->jqdatagrid;\n\n\t\t// CREA EL WHERE PARA LA BUSQUEDA EN EL ENCABEZADO\n\t\t$mWHERE = $grid->geneTopWhere('rcobro');\n\n\t\t$response = $grid->getData('rcobro', array(array()), array(), false, $mWHERE, 'id','desc' );\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public function run()\n {\n // Model::unguard();\n\n // //Business Categories\n // $insert[0][\"business_category_id\"] \t = 1;\n // $insert[0][\"business_category_name\"] = \"Arts, crafts, and collectibles\";\n // $insert[0][\"parent_id\"] = \" \";\n\n // $insert[1][\"business_category_id\"] \t = 2;\n // $insert[1][\"business_category_name\"] = \"Baby\";\n // $insert[1][\"parent_id\"] = \" \";\n\n // $insert[2][\"business_category_id\"] \t = 3;\n // $insert[2][\"business_category_name\"] = \"Beauty and fragrances\";\n // $insert[2][\"parent_id\"] = \" \";\n\n // $insert[3][\"business_category_id\"] \t = 4;\n // $insert[3][\"business_category_name\"] = \"Books and magazines\";\n // $insert[3][\"parent_id\"] = \" \";\n\n // $insert[4][\"business_category_id\"] \t = 5;\n // $insert[4][\"business_category_name\"] = \"Business to business\";\n // $insert[4][\"parent_id\"] = \" \";\n\n // $insert[5][\"business_category_id\"] \t = 6;\n // $insert[5][\"business_category_name\"] = \"Clothing, accessories, and shoes\";\n // $insert[5][\"parent_id\"] = \" \";\n\n // $insert[6][\"business_category_id\"] \t = 7;\n // $insert[6][\"business_category_name\"] = \"Computers, accessories, and services\";\n // $insert[6][\"parent_id\"] = \" \";\n\n // $insert[7][\"business_category_id\"] \t = 8;\n // $insert[7][\"business_category_name\"] = \"Education\";\n // $insert[7][\"parent_id\"] = \" \";\n\n // $insert[8][\"business_category_id\"] \t = 9;\n // $insert[8][\"business_category_name\"] = \"Electronics and telecom\";\n // $insert[8][\"parent_id\"] = \" \";\n\n // $insert[9][\"business_category_id\"] \t = 10;\n // $insert[9][\"business_category_name\"] = \"Entertainment and media\";\n // $insert[9][\"parent_id\"] = \" \";\n\n // $insert[10][\"business_category_id\"] = 11;\n // $insert[10][\"business_category_name\"] = \"Financial services and products\";\n // $insert[10][\"parent_id\"] = \" \";\n\n // $insert[11][\"business_category_id\"] = 12;\n // $insert[11][\"business_category_name\"] = \"Food retail and service\";\n // $insert[11][\"parent_id\"] = \" \";\n\n // $insert[12][\"business_category_id\"] = 13;\n // $insert[12][\"business_category_name\"] = \"Gifts and flowers\";\n // $insert[12][\"parent_id\"] = \" \";\n\n // $insert[13][\"business_category_id\"] = 14;\n // $insert[13][\"business_category_name\"] = \"Government\";\n // $insert[13][\"parent_id\"] = \" \";\n\n // $insert[14][\"business_category_id\"] = 15;\n // $insert[14][\"business_category_name\"] = \"Health and personal care\";\n // $insert[14][\"parent_id\"] = \" \";\n\n // $insert[15][\"business_category_id\"] = 16;\n // $insert[15][\"business_category_name\"] = \"Home and garden\";\n // $insert[15][\"parent_id\"] = \" \";\n\n // $insert[16][\"business_category_id\"] = 17;\n // $insert[16][\"business_category_name\"] = \"Nonprofit\";\n // $insert[16][\"parent_id\"] = \" \";\n\n // $insert[17][\"business_category_id\"] = 18;\n // $insert[17][\"business_category_name\"] = \"Pets and animals\";\n // $insert[17][\"parent_id\"] = \" \";\n\n // $insert[18][\"business_category_id\"] = 19;\n // $insert[18][\"business_category_name\"] = \"Religion and spirituality (for profit)\";\n // $insert[18][\"parent_id\"] = \" \";\n\n // $insert[19][\"business_category_id\"] = 20;\n // $insert[19][\"business_category_name\"] = \"Retail (not elsewhere classified)\";\n // $insert[19][\"parent_id\"] = \" \";\n\n // $insert[20][\"business_category_id\"] = 21;\n // $insert[20][\"business_category_name\"] = \"Services - other\";\n // $insert[20][\"parent_id\"] = \" \";\n\n // $insert[21][\"business_category_id\"] = 22;\n // $insert[21][\"business_category_name\"] = \"Sports and outdoors\";\n // $insert[21][\"parent_id\"] = \" \";\n\n // $insert[22][\"business_category_id\"] = 23;\n // $insert[22][\"business_category_name\"] = \"Toys and hobbies\";\n // $insert[22][\"parent_id\"] = \" \";\n\n // $insert[23][\"business_category_id\"] = 24;\n // $insert[23][\"business_category_name\"] = \"Travel\";\n // $insert[23][\"parent_id\"] = \" \";\n\n // $insert[24][\"business_category_id\"] = 25;\n // $insert[24][\"business_category_name\"] = \"Vehicle sales\";\n // $insert[24][\"parent_id\"] = \" \";\n\n // $insert[25][\"business_category_id\"] = 26;\n // $insert[25][\"business_category_name\"] = \"Vehicle service and accessories\";\n // $insert[25][\"parent_id\"] = \" \";\n\n // //Business Subcategories\n\n // //Business Subcategories for Arts, crafts, and collectibles\n // $insert[26][\"business_category_id\"] = 27;\n // $insert[26][\"business_category_name\"] = \"Antiques\";\n // $insert[26][\"parent_id\"] = 1;\n\n // $insert[27][\"business_category_id\"] = 28;\n // $insert[27][\"business_category_name\"] = \"Art and craft supplies\";\n // $insert[27][\"parent_id\"] = 1;\n\n // //Business Subcategories for Baby\n // $insert[28][\"business_category_id\"] = 29;\n // $insert[28][\"business_category_name\"] = \"Clothing\";\n // $insert[28][\"parent_id\"] = 2;\n\n // $insert[29][\"business_category_id\"] = 30;\n // $insert[29][\"business_category_name\"] = \"Furniture\";\n // $insert[29][\"parent_id\"] = 2;\n\n // //Business Subcategories for Beauty and fragrances\n // $insert[30][\"business_category_id\"] = 31;\n // $insert[30][\"business_category_name\"] = \"Bath and body\";\n // $insert[30][\"parent_id\"] = 3;\n\n // $insert[31][\"business_category_id\"] = 32;\n // $insert[31][\"business_category_name\"] = \"Fragrances and perfumes\";\n // $insert[31][\"parent_id\"] = 3;\n\n // //Business Subcategories for Books and magazines\n // $insert[32][\"business_category_id\"] = 33;\n // $insert[32][\"business_category_name\"] = \"Audio books\";\n // $insert[32][\"parent_id\"] = 4;\n\n // $insert[33][\"business_category_id\"] = 34;\n // $insert[33][\"business_category_name\"] = \"Digital content\";\n // $insert[33][\"parent_id\"] = 4;\n\n // //Business Subcategories for Business to business\n // $insert[34][\"business_category_id\"] = 35;\n // $insert[34][\"business_category_name\"] = \"Accounting\";\n // $insert[34][\"parent_id\"] = 5;\n\n // $insert[35][\"business_category_id\"] = 36;\n // $insert[35][\"business_category_name\"] = \"Advertising\";\n // $insert[35][\"parent_id\"] = 5;\n\n // //Business Subcategories for Clothing, accessories, and shoes\n // $insert[36][\"business_category_id\"] = 37;\n // $insert[36][\"business_category_name\"] = \"Children's clothing\";\n // $insert[36][\"parent_id\"] = 6;\n\n // $insert[37][\"business_category_id\"] = 38;\n // $insert[37][\"business_category_name\"] = \"Men's clothing\";\n // $insert[37][\"parent_id\"] = 6;\n\n // //Business Subcategories for Computers, accessories, and services\n // $insert[38][\"business_category_id\"] = 39;\n // $insert[38][\"business_category_name\"] = \"Computer and data processing services\";\n // $insert[38][\"parent_id\"] = 7;\n\n // $insert[39][\"business_category_id\"] = 40;\n // $insert[39][\"business_category_name\"] = \"Desktops, laptops, and notebooks\";\n // $insert[39][\"parent_id\"] = 7;\n\n // //Business Subcategories for Education\n // $insert[40][\"business_category_id\"] = 41;\n // $insert[40][\"business_category_name\"] = \"Business and secretarial schools\";\n // $insert[40][\"parent_id\"] = 8;\n\n // $insert[41][\"business_category_id\"] = 42;\n // $insert[41][\"business_category_name\"] = \"Child daycare services\";\n // $insert[41][\"parent_id\"] = 8;\n\n // //Business Subcategories for Electronics and telecom\n // $insert[42][\"business_category_id\"] = 43;\n // $insert[42][\"business_category_name\"] = \"Cameras, camcorders, and equipment\";\n // $insert[42][\"parent_id\"] = 9;\n\n // $insert[43][\"business_category_id\"] = 44;\n // $insert[43][\"business_category_name\"] = \"Cell phones, PDAs, and pagers\";\n // $insert[43][\"parent_id\"] = 9;\n\n // //Business Subcategories for Entertainment and media\n // $insert[44][\"business_category_id\"] = 45;\n // $insert[44][\"business_category_name\"] = \"Memorabilia\";\n // $insert[44][\"parent_id\"] = 10;\n\n // $insert[45][\"business_category_id\"] = 46;\n // $insert[45][\"business_category_name\"] = \"Movie tickets\";\n // $insert[45][\"parent_id\"] = 10;\n\n // //Business Subcategories for Financial services and products\n // $insert[46][\"business_category_id\"] = 47;\n // $insert[46][\"business_category_name\"] = \"Accounting\";\n // $insert[46][\"parent_id\"] = 11;\n\n // $insert[47][\"business_category_id\"] = 48;\n // $insert[47][\"business_category_name\"] = \"Collection agency\";\n // $insert[47][\"parent_id\"] = 11;\n\n // //Business Subcategories for Food retail and service\n // $insert[48][\"business_category_id\"] = 49;\n // $insert[48][\"business_category_name\"] = \"Alcoholic beverages\";\n // $insert[48][\"parent_id\"] = 12;\n\n // $insert[49][\"business_category_id\"] = 50;\n // $insert[49][\"business_category_name\"] = \"Catering services\";\n // $insert[49][\"parent_id\"] = 12;\n\n // //Business Subcategories for Gifts and flowers\n // $insert[50][\"business_category_id\"] = 51;\n // $insert[50][\"business_category_name\"] = \"Florist\";\n // $insert[50][\"parent_id\"] = 13;\n\n // $insert[51][\"business_category_id\"] = 52;\n // $insert[51][\"business_category_name\"] = \"Gift, card, novelty, and souvenir shops\";\n // $insert[51][\"parent_id\"] = 13;\n\n // //Business Subcategories for Government\n // $insert[52][\"business_category_id\"] = 53;\n // $insert[52][\"business_category_name\"] = \"Government services (not elsewhere classified)\";\n // $insert[52][\"parent_id\"] = 14;\n\n \t// //Business Subcategories for Health and personal care\n // $insert[53][\"business_category_id\"] = 54;\n // $insert[53][\"business_category_name\"] = \"Dental care\";\n // $insert[53][\"parent_id\"] = 15;\n\n // $insert[54][\"business_category_id\"] = 55;\n // $insert[54][\"business_category_name\"] = \"Medical care\";\n // $insert[54][\"parent_id\"] = 15;\n\n // //Business Subcategories for Home and garden\n // $insert[55][\"business_category_id\"] = 56;\n // $insert[55][\"business_category_name\"] = \"Antiques\";\n // $insert[55][\"parent_id\"] = 16;\n\n // $insert[56][\"business_category_id\"] = 57;\n // $insert[56][\"business_category_name\"] = \"Appliances\";\n // $insert[56][\"parent_id\"] = 16;\n\n // //Business Subcategories for Nonprofit\n // $insert[57][\"business_category_id\"] = 58;\n // $insert[57][\"business_category_name\"] = \"Charity\";\n // $insert[57][\"parent_id\"] = 17;\n\n // $insert[58][\"business_category_id\"] = 59;\n // $insert[58][\"business_category_name\"] = \"Political\";\n // $insert[58][\"parent_id\"] = 17;\n\n // //Business Subcategories for Pets and animals\n // $insert[59][\"business_category_id\"] = 60;\n // $insert[59][\"business_category_name\"] = \"Medication and supplements\";\n // $insert[59][\"parent_id\"] = 18;\n\n // $insert[60][\"business_category_id\"] = 61;\n // $insert[60][\"business_category_name\"] = \"Pet shops, pet food, and supplies\";\n // $insert[60][\"parent_id\"] = 18;\n\n // //Business Subcategories for Religion and spirituality (for profit)\n // $insert[61][\"business_category_id\"] = 62;\n // $insert[61][\"business_category_name\"] = \"Membership services\";\n // $insert[61][\"parent_id\"] = 19;\n\n // $insert[62][\"business_category_id\"] = 63;\n // $insert[62][\"business_category_name\"] = \"Merchandise\";\n // $insert[62][\"parent_id\"] = 19;\n\n // //Business Subcategories for Retail (not elsewhere classified)\n // $insert[63][\"business_category_id\"] = 64;\n // $insert[63][\"business_category_name\"] = \"Chemicals and allied products\";\n // $insert[63][\"parent_id\"] = 20;\n\n // $insert[64][\"business_category_id\"] = 65;\n // $insert[64][\"business_category_name\"] = \"Department store\";\n // $insert[64][\"parent_id\"] = 20;\n\n // //Business Subcategories for Services - other\n // $insert[65][\"business_category_id\"] = 66;\n // $insert[65][\"business_category_name\"] = \"Advertising\";\n // $insert[65][\"parent_id\"] = 21;\n\n // $insert[66][\"business_category_id\"] = 67;\n // $insert[66][\"business_category_name\"] = \"Shopping services and buying clubs\";\n // $insert[66][\"parent_id\"] = 21;\n\n // //Business Subcategories for Sports and outdoors\n // $insert[67][\"business_category_id\"] = 68;\n // $insert[67][\"business_category_name\"] = \"Athletic shoes\";\n // $insert[67][\"parent_id\"] = 22;\n\n // $insert[68][\"business_category_id\"] = 69;\n // $insert[68][\"business_category_name\"] = \"Bicycle shop, service, and repair\";\n // $insert[68][\"parent_id\"] = 22;\n\n // //Business Subcategories for Toys and hobbies\n // $insert[69][\"business_category_id\"] = 70;\n // $insert[69][\"business_category_name\"] = \"Arts and crafts\";\n // $insert[69][\"parent_id\"] = 23;\n\n // $insert[70][\"business_category_id\"] = 71;\n // $insert[70][\"business_category_name\"] = \"Hobby, toy, and game shops\";\n // $insert[70][\"parent_id\"] = 23;\n\n // //Business Subcategories for Travel\n // $insert[71][\"business_category_id\"] = 72;\n // $insert[71][\"business_category_name\"] = \"Airline\";\n // $insert[71][\"parent_id\"] = 24;\n\n // $insert[72][\"business_category_id\"] = 73;\n // $insert[72][\"business_category_name\"] = \"Auto rental\";\n // $insert[72][\"parent_id\"] = 24;\n\n // //Business Subcategories for Vehicle sales\n // $insert[73][\"business_category_id\"] = 74;\n // $insert[73][\"business_category_name\"] = \"Auto dealer - new and used\";\n // $insert[73][\"parent_id\"] = 25;\n\n // $insert[74][\"business_category_id\"] = 75;\n // $insert[74][\"business_category_name\"] = \"Aviation\";\n // $insert[74][\"parent_id\"] = 25;\n\n // //Business Subcategories for Vehicle service and accessories\n // $insert[75][\"business_category_id\"] = 76;\n // $insert[75][\"business_category_name\"] = \"New parts and supplies - motor vehicle\";\n // $insert[75][\"parent_id\"] = 26;\n\n // $insert[76][\"business_category_id\"] = 77;\n // $insert[76][\"business_category_name\"] = \"Used parts - motor vehicle\";\n // $insert[76][\"parent_id\"] = 26;\n \n // DB::table('tbl_business_category')->insert($insert);\n\n // Model::reguard();\n }", "public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "public function data()\n {\n $orders=libro::all();\n foreach ($orders as $key => $value) {\n \n if(count(autor::find($value->id_autor)))\n $value->id_autor=autor::find($value->id_autor)->nombre;\n else $value->id_autor='No asignado';\n \n }\n return \\Datatables::of($orders)->addColumn('action', 'libro.partials.vista')->make(true) ; \n }", "public function build()\n {\n\n $this->load();\n $this->html = $this->buildTable() ;\n\n return $this->html;\n\n }" ]
[ "0.5958221", "0.58934355", "0.57636535", "0.56906676", "0.5668581", "0.5667496", "0.56548727", "0.56284297", "0.5623634", "0.5608487", "0.56057334", "0.558787", "0.5581347", "0.5542536", "0.55409706", "0.5513466", "0.5502094", "0.5492745", "0.5491858", "0.5463011", "0.5460948", "0.5454191", "0.5443117", "0.54365015", "0.5432261", "0.5364099", "0.5357443", "0.5354853", "0.53547364", "0.5342736" ]
0.7367779
0
Calculate total number of subordinate employees for a given employee using recursion
function assign_subordinate_count($employee) { $count = 0; //Get subordinate employees of current employee $employees = $employee->getSubordinates(); //Add to count $count += count($employees); //Recursively add all subordinate employees number of employees to current employees count foreach($employees AS $emp) { $count += assign_subordinate_count($emp); } //Update number of subordinate employees for this employee $employee->setNumSubordinates($count); //Destroy the subordinates attribute so returned data will be flat array/chop off multidimensional array $employee->destroySubordinates(); return $count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNrEmployeesBranch($username){\n\n global $db;\n\n $stmt=$db->prepare('SELECT count(*) as nrEmployees from employee\n WHERE employee_branch_id=(\n SELECT client_branch\n FROM client\n JOIN\n (\n SELECT client_id AS client\n FROM person\n JOIN\n client ON client_id = person_id\n WHERE username = ?\n )\n ON client_id = client)');\n \n $stmt->execute(array($username));\n return $stmt->fetch();\n }", "public function countAncestors();", "public function countChildren();", "public function getNumberChildren();", "public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }", "public function countDescendants();", "public function getRowsCountRecursive()\n {\n $totalCount = 0;\n foreach ($this->rows as $row) {\n if (($idSubTable = $row->getIdSubDataTable()) !== null) {\n $subTable = Piwik_DataTable_Manager::getInstance()->getTable($idSubTable);\n $count = $subTable->getRowsCountRecursive();\n $totalCount += $count;\n }\n }\n\n $totalCount += $this->getRowsCount();\n return $totalCount;\n }", "public function getNumberDescendants();", "public function childrenCount( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $_where=array() )\n\t{\n\t\t/* We almost universally need the children after getting the count, so let's just cut to the chase and run one query instead of 2 */\n\t\treturn count( $this->children( $permissionCheck, $member, $subnodes, NULL, $_where ) );\n\t}", "public function getNumberOfEmployees(): ?int;", "function scanDeptLevelTree($x, &$arr, $level=\"\") {\n if (empty($level))\n $level = 0;\n\n $query = \"SELECT company_id FROM company WHERE parent_id=\" . $x . \" ORDER BY name\";\n $result = $this->getDBRecords($query);\n\n if (count($result) > 0) {\n $level++;\n for ($i = 0; $i < count($result); $i++) {\n $arr[$level]['company_id'][] = $result[$i]['company_id'];\n $this->scanDeptLevelTree($result[$i]['company_id'], $arr, $level);\n }\n }\n\n $childrens = count($arr);\n return $childrens;\n }", "public function getEmployeesCount() {\n return $this->getTable()->getEmployeesCount();\n }", "function TotalEmployee() {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT \n\t\t\" . $db_table_prefix . \"users.id, \" . $db_table_prefix . \"user_permission_matches.permission_id\n\t\tFROM \" . $db_table_prefix . \"users LEFT JOIN \" . $db_table_prefix . \"user_permission_matches ON \n\t\t\" . $db_table_prefix . \"users.id = \" . $db_table_prefix . \"user_permission_matches.user_id where \" . $db_table_prefix . \"user_permission_matches.permission_id = '1'\");\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n return $num_returns;\n}", "function solution($T) {\n if (!is_object($T) ) {\n return -1;\n }\n //elseif ((is_null($T->l) && is_null($T->r)) {\n // return 0; //no children\n //}\n \n $heightLeft = -1;\n $heightRight = -1;\n \n if($T->l != null) {\n $heightLeft = solution($T->l);\n }\n if($T->r != null) {\n $heightRight = solution($T->r);\n }\n \n if($heightLeft > $heightRight){\n return $heightLeft+1;\n }\n else{\n return $heightRight+1;\n }\n \n return -1; //empty\n}", "function CountSumOfDepthIncreases($data): int{\n $countSumOfDepthIncreases=0;\n for ($i = 3; $i < count($data); $i++){\n if(($data[$i-3]+$data[$i-2]+$data[$i-1])<($data[$i-2]+$data[$i-1]+$data[$i])){\n $countSumOfDepthIncreases++;\n }\n }\n return $countSumOfDepthIncreases;\n}", "function tep_childs_in_category_count($categories_id) {\n $categories_count = 0;\n\n $categories_query = tep_db_query(\"select categories_id from \" . TABLE_CATEGORIES . \" where parent_id = '\" . $categories_id . \"'\");\n while ($categories = tep_db_fetch_array($categories_query)) {\n $categories_count++;\n $categories_count += tep_childs_in_category_count($categories['categories_id']);\n }\n\n return $categories_count;\n}", "protected function calltreeCount( $stack, $start ) {\n\t\t$level = $stack[$start][1];\n\t\t$count = 0;\n\t\tfor ( $i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {\n\t\t\t$count ++;\n\t\t}\n\t\treturn $count;\n\t}", "#[Pure] public function get_children_number(): int\n {\n return $this -> children -> size();\n }", "function recursive($n){\r\n\r\n if($n==0){\r\n return 1;\r\n }\r\n else{\r\n return $n * recursive($n-1);\r\n }\r\n\r\n}", "public function hierarchy() : int\n {\n return DB::table('ranks')\n ->join('user_ranks', 'ranks.rank_id', '=', 'user_ranks.rank_id')\n ->where('user_id', $this->id)\n ->max('ranks.rank_hierarchy');\n }", "protected function get_descendents_count()\n\t{\n\t\t$n = 0;\n\n\t\tforeach ($this->children as $child)\n\t\t{\n\t\t\t$n += 1 + $child->descendents_count;\n\t\t}\n\n\t\treturn $n;\n\t}", "function ep_post_childcount() {\n\tglobal $wp_query;\n\t$queried_object = $wp_query->get_queried_object();\n\t$child_count = 0;\n\tif (isset($queried_object)) {\n\t\t$parents = get_post_ancestors($queried_object->ID);\n\t\t$args = array(\n\t\t\t\"post_parent\" => $queried_object->ID,\n\t\t\t\"post_type\" => $queried_object->post_type,\n\t\t\t\"post_status\" => \"publish\"\n\t\t);\n\t\t$children = get_children($args);\n\t\t$child_count = sizeof($children);\n\t}\n\treturn $child_count;\n}", "public function countWorkOrdersByEmployee($employeeIOID, $start = '', $end = '')\n\t{\n\t\t$where = '';\n\t\tif($start && $end)\n\t\t{\n\t\t\t$where .= sprintf('AND \n\t\t\t\tpbt.NgayBatDau >= %1$s\n\t\t\t\tAND \n\t\t\t\t(ifnull(pbt.Ngay, \\'\\') = \\'\\' OR pbt.Ngay <= %2$s)'\n\t\t\t, $this->_o_DB->quote($start)\n\t\t\t, $this->_o_DB->quote($end));\n\t\t}\n\t\t\n\t\t$sql = sprintf('\n\t\t\tSELECT count(1) AS TotalWorkOrders\n\t\t\tFROM OPhieuBaoTri AS pbt\n\t\t\tINNER JOIN qsiforms AS f ON pbt.IFID_M759 = f.IFID\n\t\t\tWHERE \n\t\t\t\tpbt.Ref_NguoiThucHien = %1$d\n\t\t\t\tAND ifnull(f.Status, 1) < 3\n\t\t\t\t%2$s'\n\t\t, $employeeIOID, $where\n\t\t);\n\t\t\n\t\t$dataSql = $this->_o_DB->fetchOne($sql);\n\t\treturn $dataSql?(int)$dataSql->TotalWorkOrders:0;\n\t}", "function numChildren($options = null) {\n\n#\t\tif (!isset($this->numChildren)) {\n\t\t\t$children = $this->children($options);\n\t\t\treturn sizeof($children);\n#\t\t\t$this->numChildren = sizeof($children);\n#\t\t}\n\n#\t\treturn $this->numChildren;\n\n\t}", "function countChilds($id);", "function getRowCount($modelNode = null) { \n\t\tif ($modelNode == null) {\n\t\t\t//$modelNode = new Cgn_Mvc_ModelNode(0,0,$this->root());\n\t\t\t$modelNode = $this->root();\n\t\t} else {\n\t\t\t$parent = $modelNode->_parentPointer;\n\t\t\t$modelNode = $parent;\n\t\t}\n\t\t$count = 0;\n//\t\techo \"get row count \\n<br/>\\n\";\n\t\t$child = $this->findItem($modelNode);\n\t\t$count = count($child->children);\n//\t\techo \"got $count \\n<br/>\\n\";\n//\t\techo \"DONE: get row count \\n<br/>\\n\";\n\t\t/*\n\t\tif ($child) {\n\t\t\t$count++;\n\t\t}\n\t\twhile ($sib = $child->getSibling($child)) {\n\t\t\t$count++;\n\t\t}\n\t\t */\n//\t\techo \"Row Count \";Cgn::debug($modelNode); //exit();\n//\t\techo \"Row Count \";Cgn::debug($child); //exit();\n\t\treturn $count;\n\t}", "function Count_Max_Reattempts($schedule, $origin_id=null)\n{\n\tstatic $recursion_level;\n\tif (empty($origin_id))\n\t{\n\t\t$max_level = 0;\n\t\t$reatt_count = 0;\n\t\tfor($x = 0; $x < count($schedule); $x++)\n\t\t{\n\t\t\t$e = $schedule[$x];\n\t\t\t$recursion_level = 1;\n\t\t\tif ($e->origin_id !== NULL && $e->origin_id > 0)\n\t\t\t{\n\t\t\t\t$reatt_count = max($reatt_count, Count_Max_Reattempts($schedule, $e->origin_id));\n\t\t\t\t$recursion_level--;\n\t\t\t\tif($recursion_level > $max_level) $max_level = $recursion_level;\n\t\t\t}\n\t\t}\n\t\t//return $reatt_count;\n\t\treturn $max_level;\n\t}\n\telse\n\t{\n\t\t$recursion_level++;\n\t\tfor($i = 0; $i < count($schedule); $i++)\n\t\t{\n\t\t\t$e = $schedule[$i];\n\t\t\tif ($e->transaction_register_id === $origin_id)\n\t\t\t{\n\t\t\t\tif ($e->origin_id === NULL) return 0;\n\t\t\t\telse return (Count_Max_Reattempts($schedule, $e->origin_id) + 1);\n\t\t\t}\n\t\t}\n\t}\n}", "public function count(): int\n {\n return \\count($this->children);\n }", "function array_count_recursive($arr)\n{\n $count = 0;\n foreach (array_values($arr) as $val) {\n $count++;\n if (is_array($val)) {\n $count += array_count_recursive($val);\n }\n }\n\n return $count;\n}", "public function countContentsRecursive(callable $filter = null): int\n {\n return $this->countGenerator($this->scanRawRecursive(true, true, $filter, null));\n }" ]
[ "0.5929706", "0.5877162", "0.5555115", "0.55134", "0.54977053", "0.5426608", "0.54137176", "0.5259671", "0.52588916", "0.51397985", "0.5080739", "0.50494003", "0.5031099", "0.49722075", "0.49419516", "0.49285042", "0.49187142", "0.4918409", "0.49022382", "0.4897613", "0.48904353", "0.48423925", "0.48363158", "0.4779628", "0.47726998", "0.47715324", "0.47604474", "0.47593695", "0.4731129", "0.46815023" ]
0.80555105
0
Deletes a blocked day fromm the database
function delete_blocked_day() { $db = JFactory::getDBO(); $sql = sprintf('delete from #__pbbooking_block_days where id = %s',$db->escape(JRequest::getVar('id'))); $db->setQuery($sql); $db->query(); $this->setRedirect('index.php?option=com_pbbooking&controller=manage&task=blockdays'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_stale_information($dow) {\n $delete_sql = \"DELETE FROM link_times_development \"\n \t\t .\"WHERE day = $dow \";\n\n $this->database->execute_sql($delete_sql);\n }", "public function cleanScheduleAction(){\n \t$actual = new Frogg_Time_Time();\n \t$cleaning_day = $actual->subtract(3*24*60*60);\n \t$cleaning_stamp = $cleaning_day->getUnixTstamp();\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `timestamp` < '.$cleaning_stamp);\n \tdie;\n }", "function delete_records_from_band()\n{\n\t$delete_dt=date(\"Y-m-d\",time()-7*24*60*60);\n\t$sql= \"DELETE FROM newjs.FEMALE_BAND WHERE CHECK_DATE < '$delete_dt' \";\n\tmysql_query($sql) or die(mysql_error());\n\n\t$sql= \"DELETE FROM newjs.MALE_BAND WHERE CHECK_DATE < '$delete_dt' \";\n mysql_query($sql) or die(mysql_error());\n}", "public function deleted(InDay $inDay)\n {\n //\n }", "public function deleteMemberOfDayAction() {\n \n $this->view->id = $this->_getParam('id');\n \n if ($this->getRequest()->isPost()) {\n\n Engine_Api::_()->getDbtable('itemofthedays', 'sitepage')->delete(array('itemoftheday_id =?' => $this->_getParam('id')));\n\n\t\t\treturn $this->_forward('success', 'utility', 'core', array(\n\t\t\t\t'smoothboxClose' => 10,\n\t\t\t\t'parentRefresh' => 10,\n\t\t\t\t'messages' => array(Zend_Registry::get('Zend_Translate')->_(''))\n\t\t\t));\n }\n\n $this->renderScript('admin-widgets/delete.tpl');\n }", "public function deleteAction() {\n\t\t$request = $this->getRequest();\n\t\t$values = $request->getParams();\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$dbseries->update(array('newday' => (int)$this->_getParam('newday', -1)), 'id = '. (int) $values['seriesid']);\n\t\t$this->_forward('crfetch');\n\t}", "public function forceDeleted(InDay $inDay)\n {\n //\n }", "public function delete()\n {\n $dayId = $this->uri->segment(3);\n \n if ($dayId) {\n $this->load->model(\"Eggproductiondata\", 'production');\n \n $this->load->model(\"Eggproductiondays\", 'day');\n \n //echo $this->production->delete(array('egg_production_day_id'=>$dayId));\n echo $this->day->delete($dayId);\n } else {\n \n echo 0;\n }\n \n die;\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function actionDeleteNotificationOld() {\n $connection = Yii::app()->db;\n $sqlRaw = \"DELETE FROM s_notification WHERE alert_after_date < \" . strtotime(\"-360 day\");\n Yii::app()->db->createCommand($sqlRaw)->execute();\n }", "private function cleanHashs() {\n\t\t//$sql = \"DELETE FROM `*PREFIX*ocDashboard_usedHashs` WHERE `timestamp` < '\".(time()-60*60*24).\"'\";\n\t\t$sql = \"DELETE FROM `*PREFIX*ocDashboard_usedHashs` WHERE `timestamp` < ?\";\n\t\t$query = \\OCP\\DB::prepare($sql);\n\t\t$params = Array(time()-60*60*24);\n\t\tif(!$query->execute($params)) {\n\t\t\tOCP\\Util::writeLog('ocDashboard',\"Can't delete usedHashs\", \\OCP\\Util::WARN);\n\t\t}\n\t}", "function delete()\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\r\n\t\t// Delete current item\r\n\t\t$sql = \"delete from tbl_Pistol_CompetitionDay\r\n\t\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r(\"SQL: \" . $sql);\r\n\t\t\t\r\n\t\tmysqli_query($dbh,$sql);\r\n\t\tif (mysqli_errno($dbh)!=0) {\r\n\t\t\tprint_r(mysqli_error($dbh));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->clear(); // Clear current object\r\n\r\n\t}", "public function handle()\n {\n Day::deletePastDays();\n }", "function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }", "public function deletepurgeAction($days)\n {\n $purge = $this->get('oc_platform.advert_purger');\n /* $old_adverts = $purge->purge($days, $advertswithapplication);*/\n $purge->purge($days);\n /* foreach($old_adverts as $old_advert)\n {\n $em = $this->getdoctrine()->getManager();\n $em->remove($old_advert);\n $em->flush();\n }*/\n return $this->redirect($this->generateUrl('oc_platform_home'));\n }", "public static function ADMIN_AREA_DELETE_AREA_STOP_DATE(){\n\t $SQL_String = \"UPDATE area_stop SET _keep=0 AND @user=:user WHERE asno=:asno AND _keep=1\";\n\t return $SQL_String;\n\t}", "public function deleteBook()\n {\n $id = $_POST['id'];\n $time = DELETE_AFTER;\n if (USE_ONE_TABLE) {\n $sql = \"UPDATE `books_authors` SET `deleted` = DATE_ADD(NOW(), interval $time HOUR) WHERE `id` = ?\";\n } else {\n $sql = \"UPDATE `books` SET `deleted` = DATE_ADD(NOW(), interval $time HOUR) WHERE `id` = ?\";\n }\n $this->findBySql($sql, [$id]);\n\n }", "public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function Del_activiteiten() {\n\t\t \t$this->db->query('DELETE FROM Activiteiten WHERE Datum < UNIX_TIMESTAMP(NOW())');\n\t\t \treturn $this->db->affected_rows();\n\t\t}", "protected function removeDayFromStorage(\\DateTime $day)\n {\n unset($this->dateTimeStorage[$day->format('U')]);\n }", "public function cleanupDatabase() {\n\t\t\tif ( !$this->getTableExists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sQuery = \"\n\t\t\t\tDELETE from `%s`\n\t\t\t\tWHERE\n\t\t\t\t\t`day_id`\t\t\t!= '0'\n\t\t\t\t\tAND `created_at`\t< '%s'\n\t\t\t\";\n\t\t\t$sQuery = sprintf( $sQuery,\n\t\t\t\t$this->getTableName(),\n\t\t\t\t( $this->loadDP()->time() - 31*DAY_IN_SECONDS )\n\t\t\t);\n\t\t\t$this->loadDbProcessor()->doSql( $sQuery );\n\t\t}", "public function delete_timbudaya($nopeg) {\n\t\t$this->db->where('nopeg', $nopeg)\n\t\t\t\t ->delete('baru_tim_implementasi_budaya');\n\t}", "public function deleting(GamesDay $gamesDay)\n {\n\n $gamesDay->user_eraser_id = \\Auth::id();\n $gamesDay->timestamps = false;\n $gamesDay->save();\n }", "public function cleanClients()\n {\n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C1B begin\n\n $sql = \"delete from codefw_client where is_active=:is_active or end_date < :now\";\n\n // query \n $q = $this->db->prepare($sql);\n\n // bind parameters\n date_default_timezone_set(\"UTC\");\n $q->bindValue(\"is_active\", 0);\n \n date_default_timezone_set(\"UTC\"); \n $q->bindValue(\"now\", time());\n\n // execute query\n $q->execute();\n \n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C1B end\n }", "public function cleanInvalidScheduleAction(){\n \t$sql = new Frogg_Db_Sql('SELECT `rage_id` FROM `newseries` WHERE `flag` = '.Application_Model_NewSeries::INVALID);\n \t$ids = array();\n \tif($sql->rows()){\n \t\twhile($row=$sql->fetch()){\n \t\t\tarray_push($ids, $row['rage_id']);\n \t\t}\n \t}\n \t$ids = implode(',', $ids);\n \t\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `rage_id` IN ('.$ids.')');\n \tdie;\n }", "function basketsPurge() {\n if (!$con = connectDB2()) $res = \"ERR\"; // si échec de connexion\n else { // sinon\n $ilya24h = time() - 60*60*24;\n $req = \"DELETE FROM rqdl_baskcontent \";\n $req .= \"WHERE num IN (SELECT num FROM rqdl_baskets WHERE UNIX_TIMESTAMP(lastchange) < $ilya24h)\";\n if (!mysql_query($req,$con)) $res = \"KO\";\n else {\n $req = \"DELETE FROM rqdl_baskets WHERE UNIX_TIMESTAMP(lastchange) < $ilya24h\";\n if (!mysql_query($req,$con)) $res = \"KO\";\n else $res = \"OK\";\n }\n mysql_close($con); // fermeture de la connexion\n }\n return $res; // on retourne soit \"KO\", soit \"OK\", soit \"ERR\"\n}", "public function removeInvalidReferCodes(){\n $date = new \\DateTime();\n $date->modify('-96 hours');\n $formatted_date = $date->format('Y-m-d H:i:s');\n $invalidCodes = Refer_code::where('created_at', '<',$formatted_date)->delete();\n }", "public static function delete2(){\n\t\t$now = time() - 5*24*3600;\n\t\t$result = MGameBase::getInstance()->getDB()->query(\"DELETE FROM messages WHERE readed = 2 and time < '\".$now.\"'\");\n\t}", "function deleteFee()\n {\n global $db;\n $requete = $db->prepare('DELETE FROM fees WHERE idF = ?');\n $requete->execute(array($this->idF));\n }", "function procDeleteInactive(){\r\n\t\t\tglobal $session, $database;\r\n\t\t\t$inact_time = $session->time - $_POST['inactdays']*24*60*60;\r\n\t\t\t$q = \"DELETE FROM \".TBL_USERS.\" WHERE timestamp < $inact_time \"\r\n\t\t\t.\"AND userlevel != \".ADMIN_LEVEL;\r\n\t\t\t$database->query($q);\r\n\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t}" ]
[ "0.6855102", "0.65642005", "0.6172881", "0.6152908", "0.6135576", "0.61299783", "0.607255", "0.5965789", "0.5947851", "0.59291697", "0.5921442", "0.59193087", "0.5913087", "0.58906025", "0.5858244", "0.5843967", "0.58401734", "0.58152854", "0.57951736", "0.57829964", "0.5781107", "0.5778947", "0.57612854", "0.57531744", "0.5737319", "0.5718397", "0.5716089", "0.57109946", "0.57086825", "0.5686748" ]
0.8076172
0
view_ical used to render an ics file that the user can dump into their diary app
function view_ical() { if (!JRequest::getVar('format') == 'raw') { $this->setRedirect(JURI::root(false).'administrator/index.php?option=com_pbbooking&controller=manage&task=view_ical&id='.JRequest::getInt('id').'&format=raw'); return; } $view=$this->getView('manage','raw'); $view->setLayout('ics_view'); $db = JFactory::getDbo(); $db->setQuery('select * from #__pbbooking_events where id='.$db->escape((int)JRequest::getInt('id'))); $view->event = $db->loadObject(); $view->display(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ical() {\n \t$filter = ProjectUsers::getVisibleTypesFilter($this->logged_user, array(PROJECT_STATUS_ACTIVE), get_completable_project_object_types());\n if($filter) {\n $objects = ProjectObjects::find(array(\n \t\t 'conditions' => array($filter . ' AND completed_on IS NULL AND state >= ? AND visibility >= ?', STATE_VISIBLE, $this->logged_user->getVisibility()),\n \t\t 'order' => 'priority DESC',\n \t\t));\n\n \t\trender_icalendar(lang('Global Calendar'), $objects, true);\n \t\tdie();\n } elseif($this->request->get('subscribe')) {\n \tflash_error(lang('You are not able to download .ics file because you are not participating in any of the active projects at the moment'));\n \t$this->redirectTo('ical_subscribe');\n } else {\n \t$this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n }", "function fichier_ical($liste_evenements)\r\n{\r\n\t////\tINIT\r\n\tglobal $tab_timezones, $AGENDAS_AFFECTATIONS;\r\n\r\n\t////\tDEBUT DU ICAL\r\n\t$sortie = \"BEGIN:VCALENDAR\\n\";\r\n\t$sortie .= \"PRODID:-//Agora-Project//\".$_SESSION[\"agora\"][\"nom\"].\"//EN\\n\";\r\n\t$sortie .= \"VERSION:2.0\\n\";\r\n\t$sortie .= \"CALSCALE:GREGORIAN\\n\";\r\n\t$sortie .= \"METHOD:PUBLISH\\n\";\r\n\r\n\t////\tTIMEZONE\r\n\t$current_timezone = current_timezone();\r\n\t$heure_time_zone = $tab_timezones[$current_timezone];\r\n\t$sortie .= \"BEGIN:VTIMEZONE\\n\";\r\n\t$sortie .= \"TZID:\".$current_timezone.\"\\n\";\r\n\t$sortie .= \"X-LIC-LOCATION:\".$current_timezone.\"\\n\";\r\n\t//Daylight\r\n\t$sortie .= \"BEGIN:DAYLIGHT\\n\";\r\n\t$sortie .= \"TZOFFSETFROM:\".heure_ical($heure_time_zone).\"\\n\";\r\n\t$sortie .= \"TZOFFSETTO:\".heure_ical($heure_time_zone,1).\"\\n\";\r\n\t$sortie .= \"TZNAME:CEST\\n\";\r\n\t$sortie .= \"DTSTART:19700329T020000\\n\";\r\n\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3\\n\";\r\n\t$sortie .= \"END:DAYLIGHT\\n\";\r\n\t//Standard\r\n\t$sortie .= \"BEGIN:STANDARD\\n\";\r\n\t$sortie .= \"TZOFFSETFROM:\".heure_ical($heure_time_zone,1).\"\\n\";\r\n\t$sortie .= \"TZOFFSETTO:\".heure_ical($heure_time_zone).\"\\n\";\r\n\t$sortie .= \"TZNAME:CET\\n\";\r\n\t$sortie .= \"DTSTART:19701025T030000\\n\";\r\n\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10\\n\";\r\n\t$sortie .= \"END:STANDARD\\n\";\r\n\t$sortie .= \"END:VTIMEZONE\\n\";\r\n\r\n\t////\tAJOUT DE CHAQUE EVENEMENT\r\n\tforeach($liste_evenements as $evt)\r\n\t{\r\n\t\t////\tDescription & agendas où est affecté l'événement\r\n\t\t$evt[\"description\"] = strip_tags(str_replace(\"<br />\",\" \",$evt[\"description\"]));\r\n\t\t$agendas = agendas_evts($evt[\"id_evenement\"],\"1\");\r\n\t\tif(count($agendas)>1){\r\n\t\t\t$agendas_txt = \"\";\r\n\t\t\tforeach($agendas as $id_agenda) { $agendas_txt .= $AGENDAS_AFFECTATIONS[$id_agenda][\"titre\"].\", \"; }\r\n\t\t\t$evt[\"description\"] .= \" [\".substr(text_reduit($agendas_txt),0,-2).\"]\";\r\n\t\t}\r\n\t\t////\tAffichage\r\n\t\t$sortie .= \"BEGIN:VEVENT\\n\";\r\n\t\t$sortie .= \"CREATED:\".date_ical($evt[\"date_crea\"],false).\"\\n\";\r\n\t\t$sortie .= \"LAST-MODIFIED:\".date_ical($evt[\"date_crea\"],false).\"\\n\";\r\n\t\t$sortie .= \"DTSTAMP:\".date_ical(db_insert_date(),false).\"\\n\";\r\n\t\t$sortie .= \"UID:\".ical_uid_evt($evt).\"\\n\";\r\n\t\t$sortie .= \"SUMMARY:\".$evt[\"titre\"].\"\\n\";\r\n\t\t$sortie .= \"DTSTART;TZID=\".date_ical($evt[\"date_debut\"]).\"\\n\"; //exple : \"19970714T170000Z\" pour 14 juillet 1997 à 17h00\r\n\t\t$sortie .= \"DTEND;TZID=\".date_ical($evt[\"date_fin\"]).\"\\n\";\r\n\t\tif($evt[\"id_categorie\"]>0)\t\t$sortie .= \"CATEGORIES:\".db_valeur(\"SELECT titre FROM gt_agenda_categorie WHERE id_categorie='\".$evt[\"id_categorie\"].\"'\").\"\\n\";\r\n\t\tif($evt[\"description\"]!=\"\")\t\t$sortie .= \"DESCRIPTION:\".preg_replace(\"/\\r\\n/\",\" \",html_entity_decode(strip_tags($evt[\"description\"]))).\"\\n\";\r\n\t\t// Périodicité\r\n\t\t$period_date_fin = ($evt[\"period_date_fin\"]) ? \";UNTIL=\".date_ical($evt[\"period_date_fin\"],false) : \"\";\r\n\t\tif($evt[\"periodicite_type\"]==\"annee\")\t\t\t\t$sortie .= \"RRULE:FREQ=YEARLY;INTERVAL=1\".$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"mois\")\t\t\t$sortie .= \"RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=\".trim(strftime(\"%e\",strtotime($evt[\"date_debut\"]))).$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"jour_mois\")\t\t$sortie .= \"RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=\".implode(\",\",array_map(\"abs\",explode(\",\",$evt[\"periodicite_valeurs\"]))).$period_date_fin.\"\\n\";\r\n\t\telseif($evt[\"periodicite_type\"]==\"jour_semaine\")\t$sortie .= \"RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=\".implode(\",\",array_map(\"jour_ical\",explode(\",\",$evt[\"periodicite_valeurs\"]))).$period_date_fin.\"\\n\";\r\n\t\t$sortie .= \"END:VEVENT\\n\";\r\n\t}\r\n\r\n\t////\tFIN DU ICAL\r\n\t$sortie .= \"END:VCALENDAR\\n\";\r\n\treturn $sortie;\r\n}", "public function render() {\n echo \"BEGIN:VCALENDAR\\r\\n\";\n echo \"VERSION:2.0\\r\\n\";\n echo \"PRODID:-//X2Engine//NONSGML X2 Calendar//EN\\r\\n\";\n \n if (is_array($this->_actions)) {\n $actionsPrinted = array();\n $users = array();\n foreach($this->_actions as $action) {\n // skip events showing up more than once (i.e. combined cal)\n if(!($action instanceof Actions) || !empty($actionsPrinted[$action->id])) \n continue;\n // Render a VEVENT for each action\n echo \"BEGIN:VEVENT\\r\\n\";\n // Treat the first assignee as the one to use for generating the \"organizer\" \n // and all of the assignees for the unique ID field\n $assignees = $action->getAssignees();\n if(!empty($assignees)) {\n $first = reset($assignees);\n echo \"UID:\".$action->assignedTo.\"-\".$action->id.\"@\".$_SERVER['SERVER_NAME'].\"\\r\\n\";\n \n if (!empty($first) && !array_key_exists($first, $users)) {\n // cache user emails\n $user = User::model()->findByAttributes(array('username'=>$first));\n $users[$first] = array(\n 'name'=>$user->name, \n 'email'=>$user->emailAddress,\n 'timeZone'=>$user->profile->timeZone\n );\n }\n $tz = $users[$first]['timeZone'];\n echo \"ORGANIZER;CN=\\\"\".$users[$first]['name'].\"\\\":mailto:\".$users[$first]['email'].\"\\r\\n\";\n } else {\n // Default app timezone (which is actually stored as the column default value)\n $tz = Profile::model()->tableSchema->columns['timeZone']->defaultValue;\n echo \"UID:Anyone-{$action->id}@{$_SERVER['SERVER_NAME']}\\r\\n\";\n }\n $start = new DateTime();\n $end = new DateTime();\n $tzOb = new DateTimeZone($tz);\n $start->setTimestamp($action->dueDate);\n $end->setTimestamp($action->completeDate);\n $start->setTimezone($tzOb);\n $end->setTimezone($tzOb);\n echo \"DTSTART;TZID=$tz:\".$start->format('Ymd\\THis').\"\\r\\n\";\n echo \"DTEND;TZID=$tz:\".$end->format('Ymd\\THis').\"\\r\\n\";\n echo \"SUMMARY:\".self::escapeText($action->actionText->text).\"\\r\\n\";\n echo \"END:VEVENT\\r\\n\";\n $actionsPrinted[$action->id] = true;\n }\n }\n\n echo \"END:VCALENDAR\\r\\n\";\n }", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "public function icalExport($id, $title, $description, $start_date, $end_date, $url=false)\n\t\t{\n\t\t\t\n\t\t\tif($url == 'undefined') \n\t\t\t{\n\t\t\t\t$url = '';\n\t\t\t} else {\n\t\t\t\t$url = ' '.$url.' ';\t\n\t\t\t}\n\t\t\t\n\t\t\t$description_fn = $str = str_replace(array(\"\\r\",\"\\n\",\"\\t\"),'\\n',$description);;\n\t\t\t\n\t\t\t// Build the ics file\n$ical = 'BEGIN:VCALENDAR\nPRODID:-//Paulo Regina//Ajax Calendar 1.6 MIMEDIR//EN\nVERSION:2.0\nBEGIN:VEVENT\nCREATED:'.date('Ymd\\This', time()).'Z'.'\nDESCRIPTION:'.$description_fn.$url.'\nDTEND:'.$end_date.'\nDTSTAMP:'.date('Ymd\\This', time()).'Z'.'\nDTSTART:'.$start_date.'\nLAST-MODIFIED:'.date('Ymd\\This', time()).'Z'.'\nSUMMARY:'.addslashes($title).'\nEND:VEVENT\nEND:VCALENDAR';\n\t\t\t \n\t\t\tif(isset($id)) {\n\t\t\t\treturn $ical;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function toICS() {\r\n require_once BPSP_PLUGIN_DIR . '/schedules/iCalcreator.class.php';\r\n global $bp;\r\n define( 'ICAL_LANG', get_bloginfo( 'language' ) );\r\n \r\n $cal = new vcalendar();\r\n $cal->setConfig( 'unique_id', str_replace( 'http://', '', get_bloginfo( 'siteurl' ) ) );\r\n $cal->setConfig( 'filename', $bp->groups->current_group->slug );\r\n $cal->setProperty( 'X-WR-CALNAME', __( 'Calendar for: ', 'bpsp' ) . $bp->groups->current_group->name );\r\n $cal->setProperty( 'X-WR-CALDESC', $bp->groups->current_group->description );\r\n $cal->setProperty( 'X-WR-TIMEZONE', get_option('timezone_string') );\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $entry ) {\r\n setup_postdata( $entry );\r\n \r\n $e = new vevent();\r\n \r\n if( $entry->post_type == \"schedule\" )\r\n $date = getdate( strtotime( $entry->start_date ) );\r\n elseif( $entry->post_type == \"assignment\" )\r\n $date = getdate( strtotime( $entry->post_date ) );\r\n $dtstart['year'] = $date['year'];\r\n $dtstart['month'] = $date['mon'];\r\n $dtstart['day'] = $date['mday'];\r\n $dtstart['hour'] = $date['hours'];\r\n $dtstart['min'] = $date['minutes'];\r\n $dtstart['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtstart', $dtstart );\r\n \r\n $e->setProperty( 'description', get_the_content() . \"\\n\\n\" . $entry->permalink );\r\n \r\n if( !empty( $entry->location ) )\r\n $e->setProperty( 'location', $entry->location );\r\n \r\n if( $entry->post_type == \"assignment\" )\r\n $entry->end_date = $entry->due_date; // make assignments compatible with schedule parser\r\n \r\n if( !empty( $entry->end_date ) ) {\r\n $date = getdate( strtotime( $entry->end_date ) );\r\n $dtend['year'] = $date['year'];\r\n $dtend['month'] = $date['mon'];\r\n $dtend['day'] = $date['mday'];\r\n $dtend['hour'] = $date['hours'];\r\n $dtend['min'] = $date['minutes'];\r\n $dtend['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtend', $dtend );\r\n } else\r\n $e->setProperty( 'duration', 0, 1, 0 ); // Assume it's an one day event\r\n \r\n $e->setProperty( 'summary', get_the_title( $entry->ID ) );\r\n $e->setProperty( 'status', 'CONFIRMED' );\r\n \r\n $cal->setComponent( $e );\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( $cal->returnCalendar() );\r\n }", "public static function iCalGenerate($event, $incRecurrences = false) {\n // with calling this method statically as at times no SSViewer theme is set)\n Config::inst()->update('SSViewer', 'theme', 'default');\n Config::inst()->update('SSViewer', 'theme_enabled', true);\n\n $content = ViewableData::create()->customise(\n array(\n \"Event\" => $event,\n \"Now\" => SS_Datetime::now(),\n \"IncludeRecurrences\" => $incRecurrences\n )\n )->renderWith(\"ICS\");\n\n $content = preg_replace(\"/\\n{2,}/\", \"\\n\", $content);\n $content = preg_replace(\"/\\n/\", \"\\r\\n\", $content);\n $content = trim($content);\n\n // Ensure ICS validation against length of lines\n $lines = explode(\"\\r\\n\", $content);\n $content = \"\";\n foreach ($lines as $line) {\n // Each content line must begin with a space or tab, hence \\t after the usual \\r\\n\n $content .= wordwrap($line, 70, \"\\r\\n\\t\") . \"\\r\\n\";\n }\n\n return $content;\n\n }", "public function action_ics($calendar_id = null)\n {\n if ($calendar_id == null) {\n $events = ORM::factory('event')->order_by('date')->order_by('start_time')->find_all()->as_array();\n } else {\n $events = ORM::factory('event')->where('calendar_id', '=', $calendar_id)->order_by('date')->order_by('start_time')->find_all()->as_array();\n }\n\n $this->_build_ics($events);\n }", "static function toXCAL($icalData) {\n\n // Detecting line endings\n $lb=\"\\r\\n\";\n if (strpos($icalData,\"\\r\\n\")!==false) $lb = \"\\r\\n\";\n elseif (strpos($icalData,\"\\n\")!==false) $lb = \"\\n\";\n\n // Splitting up items per line\n $lines = explode($lb,$icalData);\n\n // Properties can be folded over 2 lines. In this case the second\n // line will be preceeded by a space or tab.\n $lines2 = array();\n foreach($lines as $line) {\n\n if (!$line) continue;\n if ($line[0]===\" \" || $line[0]===\"\\t\") {\n $lines2[count($lines2)-1].=substr($line,1);\n continue;\n }\n\n $lines2[]=$line;\n\n }\n\n $xml = '<?xml version=\"1.0\"?>' . \"\\n\";\n $xml.= \"<iCalendar xmlns=\\\"urn:ietf:params:xml:ns:xcal\\\">\\n\";\n\n $spaces = 2;\n foreach($lines2 as $line) {\n\n $matches = array();\n // This matches PROPERTYNAME;ATTRIBUTES:VALUE\n if (!preg_match('/^([^:^;]*)(?:;([^:]*))?:(.*)$/',$line,$matches))\n continue;\n\n $propertyName = strtolower($matches[1]);\n $attributes = $matches[2];\n $value = $matches[3];\n\n // If the line was in the format BEGIN:COMPONENT or END:COMPONENT, we need to special case it.\n if ($propertyName === 'begin') {\n $xml.=str_repeat(\" \",$spaces);\n $xml.='<' . strtolower($value) . \">\\n\";\n $spaces+=2;\n continue;\n } elseif ($propertyName === 'end') {\n $spaces-=2;\n $xml.=str_repeat(\" \",$spaces);\n $xml.='</' . strtolower($value) . \">\\n\";\n continue;\n }\n\n $xml.=str_repeat(\" \",$spaces);\n $xml.='<' . $propertyName;\n if ($attributes) {\n // There can be multiple attributes\n $attributes = explode(';',$attributes);\n foreach($attributes as $att) {\n \n list($attName,$attValue) = explode('=',$att,2);\n $attName = strtolower($attName);\n if ($attName === 'language') $attName='xml:lang';\n $xml.=' ' . $attName . '=\"' . htmlspecialchars($attValue) . '\"';\n\n }\n }\n\n $xml.='>'. htmlspecialchars(trim($value)) . '</' . $propertyName . \">\\n\";\n \n }\n $xml.=\"</iCalendar>\";\n return $xml;\n\n }", "public function icalendar()\n\t{\n\t\t$s = 'EJURI3ia8aj#912IKa';\n\t\t$r = '#';\n\t\t$e = 'aAEah38a;a33';\n\n\t\t// -------------------------------------\n\t\t// Some dummy tagdata we'll hand off to events()\n\t\t// -------------------------------------\n\n\t\t$vars = array(\n\t\t\t'event_title'\t\t\t\t\t=> 'title',\n\t\t\t'event_id'\t\t\t\t\t\t=> 'id',\n\t\t\t'event_summary'\t\t\t\t\t=> 'summary',\n\t\t\t'event_location'\t\t\t\t=> 'location',\n\t\t\t'event_start_date format=\"%Y\"'\t=> 'start_year',\n\t\t\t'event_start_date format=\"%m\"'\t=> 'start_month',\n\t\t\t'event_start_date format=\"%d\"'\t=> 'start_day',\n\t\t\t'event_start_date format=\"%H\"'\t=> 'start_hour',\n\t\t\t'event_start_date format=\"%i\"'\t=> 'start_minute',\n\t\t\t'event_end_date format=\"%Y\"'\t=> 'end_year',\n\t\t\t'event_end_date format=\"%m\"'\t=> 'end_month',\n\t\t\t'event_end_date format=\"%d\"'\t=> 'end_day',\n\t\t\t'event_end_date format=\"%H\"'\t=> 'end_hour',\n\t\t\t'event_end_date format=\"%i\"'\t=> 'end_minute',\n\t\t\t'event_calendar_tz_offset'\t\t=> 'tz_offset',\n\t\t\t'event_calendar_timezone'\t\t=> 'timezone'\n\t\t);\n\n\t\t$rvars = array(\n\t\t\t'rule_type',\n\t\t\t'rule_start_date',\n\t\t\t'rule_repeat_years',\n\t\t\t'rule_repeat_months',\n\t\t\t'rule_repeat_days',\n\t\t\t'rule_repeat_weeks',\n\t\t\t'rule_days_of_week',\n\t\t\t'rule_relative_dow',\n\t\t\t'rule_days_of_month',\n\t\t\t'rule_months_of_year',\n\t\t\t'rule_stop_by',\n\t\t\t'rule_stop_after'\n\t\t);\n\n\t\t$evars = array(\n\t\t\t'exception_start_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t$ovars = array(\n\t\t\t'occurrence_start_date format=\"%Y%m%dT%H%i00\"',\n\t\t\t'occurrence_end_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing tagdata');\n\n\t\t$summary_field = ee()->TMPL->fetch_param('summary_field', 'event_title');\n\n\t\tee()->TMPL->tagdata =\timplode($s, array(\n\t\t\tLD . $summary_field . RD,\n\t\t\tLD . 'event_id' . RD,\n\t\t\tLD . 'if event_summary' . RD .\n\t\t\t\tLD . 'event_summary' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'if event_location' . RD .\n\t\t\t\tLD . 'event_location' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'event_start_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_calendar_tz_offset' . RD,\n\t\t\tLD . 'event_calendar_timezone' . RD,\n\t\t\t'RULES' .\n\t\t\t\tLD . 'if event_has_rules' . RD .\n\t\t\t\tLD . 'rules' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $rvars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'rules' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'OCCURRENCES'.\n\t\t\t\tLD . 'if event_has_occurrences' . RD .\n\t\t\t\tLD . 'occurrences' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $ovars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'occurrences' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'EXCEPTIONS'.\n\t\t\t\tLD . 'if event_has_exceptions' . RD .\n\t\t\t\tLD . 'exceptions' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $evars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'exceptions' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t$e\n\t\t));\n\n\t\t$tvars \t\t\t\t\t= ee()->functions->assign_variables(\n\t\t\tee()->TMPL->tagdata\n\t\t);\n\t\tee()->TMPL->var_single \t= $tvars['var_single'];\n\t\tee()->TMPL->var_pair \t= $tvars['var_pair'];\n\t\tee()->TMPL->tagdata \t= ee()->functions->prep_conditionals(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray_keys($vars)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Fire up events()\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Firing up Events()');\n\n\t\t$tagdata = ee()->TMPL->advanced_conditionals($this->events());\n\n\t\t// -------------------------------------\n\t\t// Collect the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting events');\n\n\t\t$events = explode($e, $tagdata);\n\n\t\t// -------------------------------------\n\t\t// Fire up iCalCreator\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting iCalCreator');\n\n\t\tif ( ! class_exists('vcalendar'))\n\t\t{\n\t\t\trequire_once 'libraries/icalcreator/iCalcreator.class.php';\n\t\t}\n\n\t\t$ICAL = new vcalendar();\n\n\t\t//we are setting this manually because we need individual ones for each event for this to work\n\t\t//$ICAL->setConfig('unique_id', parse_url(ee()->config->item('site_url'), PHP_URL_HOST));\n\t\t$host = parse_url(ee()->config->item('site_url'), PHP_URL_HOST);\n\n\n\t\t$vars = array_values($vars);\n\n\t\t//ee()->TMPL->log_item('Calendar: Iterating through the events');\n\n\t\tforeach ($events as $key => $event)\n\t\t{\n\t\t\tif (trim($event) == '') continue;\n\n\t\t\t$E \t\t\t\t= new vevent();\n\n\t\t\t$event \t\t\t= explode($s, $event);\n\t\t\t$rules \t\t\t= '';\n\t\t\t$occurrences \t= '';\n\t\t\t$exceptions \t= '';\n\n\t\t\tforeach ($event as $k => $v)\n\t\t\t{\n\t\t\t\tif (isset($vars[$k]))\n\t\t\t\t{\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t//\tMakes the local vars from above, if available:\n\t\t\t\t\t// \t$title, $summary, $location,\n\t\t\t\t\t// $start_year, $start_month, $start_day,\n\t\t\t\t\t// $start_hour, $start_minute, $end_year,\n\t\t\t\t\t// $end_month, $end_day, $end_hour,\n\t\t\t\t\t// \t$end_minute, $tz_offset, $timezone\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t$$vars[$k] = $v;\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 5) == 'RULES')\n\t\t\t\t{\n\t\t\t\t\t$rules = substr($v, 5);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 11) == 'OCCURRENCES')\n\t\t\t\t{\n\t\t\t\t\t$occurrences = substr($v, 11);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 10) == 'EXCEPTIONS')\n\t\t\t\t{\n\t\t\t\t\t$exceptions = substr($v, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Set the timezone for this calendar based on the first event's info\n\t\t\t// -------------------------------------\n\n\t\t\tif ($key == 0)\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Convert calendar_name to calendar_id\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t\t\t$this->P->value('calendar_name') != '')\n\t\t\t\t{\n\t\t\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\tlets try to get the timezone from the\n\t\t\t\t//\tpassed calendar ID if there is one\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$cal_timezone \t= FALSE;\n\t\t\t\t$cal_tz_offset \t= FALSE;\n\n\t\t\t\tif ($this->P->value('calendar_id') != '')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT \ttz_offset, timezone\n\t\t\t\t\t\t\tFROM\texp_calendar_calendars\n\t\t\t\t\t\t\tWHERE \tcalendar_id\n\t\t\t\t\t\t\tIN \t\t(\" . ee()->db->escape_str(\n\t\t\t\t\t\t\t\t\t\t\timplode(',',\n\t\t\t\t\t\t\t\t\t\t\t\texplode('|',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->P->value('calendar_id')\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) .\n\t\t\t\t\t\t\t\t\t\")\n\t\t\t\t\t\t\tLIMIT\t1\";\n\n\t\t\t\t\t$cal_tz_query = ee()->db->query($sql);\n\n\t\t\t\t\tif ($cal_tz_query->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_timezone \t= $cal_tz_query->row('timezone');\n\t\t\t\t\t\t$cal_tz_offset \t= $cal_tz_query->row('tz_offset');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//last resort, we get it from the current event\n\n\t\t\t\t$T = new vtimezone();\n\t\t\t\t$T->setProperty('tzid', ($cal_timezone ? $cal_timezone : $timezone));\n\t\t\t\t$T->setProperty('tzoffsetfrom', '+0000');\n\n\t\t\t\t$tzoffsetto = ($cal_tz_offset ? $cal_tz_offset : $tz_offset);\n\n\t\t\t\tif ($tzoffsetto === '0000')\n\t\t\t\t{\n\t\t\t\t\t$tzoffsetto = '+0000';\n\t\t\t\t}\n\n\t\t\t\t$T->setProperty('tzoffsetto', $tzoffsetto);\n\t\t\t\t$ICAL->setComponent($T);\n\t\t\t}\n\n\t\t\t$title\t\t\t= strip_tags($title);\n\t\t\t$description\t= strip_tags(trim($summary));\n\t\t\t$location\t\t= strip_tags(trim($location));\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrences?\n\t\t\t// -------------------------------------\n\n\t\t\t$occurrences\t= explode('|', rtrim($occurrences, '|'));\n\t\t\t$odata\t\t\t= array();\n\n\t\t\tforeach ($occurrences as $k => $occ)\n\t\t\t{\n\t\t\t\t$occ = trim($occ);\n\t\t\t\tif ($occ == '') continue;\n\n\t\t\t\t$occ = explode($r, $occ);\n\t\t\t\t$odata[$k][] = $occ[0];\n\t\t\t\t$odata[$k][] = $occ[1];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Exceptions?\n\t\t\t// -------------------------------------\n\n\t\t\t$exceptions\t= explode('|', rtrim($exceptions, '|'));\n\t\t\t$exdata\t\t= array();\n\n\t\t\tforeach ($exceptions as $k => $exc)\n\t\t\t{\n\t\t\t\t$exc = trim($exc);\n\n\t\t\t\tif ($exc == '') continue;\n\n\t\t\t\t$exdata[] = $exc;\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Rules?\n\t\t\t// -------------------------------------\n\n\t\t\t$add_rules \t= FALSE;\n\t\t\t$erules \t= array();\n\t\t\t$rules \t\t= explode('|', rtrim($rules, '|'));\n\n\t\t\tforeach ($rules as $rule)\n\t\t\t{\n\t\t\t\t$temp = explode($r, $rule);\n\t\t\t\t$rule = array();\n\n\t\t\t\tforeach ($temp as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif ($v != FALSE) $add_rules = TRUE;\n\t\t\t\t\t$rule[substr($rvars[$k], 5)] = $v;\n\t\t\t\t}\n\n\t\t\t\tif ($add_rules === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$temp = array();\n\n\t\t\t\t\tif ($rule['repeat_years'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'YEARLY';\n\n\t\t\t\t\t\tif ($rule['repeat_years'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_years'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_months'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'MONTHLY';\n\n\t\t\t\t\t\tif ($rule['repeat_months'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_months'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_weeks'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'WEEKLY';\n\n\t\t\t\t\t\tif ($rule['repeat_weeks'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_weeks'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_days'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'DAILY';\n\n\t\t\t\t\t\tif ($rule['repeat_days'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_days'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['months_of_year'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'c' => 12, etc\n\t\t\t\t\t\t$m = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['months_of_year'] > 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$months = str_split($rule['months_of_year']);\n\t\t\t\t\t\t\tforeach ($months as $month)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTH'][] = $m[$month] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTH'] = $m[$month] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_month'] > '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'v' => 30, etc\n\t\t\t\t\t\t$d = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9,\n\t\t\t\t\t\t\t'A', 'B', 'C', 'D', 'E', 'F',\n\t\t\t\t\t\t\t'G', 'H', 'I', 'J', 'K', 'L',\n\t\t\t\t\t\t\t'M', 'N', 'O', 'P', 'Q', 'R',\n\t\t\t\t\t\t\t'S', 'T', 'U', 'V'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['days_of_month']) > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$days = str_split($rule['days_of_month']);\n\t\t\t\t\t\t\tforeach ($days as $day)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTHDAY'][] = $d[$day] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTHDAY'] = $d[$rule['days_of_month']] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_week'] != '' OR $rule['days_of_week'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d \t\t\t= array('SU','MO','TU','WE','TH','FR','SA');\n\t\t\t\t\t\t$d_letter \t= array('U','M','T','W','R','F','S');\n\n\t\t\t\t\t\t$dows \t\t= str_split($rule['days_of_week']);\n\n\t\t\t\t\t\tif ($rule['relative_dow'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rels = str_split($rule['relative_dow']);\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($rels as $rel)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($rel == 6) $rel = -1;\n\t\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $rel.$d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['stop_after'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['COUNT'] = $rule['stop_after'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['stop_by'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add time\n\t\t\t\t\t\t// TODO: The \"+1\" below is because the ical standard treats\n\t\t\t\t\t\t// \tUNTIL as \"less than\", not \"less than or equal to\" (which\n\t\t\t\t\t\t// \tis how Calendar treats stop_by). Double check that a simple\n\t\t\t\t\t\t// \t\"+1\" accurately addresses this difference.\n\t\t\t\t\t\t$temp['UNTIL'] = $rule['stop_by'] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$erules[] = $temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Put it together\n\t\t\t// -------------------------------------\n\n\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\tif ($this->_is_all_day($start_hour, $start_minute, $end_hour, $end_minute))\n\t\t\t{\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $start_year,\n\t\t\t\t\t\t'month' => $start_month,\n\t\t\t\t\t\t'day'\t=> $start_day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t{\n\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t$end_year,\n\t\t\t\t\t$end_month,\n\t\t\t\t\t$end_day\n\t\t\t\t);\n\n\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t$E->setProperty('summary', $title);\n\n\t\t\tif ( ! empty($erules))\n\t\t\t{\n\t\t\t\tforeach ($erules as $rule)\n\t\t\t\t{\n\t\t\t\t\t$E->setProperty('rrule', $rule);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extras = array();\n\t\t\t$edits\t= array();\n\n\t\t\tif ( ! empty($odata))\n\t\t\t{\n\t\t\t\t$query = ee()->db->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM\texp_calendar_events_occurrences\n\t\t\t\t\t WHERE\tevent_id = \" . ee()->db->escape_str($id)\n\t\t\t\t);\n\n\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t//fix blank times\n\t\t\t\t\t$row['start_time'] \t= ($row['start_time'] == 0) ? '0000' \t: $row['start_time'];\n\t\t\t\t\t$row['end_time'] \t= ($row['end_time'] == 0) ? '2400' \t\t: $row['end_time'];\n\n\t\t\t\t\t//looks like an edited occurrence\n\t\t\t\t\t//edits without rules arent really edits.\n\t\t\t\t\tif ($row['event_id'] != $row['entry_id'] AND empty($rules))\n\t\t\t\t\t{\n\t\t\t\t\t\t$edits[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t//probably entered with the date picker or something\n\t\t\t\t\t//these loose occurences\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$extras[] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty($exdata))\n\t\t\t{\n\t\t\t\t$E->setProperty('exdate', $exdata);\n\t\t\t}\n\n\t\t\tif ($description != '') $E->setProperty('description', $description);\n\t\t\tif ($location != '') $E->setProperty('location', $location);\n\n\n\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t$ICAL->setComponent($E);\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tremove rules for subsequent items\n\t\t\t//--------------------------------------------\n\n\t\t\twhile( $E->deleteProperty( \"RRULE\" )) continue;\n\n\t\t\t//edits must come right after\n\t\t\tif ( ! empty($edits))\n\t\t\t{\n\t\t\t\tforeach ($edits as $edit)\n\t\t\t\t{\n\t\t\t\t\t$edit_date = array(\n\t\t\t\t\t\t\"year\" \t=> $edit['start_year'],\n\t\t\t\t\t\t\"month\" => $edit['start_month'],\n\t\t\t\t\t\t\"day\" \t=> $edit['start_day'] ,\n\t\t\t\t\t\t\"hour\" \t=> substr($edit['start_time'], 0, 2) ,\n\t\t\t\t\t\t\"min\" \t=> substr($edit['start_time'], 2, 2)\n\t\t\t\t\t);\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($edit['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $edit['start_year'],\n\t\t\t\t\t\t\t\t'month' => $edit['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $edit['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$edit_date['year'],\n\t\t\t\t\t\t\t$edit_date['month'],\n\t\t\t\t\t\t\t$edit_date['day'],\n\t\t\t\t\t\t\t$edit_date['hour'],\n\t\t\t\t\t\t\t$edit_date['min'],\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day'] ,\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"RECURRENCE-ID\", $edit_date);\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//cleanup\n\t\t\t\t$E->deleteProperty(\"RECURRENCE-ID\");\n\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t// these random ass add-in dates are non-standard to most cal creation\n\t\t\t// and need to be treated seperately as lumping don't work, dog\n\t\t\tif ( ! empty($extras))\n\t\t\t{\n\t\t\t\tforeach ($extras as $extra)\n\t\t\t\t{\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $extra['start_year'],\n\t\t\t\t\t\t\t\t'month' => $extra['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $extra['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$extra['start_year'],\n\t\t\t\t\t\t\t$extra['start_month'],\n\t\t\t\t\t\t\t$extra['start_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//clean in case we need to add more later\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\t\t}\n\t\t//return $ICAL->createCalendar();\n\t\treturn $ICAL->returnCalendar();\n\t}", "public function getPublicIcsUrl(){\n\t\treturn \\GO::config()->full_url.'public/calendar/'.$this->id.'/calendar.ics';\n\t}", "function render_icalendar($name, $objects, $include_project_name = false) {\n \trequire_once ANGIE_PATH . '/classes/icalendar/iCalCreator.class.php';\n\n $calendar = new vcalendar();\n //$calendar->setProperty('VERSION', '1.0');\n $calendar->setProperty('X-WR-CALNAME', $name);\n $calendar->setProperty('METHOD', 'PUBLISH');\n\n $projects = array();\n foreach($objects as $object) {\n $summary = $object->getName();\n if($include_project_name) {\n $project_id = $object->getProjectId();\n if(isset($projects[$project_id])) {\n $summary .= ' | ' . $projects[$project_id]->getName();\n } else {\n $project = $object->getProject();\n if(instance_of($project, 'Project')) {\n $projects[$project_id] = $project;\n $summary .= ' | ' . $projects[$project_id]->getName();\n } // if\n } // if\n } // if\n\n \tswitch(strtolower($object->getType())) {\n \t\tcase 'milestone':\n \t\t\t$start_on = $object->getStartOn();\n \t\t $due_on = $object->getDueOn();\n\n \t\t $due_on->advance(24 * 60 * 60, true); // One day shift because iCal and Windows Calendar don't include last day\n\n \t\t $start_on_year = $start_on->getYear();\n \t\t$start_on_month = $start_on->getMonth() < 10 ? '0' . $start_on->getMonth() : $start_on->getMonth();\n \t\t$start_on_day = $start_on->getDay() < 10 ? '0' . $start_on->getDay() : $start_on->getDay();\n\n \t\t$due_on_year = $due_on->getYear();\n \t\t$due_on_month = $due_on->getMonth() < 10 ? '0' . $due_on->getMonth() : $due_on->getMonth();\n \t\t$due_on_day = $due_on->getDay() < 10 ? '0' . $due_on->getDay() : $due_on->getDay();\n\n \t\t$event = new vevent();\n\n $event->setProperty('dtstart', array($start_on_year, $start_on_month, $start_on_day), array('VALUE'=>'DATE'));\n $event->setProperty('dtend', array($due_on_year, $due_on_month, $due_on_day), array('VALUE'=>'DATE'));\n\n $event->setProperty('dtstamp', date('Ymd'));\n $event->setProperty('summary', $summary);\n\n if($object->getBody()) {\n $event->setProperty('description', html_to_text($object->getFormattedBody()) . \"\\n\\n\" . lang('Details: ') . $object->getViewUrl());\n } else {\n $event->setProperty('description', lang('Details') . ': ' . $object->getViewUrl());\n } // if\n\n switch($object->getPriority()) {\n \t\t case PRIORITY_HIGHEST:\n \t\t $event->setProperty('priority', 1);\n \t\t break;\n \t\t case PRIORITY_HIGH:\n \t\t $event->setProperty('priority', 3);\n \t\t break;\n \t\t case PRIORITY_LOW:\n \t\t $event->setProperty('priority', 7);\n \t\t break;\n \t\t case PRIORITY_LOWEST:\n \t\t $event->setProperty('priority', 9);\n \t\t break;\n \t\t default:\n \t\t $event->setProperty('priority', 5);\n \t\t} // switch\n\n \t\t\t$calendar->addComponent($event);\n \t\t break;\n \t\tcase 'ticket':\n \t\tcase 'task':\n \t\t $start_on = $object->getCreatedOn();\n \t\t $due_on = $object->getDueOn();\n\n \t\t$todo = new vtodo();\n\n \t\t$todo->setProperty('summary', $summary);\n \t\t$todo->setProperty('description', $object->getName() . \"\\n\\n\" . lang('Details') . ': ' . $object->getViewUrl());\n\n \t\tswitch($object->getPriority()) {\n \t\t case PRIORITY_HIGHEST:\n \t\t $todo->setProperty('priority', 1);\n \t\t break;\n \t\t case PRIORITY_HIGH:\n \t\t $todo->setProperty('priority', 3);\n \t\t break;\n \t\t case PRIORITY_LOW:\n \t\t $todo->setProperty('priority', 7);\n \t\t break;\n \t\t case PRIORITY_LOWEST:\n \t\t $todo->setProperty('priority', 9);\n \t\t break;\n \t\t default:\n \t\t $todo->setProperty('priority', 5);\n \t\t} // switch\n\n \t\tif(instance_of($due_on, 'DateValue')) {\n \t\t$due_on_year = $due_on->getYear();\n \t\t$due_on_month = $due_on->getMonth() < 10 ? '0' . $due_on->getMonth() : $due_on->getMonth();\n \t\t$due_on_day = $due_on->getDay() < 10 ? '0' . $due_on->getDay() : $due_on->getDay();\n\n \t\t$todo->setProperty('due', $due_on_year, $due_on_month, $due_on_day);\n \t\t} // if\n\n $calendar->addComponent($todo);\n \t\t break;\n \t\tdefault:\n \t\t\t break;\n \t}\n } // foreach\n\n $cal = $calendar->createCalendar();\n\n header('Content-Type: text/calendar; charset=UTF-8');\n header('Content-Disposition: attachment; filename=\"' . $name .'.ics\"');\n header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Pragma: no-cache');\n\n print $cal;\n die();\n }", "function icalendar_render_events( $url = '', $args = array() ) {\n\t$ical = new iCalendarReader();\n\treturn $ical->render( $url, $args );\n}", "public function getIcs() {\n\t\treturn \"BEGIN:VEVENT\\r\\n\" .\n\t\t\t\t\"DTSTART;TZID=Europe/Stockholm:\" . $this->dateToCal($this->start) . \"\\r\\n\" .\n\t\t\t\t\"DTEND;TZID=Europe/Stockholm:\" . $this->dateToCal($this->start->add(new DateInterval('PT' . $this->length . 'S'))) . \"\\r\\n\" .\n\t\t\t\t\"DTSTAMP;TZID=Europe/Stockholm:\" . $this->dateToCal(new DateTime) . \"\\r\\n\" .\n\t\t\t\t\"UID:\" . $this->escapeString($this->id) . \"\\r\\n\" .\n\t\t\t\t\"CREATED;TZID=Europe/Stockholm:\" . $this->dateToCal(new DateTime) . \"\\r\\n\" . \n\t\t\t\t\"LOCATION:\" . $this->escapeString($this->location) . \"\\r\\n\" .\n\t\t\t\t\"DESCRIPTION:\" . $this->escapeString($this->description) . \"\\r\\n\" .\n\t\t\t\t\"LAST-MODIFIED;TZID=Europe/Stockholm:\" . $this->dateToCal(new DateTime) . \"\\r\\n\" .\n\t\t\t\t\"SEQUENCE:0\" . \"\\r\\n\" .\n\t\t\t\t\"STATUS:CONFIRMED\" . \"\\r\\n\" .\n\t\t\t\t\"SUMMARY:\" . $this->escapeString($this->summary) . \"\\r\\n\" .\n\t\t\t\t\"END:VEVENT\" . \"\\r\\n\";\n\t}", "public function getPublicIcsPath(){\n\t\treturn \\GO::config()->file_storage_path.'public/calendar/'.$this->id.'/calendar.ics';\n\t}", "public function execute()\n {\n $event_id = rex_request('id', 'int', 0);\n if (!$event_id) {\n $result = [ 'errorcode' => 1, rex_i18n::msg('rex_api_events_ics_file_no_id') ];\n self::httpError($result);\n } else {\n $ics_filename = event_date::get($event_id)->getName();\n header('Content-Type: text/calendar; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"' . $ics_filename . '.ics\"');\n\n exit(event_date::get($event_id)->getIcs());\n }\n }", "function cal_content()\n{\n $a = get_app();\n $o = \"\";\n if ($a->argc == 1) {\n $o .= \"<h3>\".t('Event Export').\"</h3><p>\".t('You can download public events from: ').$a->get_baseurl().\"/cal/username/export/ical</p>\";\n } elseif ($a->argc==4) {\n\t// get the parameters from the request we just received\n\t$username = $a->argv[1];\n\t$do = $a->argv[2];\n\t$format = $a->argv[3];\n\t// check that there is a user matching the requested profile\n\t$r = q(\"SELECT uid FROM user WHERE nickname='\".$username.\"' LIMIT 1;\");\n\tif (count($r)) \n\t{\n\t $uid = $r[0]['uid'];\n\t} else {\n\t killme();\n\t}\n\t// if we shall do anything other then export, end here\n\tif (! $do == 'export' )\n\t killme();\n\t// check if the user allows us to share the profile\n\t$enable = get_pconfig( $uid, 'cal', 'enable');\n\tif (! $enable == 1) {\n\t info(t('The user does not export the calendar.'));\n\t return;\n\t}\n\t// we are allowed to show events\n\t// get the timezone the user is in\n\t$r = q(\"SELECT timezone FROM user WHERE uid=\".$uid.\" LIMIT 1;\");\n\tif (count($r))\n\t $timezone = $r[0]['timezone'];\n\t// does the user who requests happen to be the owner of the events \n\t// requested? then show all of your events, otherwise only those that \n\t// don't have limitations set in allow_cid and allow_gid\n\tif (local_user() == $uid) {\n\t $r = q(\"SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `uid`=\".$uid.\" and `cid`=0;\");\n\t} else {\n\t $r = q(\"SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `allow_cid`='' and `allow_gid`='' and `uid`='\".$uid.\"' and `cid`='0';\");\n\t}\n\t// we have the events that are available for the requestor\n\t// now format the output according to the requested format\n\t$res = cal_format_output($r, $format, $timezone);\n\tif (! $res=='')\n\t info($res);\n } else {\n\t// wrong number of parameters\n\tkillme();\n }\n return $o;\n}", "public function render() {\n Openbizx::$app->getClientProxy()->includeCalendarScripts();\n\n $format = $this->dateFormat ? $this->dateFormat : \"%Y-%m-%d\";\n\n $sHTML = parent::render();\n\n $showTime = 'false';\n //$image = \"<img src=\\\"\".Openbizx::$app->getImageUrl().\"/calendar.gif\\\" border=0 title=\\\"Select date...\\\" align='top' hspace='2'>\";\n $sHTML .= \"<a class=\\\"date_picker\\\" href=\\\"javascript: void(0);\\\" onclick=\\\"return showCalendar('$this->objectName','$format',$showTime,true);\\\"></a>\";\n return $sHTML;\n }", "public function getEvolutionIcons()\n {\n // get annotation the count\n $annotationCounts = Request::processRequest(\n \"Annotations.getAnnotationCountForDates\", array('getAnnotationText' => 1));\n\n // create & render the view\n $view = new View('@Annotations/getEvolutionIcons');\n $view->annotationCounts = reset($annotationCounts); // only one idSite allowed for this action\n\n return $view->render();\n }", "public function calendario() {\n $datos['titulo'] = 'Calendario';\n $this->load->view('calendar/calendar_view',$datos);\n }", "public function getOutput()\n\t{\n\t\tif( ! IPSLib::appIsInstalled( 'calendar' ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t/* Load language */\n\t\t$this->registry->class_localization->loadLanguageFile( array( 'public_calendar' ), 'calendar' );\n\n\t\t/* Load calendar library */\n\t\t$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'calendar' ) .'/modules_public/calendar/view.php', 'public_calendar_calendar_view' );\n\t\t$cal = new $classToLoad();\n\t\t$cal->makeRegistryShortcuts( $this->registry );\n\t\t\n\t\tif( !$cal->initCalendar( true ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t/* Return calendar */\n\t\treturn \"<div id='hook_calendar' class='calendar_wrap'>\". $cal->getMiniCalendar( date('n'), date('Y') ) . '</div><br />';\n\t}", "public function toVObject(){\n\n\t\t//$stmt = $this->events(\\GO\\Base\\Db\\FindParams::newInstance()->select(\"t.*\"));\n\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()->select(\"t.*\");\n\t\t$findParams->getCriteria()->addCondition(\"calendar_id\", $this->id);\n\t\n\t\t$stmt = Event::model()->findForPeriod($findParams, \\GO\\Base\\Util\\Date::date_add(time(), 0, -1));\n\t\t\n\t\t$string = \"BEGIN:VCALENDAR\\r\\nVERSION:2.0\\r\\nPRODID:-//Intermesh//NONSGML \".\\GO::config()->product_name.\" \".\\GO::config()->version.\"//EN\\r\\n\";\n\n\t\t\t$t = new \\GO\\Base\\VObject\\VTimezone();\n\t\t\t$string .= $t->serialize();\n\n\t\t\twhile($event = $stmt->fetch()){\n\t\t\t\t$v = $event->toVObject();\n\t\t\t\t$string .= $v->serialize();\n\t\t\t}\n\n\t\t\t$string .= \"END:VCALENDAR\\r\\n\";\n\t\t\t\n\t\t\treturn $string;\n\t}", "function icsAJson($temp){\n\t$original = array(\"BEGIN:VCALENDAR\", \"END:VCALENDAR\", \"PRODID:\", \"BEGIN:VEVENT\", \"END:VEVENT\", \"VERSION:\", \"CALSCALE:\",\n\t\"METHOD:\", \"X-WR-CALNAME:\", \"X-WR-TIMEZONE:\", \"X-WR-CALDESC:\", \"DTSTART:\", \"DTEND:\", \"DTSTAMP:\", \"UID:\", \"CREATED:\", \"DESCRIPTION:\",\n\t\"LAST-MODIFIED:\", \"LOCATION:\", \"SEQUENCE:\", \"STATUS:\", \"SUMMARY:\", \"TRANSP:TRANSPARENT\", \"TRANSP:OPAQUE\", \"X-GOOGLE-HANGOUT:\" , \"DTSTART;VALUE=DATE:\", \"DTEND;VALUE=DATE:\",\n\t'\\n', '\\r', '<br />', '<br \\/>', '\\/', '\"{\"VCALENDAR');\n\t$cambiadas = array('{\"VCALENDAR\":[{', '}]}', '\"PRODID\":\"', ', \"VEVENT\":[', ']', '\", \"VERSION\": \"', '\", \"CALSCALE\": \"', '\", \"METHOD\":\"',\n\t'\", \"X-WR-CALNAME\":\"', '\", \"X-WR-TIMEZONE\":\"' , '\", \"X-WR-CALDESC\":\"\"', '{\"DTSTART\":\"', '\", \"DTEND\":\"', '\", \"DTSTAMP\":\"', '\", \"UID\":\"',\n\t'\", \"CREATED\":\"', '\", \"DESCRIPTION\":\"', '\", \"LAST-MODIFIED\":\"', '\", \"LOCATION\":\"', '\", \"SEQUENCE\":\"', '\", \"STATUS\":\"', '\", \"SUMMARY\":\"',\n\t'\", \"TRANSP\":\"TRANSPARENT\"}', '\", \"TRANSP\":\"OPAQUE\"}', '\", \"X-GOOGLE-HANGOUT\":\"' , '{\"DTSTART\":\"', '\", \"DTEND\":\"',\n\t'', '', '', '', '/', '{\"VCALENDAR');\n\t$newphrase = trim(str_replace($original, $cambiadas, $temp));\n\t//Busco los Eventos del calendario\n\t$busco = '\"VEVENT\"';\n\t$pos = strpos($newphrase, $busco);\n\t$primerParte = \"\";\n\t$segundaParte = \"\";\n\t$terceraParte = \"]}]}\";\n\t$salida = \"\";\n\tif ($pos !== false) {\n\t\t//Al encontrar al primer Evento separo el texto en 2 partes, la primera con lo anterior a este\n\t\t$primerParte = (substr($newphrase, 0, $pos)) . '\"VEVENT\":[';\n\t\t//La segunda parte contendra los Eventos a medio camino de estar en formato JSON\n\t\t$temp = substr($newphrase, $pos, ((strlen($newphrase)-5) - $pos));\n\t\t//Cambio esta segunda parte para darle el formato que corresponde\n\t\t$original = array('\"VEVENT\":[', \"]\");\n\t\t$cambiadas = array('', '');\n\t\t$segundaParte = trim(str_replace($original, $cambiadas, $temp));\n\t\t//Uno las 3, Inicio, Eventos y el Final que contiene los cierres de llaves necesarios\n\t\t$salida = $primerParte . $segundaParte . $terceraParte;\t\t\n\t}\n\treturn ($salida);\n}", "public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }", "function generate_category_content()\n {\n global $conf, $page;\n\n $view_type = $page['chronology_view'];\n if ($view_type==CAL_VIEW_CALENDAR)\n {\n global $template;\n $tpl_var = array();\n if ( count($page['chronology_date'])==0 )\n {//case A: no year given - display all years+months\n if ($this->build_global_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==1 )\n {//case B: year given - display all days in given year\n if ($this->build_year_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n $this->build_nav_bar(CYEAR); // years\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==2 )\n {//case C: year+month given - display a nice month calendar\n if ( $this->build_month_calendar($tpl_var) )\n {\n $template->assign('chronology_calendar', $tpl_var);\n }\n $this->build_next_prev();\n return true;\n }\n }\n\n if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)\n {\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1)\n {\n $this->build_nav_bar(CMONTH); // month\n }\n if ( count($page['chronology_date'])==2 )\n {\n $day_labels = range( 1, $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR] ,$page['chronology_date'][CMONTH] ) );\n array_unshift($day_labels, 0);\n unset( $day_labels[0] );\n $this->build_nav_bar( CDAY, $day_labels ); // days\n }\n $this->build_next_prev();\n }\n return false;\n }", "function iCal2XML(& $calendar) {\n\t/** fix an SimpleXMLElement instance and create root element */\n\t$xmlstr = '<?xml version=\"1.0\" encoding=\"utf-8\"?><icalendar xmlns=\"urn:ietf:params:xml:ns:icalendar-2.0\">';\n\t$xmlstr .= '<!-- created utilizing kigkonsult.se ' . ICALCREATOR_VERSION . ' iCal2XMl (rfc6321) -->';\n\t$xmlstr .= '</icalendar>';\n\t$xml = new SimpleXMLElement($xmlstr);\n\t$vcalendar = $xml->addChild('vcalendar');\n\t/** fix calendar properties */\n\t$properties = $vcalendar->addChild('properties');\n\t$calProps = array('prodid', 'version', 'calscale', 'method');\n\tforeach ($calProps as $calProp) {\n\t\tif (FALSE !== ( $content = $calendar->getProperty($calProp)))\n\t\t\t_addXMLchild($properties, $calProp, 'text', $content);\n\t}\n\twhile (FALSE !== ( $content = $calendar->getProperty(FALSE, FALSE, TRUE)))\n\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t$langCal = $calendar->getConfig('language');\n\t/** prepare to fix components with properties */\n\t$components = $vcalendar->addChild('components');\n\t$comps = array('vtimezone', 'vevent', 'vtodo', 'vjournal', 'vfreebusy');\n\t$eventProps = array('dtstamp', 'dtstart', 'uid',\n\t\t'class', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'priority',\n\t\t'sequence', 'status', 'summary', 'transp', 'url', 'recurrence-id', 'rrule', 'dtend', 'duration',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate',\n\t\t'x-prop');\n\t$todoProps = array('dtstamp', 'uid',\n\t\t'class', 'completed', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'percent-complete', 'priority',\n\t\t'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule', 'dtstart', 'due', 'duration',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate',\n\t\t'x-prop');\n\t$journalProps = array('dtstamp', 'uid',\n\t\t'class', 'created', 'dtstart', 'last-modified', 'organizer', 'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact',\n\t\t'description',\n\t\t'exdate', 'related-to', 'rdate', 'request-status',\n\t\t'x-prop');\n\t$freebusyProps = array('dtstamp', 'uid',\n\t\t'contact', 'dtstart', 'dtend', 'duration', 'organizer', 'url',\n\t\t'attendee', 'comment', 'freebusy', 'request-status',\n\t\t'x-prop');\n\t$timezoneProps = array('tzid',\n\t\t'last-modified', 'tzurl',\n\t\t'x-prop');\n\t$alarmProps = array('action', 'description', 'trigger', 'summary',\n\t\t'attendee',\n\t\t'duration', 'repeat', 'attach',\n\t\t'x-prop');\n\t$stddghtProps = array('dtstart', 'tzoffsetto', 'tzoffsetfrom',\n\t\t'rrule',\n\t\t'comment', 'rdate', 'tzname',\n\t\t'x-prop');\n\tforeach ($comps as $compName) {\n\t\tswitch ($compName) {\n\t\t\tcase 'vevent':\n\t\t\t\t$props = & $eventProps;\n\t\t\t\t$subComps = array('valarm');\n\t\t\t\t$subCompProps = & $alarmProps;\n\t\t\t\tbreak;\n\t\t\tcase 'vtodo':\n\t\t\t\t$props = & $todoProps;\n\t\t\t\t$subComps = array('valarm');\n\t\t\t\t$subCompProps = & $alarmProps;\n\t\t\t\tbreak;\n\t\t\tcase 'vjournal':\n\t\t\t\t$props = & $journalProps;\n\t\t\t\t$subComps = array();\n\t\t\t\t$subCompProps = array();\n\t\t\t\tbreak;\n\t\t\tcase 'vfreebusy':\n\t\t\t\t$props = & $freebusyProps;\n\t\t\t\t$subComps = array();\n\t\t\t\t$subCompProps = array();\n\t\t\t\tbreak;\n\t\t\tcase 'vtimezone':\n\t\t\t\t$props = & $timezoneProps;\n\t\t\t\t$subComps = array('standard', 'daylight');\n\t\t\t\t$subCompProps = & $stddghtProps;\n\t\t\t\tbreak;\n\t\t} // end switch( $compName )\n\t\t/** fix component properties */\n\t\twhile (FALSE !== ( $component = $calendar->getComponent($compName))) {\n\t\t\t$child = $components->addChild($compName);\n\t\t\t$properties = $child->addChild('properties');\n\t\t\t$langComp = $component->getConfig('language');\n\t\t\tforeach ($props as $prop) {\n\t\t\t\tswitch ($prop) {\n\t\t\t\t\tcase 'attach': // may occur multiple times, below\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'attendee':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'exdate':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\tforeach ($content['value'] as & $exDate) {\n\t\t\t\t\t\t\t\tif (( isset($exDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($exDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $exDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t$offset = isset($exDate['tz']) ? $exDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t$date = mktime((int) $exDate['hour'], (int) $exDate['min'], (int) ($exDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $exDate['month'], (int) $exDate['day'], (int) $exDate['year']);\n\t\t\t\t\t\t\t\t\tunset($exDate['tz']);\n\t\t\t\t\t\t\t\t\t$exDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\tunset($exDate['unparsedtext']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'freebusy':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'period', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'request-status':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (!isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'rstatus', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rdate':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\tif (isset($content['params']['VALUE'])) {\n\t\t\t\t\t\t\t\tif ('DATE' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\telseif ('PERIOD' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t$type = 'period';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ('period' == $type) {\n\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDates) {\n\t\t\t\t\t\t\t\t\tif (( isset($rDates[0]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[0]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[0]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[0]['tz']) ? $rDates[0]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year']);\n\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['tz']);\n\t\t\t\t\t\t\t\t\t\t$rDates[0] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($rDates[1]['year'])) {\n\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[1]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[1]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[1]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[1]['tz']) ? $rDates[1]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year']);\n\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t$rDates[1] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif ('date-time' == $type) {\n\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDate) {\n\t\t\t\t\t\t\t\t\tif (( isset($rDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t$offset = isset($rDate['tz']) ? $rDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year']);\n\t\t\t\t\t\t\t\t\t\tunset($rDate['tz']);\n\t\t\t\t\t\t\t\t\t\t$rDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\tunset($rDate['unparsedtext']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'categories':\n\t\t\t\t\tcase 'comment':\n\t\t\t\t\tcase 'contact':\n\t\t\t\t\tcase 'description':\n\t\t\t\t\tcase 'related-to':\n\t\t\t\t\tcase 'resources':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (( 'related-to' != $prop ) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'x-prop':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'created': // single occurence below, if set\n\t\t\t\t\tcase 'completed':\n\t\t\t\t\tcase 'dtstamp':\n\t\t\t\t\tcase 'last-modified':\n\t\t\t\t\t\t$utcDate = TRUE;\n\t\t\t\t\tcase 'dtstart':\n\t\t\t\t\tcase 'dtend':\n\t\t\t\t\tcase 'due':\n\t\t\t\t\tcase 'recurrence-id':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['VALUE']) && ( 'DATE' == $content['params']['VALUE'] )) {\n\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\tunset($content['value']['hour'], $content['value']['min'], $content['value']['sec']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\tif (isset($utcDate) && !isset($content['value']['tz']))\n\t\t\t\t\t\t\t\t\t$content['value']['tz'] = 'Z';\n\t\t\t\t\t\t\t\tif (( isset($content['value']['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['value']['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['value']['tz'] ))\n\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t$offset = isset($content['value']['tz']) ? $content['value']['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t$date = mktime((int) $content['value']['hour'], (int) $content['value']['min'], (int) ($content['value']['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $content['value']['month'], (int) $content['value']['day'], (int) $content['value']['year']);\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz'], $content['params']['TZID']);\n\t\t\t\t\t\t\t\t\t$content['value'] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\tunset($content['value']['unparsedtext']);\n\t\t\t\t\t\t\t\t} elseif (isset($content['value']['tz']) && !empty($content['value']['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['value']['tz'] ) && !isset($content['params']['TZID'])) {\n\t\t\t\t\t\t\t\t\t$content['params']['TZID'] = $content['value']['tz'];\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\tif (( isset($content['params']['TZID']) && empty($content['params']['TZID'])) || @is_null($content['params']['TZID']))\n\t\t\t\t\t\t\t\tunset($content['params']['TZID']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($utcDate);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'duration':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'duration', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rrule':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'recur', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'class':\n\t\t\t\t\tcase 'location':\n\t\t\t\t\tcase 'status':\n\t\t\t\t\tcase 'summary':\n\t\t\t\t\tcase 'transp':\n\t\t\t\t\tcase 'tzid':\n\t\t\t\t\tcase 'uid':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif ((( 'location' == $prop ) || ( 'summary' == $prop )) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'geo':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'geo', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'organizer':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'percent-complete':\n\t\t\t\t\tcase 'priority':\n\t\t\t\t\tcase 'sequence':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'integer', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'tzurl':\n\t\t\t\t\tcase 'url':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'uri', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t} // end switch( $prop )\n\t\t\t} // end foreach( $props as $prop )\n\t\t\t/** fix subComponent properties, if any */\n\t\t\tforeach ($subComps as $subCompName) {\n\t\t\t\twhile (FALSE !== ( $subcomp = $component->getComponent($subCompName))) {\n\t\t\t\t\t$child2 = $child->addChild($subCompName);\n\t\t\t\t\t$properties = $child2->addChild('properties');\n\t\t\t\t\t$langComp = $subcomp->getConfig('language');\n\t\t\t\t\tforeach ($subCompProps as $prop) {\n\t\t\t\t\t\tswitch ($prop) {\n\t\t\t\t\t\t\tcase 'attach': // may occur multiple times, below\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';\n\t\t\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'attendee':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'comment':\n\t\t\t\t\t\t\tcase 'tzname':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (!isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'rdate':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\t\tif (isset($content['params']['VALUE'])) {\n\t\t\t\t\t\t\t\t\t\tif ('DATE' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\t\t\telseif ('PERIOD' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t\t\t$type = 'period';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ('period' == $type) {\n\t\t\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDates) {\n\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[0]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[0]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[0]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[0]['tz']) ? $rDates[0]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year']);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t$rDates[0] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (isset($rDates[1]['year'])) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[1]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[1]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[1]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[1]['tz']) ? $rDates[1]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rDates[1] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} elseif ('date-time' == $type) {\n\t\t\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDate) {\n\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDate['tz']) ? $rDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year']);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDate['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t$rDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDate['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'x-prop':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'action': // single occurence below, if set\n\t\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\tcase 'summary':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (( 'action' != $prop ) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'dtstart':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz'], $content['params']['VALUE']); // always local time\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'date-time', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'duration':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'duration', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'repeat':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'integer', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'trigger':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (isset($content['value']['year']) &&\n\t\t\t\t\t\t\t\t\t\t\tisset($content['value']['month']) &&\n\t\t\t\t\t\t\t\t\t\t\tisset($content['value']['day']))\n\t\t\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$type = 'duration';\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'tzoffsetto':\n\t\t\t\t\t\t\tcase 'tzoffsetfrom':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'utc-offset', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'rrule':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'recur', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} // switch( $prop )\n\t\t\t\t\t} // end foreach( $subCompProps as $prop )\n\t\t\t\t} // end while( FALSE !== ( $subcomp = $component->getComponent( subCompName )))\n\t\t\t} // end foreach( $subCombs as $subCompName )\n\t\t} // end while( FALSE !== ( $component = $calendar->getComponent( $compName )))\n\t} // end foreach( $comps as $compName)\n\treturn $xml->asXML();\n}", "function date_ical($date, $timezone=true)\r\n{\r\n\t$date = strftime(\"%Y%m%dT%H%M%S\", strtotime($date));\r\n\tif($timezone==true)\t\treturn current_timezone().\":\".$date;\r\n\telse\t\t\t\t\treturn str_replace(\"T000000Z\",\"T235959Z\", $date.\"Z\");\r\n}", "public function getBookingsAsICAL($username, $password, $start_date, $end_date, $groups=false, $buildings=false, $statuses=false, $event_types=false, $group_types=false, $group_id=false) {\nglobal $_LW;\n$feed=$_LW->getNew('feed'); // get a feed object\n$ical=$feed->createFeed(['title'=>'EMS Events'], 'ical'); // create new feed\n$hostname=@parse_url((!empty($_LW->REGISTERED_APPS['ems']['custom']['wsdl']) ? $_LW->REGISTERED_APPS['ems']['custom']['wsdl'] : (!empty($_LW->REGISTERED_APPS['ems']['custom']['rest']) ? $_LW->REGISTERED_APPS['ems']['custom']['rest'] : '')), PHP_URL_HOST);\nif ($bookings=$this->getBookings($username, $password, $start_date, $end_date, $groups, $buildings, $statuses, $event_types, $group_types, $group_id)) { // if bookings obtained\n\tforeach($bookings as $booking) { // for each booking\n\t\t$arr=[ // format the event\n\t\t\t'summary'=>$booking['title'],\n\t\t\t'dtstart'=>$booking['date_ts'],\n\t\t\t'dtend'=>(!empty($booking['date2_ts']) ? $booking['date2_ts'] : ''),\n\t\t\t'description'=>'',\n\t\t\t'uid'=>$booking['booking_id'].'@'.$hostname,\n\t\t\t'categories'=>$booking['event_type'],\n\t\t\t'location'=>$booking['location'],\n\t\t\t'X-LIVEWHALE-TYPE'=>'event',\n\t\t\t'X-LIVEWHALE-TIMEZONE'=>@$booking['timezone'],\n\t\t\t'X-LIVEWHALE-CANCELED'=>@$booking['canceled'],\n\t\t\t'X-LIVEWHALE-CONTACT-INFO'=>@$booking['contact_info'],\n\t\t\t'X-EMS-STATUS-ID'=>@$booking['status_id'],\n\t\t\t'X-EMS-EVENT-TYPE-ID'=>@$booking['event_type_id']\n\t\t];\n\t\tif (@$booking['status_id']==5 || @$booking['status_id']==17) { // if this is a pending event, skip syncing (creation of events and updating if already existing)\n\t\t\t$arr['X-LIVEWHALE-SKIP-SYNC']=1;\n\t\t};\n\t\tif (!empty($_LW->REGISTERED_APPS['ems']['custom']['hidden_by_default'])) { // if importing hidden events, flag them\n\t\t\t$arr['X-LIVEWHALE-HIDDEN']=1;\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_tags']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']])) { // if assigning UDF values as event tags\n\t\t\t$arr['X-LIVEWHALE-TAGS']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_categories']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']])) { // if assigning UDF values as event categories, implode array\n\t\t\t$arr['categories']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_description']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']])) { // if assigning UDF value as event description\n\t\t\t$arr['description']=$booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']];\n\t\t};\n\t\tif (!empty($booking['contact_info'])) { // add contact info if available\n\t\t\t$arr['X-EMS-CONTACT-INFO']=$booking['contact_info'];\n\t\t};\n\t\tif (!empty($booking['contact_name'])) { // add contact name if available\n\t\t\t$arr['X-EMS-CONTACT-NAME']=$booking['contact_name'];\n\t\t};\n\t\t$arr=$_LW->callHandlersByType('application', 'onBeforeEMSFeed', ['buffer'=>$arr, 'booking'=>$booking]); // call handlers\n\t\tforeach($arr as $key=>$val) { // clear empty entries\n\t\t\tif (empty($val)) {\n\t\t\t\tunset($arr[$key]);\n\t\t\t};\n\t\t};\n\t\t$feed->addFeedItem($ical, $arr, 'ical'); // add event to feed\n\t};\n};\n$feed->disable_content_length=true;\nreturn $feed->showFeed($ical, 'ical'); // show the feed\n}", "function calendarioJson() {\n \t$fp = fopen(\"ics/basic5.ics\", \"r\"); \n\t$temp = fread($fp, filesize(\"ics/basic5.ics\"));\n\t//Ver si se necesita nl2br\n\t$salida = icsAJson(json_encode(nl2br($temp)));\n\t//Este es el Json Final\n\treturn ('[' . $salida . ']');\n}", "protected function beginVCal()\n {\n return $this->assemble([\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'METHOD:PUBLISH',\n 'PRODID:' . $this->string($this->prodId),\n 'X-CALSTART:' . $this->dateStr($this->start),\n 'X-WR-CALNAME:' . $this->string($this->name),\n ]);\n }" ]
[ "0.6981924", "0.67952913", "0.6676531", "0.6656392", "0.65342915", "0.6308847", "0.62426144", "0.6236596", "0.6214256", "0.6210372", "0.608663", "0.6086484", "0.6030799", "0.58993393", "0.5726037", "0.57044417", "0.56094027", "0.55681133", "0.55492663", "0.5522826", "0.5515301", "0.5512353", "0.5492557", "0.54745346", "0.5453466", "0.5411564", "0.5406333", "0.53935504", "0.5386194", "0.53861856" ]
0.7621386
0
Lists all furTexture entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $furTextures = $em->getRepository('UnicornBundle:furTexture')->findAll(); return $this->render('furtexture/index.html.twig', array( 'furTextures' => $furTextures, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllEntities();", "public function index()\n {\n return ImageEntity::all();\n }", "public function get_entities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CrudforgeBundle:Users')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AlmaBundle:TipoCamera')->findAll();\n\n return $this->render('AlmaBundle:TipoCamera:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('MiiGameBundle:Level')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('HypoTestBundle:File')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MHProductsBundle:Upload')->findAll();\n\n return $this->render('MHProductsBundle:Upload:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function getEntities();", "public function getEntities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HamdiMediaBundle:GalleryImage')->findAll();\n\n return $this->render('HamdiMediaBundle:GalleryImage:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function findAllEntities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BaseBundle:Feriado')->findAll();\n\n return $this->render('BaseBundle:Feriado:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function getEntityList()\n\t{\n\t\tif($this->entityList === null)\n\t\t{\n\t\t\t$event = new \\Bitrix\\Main\\Event('main', 'onUserTypeEntityOrmMap');\n\t\t\t$event->send();\n\n\t\t\tforeach($event->getResults() as $eventResult)\n\t\t\t{\n\t\t\t\tif($eventResult->getType() == \\Bitrix\\Main\\EventResult::SUCCESS)\n\t\t\t\t{\n\t\t\t\t\t$result = $eventResult->getParameters(); // [ENTITY_ID => 'SomeTable']\n\t\t\t\t\tforeach($result as $entityId => $entityClass)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(mb_substr($entityClass, 0, 1) !== '\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entityClass = '\\\\' . $entityClass;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->entityList[$entityId] = $entityClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->entityList;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Vluchten')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('GaleriasBundle:Galeria')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }", "public function index()\n {\n return Entity::all();\n }", "function show_images() {\n global $app;\n $images = new entities\\Image();\n $cursor = $images->getRange($app, 0);\n $posts = array();\n \n foreach ($cursor->toArray() as $post) {\n $posts[] = $post;\n }\n return $app['twig']->render('admin/admin_images.twig', array('images' => $posts));\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('InfectBackendBundle:Species')->findAll();\n\n return $this->render('InfectBackendBundle:Species:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CineminoSiteBundle:Film')->findAll();\n \n return $this->render('CineminoSiteBundle:Film:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PrognozMagazineBundle:User')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackendBundle:Founder')->findAll();\n\n return $this->render('BackendBundle:Founder:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "function tp_view_entity_list($entities, $count, $offset, $limit, $fullview = true, $viewtypetoggle = false, $pagination = true) {\n\t$context = get_context();\n\n\t$html = elgg_view('tidypics/gallery',array(\n\t\t\t'entities' => $entities,\n\t\t\t'count' => $count,\n\t\t\t'offset' => $offset,\n\t\t\t'limit' => $limit,\n\t\t\t'baseurl' => $_SERVER['REQUEST_URI'],\n\t\t\t'fullview' => $fullview,\n\t\t\t'context' => $context,\n\t\t\t'viewtypetoggle' => $viewtypetoggle,\n\t\t\t'viewtype' => get_input('search_viewtype','list'),\n\t\t\t'pagination' => $pagination\n\t));\n\n\treturn $html;\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n// $entities = $em->getRepository('uniRecetasBundle:ingrediente')->findAll();\n $entities = $em->getRepository('uniRecetasBundle:ingrediente')->findBy(\n array(), \n array('nombre' => 'ASC')\n );\n\n return $this->render('uniRecetasBundle:ingrediente:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n// $a = new Hotel();\n// $a->setImage('aa.jpg');\n// echo $a->getAbsolutePath();\n\n\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CtcAppBundle:Hotel\\Hotel')->findAll();\n\n return $this->render('CtcAppBundle:Admin/Hotel/Hotel:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fraturas = $em->getRepository('AppBundle:Fratura')->findAll();\n\n return $this->render('fratura/index.html.twig', array(\n 'fraturas' => $fraturas,\n ));\n }" ]
[ "0.5907804", "0.5761466", "0.5759667", "0.5737906", "0.567602", "0.5653502", "0.5640266", "0.563372", "0.5616117", "0.5616117", "0.55756867", "0.5561029", "0.5551323", "0.5526378", "0.55074847", "0.5497758", "0.5496682", "0.54613507", "0.54518837", "0.5451791", "0.5438359", "0.5387095", "0.537735", "0.53756046", "0.53716165", "0.53669405", "0.5363795", "0.5357802", "0.53497356", "0.5349261" ]
0.70311266
0
Finds and displays a furTexture entity.
public function showAction(furTexture $furTexture) { return $this->render('furtexture/show.html.twig', array( 'furTexture' => $furTexture, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $furTextures = $em->getRepository('UnicornBundle:furTexture')->findAll();\n\n return $this->render('furtexture/index.html.twig', array(\n 'furTextures' => $furTextures,\n ));\n }", "function display_image($entity)\n{\n\tglobal $config;\n\t\n\techo '\n\t\t\t<div class=\"heading-block clearfix\">\n\t\t\t\t<div class=\"heading-thumbnail\">';\n\t\t\t\t\n\t\n\tif (isset($entity->thumbnailUrl))\n\t{\n\t\techo '<img src=\"' . $config['thumbnail_cdn'] . get_thumbnail_url($entity->thumbnailUrl) . '\" />';\t\t\n\t}\t\n\telse\n\t{\n\t\techo '<img src=\"images/no-icon.svg\" />';\n\t}\n\t\t\n\techo '\n\t\t\t\t</div>\n\t\t\t\t<div class=\"heading-body\">\n\t\t\t\t\t<div class=\"heading-title\">';\n\t\t\t\t\t\n\techo get_literal_display($entity->name);\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"heading-description\">';\n\t\t\t\t\t\n\tif (isset($entity->description))\n\t{\n\t\techo '<div class=\"caption\">' . get_literal_display($entity->description) . '</div>';\n\t}\t\t\t\n\t\n\techo '<div id=\"identifiers\">';\n\techo '<ul class=\"identifier-list\">';\n\techo '<li><a class=\"external\" href=\"' . $entity->{'@id'} . '\" target=\"_new\">' . $entity->{'@id'} . '</a></li>';\n\techo '</ul>';\n\techo '</div>';\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t\t\n\t// Display image\n\techo '<div>';\t\n\techo '<img class=\"image\" src=\"' .$entity->contentUrl->{'@id'} . '\" />';\t\n\techo '</div>';\n\n\n\n\techo '\n\t\t<script>figure_is_part_of(\"' . $entity->{'@id'} . '\", \"cited_by\");</script> \n\t';\n}", "protected function fetchFullTextImage(){\n $this->imageFullText = $this->getImageTypeFromImages('full');\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AlmaBundle:TipoCamera')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TipoCamera entity.');\n }\n\n\n return $this->render('AlmaBundle:TipoCamera:show.html.twig', array(\n 'entity' => $entity\n ));\n }", "function amap_ma_get_entity_img($u, $namecleared) {\n if (!$namecleared)\n return false;\n\n if (elgg_instanceof($u, 'user') || elgg_instanceof($u, 'group')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'agora')) {\n $entity_img = elgg_view('output/url', array(\n 'href' => \"agora/view/{$u->guid}/\" . elgg_get_friendly_title($namecleared),\n 'text' => elgg_view('agora/thumbnail', array('classfdguid' => $u->guid, 'size' => 'tiny', 'tu' => $u->time_updated)),\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'page') || elgg_instanceof($u, 'object', 'page_top')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n }\n return $entity_img;\n}", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Founder')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Founder entity.');\n }\n\n return $this->render('BackendBundle:Founder:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SkokiOrlikBundle:Matches')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Matches entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SkokiOrlikBundle:Matches:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function picture() {\n $picture = $this->_model->getPicture(explode(\"/\", $this->_url)[1]);\n if ($picture === null) {\n $this->redirect(\"/index\");\n }\n $this->render(\"General.Picture\", compact('picture'));\n }", "function __renderEntity($entity,$action,$data){\r\n\tTemplate::getInstance()->renderEntity($entity,$action,$data);\r\n}", "public function testAction()\n {\n $image = $this->getManager()->getRepository(Image::class)->find(3);\n\n return $this->render(\n '@Gui/gui/test.html.twig',\n [\n 'image' => $image\n ]\n );\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('PSBAdminBundle:Matches')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Matches entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('PSBAdminBundle:Matches:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "abstract public function show($img);", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $actualite = $em->getRepository('MyAppEspritBundle:Actualite')->findAll();\n\n return $this->render('MyAppEspritBundle:Actualite:show.html.twig', array(\n 'actualite' => $actualite,\n ));\n }", "public function showImage()\n {\n }", "public function GridTexture($uuid){\n\t\t\tif(is_string($uuid) === false){\n\t\t\t\tthrow new InvalidArgumentException('Texture UUID should be a string.');\n\t\t\t}else if(preg_match(self::regex_UUID, $uuid) !== 1){\n\t\t\t\tthrow new InvalidArgumentException('Texture UUID was invalid.');\n\t\t\t}\n\n\t\t\treturn $this->get_grid_info('WebUIHandlerTextureServer') . '/index.php?' . http_build_query(array( 'method'=>'GridTexture', 'uuid'=>$uuid));\n\t\t}", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "public function show(ImageEntity $user)\n {\n return $user;\n }", "public function show(Surface $surface)\n {\n //\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //recupérer le repo\n $repository = $em->getRepository('InsatGl2Bundle:Personne');\n\n $personnes = $repository->findAll();\n\n\n return $this->render('@InsatGl2\\Personne\\show.html.twig',\n array(\n 'personnes'=> $personnes\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('GestionPassBundle:Fluidite')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fluidite entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('GestionPassBundle:Fluidite:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function imageTag($arrMatch) {\n \n $em = $this->getDoctrine()->getEntityManager();\n\n $image = $em->getRepository('BloggerGalleryBundle:Image')->find($arrMatch[1]);\n \n if (!$image) {\n throw $this->createNotFoundException('Unable to find image.');\n }\n \n return $this->renderView('BloggerGalleryBundle:Gallery:image.html.twig', array(\n 'image' => $image,\n ));\n \n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('HamdiMediaBundle:GalleryImage')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find GalleryImage entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('HamdiMediaBundle:GalleryImage:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function renderImageAction()\n {\n $config = \\Zend_Registry::get('configs');\n $path = $config['upload']['rodape']['destination'];\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_getAllParams();\n\n $entity = $this->getService('Artefato')->findBy(array(\n 'sqArtefato' => $params['sqArtefato']\n ));\n $enderecoImagem = $path . '/' . $entity[0]->getDeImagemRodape();\n $dto = new \\Core_Dto_Search(\n array(\n 'resize' => true,\n 'width' => 120,\n 'height' => 120\n )\n );\n\n return $this->showImage($dto, $enderecoImagem);\n }", "public function ActeurAction($acteurid){\n #Attention, nom entre parenthèses doit etre pareil que dans routing\n \n $em = $this -> getDoctrine() -> getManager();\n\n $acteur = $em -> getRepository('TroiswaPublicBundle:Acteur') -> find($acteurid); //Find pour récupérer un seul élément, et prend en argument l'id\n\n return $this->render('TroiswaPublicBundle:Acteur:acteur.html.twig', array('acteur' => $acteur ));\n #Envoyer des infos dans la vue - tableau associatif\n\n //die(Debug::dump($film));\n\n}", "public function viewEntity($entity_id) {\n $account = $this->getAccount();\n return parent::viewEntity($account->uid);\n }", "public function fullTextImage(){\n if(isset($this->imageFullText)){\n return $this->imageFullText;\n }\n $this->fetchFullTextImage();\n return $this->imageFullText;\n }", "public function show(Tile $tile)\n {\n //\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }" ]
[ "0.6151867", "0.5980636", "0.55248195", "0.54929376", "0.52117884", "0.5172629", "0.5169935", "0.51285255", "0.51216215", "0.5076389", "0.504311", "0.50092643", "0.49635264", "0.49633294", "0.49576864", "0.49574593", "0.4954336", "0.4930908", "0.4910137", "0.48924533", "0.48852575", "0.4863075", "0.48620653", "0.48605013", "0.4852724", "0.48424718", "0.484155", "0.4841231", "0.4821374", "0.47967348" ]
0.6983073
0
Gets the DynaGridStore configuration instance
public function getStore() { $settings = [ 'id' => $this->dynaGridId, 'name' => $this->name, 'category' => $this->category, 'storage' => $this->storage, 'userSpecific' => $this->userSpecific ]; if (isset($this->id) && !empty($this->id)) { $settings['dtlKey'] = $this->id; } return new DynaGridStore($settings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getDpgConfig()\n {\n $config = Mage::getSingleton('dpg/config');\n return $config->setStore($this->getStore());\n }", "public static function getInstance(): Config\n {\n if (is_null(static::$store)) {\n static::$store = static::createConfig();\n }\n\n return static::$store;\n }", "protected function getStoreConfig () {\n\t\t$aConfig = array(\n\t\t\t'db_host'\t\t=> DB_HOST,\n\t\t\t'db_name'\t\t=> DB_NAME,\n\t\t\t'db_user'\t\t=> DB_USER,\n\t\t\t'db_pwd'\t\t=> DB_PASSWORD,\n\t\t\t'store_name'\t=> getWpPrefix() . 'pp_thesaurus',\n\t\t);\n\n\t\treturn $aConfig;\n\t}", "public function getConfig()\r\n {\r\n $db = $this->_getDb();\r\n\r\n // Get the database configuration information\r\n return $this->_db->getConfig();\r\n\r\n }", "public function get()\r\n {\r\n $this->ensureLoaded();\r\n return $this->config;\r\n }", "public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}", "public function getConfig()\n {\n if (!$this->configuration) {\n $this->getDatabaseConfiguration();\n }\n\n return $this->configuration;\n }", "public static function getInstance() {\n return self::getConfig();\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "static function getConfig() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_CONFIG);\n\t}", "public function getConfig()\n {\n return Mage::getModel(\"postident/config\");\n }", "protected function getConfig()\n {\n\n return $this->app['config']['manticore'];\n }", "protected function getConfigService()\n {\n return $this->services['config'] = new \\phpbb\\config\\db(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, 'phpbb_config');\n }", "public static function getConfig() {\n if (!self::$_configInstance)\n new acs_config();\n \n return self::$_configInstance;\n }", "function cfg($param = null) {\n static $config;\n if (!$config) {\n $config = new \\Core\\ConfigStore('app');\n if ($config->environment) {\n $defaults = $config;\n $config = new \\Core\\ConfigStore($config->environment);\n $config->setDefaults($defaults);\n }\n }\n if ($param) {\n return $config->get($param);\n }\n return $config;\n}", "public static function getConfig()\n {\n return new Config(self::$config);\n }", "public static function getConfigInstance()\n {\n if (!static::$config) {\n static::$config = new Config\\NativeConfig;\n }\n\n return static::$config;\n }", "public function get() {\n return $this->_configuration;\n }", "public function getConfig()\n {\n return $this->get('config');\n }", "public static function getConfig()\n {\n return self::$config;\n }", "protected function config()\n {\n return $this->make('config');\n }", "public function getStoreConfig(){\n return Mage::getStoreConfig('payment/vpayment/client');\n }", "public function getConfig() : \\codename\\core\\config {\r\n return $this->config;\r\n }", "public function getSforceConfig() {\n $sforce = $this->getDataSource();\n return $sforce->config;\n }", "public function getConfig()\n {\n return $this->_config;\n }", "public function getConfig()\n {\n return $this->_config;\n }", "protected function getConfig()\n\t{\n\t\treturn $this->oConfig;\n\t}", "public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }", "protected function _getConfig()\n {\n return Mage::getSingleton('customgrid/column_renderer_config_collection');\n }", "public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}" ]
[ "0.76424116", "0.7267713", "0.7100692", "0.6550001", "0.653918", "0.6491737", "0.64514095", "0.6450878", "0.6441958", "0.6391585", "0.6375942", "0.6372753", "0.6359107", "0.63572717", "0.6344555", "0.63347626", "0.6334402", "0.63343984", "0.6328501", "0.6307997", "0.6289649", "0.62405235", "0.62364", "0.623329", "0.62243223", "0.62243223", "0.62181324", "0.62102574", "0.6194698", "0.61918014" ]
0.7460804
1
Fetches grid configuration settings from store
public function fetchSettings() { return $this->store->fetch(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getAllConfig() {\n $this->user_panel->checkAuth();\n $this->config->findAll();\n }", "protected function _getConfig()\n {\n return Mage::getSingleton('customgrid/column_renderer_config_collection');\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "public function getCommunityGridSettings() {\n\t\treturn $this->communityGridSettings;\n\t}", "public function getDataGridPluginConfig();", "public function getSettings();", "public function settings_get()\n \t{\n \t\tlog_message('debug', 'Score/setting_get');\n\n\t\t$result = $this->_score->get_settings(\n\t\t\t$this->get('type'),\n\t\t\t$this->get('use'),\n\t\t\textract_id($this->get('storeId'))\n\t\t);\n\n\t\tlog_message('debug', 'Score/setting_get:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "abstract public function get_settings();", "function get_config(){\n\t\t\t$arr = array();\n\t\t\n\t\t// Try to get the configuration data \n\t\t// from a cached config file\n\t\t// \n\t\t// Added a disable option in 1.2.1 - dpd\n\t\t\t$disable_cache = ($this->config->item('br_disable_system_cache') === TRUE) ? 1 : 0;\n\t\t\tif($disable_cache == 0){\n\t\t\t\tif($str=read_from_cache('config')){\n\t\t\t\t\t$arr = unserialize($str);\n\t\t\t\t\treturn $arr;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// Get the store config \n\t\t\t$this->EE->db->select('\ts.*, \n\t\t\t\t\t\t\t\tc.code as currency,\n\t\t\t\t\t\t\t\tc.currency_id,\n\t\t\t\t\t\t\t\tc.marker as currency_marker')\n\t\t\t\t\t\n\t\t\t\t\t->from('br_store s')\n\t\t\t\t\t->join('br_currencies c','c.currency_id = s.currency_id');\t\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[\"store\"][$row[\"site_id\"]] = $row;\n\t\t\t}\n\n\t\t// Get the config data for each item\n\n\t\t\t$this->EE->db->select('*')->from('br_config_data')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[$row['config_id']][] = $row;\n\t\t\t}\n\t\t\t\n\t\t// Get the items\n\n\t\t\t$this->EE->db->select('*')->from('br_config')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]] = $row;\n\t\t\t\tif(isset($data[$row[\"config_id\"]])){\n\t\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]][\"config_data\"] = $data[$row[\"config_id\"]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Save the new array to cache\n\t\t\tsave_to_cache('config',serialize($arr));\n\t\t\treturn $arr;\n\t}", "protected function grid()\n {\n return Admin::grid(Config::class, function (Grid $grid) {\n\n $grid->paginate(20);\n\n $grid->id('配置ID')->sortable();\n\n $grid->key('配置项');\n\n $grid->value('值');\n\n $grid->desc('描述');\n\n $grid->filter(function (Grid\\Filter $filter) {\n $filter->like('key', '配置项');\n });\n\n $grid->disableCreateButton();\n\n $grid->disableRowSelector();\n\n $grid->actions(function (Grid\\Displayers\\Actions $actions) {\n\n //$actions->disableDelete();\n\n //$actions->disableEdit();\n\n $actions->disableView();\n\n });\n });\n }", "protected function _getDpgConfig()\n {\n $config = Mage::getSingleton('dpg/config');\n return $config->setStore($this->getStore());\n }", "public function list() {\n $this->store->listConfig();\n }", "abstract public function getSettings();", "public function getConfig() {\n\t\t\n\t\t// Get a db connection.\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t \n\t\t$query->select($db->quoteName(array('apikey', 'addsubscribe_myaccounts', 'sync', 'te', 'list', 'groups', 'tag', 'client_id')));\n\t\t$query->from($db->quoteName('#__egoi'));\n\n\t\t$db->setQuery($query);\n\t\t$row = $db->loadRow();\n\t\t\n\t\treturn $row;\n\t}", "public function queryAll()\n {\n $storeId=Mage::app()->getStore()->getId();\n return Mage::getStoreConfig('carriers', $storeId);\n }", "abstract protected function getConfig();", "protected function _getAdminSettings(){\n if (is_null($this->_adminSettings)){\n $this->_adminSettings = $settings = Mage::getModel('easylife_gridenhancer/settings')\n ->loadByAdmin(\n Mage::getSingleton('admin/session')->getUser()->getId(),\n Easylife_GridEnhancer_Helper_Customer::CUSTOMER_GRID_IDENTIFIER\n );\n }\n return $this->_adminSettings;\n }", "protected function getStoreConfig () {\n\t\t$aConfig = array(\n\t\t\t'db_host'\t\t=> DB_HOST,\n\t\t\t'db_name'\t\t=> DB_NAME,\n\t\t\t'db_user'\t\t=> DB_USER,\n\t\t\t'db_pwd'\t\t=> DB_PASSWORD,\n\t\t\t'store_name'\t=> getWpPrefix() . 'pp_thesaurus',\n\t\t);\n\n\t\treturn $aConfig;\n\t}", "public static function getConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\t$query = \"SELECT module, name, value FROM config ORDER by module, name\";\n\t\t\t$table = DB::getTable($query);\n\t\t\tforeach($table as $row) {\n\t\t\t\tCoreConfig::$config[$row['module']][$row['name']] = $row['value'];\n\t\t\t}\n\t\t}\n\t\treturn CoreConfig::$config;\n\t}", "function load_config()\n\t{\n\t\t$sql = \"SELECT * FROM config\";\n\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\tforeach ($dbdata->fetchAll(PDO::FETCH_OBJ) as $conf) {\n\t\t\tif ($conf->value == 'true') {\n\t\t\t\t$conf->value = true;\n\t\t\t} elseif ($conf->value == 'false') {\n\t\t\t\t$conf->value = false;\n\t\t\t}\n\n\t\t\t$this->config->set($conf->param, $conf->value);\n\t\t}\n\t}", "private function getConfig() {\n // call the GetConfig API\n $args = array('hostname' => $this->hostname);\n $api = new \\xmlAPI('GetConfig', $this->_default_key, 'xml', $args);\n $api->server_url = $this->_default_server;\n $api->send();\n\n // change hostname if found by custom_name\n $this->hostname = $api->hostname;\n \n // save fields in metadata\n $this->key = $api->api_key ? $api->api_key : $this->_default_key;\n $this->server = $api->api_server ? $api->api_server : $this->_default_server;\n $this->controller_path = $api->controller_path;\n $this->controller = $api->controller;\n $this->error_page = $api->error_page ? $api->error_page : '404';\n $this->mode = $api->mode ? $api->mode : 'test';\n $this->site_path = $api->site_path ? $api->site_path : $this->hostname;\n $this->default_site_path = $api->default_site_path;\n $this->secure_domain = $api->secure_domain;\n \n // set the list of controllers this site can use\n $this->setRights($api->row);\n }", "public function load()\n {\n $settings = array(\n 'similarityMeasure',\n 'xFactor',\n 'alpha'\n );\n \n $result = $this->db->select($settings)\n ->from('Configuration')\n ->get()->row_array();\n \n return $result;\n }", "public function storeConfigData(){\n $data = array();\n $data['bg'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_bg', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['noitems'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_category', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['animate'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_animation_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['width'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_width', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['height'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_height', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n return $data;\n }", "public function get_settings()\n {\n }", "public function fetchAll() {\n\n $settings=$this->em->getRepository('CreavoOptionBundle:Setting')->findAll();\n\n /** @var Setting $setting */\n foreach($settings AS $setting) {\n $this->addToCache($setting);\n }\n }", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "private function loadConfigRepository(): void\n {\n // Check Config\n if (\\count($this->configs) > 0) {\n return;\n }\n\n // Load Cache|Repository\n $store = $this->configRepo->findAll();\n foreach ($store as $config) {\n if (count($config->getValue()) === 1) {\n $val = $config->getValue()[0];\n\n if ('true' === $val) {\n $val = true;\n } elseif ('false' === $val) {\n $val = false;\n }\n } else {\n $val = $config->getValue();\n }\n\n $this->configs[$config->getName()] = $val;\n }\n }", "public function getConfig() {\n return Mage::getSingleton('profileolabs_shoppingflux/config');\n }", "public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }", "public function getAll()\n {\n return $this->config;\n }" ]
[ "0.63916487", "0.6328137", "0.62886477", "0.62371826", "0.61417246", "0.6033346", "0.5991536", "0.59908175", "0.597144", "0.5940942", "0.5932943", "0.59280473", "0.5911799", "0.5889918", "0.58863765", "0.586022", "0.58496034", "0.5848951", "0.58410025", "0.58358425", "0.58198947", "0.5818532", "0.5818096", "0.5749638", "0.57448924", "0.5741232", "0.5737015", "0.5730348", "0.5712045", "0.5704172" ]
0.7333951
0
Saves grid configuration settings to store
public function saveSettings() { $this->store->save($this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "public function config_save() {\n }", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function saveConfigOptions() {}", "function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}", "public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}", "public function saveSettings()\n {\n return $this->config->saveFile();\n }", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}", "public function saveAction()\n {\n $pageCode = $this->getRequest()->getParam('page_code');\n\n $config = $this->initConfig($pageCode);\n\n\n $session = Mage::getSingleton('adminhtml/session');\n\n try {\n\n $section = $config->getData('codes/section');\n $website = $this->getRequest()->getParam('website');\n $store = $this->getRequest()->getParam('store');\n $groups = $this->getRequest()->getPost('groups');\n $configData = Mage::getModel('adminhtml/config_data');\n $configData->setSection($section)\n ->setWebsite($website)\n ->setStore($store)\n ->setGroups($groups)\n ->save();\n\n $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.'));\n } catch (Mage_Core_Exception $e) {\n foreach (explode(\"\\n\", $e->getMessage()) as $message) {\n $session->addError($message);\n }\n } catch (Exception $e) {\n $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();\n $session->addException($e, $msg);\n }\n\n $this->_redirectByPageConfig();\n }", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }", "private function __saveConfiguration()\n {\n //Check is submit the form\n if (Tools::isSubmit(BECOPAY_PREFIX . 'submit')) {\n\n //clear errors messages\n $this->_errors = array();\n\n //validate is set configuration field\n foreach ($this->config['configuration'] as $config) {\n if ($config['isRequired'] && Tools::getValue(BECOPAY_PREFIX . $config['name']) == NULL)\n $this->_errors[] = $this->l($config['title'] . ' is require');\n }\n\n //if has no errors check with PaymentGateway Constructor validation\n if (empty($this->_errors)) {\n try {\n new PaymentGateway(\n Tools::getValue(BECOPAY_PREFIX . 'apiBaseUrl'),\n Tools::getValue(BECOPAY_PREFIX . 'apiKey'),\n Tools::getValue(BECOPAY_PREFIX . 'mobile')\n );\n } catch (\\Exception $e) {\n $this->_errors[] = $e->getMessage();\n }\n }\n\n //Display error messages if has error\n if (!empty($this->_errors)) {\n $this->_html = $this->displayError(implode('<br>', $this->_errors));\n } else {\n\n //save configuration form fields\n foreach ($this->config['configuration'] as $config)\n if (Tools::getValue(BECOPAY_PREFIX . $config['name']) != NULL)\n Configuration::updateValue(BECOPAY_PREFIX . $config['name'], trim(Tools::getValue(BECOPAY_PREFIX . $config['name'])));\n\n\n //display confirmation message\n $this->_html = $this->displayConfirmation($this->l('Settings updated'));\n }\n }\n }", "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "function _savesettings()\r\n {\r\n\t\t$settings = JRequest::getVar('settings');\r\n\r\n\t\tjimport('joomla.registry.registry');\r\n\t\t$reg = new JRegistry();\r\n\t\t$reg->loadArray($settings);\r\n\t\t\t\t\r\n\t\tif(JFusionConnect::isJoomlaVersion('1.6')) {\r\n\t\t\t$component =& JTable::getInstance('extension');\r\n\t\t\t$componentid = $component->find(array('type' => 'component','element' => 'com_jfusionconnect'));\r\n\t\t\t$component->load($componentid);\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('extension');\r\n\t\t\t$pluginid = $plugin->find(array('type' => 'plugin','element' => 'jfusionconnect'));\r\n\t\t\t$plugin->load($pluginid);\r\n\t\t\t$key='enabled';\r\n\t\t} else {\r\n\t\t\t$component =& JTable::getInstance('component');\r\n\t\t\t$component->loadByOption('com_jfusionconnect');\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('plugin');\r\n\t\t\t$plugin->_tbl_key = 'element';\r\n\t\t\t$plugin->load('jfusionconnect');\r\n\t\t\t$key='published';\r\n\t\t}\r\n\t\t$component->params = $reg->toString();\r\n\t\t$component->store();\r\n \tif ($settings['enabled']) {\r\n\t\t\t$plugin->$key = 1;\r\n\t\t} else {\r\n\t\t\t$plugin->$key = 0;\r\n\t\t}\r\n\t\t$plugin->store();\r\n }", "public function save_settings($settings)\n {\n }", "public static function save(){\n\t\t//if this entry is set in the config file, then store the set\n\t\t//and modules in the team_set_modules table\n if (!isset($GLOBALS['sugar_config']['enable_team_module_save'])\n || !empty($GLOBALS['sugar_config']['enable_team_module_save'])) {\n\t\t\tforeach(self::$_setHash as $team_set_id => $table_names){\n\t\t\t\t$teamSetModule = BeanFactory::newBean('TeamSetModules');\n\t\t\t\t$teamSetModule->team_set_id = $team_set_id;\n\n\t\t\t\tforeach($table_names as $table_name){\n\t\t\t\t\t$teamSetModule->module_table_name = $table_name;\n\t\t\t\t\t//remove the id so we do not think this is an update\n\t\t\t\t\t$teamSetModule->id = '';\n\t\t\t\t\t$teamSetModule->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function saveConfig() {\n\t\tif(!$this->_configTitle) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configDatabase) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTable) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configCreditsCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserColId) throw new Exception(lang('error_4'));\n\t\t\n\t\t$data = array(\n\t\t\t'title' => $this->_configTitle,\n\t\t\t'database' => $this->_configDatabase,\n\t\t\t'table' => $this->_configTable,\n\t\t\t'creditscol' => $this->_configCreditsCol,\n\t\t\t'usercol' => $this->_configUserCol,\n\t\t\t'usercolid' => $this->_configUserColId,\n\t\t\t'checkonline' => $this->_configCheckOnline,\n\t\t\t'display' => $this->_configDisplay,\n\t\t\t'phrase' => $this->_configPhrase\n\t\t);\n\t\t\n\t\t$query = \"INSERT INTO \"._WE_CREDITSYS_.\" \"\n\t\t\t. \"(config_title, config_database, config_table, config_credits_col, config_user_col, config_user_col_id, config_checkonline, config_display, config_phrase) \"\n\t\t\t. \"VALUES \"\n\t\t\t. \"(:title, :database, :table, :creditscol, :usercol, :usercolid, :checkonline, :display, :phrase)\";\n\t\t\n\t\t$saveConfig = $this->db->query($query, $data);\n\t\tif(!$saveConfig) throw new Exception(lang('error_140'));\n\t}" ]
[ "0.741802", "0.73677206", "0.72362244", "0.72257257", "0.70773035", "0.70331293", "0.7005447", "0.6992368", "0.68396664", "0.68207", "0.6814125", "0.67436886", "0.66654724", "0.66470945", "0.66256005", "0.65832406", "0.65194786", "0.64991367", "0.6488498", "0.64809996", "0.64604634", "0.64235675", "0.6406975", "0.6385082", "0.63599586", "0.6359925", "0.6355638", "0.63547724", "0.62818563", "0.6275781" ]
0.7933397
0
Deletes grid configuration settings from store
public function deleteSettings() { $master = new DynaGridStore([ 'id' => $this->dynaGridId, 'category' => DynaGridStore::STORE_GRID, 'storage' => $this->storage, 'userSpecific' => $this->userSpecific ]); $config = $this->storage == DynaGrid::TYPE_DB ? null : $master->fetch(); $master->deleteConfig($this->category, $config); $this->store->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearConfig()\n {\n $this->_xcoobee->getStore()->clearStore();\n }", "protected function deleteConfiguration(){\n Configuration::deleteByName($this->name.'_settings');\n }", "function clear_integration_settings() {\n\tglobal $db;\n\t\n\t$config_fields = get_db_schema();\n\t$key_names = array();\n\tforeach ($config_fields as $config_field) {\n\t\t$key_names[] = 'wpu_' . $config_field;\n\t}\n\t\n\t$sql = 'DELETE FROM ' . CONFIG_TABLE . '\n\t\t\tWHERE ' . $db->sql_in_set('config_name', $key_names);\n\t$db->sql_query($sql);\n\n}", "private function deleteSettings()\n\t{\n\t}", "function remove()\t{\r\n\t\ttep_db_query(\"delete from IXcore.\" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n\t}", "function remove(){\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "function remove() {\n global $db;\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n }", "protected function deleteStore() {\n $keys = ['entity_type', 'entity_id', 'export_type'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function deleteObsoleteConfigs();", "public static function removeAllConfig()\n {\n foreach (self::CONFIG as $configKey) {\n Configuration::deleteByName($configKey);\n }\n }", "protected function deleteStore() {\n $keys = ['community', 'address', 'state', 'city', 'country','attention_to','company','promocode','is_student','payment_type','name_card','card_number'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function deleteConfigs()\n {\n foreach ($this->fields_form as $k => $f) {\n foreach ($f['form']['input'] as $i => $input) {\n if (isset($input['ignore']) && $input['ignore'] == true) {\n continue;\n }\n Configuration::deleteByName($input['name']);\n }\n }\n\n $this->deleteCustomConfigs();\n\n return true;\n }", "function cxense_remove_all_settings() {\n foreach(cxense_get_settings() as $setting)\n delete_option($setting['name']);\n}", "function deleteSettings() {\n\t\tdelete_option('wassup_settings');\n\t}", "public function phpunit_remove_stores() {\n $this->configstores = array();\n }", "protected function deleteStore()\n {\n $keys = ['name', 'email'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "function remove() \r\n {\r\n $tbl = new Payment_Config;\r\n $tbl->delete('where `module_key`=?', array($this->module_key()));\r\n }", "public function deleteConfig() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->db->query(\"DELETE FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($this->_configId))) {\n\t\t\tthrow new Exception(lang('error_142'));\n\t\t}\n\t}", "public function IVS_Store_deactivation(){\n\t\t\t\t$this->db_connection->query(\"DROP TABLE IF EXISTS ivs_store_configurations\");\n\t\t\t}", "public function deleteConfig($key) {\n\t $config = Mage::getConfig();\n\t $config->deleteConfig($key);\n\t}", "function clearConfigSession()\n {\n \t//clear session db info\n\t\t$this->setGeneralSession('db_name', '');\n\t\t$this->setGeneralSession('db_username', '');\n\t\t$this->setGeneralSession('db_password', '');\n\t\t$this->setGeneralSession('status', '');\n }", "private function _deleteConfigs()\r\n {\r\n $response = Configuration::deleteByName($this->name . '_TITLE');\r\n $response &= Configuration::deleteByName($this->name . '_MAXITEM');\r\n $response &= Configuration::deleteByName($this->name . '_MINITEM');\r\n $response &= Configuration::deleteByName($this->name . '_AUTOSCROLL');\r\n $response &= Configuration::deleteByName($this->name . '_PAGINATION');\r\n $response &= Configuration::deleteByName($this->name . '_NAVIGATION');\r\n $response &= Configuration::deleteByName($this->name . '_AUTOSCROLLDELAY');\r\n $response &= Configuration::deleteByName($this->name . '_PAUSEONHOVER');\r\n $response &= Configuration::deleteByName($this->name . '_MANTITLE');\r\n\r\n return $response;\r\n }", "function module_remove($config_id){\n\t\t\t$this->EE->db->delete('br_config', array('config_id' => $config_id)); \n\t\n\t\t// Remove any custom configuration \n\t\t// data that the module has\n\t\t\t$this->EE->db->delete('br_config_data', array('config_id' => $config_id)); \n\t}", "public function delete_config($data)\n {\n\n $this->db->where('id', $data);\n $this->db->delete('configuration');\n return true;\n }", "abstract protected function deleteConfiguration($name);", "private function _deleteConfigs()\r\n {\r\n $response = Configuration::deleteByName('FIELD_FEATUREDPSL_TITLE');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_VERTICAL');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_COLUMNITEM');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_MAXITEM');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_MEDIUMITEM');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_MINITEM');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_AUTOSCROLL');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_PAGINATION');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_NAVIGATION');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_AUTOSCROLLDELAY');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_PAUSEONHOVER');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_NBR');\r\n $response &= Configuration::deleteByName('FIELD_FEATUREDPSL_CAT');\r\n\r\n return $response;\r\n }", "private function _deleteConfigs()\r\n {\r\n $response = Configuration::deleteByName('FIELD_SPECIALPLS_TITLE');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_VERTICAL');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_COLUMNITEM');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_MAXITEM');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_MEDIUMITEM');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_MINITEM');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_AUTOSCROLL');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_PAGINATION');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_NAVIGATION');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_AUTOSCROLLDELAY');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_PAUSEONHOVER');\r\n $response &= Configuration::deleteByName('FIELD_SPECIALPLS_NBR');\r\n\r\n return $response;\r\n }", "function cfg_del(...$args)\n{\n\tglobal $CONFIG;\n\tswitch( count($args) )\n\t{\n\t\tcase 1: unset($CONFIG[$args[0]]); break;\n\t\tcase 2: unset($CONFIG[$args[0]][$args[1]]); break;\n\t\tcase 3: unset($CONFIG[$args[0]][$args[1]][$args[2]]); break;\n\t\tcase 4: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]]); break;\n\t\tcase 5: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]]); break;\n\t\tcase 6: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]][$args[5]]); break;\n\t\tdefault: WdfException::Raise(\"Illegal argument count: \".count($args));\n\t}\n}", "public static function clear()\n {\n self::$config = array();\n }" ]
[ "0.7524371", "0.7367992", "0.71419346", "0.6889994", "0.67518234", "0.6655889", "0.66440135", "0.66342455", "0.6632941", "0.6581649", "0.6569866", "0.65285313", "0.6506302", "0.6503231", "0.6422866", "0.6417303", "0.6415153", "0.6378917", "0.63504285", "0.6255177", "0.6250833", "0.6221436", "0.6087762", "0.60666364", "0.60503346", "0.60422724", "0.60309917", "0.60122716", "0.6004675", "0.6002471" ]
0.85020447
0
/ Definition : ExecutableDefinition TypeSystemDefinition TypeSystemExtension
function Definition($string) { [$definition, $substr] = ExecutableDefinition($string); if ($definition !== null) { $definition['__Definition'] = 'ExecutableDefinition'; return [$definition, $substr]; } [$definition, $substr] = TypeSystemDefinition($string); if ($definition !== null) { $definition['__Definition'] = 'TypeSystemDefinition'; return [$definition, $substr]; } [$definition, $substr] = TypeSystemExtension($string); if ($definition !== null) { $definition['__Definition'] = 'TypeSystemExtension'; return [$definition, $substr]; } Parser::throwSyntax('Definition', $string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefinition();", "public function getDefinition();", "public function getType(): TypeDefinition;", "public function getDefinition() {}", "abstract public function register_type();", "public function type()\n\t{\n\t\treturn $this->definition->name;\n\t}", "public function getClassDefinition();", "function obdiy_create_ep_post_type() {\n\tregister_post_type( 'execution_plan',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Execution Plans' ),\n\t\t\t\t'singular_name' => __( 'Execution Plan' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true, //Behave like a page\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes', 'comments' ),\n\t\t\t'rewrite' => array( 'slug' => 'resources', 'with_front' => false ),\n\t\t\t'permalink_epmask' => EP_PERMALINK,\n\t\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t\t)\n\t);\n}", "public function manipulateTypeDefinition(DocumentAST &$documentAST, TypeDefinitionNode &$typeDefinition): void;", "public function getProcessDefinition();", "public function getDefinition(): string {\n return \"`{$this->name}` {$this->type}\";\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }" ]
[ "0.5611623", "0.5611623", "0.55874705", "0.55021477", "0.5375821", "0.5311329", "0.5307346", "0.51328856", "0.509132", "0.50868523", "0.5085072", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572", "0.5066572" ]
0.57053035
0
setup before redirecting to Linkedin for authentication.
function initiate(){ $linkedin_config = array( 'appKey' => 'xxxxxxxx', 'appSecret' => 'xxxxxxxx', 'callbackUrl' => 'xxx=url=xxx/linkedin_signup/data/' ); $this->load->library('linkedin', $linkedin_config); $this->linkedin->setResponseFormat(LINKEDIN::_RESPONSE_JSON); $token = $this->linkedin->retrieveTokenRequest(); $this->session->set_flashdata('oauth_request_token_secret',$token['linkedin']['oauth_token_secret']); $this->session->set_flashdata('oauth_request_token',$token['linkedin']['oauth_token']); $link = "https://api.linkedin.com/uas/oauth/authorize?oauth_token=". $token['linkedin']['oauth_token']; redirect($link); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "function initiate(){\n $linkedin_config = array(\n 'appKey' => '81pkixf5dxjfaw',\n 'appSecret' => 'VXmzSddDzlEjNNg6',\n 'callbackUrl' => 'http://localhost/Portfolio/linkedin_signup/data/'\n );\n \n $this->load->library('linkedin', $linkedin_config);\n $this->linkedin->setResponseFormat(LINKEDIN::_RESPONSE_JSON);\n $token = $this->linkedin->retrieveTokenRequest();\n \n $this->session->set_flashdata('oauth_request_token_secret',$token['linkedin']['oauth_token_secret']);\n $this->session->set_flashdata('oauth_request_token',$token['linkedin']['oauth_token']);\n \n $link = \"https://api.linkedin.com/uas/oauth/authorize?oauth_token=\". $token['linkedin']['oauth_token']; \n redirect($link);\n}", "public function initializeRedirectUrlHandlers() {}", "public function linkedin()\n {\n return Socialite::driver('linkedin')->redirect();\n }", "function loginpage_hook() {\n global $CFG, $SESSION; \n \n if(isset($CFG->disablewordpressauth) && ($CFG->disablewordpressauth == true)) {\n return;\n }\n \n // Only authenticate against WordPress if the user has clicked on a link to a protected resource\n if(!isset($SESSION->wantsurl)) {\n return;\n }\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n if( (strlen($wordpress_host) > 0) && (strlen($client_key) > 0) && (strlen($client_secret) > 0) ) {\n // kick ff the authentication process\n $connection = new BasicOAuth($client_key, $client_secret);\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n $connection->host = $wordpress_host . \"/wp-json\";\n $connection->requestTokenURL = $wordpress_host . \"/oauth1/request\";\n \n $callback = $CFG->wwwroot . '/auth/wordpress/callback.php';\n $tempCredentials = $connection->getRequestToken($callback);\n \n $_SESSION['oauth_token'] = $tempCredentials['oauth_token'];\n $_SESSION['oauth_token_secret'] = $tempCredentials['oauth_token_secret'];\n \n $connection->authorizeURL = $wordpress_host . \"/oauth1/authorize\";\n \n $redirect_url = $connection->getAuthorizeURL($tempCredentials);\n \n header('Location: ' . $redirect_url);\n die;\n }// if \n }", "public function init()\n {\n \t$auth = Zend_Auth::getInstance();\n \t\n \tif(!$auth->hasIdentity()){\n \t\t$this->_redirect('/login');\n \t}\n }", "public function __construct()\n {\n $this->protocol = api_get_setting('sso_authentication_protocol');\n // There can be multiple domains, so make sure to take only the first\n // This might be later extended with a decision process\n $domains = explode(',', api_get_setting('sso_authentication_domain'));\n $this->domain = trim($domains[0]);\n $this->auth_uri = api_get_setting('sso_authentication_auth_uri');\n $this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');\n //cut the string to avoid recursive URL construction in case of failure\n $this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));\n $this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;\n $this->master_url = $this->protocol.$this->domain.$this->auth_uri;\n $this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);\n $this->target = api_get_path(WEB_PATH);\n }", "function login_init() {\n\n\t\t\t$current_user_id = get_current_user_id();\n\n\t\t\tif ( $current_user_id ) {\n\n\t\t\t\t$is_merge = false;\n\t\t\t\tif ( isset( $_REQUEST[\"isMerge\"] ) && $current_user_id !== null ) {\n\t\t\t\t\tif ( $_REQUEST[\"isMerge\"] === 1 || $_REQUEST[\"isMerge\"] === '1' ) {\n\t\t\t\t\t\t$is_merge = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$linkid_user_id = get_user_meta( $current_user_id, self::WP_USER_META_VALUE_LINKID_USER_ID, true );\n\n\t\t\t\tif ( $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start merging. Logged in user already linked to linkID account\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t} else if ( ! $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start login. User already logged in. Please wait while you are being redirected.\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse, false, true, $this->get_redirect_url( wp_get_current_user() ) ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$linkIDAuthnSession = Link_WP_LinkID::start_authn_request();\n\n\t\t\t// generate the response\n\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromAuthnSession( $linkIDAuthnSession ) );\n\n\t\t\t// response output\n\t\t\theader( \"Content-Type: application/json\" );\n\t\t\techo $response;\n\n\t\t\tdie();\n\t\t}", "public function testRedirect()\n {\n //$member = $this->objFromFixture(Member::class, \"joebloggs\");\n //$this->logInAs($member);\n $this->markTestIncomplete('Test user config CMS fields');\n }", "public function __construct() {\n \n // Get the CodeIgniter super object\n $this->CI = & get_instance();\n \n // Get Linkedin client_id\n $this->client_id = get_option('linkedin_companies_client_id');\n \n // Get Linkedin client_secret\n $this->client_secret = get_option('linkedin_companies_client_secret');\n \n // Set redirect_url\n $this->redirect_uri = site_url('user/callback/linkedin_companies');\n\n // Load the networks language's file\n $this->CI->lang->load( 'default_networks', $this->CI->config->item('language') );\n \n // Get account if exsts\n if( $this->CI->input->get('account', TRUE) ) {\n \n // Verify if account is valid\n if( is_numeric($this->CI->input->get('account', TRUE)) ) {\n \n $_SESSION['account'] = $this->CI->input->get('account', TRUE);\n \n }\n \n }\n \n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}", "public function initialConfig() \n {\n //NB: various link modes handled below in setupPageData()\n if(!isset($_GET['mode'])) {\n\n $this->user_id = $this->user->setupUserData();\n if($this->user_id != 0) {\n $this->addMessage('You are already logged in! You can login as another user or '.$this->js_links['back']);\n\n $_SESSION['login_redirect'] = $_SESSION['login_redirect'] + 1 ;\n if($_SESSION['login_redirect'] > 5) {\n $this->addError('Something is wrong with your access credentials. Please contact support.');\n } else {\n $this->user->redirectLastPage();\n }\n }\n }\n \n }", "function onAfterInitialise(){\n\t\t\n\t\t//Check if isset the code in the URL\n\t\tif(isset($_REQUEST[\"code\"]))\n\t\t{\n\t\t\t//Create an array credentials empty\n\t\t\t$credentials = array(\n\t\t\t\t\t\"username\" => \"\",\n\t\t\t\t\t\"password\" => \"\",\n\t\t\t);\n\t\t\t\n\t\t\t//Get the application\n\t\t\t$app = JFactory::getApplication(); \n\t\t\t\n\t\t\t//Now it only works if the application is the frontend. Needs a normal authentication for the backend.\n\t\t\tif($app->isSite()){\n\t\t\t\n\t\t\t\t//Through the login method. The authentication plugins will be called. One of them should be able to handle the login using the access token, instead of the credential array.\n\t\t\t\t$app->login($credentials);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function init()\n {\n $auth = Zend_Auth::getInstance();\n if(!$auth->hasIdentity()) {\n $this->_redirect($this->view->url(array(\n 'module' => 'user',\n 'controller' => 'login',\n )));\n }\n }", "public function woo_slg_initialize_linkedin() {\n\t\t\t\n\t\t\tglobal $woo_slg_options;\n\t\t\t\n\t\t\t//check enable linkedin & linkedin application id & linkedin application secret are not empty\n\t\t\tif( !empty( $woo_slg_options['woo_slg_enable_linkedin'] ) && !empty( $woo_slg_options['woo_slg_li_app_id'] )\n\t\t\t\t && !empty( $woo_slg_options['woo_slg_li_app_secret'] ) ) {\n\t\t\t\t\n\t\t\t \t//check $_GET['wooslg'] equals to linkedin\n\t\t\t\tif( isset( $_GET['wooslg'] ) && $_GET['wooslg'] == 'linkedin' \n\t\t\t\t\t&& !empty( $_GET['code'] ) && !empty( $_GET['state'] ) ) {\n\t\t\t\t\t\n\t\t\t\t\t//load linkedin class\n\t\t\t\t\t$linkedin\t= $this->woo_slg_load_linkedin();\n\t\t\t\t\t$config\t\t= $this->linkedinconfig;\n\t\t\t\t\t\n\t\t\t\t\t//check linkedin loaded or not\n\t\t\t\t\tif( !$linkedin ) return false;\n\t\t\t\t\t\n\t\t\t\t\t//Get Access token\n\t\t\t\t\t$arr_access_token\t= $this->linkedin->getAccessToken( $config['appKey'], $config['appSecret'], $config['callbackUrl']);\n\n\t\t\t\t\t// code will excute when user does connect with linked in\n\t\t\t\t\tif( !empty( $arr_access_token['access_token'] ) ) { // if user allows access to linkedin\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Get User Profiles\n\t\t\t\t\t\t$resultdata\t\t\t= $this->linkedin->getProfile();\n\n\t\t\t\t\t\t$resultdata \t\t= $this->woo_slg_get_li_processed_profile_data($resultdata);\n\n\t\t\t\t\t\t$emailData = $this->linkedin->getProfileEmail( $arr_access_token['access_token']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !empty( $emailData ) && isset( $emailData['elements'] ) && !empty( $emailData['elements'] ) ){\n\t\t\t\t\t\t\t$resultdata['emailAddress'] = $emailData['elements'][0]['handle~']['emailAddress'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$imageData = $this->linkedin->getProfileImage( $arr_access_token['access_token']);\n\n\t\t\t\t\t\tif( !empty( $imageData ) && isset( $imageData['profilePicture'] ) ){\n\t\t\t\t\t\t\t$resultdata['pictureUrl'] = $imageData['profilePicture']['displayImage~']['elements'][0]['identifiers'][0]['identifier'];\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t//set user data to sesssion for further use\n\n\t\t\t\t\t\t\\WSL\\Persistent\\WOOSLGPersistent::set('woo_slg_linkedin_user_cache', $resultdata);\n\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// bad token access\n\t\t\t\t\t\techo esc_html__( 'Access token retrieval failed', 'wooslg' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function loginBegin()\r\n\t{\r\n\t\t// if we have extra perm\r\n\t\tif( isset( $this->config[\"scope\"] ) && ! empty( $this->config[\"scope\"] ) )\r\n\t\t{\r\n\t\t\t$this->scope = $this->scope . \", \". $this->config[\"scope\"];\r\n\t\t}\r\n\r\n\t\t// get the login url \r\n\t\t$url = $this->api->getLoginUrl( array( 'scope' => $this->scope, 'redirect_uri' => $this->endpoint ) );\r\n\r\n\t\t// redirect to facebook\r\n\t\tHybrid_Auth::redirect( $url ); \r\n\t}", "protected function before()\n {\n $this->requireLogin();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "function auth_redirect()\n {\n }", "function loginRequiredMixinInit($arguments=[]){\n\n if(!AuthModel::isLoggedIn()){\n $_SESSION['rememberUrl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n header('Location: '.AuthModel::getLoginUrl());\n exit;\n }\n\n }", "public function linkedinRedirect()\n {\n $user = Socialite::driver('linkedin')->user();\n $user = User::firstOrCreate([\n 'email'=> $user->email,\n ],\n [\n 'name' => $user->nickname,\n 'email'=> $user->email,\n 'password' => Hash::make(Str::random(24))\n ]\n );\n Auth::login($user,true);\n return redirect(route('shop'));\n }", "public function setAuthenticationParams() {\n }", "public function preDispatch() {\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $requestUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();\n $session = new Zend_Session_Namespace('lastRequest');\n $session->lastRequestUri = $requestUri;\n $this->_helper->redirector('index', 'index', 'login');\n }\n }", "public function redirectToProvider()\n {\n return Socialite::driver('linkedin')->redirect();\n }", "public function init()\n {\n $authorization = Zend_Auth::getInstance();\n $storage = $authorization->getStorage();\n $sessionRead = $storage->read();\n if ($authorization->hasIdentity())\n {\n $admin = $sessionRead->name;\n if ($this->_request->getActionName() != 'login' && $admin != 'admin')\n {\n $this->redirect(\"admin/login\");\n } \n }\n else {\n if ($this->_request->getActionName() != 'login') {\n $this->redirect(\"admin/login\");\n }\n }\n }", "function parseRequest() {\n global $wp_query, $wp;\n\n if( array_key_exists('xauth', $wp->query_vars) ) {\n if ($wp->query_vars['xauth'] == 'login') {\n $redirect_to = $wp->query_vars['redirect_to'];\n\n XAuthPlugin::loginPage($redirect_to);\n }\n }\n }", "public function init()\r\n\t{\r\n\t\t$auth = Zend_Auth::getInstance();\r\n\t\tif (! $auth->hasIdentity()) {\r\n\t\t\treturn $this->_redirect('/usuarios/login');\r\n\t\t}\r\n\t\t \r\n\t}", "public function initialize() {\n parent::initialize();\n if ($this->blogger) {\n return $this->response->redirect(['for' => 'explore']);\n }\n }", "public function before() {\n\t\t\n\t\t$this->session = Session::instance();\n $user_id = $this->session->get('user_id');\n\t\t\n if (!empty($user_id) ) {\n $this->user = ORM::factory('user',$user_id);\n View::bind_global('user', $this->user);\n \n\t\t} else if ($this->_auth_required) {\n\t\t\t$this->request->redirect(NON_SIGNED_IN_HOME);\n\t\t}\n\t \n\t\t$this->load_domain_channel();\n\t\t$this->load_user_channel($this->user);\n\t\t\n\t\tif ($this->user_channel == null){\n\t\t\t/* \n\t\t\tuser who doesnt have a channel can access anything \n\t\t\t*/\n\t\t\treturn;\n\t\t} else { \n\t\t\t/* \n\t\t\tUser trying to access direct domain is not allowed\n\t\t\tUser trying to access another sub domain is not allowed\n\t\t\t*/\n\t\t\t$user_domain_url = \"http://\".$this->user_domain;\n\t\t\t\n\t\t\tif($this->channel == null) {\n\t\t\t\t/* User trying to access base domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t\t\n\t\t\t} else if ($this->channel->id != $this->user_channel->id){\n\t\t\t\t/* User trying to access some other domain \n\t\t\t\tredirect him to his domain\n\t\t\t\t*/\n\t\t\t\t$this->request->redirect($user_domain_url);\n\t\t\t} else {\n\t\t\t\t// doing the correct access leave that poor chap alone.\n\t\t\t}\n\t\t} \n\t}" ]
[ "0.67919904", "0.6460752", "0.6447396", "0.63992095", "0.6376764", "0.6279621", "0.6273765", "0.61933273", "0.61405575", "0.6117547", "0.6078427", "0.60783887", "0.60767084", "0.60705495", "0.6060106", "0.60587835", "0.6057229", "0.60224384", "0.60224384", "0.6016654", "0.59817594", "0.59715706", "0.59607214", "0.59576666", "0.59485906", "0.5890409", "0.58604795", "0.5859179", "0.58584213", "0.58541065" ]
0.6659308
1
Register the plugin:list command.
protected function registerPluginListCommand() { $this->app->singleton('command.plugin.list', function ($app) { return new PluginListCommand($app['plugins']); }); $this->commands('command.plugin.list'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listPlugin()\n\t{\n\t\t\n\t}", "protected function registerListCommand()\n {\n $this->app->singleton('command.module.list', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleListCommand($app['modules']);\n });\n\n $this->commands('command.module.list');\n }", "public function list_plugins($plugin = null) {\n\t\tApp::uses('CroogoPlugin','Extensions.Lib');\n\t\t$all = $this->params['all'];\n\t\t$plugins = $plugin == null ? App::objects('plugins') : array($plugin);\n\t\t$loaded = CakePlugin::loaded();\n\t\t$CroogoPlugin = new CroogoPlugin();\n\t\t$this->out(__('Plugins:'), 2);\n\t\t$this->out(__('%-20s%-50s%s', __('Plugin'), __('Author'), __('Status')));\n\t\t$this->out(str_repeat('-', 80));\n\t\tforeach ($plugins as $plugin) {\n\t\t\t$status = '<info>inactive</info>';\n\t\t\tif ($active = in_array($plugin, $loaded)) {\n\t\t\t\t$status = '<success>active</success>';\n\t\t\t}\n\t\t\tif (!$active && !$all) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data = $CroogoPlugin->getPluginData($plugin);\n\t\t\t$author = isset($data['author']) ? $data['author'] : '';\n\t\t\t$this->out(__('%-20s%-50s%s', $plugin, $author, $status));\n\t\t}\n\t}", "public function listCommand()\n {\n $this->console->writeLn('list: ' . implode(' ', $this->_getEnvTypes()));\n }", "protected function setupListOperation()\n {\n if (!backpack_user()->hasPermissionTo('Browse plugin')) {\n abort(403);\n }\n\n CRUD::column('name')->label('Plugin')->type('text');\n CRUD::column('version')->label('Version')->type('text');\n $this->crud->addButtonFromModelFunction('line', 'editBtn', 'editBtn', 'beginning');\n $this->crud->addButtonFromModelFunction('line', 'openBtn', 'openBtn', 'beginning');\n }", "public static function getPluginList () {\n\t\treturn self::$pInfo[1];\n\t\t$glob = glob(TH_ROOT.TH_PLUGINS.'*/plugin.php');\n\t\tforeach($glob as $plugin) {\n\t\t\t// $plugin is a full path, we don't want that.\n\t\t\t$plugin = explode(TH_ROOT.TH_PLUGINS, $plugin, 2);\n\t\t\t$plugin = explode('/plugin.php', $plugin[1]);\n\t\t\t$r[] = $plugin[0];\n\t\t}\n\t\treturn $r;\n\t}", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "abstract protected function getCommandList();", "function list_plugin_updates()\n {\n }", "public function getActivePluginsList()\n\t{\n\t\techo \"Active plugins:\\n\";\n\t\tforeach (get_plugins() as $plugin_name => $plugin_details)\n\t\t{\n\t\t\tif (is_plugin_active($plugin_name) === true)\n\t\t\t{\n\t\t\t\tforeach ($plugin_details as $details_key => $details_value)\n\t\t\t\t{\n\t\t\t\t\tif (in_array($details_key, array('Name', 'Version', 'PluginURI')))\n\t\t\t\t\t{\n\t\t\t\t\t\techo $details_key . \" : \" . $details_value . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo \"Path : \" . $plugin_name . \"\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function listCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\t$this->outputLine($file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine();\n\t\t$this->outputLine(sprintf('%s temporary file(s).', $counter));\n\t}", "function listCmds() {\n\tglobal $commands; ?>\n\t<ul width=\"700\">\n<?php\tforeach ($commands as $idx => $command): ?>\n\t\t<li>\n\t\t\t<strong><a href=\"#<?= htmlspecialchars($command['title']) ?>\"><?= htmlspecialchars($command['title']) ?></a></strong>\n\t\t</li>\n<?php\tendforeach; ?>\n\t</ul>\n<?php\n}", "public function list()\n {\n $plugins = Plugin::orderBy('name', 'asc')->where('vsrepo', 0)->where('vs_included', 0)->with('categories')->get();\n\t\treturn view('vsrepo.list', compact('plugins'));\n }", "public function list() {\n foreach ($this->instance->registered_post_types as $key => $registered_post_type) {\n WP_CLI::line($registered_post_type->get_post_type());\n }\n }", "public function listCommands()\n {\n $commands = $this->library->getAll();\n\n foreach ($commands as $name => $details) {\n $this->output->writeln(ucwords($name));\n $this->output->hr(strlen($details['description']), '-');\n $this->output->writeln($details['description']);\n $this->output->hr(strlen($details['description']), '-');\n\n foreach ($details['actions'] as $action) {\n $this->output->writeln(\n sprintf(\n \"%s - php [file] %s%s [params]\",\n $action,\n $name,\n ($action != 'main' ? \":$action\" : '')\n )\n );\n }\n\n // Just for padding\n $this->output->writeln('');\n }\n }", "function _dhz_plugins_list_meta_box() {\n\t\tif (apply_filters('remove_dhz_nag', false)) {\n\t\t\treturn;\n\t\t}\n\t\t$plugins = apply_filters('_dhz_plugins_list', array());\n\t\t\t\n\t\t$id = 'plugins-by-dreihochzwo';\n\t\t$title = '<a style=\"text-decoration: none; font-size: 1em;\" href=\"https://profiles.wordpress.org/tmconnect/#content-plugins\" target=\"_blank\">'.__(\"Plugins by dreihochzwo\", \"acf-collapse-fields\").'</a>';\n\t\t$callback = array($this, 'show_dhz_plugins_list_meta_box');\n\t\t$screens = array();\n\t\tforeach ($plugins as $plugin) {\n\t\t\t$screens = array_merge($screens, $plugin['screens']);\n\t\t}\n\t\t$context = 'side';\n\t\t$priority = 'default';\n\t\tadd_meta_box($id, $title, $callback, $screens, $context, $priority);\n\t\t\n\t\t\n\t}", "public function list_( $args, $assoc_args ) {\n\t\tWP_CLI::print_value( WP_CLI::get_runner()->aliases, $assoc_args );\n\t}", "private function plugins(){\n $all_plugins = explode(',', json_decode(file_get_contents($this->pluginsJson))->all->names);\n debug($all_plugins);\n die;\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "function listPlugins( ) {\n\t\t$list = array();\n\n\t\t$pathname = $GLOBALS['mosConfig_absolute_path'].'/administrator/components/com_joomap/plugins/';\n\t\tif ( is_dir($pathname) ) {\n\t\t\t$dir_handle = opendir($pathname);\n\t\t\tif( $dir_handle ) {\n\t\t\t\twhile (($filename = readdir($dir_handle)) !== false) {\n\t\t\t\t\tif( substr( $filename, -11 ) == '.plugin.php' ) {\n\t\t\t\t\t\t$list[] = $filename;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dir_handle);\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "function getPlugins();", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function installPlugins()\n{\n outputString(PHP_EOL.'Installing plugins', Console::FG_YELLOW);\n $installPluginCmd = './craft install/plugin ';\n foreach (INSTALL_PLUGINS as $pluginHandle) {\n outputString('- installing plugin '.$pluginHandle);\n executeShellCommand($installPluginCmd . $pluginHandle);\n }\n}", "protected function get_installed_plugin_slugs()\n {\n }", "public function register()\n {\n Permission::register('plugins', 'plugin', [\n 'change_status',\n 'list',\n 'view_settings',\n ]);\n }", "public function listInstalledCommand($type = '') {\n\t\t$type = strtoupper($type);\n\t\tif (!empty($type) && $type !== 'L' && $type !== 'G' && $type !== 'S') {\n\t\t\t$this->outputLine('Only \"L\", \"S\" and \"G\" are supported as type (or nothing)');\n\t\t\t$this->quit();\n\t\t}\n\n\t\t/** @var $extensions Tx_Coreapi_Service_ExtensionApiService */\n\t\t$extensions = $this->objectManager->get('Tx_Coreapi_Service_ExtensionApiService')->getInstalledExtensions($type);\n\n\t\tforeach ($extensions as $key => $details) {\n\t\t\t$title = $key . ' - ' . $details['version'] . '/' . $details['state'];\n\t\t\t$description = $details['title'];\n\t\t\t$description = wordwrap($description, self::MAXIMUM_LINE_LENGTH - 43, PHP_EOL . str_repeat(' ', 43), TRUE);\n\t\t\t$this->outputLine('%-2s%-40s %s', array(' ', $title, $description));\n\t\t}\n\t}", "public function index()\n {\n return Plugin::where(['is_deleted' => 0])->get();\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }" ]
[ "0.7836309", "0.7482863", "0.64678246", "0.64274716", "0.6347014", "0.6059224", "0.6048014", "0.6013477", "0.59664017", "0.5914595", "0.59128904", "0.58977383", "0.5873162", "0.57969004", "0.5755384", "0.57171446", "0.5695565", "0.5663307", "0.56529677", "0.56502944", "0.5625198", "0.5609892", "0.55871665", "0.55860496", "0.558517", "0.5580046", "0.5551643", "0.5527346", "0.5521033", "0.55209434" ]
0.8820267
0
Register the plugin:migrate command.
protected function registerPluginMigrateCommand() { $this->app->singleton('command.plugin.migrate', function ($app) { return new PluginMigrateCommand($app['migrator'], $app['plugins']); }); $this->commands('command.plugin.migrate'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }", "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "protected function registerMigrateResetCommand()\n {\n $this->app->singleton('command.module.migrate.reset', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateResetCommand($app['modules'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.module.migrate.reset');\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "protected function registerMigrations()\n {\n if (TwilioVerify::$runsMigrations && $this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }", "protected function registerMigrations(): void\n {\n if (config('permission_makr.migrations')) {\n $this->loadMigrationsFrom(__DIR__ . '/database/migrations');\n }\n }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "protected function registerMigrations()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');\n }\n }", "private function registerMigrations()\n {\n $this->loadMigrationsFrom($this->migrations);\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');\n }", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "public function register()\n {\n $this->registerMigrationSquasher();\n\n $this->commands(\n 'migrate:squash'\n );\n }", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "protected function registerMigrations()\n {\n if (config('code-log.channel') === 'database') {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n }\n }" ]
[ "0.7604389", "0.7472265", "0.7452799", "0.71933883", "0.7180311", "0.7093281", "0.681038", "0.669298", "0.66402155", "0.6409046", "0.6371802", "0.61739707", "0.6160839", "0.6100698", "0.60532653", "0.603339", "0.60199344", "0.60199344", "0.6000894", "0.59678173", "0.5955543", "0.59344745", "0.5930083", "0.5929446", "0.5915108", "0.59138584", "0.5901319", "0.58543783", "0.5846342", "0.5811231" ]
0.8287139
0
Register the plugin:migrate:refresh command.
protected function registerPluginMigrateRefreshCommand() { $this->app->singleton('command.plugin.migrate.refresh', function ($app) { return new PluginMigrateRefreshCommand($app['plugins']); }); $this->commands('command.plugin.migrate.refresh'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerMigrateResetCommand()\n {\n $this->app->singleton('command.module.migrate.reset', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateResetCommand($app['modules'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.module.migrate.reset');\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "private function registerUpdateGeoIpCommand()\n {\n $this->app->singleton('firewall.updategeoip.command', function () {\n return new UpdateGeoIpCommand();\n });\n\n $this->commands('firewall.updategeoip.command');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "protected function registerCrudCommand()\n {\n $this->app->singleton('command.core.crud', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreCrudCommand();\n });\n\n $this->commands('command.core.crud');\n }", "protected function registerCommands()\r\n\t{\r\n\t\t$this->commands(\r\n\t\t\t'hipsupport.online', \r\n\t\t\t'hipsupport.offline'\r\n\t\t);\r\n\t}", "public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }", "public function registerCommands()\n\t{\n\t\t$this->app->singleton('command.lock.clear', function ($app) {\n\t\t\treturn new ClearCommand($app['lock']);\n\t\t});\n\n\t\t$this->commands('command.lock.clear');\n\t}", "function post_sql_sync_extras_drush_help_alter(&$command) {\n if ($command['command'] == 'sql-sync') {\n $command['options']['rr'] = \"Rebuild the registry on the target site after the sync operation has completed.\";\n $command['options']['fra'] = \"Revert all features on the target site after the sync operation has completed.\";\n $command['options']['enable'] = \"Enable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['disable'] = \"Disable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['permission'] = \"Add or remove permissions from a role in the target database after the sync operation has completed. The value of this option must be an array, so it may only be specified in a site alias record or drush configuration file. See `drush topic docs-example-sync-extension`.\";\n }\n}", "public function register() {\n\n $this->app->singleton('command.schema.update', function()\n {\n return new Commands\\SchemaUpdate;\n });\n\n\n $this->app->singleton('command.schema.migrate', function()\n {\n return new Commands\\SchemaMigrate;\n });\n\n\n $this->commands(\n ['command.schema.update', 'command.schema.migrate']\n );\n }", "private function registerCommands()\n {\n $this->app->bindShared('command.lara-pay-ng.purge-database', function ($app) {\n return new PurgeDatabaseCommand();\n });\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "protected function registerSeedCommand()\n {\n $this->app->singleton('command.module.seed', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleSeedCommand($app['modules']);\n });\n\n $this->commands('command.module.seed');\n }", "protected function registerInstallCommand()\n {\n $this->app->singleton('command.core.install', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreInstallCommand();\n });\n\n $this->commands('command.core.install');\n }", "protected function registerCommands()\n {\n $this->commands([\n ConvertCommand::class,\n ]);\n }", "protected function registerCommands(): void\n {\n $this->commands([\n\n ]);\n }", "private function registerFlushCommand()\n {\n $this->app->singleton('firewall.flush.command', function () {\n return new Flush();\n });\n\n $this->commands('firewall.flush.command');\n }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "private function registerMigrations()\n {\n $this->loadMigrationsFrom($this->migrations);\n }", "protected function registerCommands()\n {\n $this->commands(CleanCommand::class);\n }" ]
[ "0.83024514", "0.704728", "0.65867484", "0.6541119", "0.6536433", "0.6472226", "0.6202226", "0.59793806", "0.57934284", "0.5781904", "0.57274", "0.56988555", "0.5660893", "0.5546303", "0.55159664", "0.5492297", "0.54750097", "0.5455738", "0.5440983", "0.54390377", "0.54003114", "0.53737307", "0.5352283", "0.534945", "0.5331261", "0.5294643", "0.52813", "0.5274566", "0.5241963", "0.52396154" ]
0.8555532
0
Register the plugin:migrate:reset command.
protected function registerPluginMigrateResetCommand() { $this->app->singleton('command.plugin.migrate.reset', function ($app) { return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']); }); $this->commands('command.plugin.migrate.reset'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerMigrateResetCommand()\n {\n $this->app->singleton('command.module.migrate.reset', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateResetCommand($app['modules'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.module.migrate.reset');\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "protected function registerCommands()\n {\n $this->commands(CleanCommand::class);\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "public function tearDown()\n {\n Artisan::call('migrate:reset');\n parent::tearDown();\n }", "public function passResetTableMigrate()\r\n\t{\r\n\t\t$isPassResetTableExist = $this->schema->tableExist('password_resets');\r\n\t\tif (!$isPassResetTableExist) {\r\n\r\n\t\t\t$fileName = \"20210408051901_create_password_resets_table.php\";\r\n\t\t\t$dir = $this->migrationFiles . $fileName;\r\n\t\t\t$content = file_get_contents($this->stubsPath . \"password_resets.stubs\");\r\n\r\n\t\t\tif (!file_exists($dir)) {\r\n\t\t\t\t$handle = fopen($dir, 'w+');\r\n\t\t\t\tfwrite($handle, $content);\r\n\t\t\t\tfclose($handle);\r\n\t\t\t\tchmod($dir, 0777);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "private function registerClearCommand()\n {\n $this->app->singleton('firewall.clear.command', function () {\n return new ClearCommand();\n });\n\n $this->commands('firewall.clear.command');\n }", "private function registerCommands()\n {\n $this->app->bindShared('command.lara-pay-ng.purge-database', function ($app) {\n return new PurgeDatabaseCommand();\n });\n }", "public function registerCommands()\n\t{\n\t\t$this->app->singleton('command.lock.clear', function ($app) {\n\t\t\treturn new ClearCommand($app['lock']);\n\t\t});\n\n\t\t$this->commands('command.lock.clear');\n\t}", "protected function registerMigrations()\n {\n if (TwilioVerify::$runsMigrations && $this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "protected function registerSeedCommand()\n {\n $this->app->singleton('command.module.seed', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleSeedCommand($app['modules']);\n });\n\n $this->commands('command.module.seed');\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }", "protected function registerCommands()\n {\n $this->commands([\n ConvertCommand::class,\n ]);\n }", "private function registerMigrations()\n {\n $this->loadMigrationsFrom($this->migrations);\n }", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "function handle_reset_command($command) {\n $output = '';\n $ref = $this->checkAndGet($command, 'ref');\n $from = $this->checkAndGet($command, 'from', FALSE);\n\n $output .= sprintf(\"reset %s\\n\", $ref);\n if (!empty($from)) {\n sprintf(\"from %s\\n\", $from);\n }\n $output .= \"\\n\";\n\n return $output;\n }", "protected function registerMigrations(): void\n {\n if (config('permission_makr.migrations')) {\n $this->loadMigrationsFrom(__DIR__ . '/database/migrations');\n }\n }", "protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }" ]
[ "0.80530953", "0.70414704", "0.66899776", "0.66237855", "0.63474596", "0.6321869", "0.627897", "0.6242711", "0.6103271", "0.5997545", "0.5792654", "0.5593008", "0.5509013", "0.5472308", "0.54620755", "0.5460137", "0.54201335", "0.5359696", "0.5358458", "0.5356676", "0.5356394", "0.53267646", "0.5303954", "0.5303954", "0.5303234", "0.5238329", "0.5234704", "0.5233233", "0.5222177", "0.52154845" ]
0.84767574
0
Register the plugin:migrate:rollback command.
protected function registerPluginMigrateRollbackCommand() { $this->app->singleton('command.plugin.migrate.rollback', function ($app) { return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']); }); $this->commands('command.plugin.migrate.rollback'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "protected function registerMigrateResetCommand()\n {\n $this->app->singleton('command.module.migrate.reset', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateResetCommand($app['modules'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.module.migrate.reset');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "public function testMigrationsOptionsRollback()\n {\n $this->exec('completion options migrations.migrations rollback');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --force -f --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "function rollback(): void;", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function register()\n {\n $this->registerMigrationSquasher();\n\n $this->commands(\n 'migrate:squash'\n );\n }", "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }", "public function rollbackAction(null|int $version=null):void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n if(!isset($version)){\n $version = count($migrations)-1;\n }\n if((int)$version >= $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=$currentVersion; $i>$version; $i--){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->down()); \n \n Migration::setCurrentVersion($i-1);\n }\n }", "public abstract function rollback();", "function rollback();", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "function rollback($option = '')\n {\n call_user_func_array([$this, __FUNCTION__], func_get_args());\n return $this;\n }", "public function rollbackTransaction(): void;", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');\n }" ]
[ "0.7901439", "0.66819143", "0.6091139", "0.6032072", "0.5872749", "0.5725627", "0.5710847", "0.5630541", "0.5412594", "0.5363787", "0.5363787", "0.5363787", "0.5363787", "0.53555423", "0.5308239", "0.5308068", "0.5242861", "0.5225984", "0.52139366", "0.5164505", "0.516167", "0.51334774", "0.51334774", "0.50918585", "0.5050871", "0.50431186", "0.50009155", "0.49810013", "0.4978498", "0.4978498" ]
0.8155297
0
Register the plugin:seed command.
protected function registerPluginSeedCommand() { $this->app->singleton('command.plugin.seed', function ($app) { return new PluginSeedCommand($app['plugins']); }); $this->commands('command.plugin.seed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerSeedCommand()\n {\n $this->app->singleton('command.module.seed', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleSeedCommand($app['modules']);\n });\n\n $this->commands('command.module.seed');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "public function test_seed_command()\n {\n // lancio il seeder (dietro le quinte lancia un comando artisan)\n $this->seed(); // lancio tutti i seeder\n $this->seed('TraineeSeeder'); // lancio solo quello specificato\n\n // torno il primo elemento\n $trainess = Trainee::first()->toArray();\n\n // verifico se è presente a db\n $this->assertDatabaseHas(\"trainees\", $trainess);\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }", "protected function registerInstallCommand()\n {\n $this->app->singleton('command.core.install', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreInstallCommand();\n });\n\n $this->commands('command.core.install');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "protected function createSeeder()\n {\n $this->call('wizard:seeder', [\n 'name' => $this->argument('name'),\n ]);\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }", "public function handle()\n {\n foreach (config('profile.seeders') as $seeder) {\n if (! class_exists($seeder)) {\n $this->comment($seeder.' does not exists');\n\n continue;\n }\n $this->call('db:seed', ['--class' => $seeder]);\n }\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "protected function registerDbRandCommand()\n {\n $this->app->singleton('command.queue.DbRand', function () {\n return new DbRandCommand($this->app['queue.worker']);\n });\n }", "public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }", "public function register()\n {\n foreach (array_keys($this->generators) as $command) {\n $class = \"Orchestra\\\\Studio\\\\Console\\\\{$command}Command\";\n $name = $this->generators[$command];\n\n $this->app->singleton($name, $class);\n }\n\n $this->commands(array_values($this->generators));\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerCommands(): void\n {\n $this->commands([\n\n ]);\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "protected function registerCommands()\n {\n $this->commands([\n // \"jwt:generate\" command (generates keys).\n KeyGenerateCommand::class,\n ]);\n }", "private function registerCommands()\n {\n $this->add(new RunCommand());\n }", "protected function createSeeder()\n {\n $seeder = Str::studly(class_basename($this->argument('name')));\n\n $this->call(SeederMakeCommand::class, [\n 'name' => \"{$seeder}Seeder\",\n ]);\n }" ]
[ "0.76133686", "0.722749", "0.64181507", "0.6340731", "0.61712587", "0.6135812", "0.6025424", "0.5732121", "0.57014805", "0.56500804", "0.5649854", "0.5539282", "0.55292654", "0.55233186", "0.55202335", "0.5497686", "0.5473434", "0.5456053", "0.5420832", "0.539244", "0.5381588", "0.5379476", "0.5377743", "0.5375206", "0.5353827", "0.535371", "0.5352821", "0.53500897", "0.5342471", "0.5303537" ]
0.8476752
0
Register the make:plugin command.
private function registerPluginMakeCommand() { $this->app->bindShared('command.make.plugin', function ($app) { return new PluginMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "abstract public function register_plugin();", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "function add_plugin($plugin)\n {\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "function createPlugin($name, $type = 'plugin', $args = '')\n\t{\n\t\t$nameSlug = Str::slug($name);\n\t\tif ($nameSlug !== $name) {\n\t\t\t$answer = \\cli\\choose(\"Is it OK to name your plugin \\\"{$nameSlug}\\\" instead\", \"yn\", \"y\");\n\t\t\tif ('y' !== $answer) {\n\t\t\t\t\\cli\\out(\"%1OK, that's fine. But you have to name your plugin something else.%n\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\t$name = $nameSlug;\n\n\t\t$workbench = $this->path(\"/workbench/{$type}s\");\n\n\t\t// make sure we have a propert workbench path setup\n\t\tif (!$this->files->exists($workbench)) {\n\t\t\t$this->files->makeDirectory($workbench);\n\t\t}\n\n\t\t$output_path = $workbench.\"/{$name}\";\n\t\tif (file_exists($output_path)) {\n\t\t\t\\cli\\out(\"%1Whoops! There's already a plugin in {$output_path}!%n\\n\");\n\t\t\texit(2);\n\t\t}\n\n\t\t$this->files->copyDirectory($this->path(\"/lib/stubs/{$type}\"), $output_path);\n\t\t$this->files->deleteDirectory($output_path.'/stubs');\n\n\t\t$tokens = [];\n\n\t\t// make sure we have a stub to work with\n\t\ttry {\n\t\t\t$plugin = static::getStub('/lib/stubs/plugin/stubs/plugin');\n\t\t\t$bootstrap = static::getStub('/lib/stubs/plugin/stubs/bootstrap');\n\t\t\t$composer = static::getStub('/lib/stubs/plugin/stubs/composer');\n\t\t\t$customPostType = static::getStub('/lib/stubs/plugin/stubs/example-custom-post-type');\n\t\t\t$customTaxonomy = static::getStub('/lib/stubs/plugin/stubs/example-custom-taxonomy');\n\t\t\t$autoload = static::getStub('/lib/stubs/plugin/stubs/autoload');\n\t\t} catch (\\Exception $e) {\n\t\t\t\\cli\\out(\"%1\".$e->getMessage().\"%n\\n\");\n\t\t\texit(4);\n\t\t}\n\n\t\t$tokens['@@PLUGIN_SLUG@@'] = $name;\n\n\t\t$tokens['@@PLUGIN_NAME@@'] = \\cli\\prompt(\"What do you want to call your plugin?\", \"My Plugin\");\n\t\t$tokens['@@PLUGIN_DESCRIPTION@@'] = \\cli\\prompt(\"What will this plugin do? Be succinct.\", \"Do something amazing.\");\n\n\t\t$tokens['@@PLUGIN_LICENSE@@'] = \\cli\\prompt(\"What should the plugin license be?\", \"GPL2\");\n\t\t$tokens['@@PLUGIN_LICENSE_URI@@'] = \\cli\\prompt(\"At what URL can more information about the license be found?\", \n\t\t\t\"https://www.gnu.org/licenses/gpl-2.0.html\");\n\n\t\t$tokens['@@PLUGIN_CLASS_NAME@@'] = Str::studly($tokens['@@PLUGIN_NAME@@']);\n\t\t$tokens['@@PLUGIN_VAR_NAME@@'] = '_' . Str::slug($name, '_');\n\n\t\t$tokens['@@PLUGIN_VERSION@@'] = \\cli\\prompt(\"What should the base version be?\", \"1.0.0\");\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR@@'] = \\cli\\prompt(\"Who is the author of this plugin?\", get_current_user());\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR_URI@@'] = \\cli\\prompt(\"What is the URL of the author's homepage?\", \n\t\t\t\"https://github.com/\" . Str::slug($tokens['@@PLUGIN_AUTHOR@@']));\n\t\t\n\t\t$tokens['@@PLUGIN_URI@@'] = \\cli\\prompt(\"What is the URL of this project's homepage?\", \n\t\t\t rtrim($tokens['@@PLUGIN_AUTHOR_URI@@'], '/') . '/' . $name);\n\n\t\t$tokens['@@PLUGIN_NAMESPACE@@'] = \\cli\\prompt(\"What should the PHP namespace be for your plugin?\", \n\t\t\t\tStr::studly($tokens['@@PLUGIN_AUTHOR@@']) . '\\\\' . Str::studly($name));\n\n\t\t$tokens['@@PLUGIN_TEXT_DOMAIN@@'] = \\cli\\prompt(\"What is this plugin's text domain?\", Str::slug($tokens['@@PLUGIN_NAME@@']));\n\n\t\t$tokens['@@PLUGIN_DOMAIN_PATH@@'] = \\cli\\prompt(\"Where will this plugin's translation files be stored?\", \"/resources/lang\");\n\n\t\t$tokens['@@COMPOSER_NAME@@'] = \\cli\\prompt(\"What should the Composer project name be?\", \n\t\t\t\tStr::slug($tokens['@@PLUGIN_AUTHOR@@']) . '/' . $name);\n\n\t\t$plugin_file = $output_path.'/src/plugin.php';\n\t\t$bootstrap_file = $output_path.'/bootstrap.php';\n\t\t$composer_file = $output_path.'/composer.json';\n\t\t$autoload_file = $output_path.'/vendor/autoload.php';\n\t\t\n\t\t$this->files->put($bootstrap_file, str_replace(array_keys($tokens), array_values($tokens), $bootstrap));\n\t\t$this->files->put($plugin_file, str_replace(array_keys($tokens), array_values($tokens), $plugin));\n\t\t$this->files->put($composer_file, str_replace(array_keys($tokens), array_values($tokens), $composer));\n\t\t$this->files->put($autoload_file, str_replace(array_keys($tokens), array_values($tokens), $autoload));\n\t\t\n\t\t$examples = \\cli\\choose(\"Should we generate sample custom post types and taxonomies\", \"yn\", \"y\");\n\n\t\t$result = [\n\t\t\t'tokens' => $tokens,\n\t\t\t'files' => [ \n\t\t\t\t'bootstrap' => $bootstrap_file, \n\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t'composer' => $composer_file,\n\t\t\t\t'autoload' => $autoload_file,\n\t\t\t]\n\t\t];\n\n\t\tif ('y' === $examples) {\n\t\t\t$person_file = $output_path.'/src/Models/Person.php';\n\t\t\t$department_file = $output_path.'/src/Models/Department.php';\n\n\t\t\t$this->files->put($person_file, str_replace(array_keys($tokens), array_values($tokens), $customPostType));\n\t\t\t$this->files->put($department_file, str_replace(array_keys($tokens), array_values($tokens), $customTaxonomy));\n\n\t\t\t$result['files']['person'] = $person_file;\n\t\t\t$result['files']['department'] = $department_file;\n\t\t}\n\n\t\t$process = $this->studio(\"load \".$this->path(\"/workbench/{$type}s/{$name}\"));\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(8);\n\t\t}\n\n\n\t\t\\cli\\out(\"Loading your new plugin into your workbench with Composer...\\n\");\n\t\t$process = $this->composer(\"require {$tokens['@@COMPOSER_NAME@@']}:\\\"dev-master\\\"\");\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(16);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "protected function registerBuildCommand()\n {\n $this->app['command.torann.assets.build'] = $this->app->share(function($app)\n {\n return new BuildCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "protected function configure()\n {\n $name = 'add-plugin';\n $desc = '<warning>Downloads</warning> a <info>YOURLS plugin</info> and add it to your <comment>`user/composer.json`</comment>';\n $def = [ new InputArgument('plugins', InputArgument::IS_ARRAY, 'YOURLS plugin(s) to download') ];\n $help = <<<EOT\nExample: <comment>`composer add-plugin ozh/example-plugin`</comment>\nThis command downloads plugins in the appropriate subfolder of <comment>user/plugins/</comment>, adds them to\nyour <comment>user/composer.json</comment> file, and updates dependencies.\nRead more at https://github.com/yourls/composer-installer/\n\nEOT;\n\n $this->setName($name)\n ->setDescription($desc)\n ->setDefinition($def)\n ->setHelp($help);\n }", "public static function register() {\n\t\t$plugin = new self();\n\n\t\tadd_action( 'network_admin_menu', [ $plugin, 'add_network_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'modify_admin_menu' ] );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\tadd_action( 'load-comment.php', [ $plugin, 'manage_comments_page_access' ] );\n\t\tadd_action( 'load-edit-comments.php', [ $plugin, 'manage_comments_page_access' ] );\n\n\t\t// Enable when we need redirects.\n\t\t//add_action( 'admin_init', [ $plugin, 'download_redirects' ] );\n\n\t}", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "function installPlugins()\n{\n outputString(PHP_EOL.'Installing plugins', Console::FG_YELLOW);\n $installPluginCmd = './craft install/plugin ';\n foreach (INSTALL_PLUGINS as $pluginHandle) {\n outputString('- installing plugin '.$pluginHandle);\n executeShellCommand($installPluginCmd . $pluginHandle);\n }\n}", "private function registerPlugin($plugin, $register=true)\n\t{\n\t\t$this->plugins[$plugin][\"flag\"] = $register;\n\t}", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "public static function register(&$plugin) {\n\t\tself::$registered[$plugin->makeSlug()] = $plugin;\n\t}", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }" ]
[ "0.740278", "0.7366321", "0.7233077", "0.712062", "0.7099911", "0.70345587", "0.6841358", "0.6633123", "0.6589437", "0.6472326", "0.6405587", "0.6314378", "0.6193578", "0.6130005", "0.605786", "0.59717137", "0.5946911", "0.5901456", "0.58490056", "0.57593083", "0.57271147", "0.57101464", "0.5702795", "0.5658871", "0.5594448", "0.5576981", "0.55515546", "0.5531542", "0.5531046", "0.5516077" ]
0.88065714
0
Register the make:plugin:controller command.
private function registerControllerMakeCommand() { $this->app->bindShared('command.make.plugin.controller', function ($app) { return new ControllerMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.controller'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "abstract public function register_plugin();", "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 }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "protected function registerControllerPlugin($pluginName, $toggle)\n {\n $frontController = Front::getInstance();\n \n $stackIndex = $this->getLowestFreeStackIndex();\n \n if (TRUE == $toggle)\n {\n $frontController->registerPlugin( new $pluginName, $stackIndex);\n }\n else \n {\n $frontController->unregisterPlugin($pluginName);\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(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "function registerMvcGenerator()\n {\n $this->app->singleton('command.kanok.mvc.generate', function ($app) {\n return $app[get_class(new GenerateMvcConsole())];\n });\n $this->commands('command.kanok.mvc.generate');\n\n $this->app->singleton('command.kanok.view.generate', function ($app) {\n return $app[get_class(new generateViewConsole())];\n });\n $this->commands('command.kanok.view.generate');\n }", "public function registerPlugin($plugin)\r\n {\r\n $this->_frontController->registerPlugin( new $plugin );\r\n }", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function testVendorPluginController()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin_three/ovens/index',\n 'params' => [\n 'plugin' => 'Company/TestPluginThree',\n 'controller' => 'Ovens',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->create($request);\n $this->assertInstanceOf(\n 'Company\\TestPluginThree\\Controller\\OvensController',\n $result\n );\n $this->assertSame($request, $result->getRequest());\n }", "function register()\n\t{\n\t\t$args=func_get_args();\n\t\t$path=$command=implode('/',$args);\n\t\t\n\t\t$parsed_uri=Dispatcher::ParseURI($path, PATH_APP.'shell/');\n\t\t\n\t\trequire_once($parsed_uri['root'].$parsed_uri['controller'].EXT);\n\n\t\t$classname=$parsed_uri['controller'].'Controller';\n\t\t$method=find_methods($classname, $parsed_uri['method'], 'index');\n\n\t\tif (!$method)\n\t\t\tthrow new Exception(\"Could not find '$command'.\");\n\n\t\t$this->_register($command,$classname,$method);\n\t}", "public function testPrefixedPluginController()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin/admin/comments',\n 'params' => [\n 'prefix' => 'Admin',\n 'plugin' => 'TestPlugin',\n 'controller' => 'Comments',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->create($request);\n $this->assertInstanceOf(\n 'TestPlugin\\Controller\\Admin\\CommentsController',\n $result\n );\n $this->assertSame($request, $result->getRequest());\n }", "function add_plugin($plugin)\n {\n }", "public function testPluginController()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin/test_plugin/index',\n 'params' => [\n 'plugin' => 'TestPlugin',\n 'controller' => 'TestPlugin',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->create($request);\n $this->assertInstanceOf(\n 'TestPlugin\\Controller\\TestPluginController',\n $result\n );\n $this->assertSame($request, $result->getRequest());\n }", "protected function autoRegisterController()\n {\n $controllerInfo = $this->getController();\n if ($controllerInfo) {\n $uri = WingedLib::clearPath(static::$parentUri);\n $baseUri = '';\n if (!$uri) {\n $baseUri = './';\n } else {\n $uri = explode('/', $uri);\n if (isset($uri[0])) {\n $baseUri = './' . $uri[0] . '/';\n }\n if (isset($uri[1])) {\n $baseUri .= $uri[1] . '/';\n } else {\n $baseUri .= 'index/';\n }\n }\n if (!empty($controllerInfo['params'])) {\n foreach ($controllerInfo['params'] as $paramName => $optional) {\n if ($optional) {\n $baseUri .= '{$' . $paramName . '?}/';\n } else {\n $baseUri .= '{$' . $paramName . '}/';\n }\n }\n }\n Route::raw($baseUri, static::$controllerName . '@' . static::$controllerAction)->addResponseMiddleware(new ResponseMiddleware(function ($response) {\n if (is_array($response)) {\n /**\n * @var $this ResponseMiddleware\n */\n $self = &$this;\n if ($self->getRoute()->request()->isAcceptableType('application/json')) {\n $self->getRoute()->forceJson();\n } else if ($self->getRoute()->request()->isAcceptableType('application/xml')) {\n $self->getRoute()->forceXml();\n } else if ($self->getRoute()->request()->isAcceptableType('application/yaml')) {\n $self->getRoute()->forceYaml();\n }\n }\n }));\n }\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }" ]
[ "0.78329444", "0.6900601", "0.6787467", "0.66222024", "0.65172076", "0.64939135", "0.6118159", "0.6013958", "0.5815318", "0.5790535", "0.5755703", "0.575211", "0.5733365", "0.555956", "0.5492085", "0.5472344", "0.54674333", "0.5437414", "0.54080695", "0.53618747", "0.53323436", "0.53249025", "0.53005356", "0.5289333", "0.52371943", "0.5233895", "0.5194628", "0.5191662", "0.51868457", "0.5179604" ]
0.8575514
0
Register the make:plugin:middleware command.
private function registerMiddlewareMakeCommand() { $this->app->bindShared('command.make.plugin.middleware', function ($app) { return new MiddlewareMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.middleware'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function registerJWTCommand()\n {\n $this->app->singleton('tymon.jwt.generate', function () {\n return new JWTGenerateCommand();\n });\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "abstract public function register_plugin();", "public static function register() {\n\t\t$plugin = new self();\n\n\t\tadd_action( 'network_admin_menu', [ $plugin, 'add_network_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'modify_admin_menu' ] );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\tadd_action( 'load-comment.php', [ $plugin, 'manage_comments_page_access' ] );\n\t\tadd_action( 'load-edit-comments.php', [ $plugin, 'manage_comments_page_access' ] );\n\n\t\t// Enable when we need redirects.\n\t\t//add_action( 'admin_init', [ $plugin, 'download_redirects' ] );\n\n\t}", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "protected function registerMiddleware()\n {\n \\Route::middleware('hsign', ApiSign::class);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "protected function registerMiddlewares()\n {\n if (!$this->app['config']->get('laratrust.middleware.register')) {\n return;\n }\n\n $router = $this->app['router'];\n\n if (method_exists($router, 'middleware')) {\n $registerMethod = 'middleware';\n } elseif (method_exists($router, 'aliasMiddleware')) {\n $registerMethod = 'aliasMiddleware';\n } else {\n return;\n }\n\n $middlewares = [\n 'role' => \\Laratrust\\Middleware\\LaratrustRole::class,\n 'permission' => \\Laratrust\\Middleware\\LaratrustPermission::class,\n 'ability' => \\Laratrust\\Middleware\\LaratrustAbility::class,\n ];\n\n foreach ($middlewares as $key => $class) {\n $router->$registerMethod($key, $class);\n }\n }", "function activate_plugin() {\n\t$logger = get_logger();\n\t$logger->activate();\n\n\t/**\n\t * Trigger custom capabilities required by the plugin to be registered.\n\t */\n\tdo_action( 'mcavoy_register_caps' );\n}", "protected function registerOptimizeCommand()\n {\n $this->app->singleton('command.module.optimize', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleOptimizeCommand();\n });\n\n $this->commands('command.module.optimize');\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function bootPlugin();", "protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }", "public function push_middleware(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Interfaces\\Registration_Middleware $middleware) : self\n {\n $this->middleware[\\get_class($middleware)] = $middleware;\n return $this;\n }" ]
[ "0.73462117", "0.6632823", "0.6387804", "0.6326368", "0.59073246", "0.58112484", "0.57462496", "0.559114", "0.5567726", "0.555221", "0.54680836", "0.5444103", "0.5416243", "0.52793056", "0.5221422", "0.52193135", "0.52080923", "0.52020794", "0.5184098", "0.51814663", "0.5170027", "0.5119864", "0.51192236", "0.50599986", "0.5051772", "0.5010487", "0.49570444", "0.4956691", "0.49516988", "0.49454284" ]
0.8431433
0
Register the make:plugin:model command.
private function registerModelMakeCommand() { $this->app->bindShared('command.make.plugin.model', function ($app) { return new ModelMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.model'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "public function generate() {\n\t\t$args = $this->args;\n\t\t$this->args = array_map('strtolower', $this->args);\n\t\t$modelAlias = ucfirst($args[0]);\n\t\t$pluginName = ucfirst($this->args[1]);\n\t\t$modelId = isset($args[2]) ? $args[2] : null;\n\t\t$len = isset($args[3]) ? $args[3] : null;\n\t\t$extensions = $this->_CroogoPlugin->getPlugins();\n\t\t$active = CakePlugin::loaded($pluginName);\n\n\t\tif (!empty($pluginName) && !in_array($pluginName, $extensions) && !$active) {\n\t\t\t$this->err(__('plugin \"%s\" not found.', $pluginName));\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($len)) {\n\t\t\t$len = 5;\n\t\t}\n\n\t\t$options = array();\n\t\tif (!empty($modelId)) {\n\t\t\t$options = Set::merge($options, array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t$modelAlias.'.id' => $modelId\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\n\t\t$Model = ClassRegistry::init($pluginName.'.'.$modelAlias);\n\t\t$Model->recursive = -1;\n\t\t$results = $Model->find('all', $options);\n\t\tforeach ($results as $result) {\n\t\t\t$Model->id = $result[$modelAlias]['id'];\n\t\t\tif (!empty($modelId)) {\n\t\t\t\t$foreignKey = $modelId;\n\t\t\t} else {\n\t\t\t\t$foreignKey = $Model->id;\n\t\t\t}\n\t\t\t$token = $this->Token->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Token.model' => $modelAlias,\n\t\t\t\t\t'Token.foreign_key' => $foreignKey,\n\t\t\t\t)\n\t\t\t));\n\t\t\tif (empty($token)) {\n\t\t\t\t$Model->Behaviors->attach('Givrate.Tokenable');\n\t\t\t\t$token = $Model->Behaviors->Tokenable->__GenerateUniqid($len);\n\t\t\t\tif ($Model->Behaviors->Tokenable->__isValidToken($token)) {\n\t\t\t\t\tif ($Model->Behaviors->Tokenable->__saveToken($Model, $token)) {\n\t\t\t\t\t\t$this->out(sprintf(__('Successful generate token for model <success>%s</success> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->out(sprintf(__('Failed generate token for model <failed>%s</failed> id <bold>%d</bold>', $Model->alias, $Model->id)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->out(sprintf(__('Model <failed>%s</failed> id <bold>%d</bold> already have token', $Model->alias, $Model->id)));\n\t\t\t}\n\t\t}\n\t}", "public function register()\n {\n// $this->app->extend('command.model.make', function ($command, $app) {\n// return new ModelMakeCommand($app['files']);\n// });\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }", "public function register()\n {\n $this->app->singleton('command.make.models', function ($app) {\n return $app['Iber\\Generator\\Commands\\MakeModelsCommand'];\n });\n\n $this->commands('command.make.models');\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "public function register(): void\n\t{\n\t\t$this->commands(ModelFillCommand::class);\n\t}", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "abstract public function register_plugin();", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "function createPlugin($name, $type = 'plugin', $args = '')\n\t{\n\t\t$nameSlug = Str::slug($name);\n\t\tif ($nameSlug !== $name) {\n\t\t\t$answer = \\cli\\choose(\"Is it OK to name your plugin \\\"{$nameSlug}\\\" instead\", \"yn\", \"y\");\n\t\t\tif ('y' !== $answer) {\n\t\t\t\t\\cli\\out(\"%1OK, that's fine. But you have to name your plugin something else.%n\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\t$name = $nameSlug;\n\n\t\t$workbench = $this->path(\"/workbench/{$type}s\");\n\n\t\t// make sure we have a propert workbench path setup\n\t\tif (!$this->files->exists($workbench)) {\n\t\t\t$this->files->makeDirectory($workbench);\n\t\t}\n\n\t\t$output_path = $workbench.\"/{$name}\";\n\t\tif (file_exists($output_path)) {\n\t\t\t\\cli\\out(\"%1Whoops! There's already a plugin in {$output_path}!%n\\n\");\n\t\t\texit(2);\n\t\t}\n\n\t\t$this->files->copyDirectory($this->path(\"/lib/stubs/{$type}\"), $output_path);\n\t\t$this->files->deleteDirectory($output_path.'/stubs');\n\n\t\t$tokens = [];\n\n\t\t// make sure we have a stub to work with\n\t\ttry {\n\t\t\t$plugin = static::getStub('/lib/stubs/plugin/stubs/plugin');\n\t\t\t$bootstrap = static::getStub('/lib/stubs/plugin/stubs/bootstrap');\n\t\t\t$composer = static::getStub('/lib/stubs/plugin/stubs/composer');\n\t\t\t$customPostType = static::getStub('/lib/stubs/plugin/stubs/example-custom-post-type');\n\t\t\t$customTaxonomy = static::getStub('/lib/stubs/plugin/stubs/example-custom-taxonomy');\n\t\t\t$autoload = static::getStub('/lib/stubs/plugin/stubs/autoload');\n\t\t} catch (\\Exception $e) {\n\t\t\t\\cli\\out(\"%1\".$e->getMessage().\"%n\\n\");\n\t\t\texit(4);\n\t\t}\n\n\t\t$tokens['@@PLUGIN_SLUG@@'] = $name;\n\n\t\t$tokens['@@PLUGIN_NAME@@'] = \\cli\\prompt(\"What do you want to call your plugin?\", \"My Plugin\");\n\t\t$tokens['@@PLUGIN_DESCRIPTION@@'] = \\cli\\prompt(\"What will this plugin do? Be succinct.\", \"Do something amazing.\");\n\n\t\t$tokens['@@PLUGIN_LICENSE@@'] = \\cli\\prompt(\"What should the plugin license be?\", \"GPL2\");\n\t\t$tokens['@@PLUGIN_LICENSE_URI@@'] = \\cli\\prompt(\"At what URL can more information about the license be found?\", \n\t\t\t\"https://www.gnu.org/licenses/gpl-2.0.html\");\n\n\t\t$tokens['@@PLUGIN_CLASS_NAME@@'] = Str::studly($tokens['@@PLUGIN_NAME@@']);\n\t\t$tokens['@@PLUGIN_VAR_NAME@@'] = '_' . Str::slug($name, '_');\n\n\t\t$tokens['@@PLUGIN_VERSION@@'] = \\cli\\prompt(\"What should the base version be?\", \"1.0.0\");\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR@@'] = \\cli\\prompt(\"Who is the author of this plugin?\", get_current_user());\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR_URI@@'] = \\cli\\prompt(\"What is the URL of the author's homepage?\", \n\t\t\t\"https://github.com/\" . Str::slug($tokens['@@PLUGIN_AUTHOR@@']));\n\t\t\n\t\t$tokens['@@PLUGIN_URI@@'] = \\cli\\prompt(\"What is the URL of this project's homepage?\", \n\t\t\t rtrim($tokens['@@PLUGIN_AUTHOR_URI@@'], '/') . '/' . $name);\n\n\t\t$tokens['@@PLUGIN_NAMESPACE@@'] = \\cli\\prompt(\"What should the PHP namespace be for your plugin?\", \n\t\t\t\tStr::studly($tokens['@@PLUGIN_AUTHOR@@']) . '\\\\' . Str::studly($name));\n\n\t\t$tokens['@@PLUGIN_TEXT_DOMAIN@@'] = \\cli\\prompt(\"What is this plugin's text domain?\", Str::slug($tokens['@@PLUGIN_NAME@@']));\n\n\t\t$tokens['@@PLUGIN_DOMAIN_PATH@@'] = \\cli\\prompt(\"Where will this plugin's translation files be stored?\", \"/resources/lang\");\n\n\t\t$tokens['@@COMPOSER_NAME@@'] = \\cli\\prompt(\"What should the Composer project name be?\", \n\t\t\t\tStr::slug($tokens['@@PLUGIN_AUTHOR@@']) . '/' . $name);\n\n\t\t$plugin_file = $output_path.'/src/plugin.php';\n\t\t$bootstrap_file = $output_path.'/bootstrap.php';\n\t\t$composer_file = $output_path.'/composer.json';\n\t\t$autoload_file = $output_path.'/vendor/autoload.php';\n\t\t\n\t\t$this->files->put($bootstrap_file, str_replace(array_keys($tokens), array_values($tokens), $bootstrap));\n\t\t$this->files->put($plugin_file, str_replace(array_keys($tokens), array_values($tokens), $plugin));\n\t\t$this->files->put($composer_file, str_replace(array_keys($tokens), array_values($tokens), $composer));\n\t\t$this->files->put($autoload_file, str_replace(array_keys($tokens), array_values($tokens), $autoload));\n\t\t\n\t\t$examples = \\cli\\choose(\"Should we generate sample custom post types and taxonomies\", \"yn\", \"y\");\n\n\t\t$result = [\n\t\t\t'tokens' => $tokens,\n\t\t\t'files' => [ \n\t\t\t\t'bootstrap' => $bootstrap_file, \n\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t'composer' => $composer_file,\n\t\t\t\t'autoload' => $autoload_file,\n\t\t\t]\n\t\t];\n\n\t\tif ('y' === $examples) {\n\t\t\t$person_file = $output_path.'/src/Models/Person.php';\n\t\t\t$department_file = $output_path.'/src/Models/Department.php';\n\n\t\t\t$this->files->put($person_file, str_replace(array_keys($tokens), array_values($tokens), $customPostType));\n\t\t\t$this->files->put($department_file, str_replace(array_keys($tokens), array_values($tokens), $customTaxonomy));\n\n\t\t\t$result['files']['person'] = $person_file;\n\t\t\t$result['files']['department'] = $department_file;\n\t\t}\n\n\t\t$process = $this->studio(\"load \".$this->path(\"/workbench/{$type}s/{$name}\"));\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(8);\n\t\t}\n\n\n\t\t\\cli\\out(\"Loading your new plugin into your workbench with Composer...\\n\");\n\t\t$process = $this->composer(\"require {$tokens['@@COMPOSER_NAME@@']}:\\\"dev-master\\\"\");\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(16);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function handle()\n {\n foreach ($this->types as $key => $type) {\n $this->types[$key] = $this->confirm(\"Would you like to generate {$key}?\", true);\n }\n\n if (!$this->option('api')) {\n $this->types['views'] = $this->confirm('Would you like to generate views?', true);\n $this->types['resource'] = false;\n }\n\n if ($this->option('api')) {\n $this->types['views'] = false;\n $this->types['resource'] = $this->confirm('Would you like to generate resource?', true);\n }\n\n if ($this->confirm('Would you like to describe model fields?', true)) {\n while ($field = $this->describeFieldDialog()) {\n $more = $field['more'];\n unset($field['more']);\n $this->fields[] = $field;\n if (!$more) {\n break;\n }\n }\n }\n\n $name = $this->argument('name');\n if (!empty($this->fields)) {\n file_put_contents(storage_path(\"{$name}_fields.json\"), json_encode($this->fields));\n }\n\n if ($this->types['model']) {\n $this->createModel();\n }\n if ($this->types['request']) {\n $this->createRequest();\n }\n if ($this->types['controller']) {\n $this->createController();\n }\n if ($this->types['migration']) {\n $this->createMigration();\n }\n if ($this->types['factory']) {\n $this->createFactory();\n }\n if ($this->types['seeder']) {\n $this->createSeeder();\n }\n if ($this->types['views']) {\n $this->createViews();\n }\n if ($this->types['resource']) {\n $this->createResource();\n }\n\n unlink(storage_path(\"{$name}_fields.json\"));\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "public function registerCommands(Application $application)\r\n {\r\n $command = new GenerateModelCommand();\r\n $command->setContainer($this->container);\r\n $application->add($command);\r\n }" ]
[ "0.7765329", "0.7159537", "0.6972451", "0.68378204", "0.6729008", "0.6405262", "0.60888517", "0.6021836", "0.59225446", "0.56860614", "0.5628", "0.56203395", "0.55451566", "0.5471991", "0.53176624", "0.5265691", "0.526561", "0.5255689", "0.5227284", "0.5221629", "0.5220121", "0.5219385", "0.5208435", "0.52002275", "0.51786405", "0.51713234", "0.5164029", "0.51223767", "0.50894237", "0.5079199" ]
0.8615172
0
Register the make:plugin:policy command.
private function registerPolicyMakeCommand() { $this->app->bindShared('command.make.plugin.policy', function ($app) { return new PolicyMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.policy'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "public static function add($plugin_name, $policy_text)\n {\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerMakeConditionCommand()\n {\n $this->app->singleton('command.acl.make.condition', function ($app) {\n return $app[MakeConditionCommand::class];\n });\n\n $this->commands('command.acl.make.condition');\n }", "abstract public function register_plugin();", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "function createPlugin($name, $type = 'plugin', $args = '')\n\t{\n\t\t$nameSlug = Str::slug($name);\n\t\tif ($nameSlug !== $name) {\n\t\t\t$answer = \\cli\\choose(\"Is it OK to name your plugin \\\"{$nameSlug}\\\" instead\", \"yn\", \"y\");\n\t\t\tif ('y' !== $answer) {\n\t\t\t\t\\cli\\out(\"%1OK, that's fine. But you have to name your plugin something else.%n\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\t$name = $nameSlug;\n\n\t\t$workbench = $this->path(\"/workbench/{$type}s\");\n\n\t\t// make sure we have a propert workbench path setup\n\t\tif (!$this->files->exists($workbench)) {\n\t\t\t$this->files->makeDirectory($workbench);\n\t\t}\n\n\t\t$output_path = $workbench.\"/{$name}\";\n\t\tif (file_exists($output_path)) {\n\t\t\t\\cli\\out(\"%1Whoops! There's already a plugin in {$output_path}!%n\\n\");\n\t\t\texit(2);\n\t\t}\n\n\t\t$this->files->copyDirectory($this->path(\"/lib/stubs/{$type}\"), $output_path);\n\t\t$this->files->deleteDirectory($output_path.'/stubs');\n\n\t\t$tokens = [];\n\n\t\t// make sure we have a stub to work with\n\t\ttry {\n\t\t\t$plugin = static::getStub('/lib/stubs/plugin/stubs/plugin');\n\t\t\t$bootstrap = static::getStub('/lib/stubs/plugin/stubs/bootstrap');\n\t\t\t$composer = static::getStub('/lib/stubs/plugin/stubs/composer');\n\t\t\t$customPostType = static::getStub('/lib/stubs/plugin/stubs/example-custom-post-type');\n\t\t\t$customTaxonomy = static::getStub('/lib/stubs/plugin/stubs/example-custom-taxonomy');\n\t\t\t$autoload = static::getStub('/lib/stubs/plugin/stubs/autoload');\n\t\t} catch (\\Exception $e) {\n\t\t\t\\cli\\out(\"%1\".$e->getMessage().\"%n\\n\");\n\t\t\texit(4);\n\t\t}\n\n\t\t$tokens['@@PLUGIN_SLUG@@'] = $name;\n\n\t\t$tokens['@@PLUGIN_NAME@@'] = \\cli\\prompt(\"What do you want to call your plugin?\", \"My Plugin\");\n\t\t$tokens['@@PLUGIN_DESCRIPTION@@'] = \\cli\\prompt(\"What will this plugin do? Be succinct.\", \"Do something amazing.\");\n\n\t\t$tokens['@@PLUGIN_LICENSE@@'] = \\cli\\prompt(\"What should the plugin license be?\", \"GPL2\");\n\t\t$tokens['@@PLUGIN_LICENSE_URI@@'] = \\cli\\prompt(\"At what URL can more information about the license be found?\", \n\t\t\t\"https://www.gnu.org/licenses/gpl-2.0.html\");\n\n\t\t$tokens['@@PLUGIN_CLASS_NAME@@'] = Str::studly($tokens['@@PLUGIN_NAME@@']);\n\t\t$tokens['@@PLUGIN_VAR_NAME@@'] = '_' . Str::slug($name, '_');\n\n\t\t$tokens['@@PLUGIN_VERSION@@'] = \\cli\\prompt(\"What should the base version be?\", \"1.0.0\");\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR@@'] = \\cli\\prompt(\"Who is the author of this plugin?\", get_current_user());\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR_URI@@'] = \\cli\\prompt(\"What is the URL of the author's homepage?\", \n\t\t\t\"https://github.com/\" . Str::slug($tokens['@@PLUGIN_AUTHOR@@']));\n\t\t\n\t\t$tokens['@@PLUGIN_URI@@'] = \\cli\\prompt(\"What is the URL of this project's homepage?\", \n\t\t\t rtrim($tokens['@@PLUGIN_AUTHOR_URI@@'], '/') . '/' . $name);\n\n\t\t$tokens['@@PLUGIN_NAMESPACE@@'] = \\cli\\prompt(\"What should the PHP namespace be for your plugin?\", \n\t\t\t\tStr::studly($tokens['@@PLUGIN_AUTHOR@@']) . '\\\\' . Str::studly($name));\n\n\t\t$tokens['@@PLUGIN_TEXT_DOMAIN@@'] = \\cli\\prompt(\"What is this plugin's text domain?\", Str::slug($tokens['@@PLUGIN_NAME@@']));\n\n\t\t$tokens['@@PLUGIN_DOMAIN_PATH@@'] = \\cli\\prompt(\"Where will this plugin's translation files be stored?\", \"/resources/lang\");\n\n\t\t$tokens['@@COMPOSER_NAME@@'] = \\cli\\prompt(\"What should the Composer project name be?\", \n\t\t\t\tStr::slug($tokens['@@PLUGIN_AUTHOR@@']) . '/' . $name);\n\n\t\t$plugin_file = $output_path.'/src/plugin.php';\n\t\t$bootstrap_file = $output_path.'/bootstrap.php';\n\t\t$composer_file = $output_path.'/composer.json';\n\t\t$autoload_file = $output_path.'/vendor/autoload.php';\n\t\t\n\t\t$this->files->put($bootstrap_file, str_replace(array_keys($tokens), array_values($tokens), $bootstrap));\n\t\t$this->files->put($plugin_file, str_replace(array_keys($tokens), array_values($tokens), $plugin));\n\t\t$this->files->put($composer_file, str_replace(array_keys($tokens), array_values($tokens), $composer));\n\t\t$this->files->put($autoload_file, str_replace(array_keys($tokens), array_values($tokens), $autoload));\n\t\t\n\t\t$examples = \\cli\\choose(\"Should we generate sample custom post types and taxonomies\", \"yn\", \"y\");\n\n\t\t$result = [\n\t\t\t'tokens' => $tokens,\n\t\t\t'files' => [ \n\t\t\t\t'bootstrap' => $bootstrap_file, \n\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t'composer' => $composer_file,\n\t\t\t\t'autoload' => $autoload_file,\n\t\t\t]\n\t\t];\n\n\t\tif ('y' === $examples) {\n\t\t\t$person_file = $output_path.'/src/Models/Person.php';\n\t\t\t$department_file = $output_path.'/src/Models/Department.php';\n\n\t\t\t$this->files->put($person_file, str_replace(array_keys($tokens), array_values($tokens), $customPostType));\n\t\t\t$this->files->put($department_file, str_replace(array_keys($tokens), array_values($tokens), $customTaxonomy));\n\n\t\t\t$result['files']['person'] = $person_file;\n\t\t\t$result['files']['department'] = $department_file;\n\t\t}\n\n\t\t$process = $this->studio(\"load \".$this->path(\"/workbench/{$type}s/{$name}\"));\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(8);\n\t\t}\n\n\n\t\t\\cli\\out(\"Loading your new plugin into your workbench with Composer...\\n\");\n\t\t$process = $this->composer(\"require {$tokens['@@COMPOSER_NAME@@']}:\\\"dev-master\\\"\");\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(16);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function activate_plugin() {\n\t$logger = get_logger();\n\t$logger->activate();\n\n\t/**\n\t * Trigger custom capabilities required by the plugin to be registered.\n\t */\n\tdo_action( 'mcavoy_register_caps' );\n}", "protected function registerJWTCommand()\n {\n $this->app->singleton('tymon.jwt.generate', function () {\n return new JWTGenerateCommand();\n });\n }", "function wp_add_privacy_policy_content($plugin_name, $policy_text)\n {\n }", "function add_plugin($plugin)\n {\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "private function registerWhitelistCommand()\n {\n $this->app->singleton('firewall.whitelist.command', function () {\n return new WhitelistCommand();\n });\n\n $this->commands('firewall.whitelist.command');\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "public function register()\n {\n Permission::register('plugins', 'plugin', [\n 'change_status',\n 'list',\n 'view_settings',\n ]);\n }", "private function registerPolicies()\n {\n foreach ($this->policies as $key => $value) {\n Gate::policy($key, $value);\n }\n }", "public function add_plugin_page()\n {\n add_management_page('Cron Schedules', 'Cron Schedules', 'manage_options', 'cron-schedule', array($this, 'create_page'));\n }", "public static function register() {\n\t\t$plugin = new self();\n\n\t\tadd_action( 'network_admin_menu', [ $plugin, 'add_network_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'modify_admin_menu' ] );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\tadd_action( 'load-comment.php', [ $plugin, 'manage_comments_page_access' ] );\n\t\tadd_action( 'load-edit-comments.php', [ $plugin, 'manage_comments_page_access' ] );\n\n\t\t// Enable when we need redirects.\n\t\t//add_action( 'admin_init', [ $plugin, 'download_redirects' ] );\n\n\t}", "public function registerPolicies()\n {\n foreach ($this->policies as $key => $value) {\n Gate::policy($key, $value);\n }\n }", "public function registerPolicies()\n {\n foreach ($this->policies as $key => $value) {\n Gate::policy($key, $value);\n }\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }" ]
[ "0.7221918", "0.62786114", "0.61724883", "0.59574956", "0.57645845", "0.5733436", "0.5501701", "0.54612267", "0.544549", "0.5328515", "0.5265876", "0.5188003", "0.5177328", "0.5149771", "0.5112402", "0.50648767", "0.50355166", "0.50232893", "0.50119376", "0.49126863", "0.49009094", "0.48666662", "0.48415294", "0.48375362", "0.48129857", "0.47950977", "0.47782183", "0.47334394", "0.47334394", "0.47126746" ]
0.854931
0
Register the make:plugin:migration command.
private function registerMigrationMakeCommand() { $this->app->bindShared('command.make.plugin.migration', function ($app) { return new MigrationMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.migration'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "protected function registerMigrateCommand()\n {\n $this->app->singleton('command.module.migrate', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateCommand($app['migrator'], $app['modules']);\n });\n\n $this->commands('command.module.migrate');\n }", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "private function registerSeederMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.seeder', function ($app)\n {\n return new SeederMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.seeder');\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function registerMigrator()\n {\n // Provides hook to send SQL DDL changes through pt-online-schema-change in CLI\n $this->app->singleton('migrator', function ($app) {\n return new OnlineMigrator($app['migration.repository'], $app['db'], $app['files']);\n });\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "protected function createMigration()\n {\n $name = $this->argument('name');\n\n $this->call('wizard:migration', [\n 'name' => $name,\n ]);\n }", "protected function createMigration()\n {\n $migrationsOptions = [\n 'migrationName' => 'create_' . Str::plural(strtolower($this->info['modelName'])) . '_table',\n 'module' => $this->info['moduleName'],\n ];\n\n if ($this->optionHasValue('index')) {\n $migrationsOptions['--index'] = $this->option('index');\n }\n\n if ($this->optionHasValue('unique')) {\n $migrationsOptions['--unique'] = $this->option('unique');\n }\n\n if ($this->optionHasValue('data')) {\n $migrationsOptions['--data'] = $this->option('data');\n }\n\n if ($this->optionHasValue('uploads')) {\n $migrationsOptions['--uploads'] = $this->option('uploads');\n }\n\n if ($this->optionHasValue('int')) {\n $migrationsOptions['--int'] = $this->option('int');\n }\n\n if ($this->optionHasValue('bool')) {\n $migrationsOptions['--bool'] = $this->option('bool');\n }\n\n if ($this->optionHasValue('float')) {\n $migrationsOptions['--float'] = $this->option('float');\n }\n if ($this->optionHasValue('table')) {\n $migrationsOptions['--table'] = $this->option('table');\n }\n\n if (isset($this->info['parent'])) {\n $migrationsOptions['--parent'] = $this->info['parent'];\n }\n\n Artisan::call('engez:migration', $migrationsOptions);\n }", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }", "protected function registerMigrateResetCommand()\n {\n $this->app->singleton('command.module.migrate.reset', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateResetCommand($app['modules'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.module.migrate.reset');\n }", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "protected function registerMigrateRollbackCommand()\n {\n $this->app->singleton('command.module.migrate.rollback', function ($app) {\n $repository = $app['migration.repository'];\n $table = $app['config']['database.migrations'];\n\n $migrator = new Migrator($table, $repository, $app['db'], $app['files']);\n\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRollbackCommand($migrator, $app['modules']);\n });\n\n $this->commands('command.module.migrate.rollback');\n }", "protected function registerMigrateRefreshCommand()\n {\n $this->app->singleton('command.module.migrate.refresh', function () {\n return new \\Pw\\Core\\Console\\Commands\\ModuleMigrateRefreshCommand();\n });\n\n $this->commands('command.module.migrate.refresh');\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "protected function createMigration()\n {\n $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));\n\n if ($this->option('pivot')) {\n $table = Str::singular($table);\n }\n try {\n\n $this->call('make:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n ]);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }" ]
[ "0.7793832", "0.74271923", "0.72385716", "0.6867094", "0.68547684", "0.67563903", "0.6738536", "0.65372026", "0.6511113", "0.64993566", "0.6401827", "0.6300279", "0.6260723", "0.6160273", "0.6126194", "0.610806", "0.5975447", "0.57966053", "0.5785827", "0.5733558", "0.5709871", "0.56936806", "0.5689495", "0.56664324", "0.56325775", "0.55901945", "0.55886763", "0.5573685", "0.55546385", "0.554854" ]
0.8441781
0
Register the make:plugin:seeder command.
private function registerSeederMakeCommand() { $this->app->bindShared('command.make.plugin.seeder', function ($app) { return new SeederMakeCommand($app['files'], $app['plugins']); }); $this->commands('command.make.plugin.seeder'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "protected function registerSeedCommand()\n {\n $this->app->singleton('command.module.seed', function ($app) {\n return new \\Pw\\Core\\Console\\Commands\\ModuleSeedCommand($app['modules']);\n });\n\n $this->commands('command.module.seed');\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "private function registerModelMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.model', function ($app)\n {\n return new ModelMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.model');\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "protected function registerPluginMigrateResetCommand()\n {\n $this->app->singleton('command.plugin.migrate.reset', function ($app) {\n return new PluginMigrateResetCommand($app['plugins'], $app['files'], $app['migrator']);\n });\n\n $this->commands('command.plugin.migrate.reset');\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }", "protected function createSeeder()\n {\n $this->call('wizard:seeder', [\n 'name' => $this->argument('name'),\n ]);\n }", "protected function createSeeder()\n {\n $seeder = Str::studly(class_basename($this->argument('name')));\n\n $this->call(SeederMakeCommand::class, [\n 'name' => \"{$seeder}Seeder\",\n ]);\n }", "function createPlugin($name, $type = 'plugin', $args = '')\n\t{\n\t\t$nameSlug = Str::slug($name);\n\t\tif ($nameSlug !== $name) {\n\t\t\t$answer = \\cli\\choose(\"Is it OK to name your plugin \\\"{$nameSlug}\\\" instead\", \"yn\", \"y\");\n\t\t\tif ('y' !== $answer) {\n\t\t\t\t\\cli\\out(\"%1OK, that's fine. But you have to name your plugin something else.%n\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\t$name = $nameSlug;\n\n\t\t$workbench = $this->path(\"/workbench/{$type}s\");\n\n\t\t// make sure we have a propert workbench path setup\n\t\tif (!$this->files->exists($workbench)) {\n\t\t\t$this->files->makeDirectory($workbench);\n\t\t}\n\n\t\t$output_path = $workbench.\"/{$name}\";\n\t\tif (file_exists($output_path)) {\n\t\t\t\\cli\\out(\"%1Whoops! There's already a plugin in {$output_path}!%n\\n\");\n\t\t\texit(2);\n\t\t}\n\n\t\t$this->files->copyDirectory($this->path(\"/lib/stubs/{$type}\"), $output_path);\n\t\t$this->files->deleteDirectory($output_path.'/stubs');\n\n\t\t$tokens = [];\n\n\t\t// make sure we have a stub to work with\n\t\ttry {\n\t\t\t$plugin = static::getStub('/lib/stubs/plugin/stubs/plugin');\n\t\t\t$bootstrap = static::getStub('/lib/stubs/plugin/stubs/bootstrap');\n\t\t\t$composer = static::getStub('/lib/stubs/plugin/stubs/composer');\n\t\t\t$customPostType = static::getStub('/lib/stubs/plugin/stubs/example-custom-post-type');\n\t\t\t$customTaxonomy = static::getStub('/lib/stubs/plugin/stubs/example-custom-taxonomy');\n\t\t\t$autoload = static::getStub('/lib/stubs/plugin/stubs/autoload');\n\t\t} catch (\\Exception $e) {\n\t\t\t\\cli\\out(\"%1\".$e->getMessage().\"%n\\n\");\n\t\t\texit(4);\n\t\t}\n\n\t\t$tokens['@@PLUGIN_SLUG@@'] = $name;\n\n\t\t$tokens['@@PLUGIN_NAME@@'] = \\cli\\prompt(\"What do you want to call your plugin?\", \"My Plugin\");\n\t\t$tokens['@@PLUGIN_DESCRIPTION@@'] = \\cli\\prompt(\"What will this plugin do? Be succinct.\", \"Do something amazing.\");\n\n\t\t$tokens['@@PLUGIN_LICENSE@@'] = \\cli\\prompt(\"What should the plugin license be?\", \"GPL2\");\n\t\t$tokens['@@PLUGIN_LICENSE_URI@@'] = \\cli\\prompt(\"At what URL can more information about the license be found?\", \n\t\t\t\"https://www.gnu.org/licenses/gpl-2.0.html\");\n\n\t\t$tokens['@@PLUGIN_CLASS_NAME@@'] = Str::studly($tokens['@@PLUGIN_NAME@@']);\n\t\t$tokens['@@PLUGIN_VAR_NAME@@'] = '_' . Str::slug($name, '_');\n\n\t\t$tokens['@@PLUGIN_VERSION@@'] = \\cli\\prompt(\"What should the base version be?\", \"1.0.0\");\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR@@'] = \\cli\\prompt(\"Who is the author of this plugin?\", get_current_user());\n\t\t\n\t\t$tokens['@@PLUGIN_AUTHOR_URI@@'] = \\cli\\prompt(\"What is the URL of the author's homepage?\", \n\t\t\t\"https://github.com/\" . Str::slug($tokens['@@PLUGIN_AUTHOR@@']));\n\t\t\n\t\t$tokens['@@PLUGIN_URI@@'] = \\cli\\prompt(\"What is the URL of this project's homepage?\", \n\t\t\t rtrim($tokens['@@PLUGIN_AUTHOR_URI@@'], '/') . '/' . $name);\n\n\t\t$tokens['@@PLUGIN_NAMESPACE@@'] = \\cli\\prompt(\"What should the PHP namespace be for your plugin?\", \n\t\t\t\tStr::studly($tokens['@@PLUGIN_AUTHOR@@']) . '\\\\' . Str::studly($name));\n\n\t\t$tokens['@@PLUGIN_TEXT_DOMAIN@@'] = \\cli\\prompt(\"What is this plugin's text domain?\", Str::slug($tokens['@@PLUGIN_NAME@@']));\n\n\t\t$tokens['@@PLUGIN_DOMAIN_PATH@@'] = \\cli\\prompt(\"Where will this plugin's translation files be stored?\", \"/resources/lang\");\n\n\t\t$tokens['@@COMPOSER_NAME@@'] = \\cli\\prompt(\"What should the Composer project name be?\", \n\t\t\t\tStr::slug($tokens['@@PLUGIN_AUTHOR@@']) . '/' . $name);\n\n\t\t$plugin_file = $output_path.'/src/plugin.php';\n\t\t$bootstrap_file = $output_path.'/bootstrap.php';\n\t\t$composer_file = $output_path.'/composer.json';\n\t\t$autoload_file = $output_path.'/vendor/autoload.php';\n\t\t\n\t\t$this->files->put($bootstrap_file, str_replace(array_keys($tokens), array_values($tokens), $bootstrap));\n\t\t$this->files->put($plugin_file, str_replace(array_keys($tokens), array_values($tokens), $plugin));\n\t\t$this->files->put($composer_file, str_replace(array_keys($tokens), array_values($tokens), $composer));\n\t\t$this->files->put($autoload_file, str_replace(array_keys($tokens), array_values($tokens), $autoload));\n\t\t\n\t\t$examples = \\cli\\choose(\"Should we generate sample custom post types and taxonomies\", \"yn\", \"y\");\n\n\t\t$result = [\n\t\t\t'tokens' => $tokens,\n\t\t\t'files' => [ \n\t\t\t\t'bootstrap' => $bootstrap_file, \n\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t'composer' => $composer_file,\n\t\t\t\t'autoload' => $autoload_file,\n\t\t\t]\n\t\t];\n\n\t\tif ('y' === $examples) {\n\t\t\t$person_file = $output_path.'/src/Models/Person.php';\n\t\t\t$department_file = $output_path.'/src/Models/Department.php';\n\n\t\t\t$this->files->put($person_file, str_replace(array_keys($tokens), array_values($tokens), $customPostType));\n\t\t\t$this->files->put($department_file, str_replace(array_keys($tokens), array_values($tokens), $customTaxonomy));\n\n\t\t\t$result['files']['person'] = $person_file;\n\t\t\t$result['files']['department'] = $department_file;\n\t\t}\n\n\t\t$process = $this->studio(\"load \".$this->path(\"/workbench/{$type}s/{$name}\"));\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(8);\n\t\t}\n\n\n\t\t\\cli\\out(\"Loading your new plugin into your workbench with Composer...\\n\");\n\t\t$process = $this->composer(\"require {$tokens['@@COMPOSER_NAME@@']}:\\\"dev-master\\\"\");\n\t\tif (!$process->isSuccessful()) {\n\t\t\texit(16);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function register()\n {\n $commands = array(\n 'PluginList',\n 'PluginMigrate',\n 'PluginMigrateRefresh',\n 'PluginMigrateReset',\n 'PluginMigrateRollback',\n 'PluginSeed',\n 'PluginMake',\n 'ControllerMake',\n 'MiddlewareMake',\n 'ModelMake',\n 'PolicyMake',\n 'MigrationMake',\n 'SeederMake',\n );\n\n foreach ($commands as $command) {\n $this->{'register' .$command .'Command'}();\n }\n }", "public function register()\n {\n foreach (array_keys($this->generators) as $command) {\n $class = \"Orchestra\\\\Studio\\\\Console\\\\{$command}Command\";\n $name = $this->generators[$command];\n\n $this->app->singleton($name, $class);\n }\n\n $this->commands(array_values($this->generators));\n }", "abstract public function register_plugin();", "protected function configure()\n {\n $this->setName('migrate:seedrun')\n ->setDescription('run seeder')\n ->setHelp(\"author ekajayanagara as miyuki nagara\\nstudent infomatic at darma persada\\n\\nUntuk membuat file controller\\njika kamu ingin membuat file controller dengan cepat\\n\\nphp nagara buat:migration\\n\\n\");\n // ->addArgument('seeder_name', InputArgument::REQUIRED, 'tuliskan nama seedernya bruh.');\n }", "public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function registerPluginListCommand()\n {\n $this->app->singleton('command.plugin.list', function ($app)\n {\n return new PluginListCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.list');\n }", "protected function registerPluginMigrateRollbackCommand()\n {\n $this->app->singleton('command.plugin.migrate.rollback', function ($app) {\n return new PluginMigrateRollbackCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.rollback');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "function islandora_internet_archive_bookreader_custom_drush_command() {\n $items = array();\n $items['islandora_bookreader_pdf_generator'] = array(\n 'callback' => 'islandora_internet_archive_bookreader_custom_pdf_generator_drush',\n 'description' => 'generates islandora PDF books',\n 'file' => 'includes/book_pdf_generator.inc',\n 'arguments' => array(\n 'pid' => \"The Fedora PID to process\",\n ),\n 'options' => array(),\n 'examples' => array(\n 'simple example' => 'drush -u 1 --root=/var/www/drupal -l http://localhost islandora_bookreader_pdf_generator islandora:1',\n ),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,\n );\n\n return $items;\n}", "public function register()\n {\n $this->commands(MakeCommand::class);\n }", "protected function configure()\n {\n $name = 'add-plugin';\n $desc = '<warning>Downloads</warning> a <info>YOURLS plugin</info> and add it to your <comment>`user/composer.json`</comment>';\n $def = [ new InputArgument('plugins', InputArgument::IS_ARRAY, 'YOURLS plugin(s) to download') ];\n $help = <<<EOT\nExample: <comment>`composer add-plugin ozh/example-plugin`</comment>\nThis command downloads plugins in the appropriate subfolder of <comment>user/plugins/</comment>, adds them to\nyour <comment>user/composer.json</comment> file, and updates dependencies.\nRead more at https://github.com/yourls/composer-installer/\n\nEOT;\n\n $this->setName($name)\n ->setDescription($desc)\n ->setDefinition($def)\n ->setHelp($help);\n }", "protected function registerPluginMigrateRefreshCommand()\n {\n $this->app->singleton('command.plugin.migrate.refresh', function ($app) {\n return new PluginMigrateRefreshCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.migrate.refresh');\n }" ]
[ "0.7802551", "0.72753453", "0.66647184", "0.6577703", "0.6158316", "0.60649633", "0.6023677", "0.60074425", "0.59345514", "0.5910208", "0.58800983", "0.58622617", "0.57192564", "0.56668043", "0.5628035", "0.5626696", "0.53846663", "0.53590965", "0.5322104", "0.526473", "0.51887053", "0.5173394", "0.51701057", "0.5170091", "0.5123315", "0.51065254", "0.5093756", "0.5092523", "0.5066389", "0.5053472" ]
0.80252
0
Define a new activity type.
public function defineType($name, $activity = []) { $this->SQL->replace('ActivityType', $activity, ['Name' => $name], true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'قطع غيار جديدة',\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'قطع غيار تشليح'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'إطارات'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'العناية بالسيارات'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'زيوت'\n \n ]);\n }", "public function __construct($activity_id, $type)\n {\n $this->activity = GuardianEarth::findOrFail($activity_id);\n\n $this->type = $type;\n }", "public function addNewActivityType(\n $options\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //prepare parameters\n $_parameters = array (\n 'name' => $this->val($options, 'name'),\n 'icon_key' => APIHelper::prepareFormFields($this->val($options, 'iconKey')),\n 'color' => $this->val($options, 'color')\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::post($_queryUrl, $_headers, Request\\Body::Form($_parameters));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function registerActivity() {\n }", "public function addType($type);", "public function __construct($type) {\n $this->type = $type;\n }", "private function createActivity($type, $fromUser, $playlistId, $songId) {\n\trequire_once CLASSES_DIR . 'activity.class.php';\n\t$activity = new Activity();\n\t$activity->setActive(true);\n\t$activity->setAlbum(null);\n\t$activity->setComment(null);\n\t$activity->setCounter(0);\n\t$activity->setEvent(null);\n\t$activity->setFromUser($fromUser);\n\t$activity->setImage(null);\n\t$activity->setPlaylist($playlistId);\n\t$activity->setQuestion(null);\n\t$activity->setRead(true);\n\t$activity->setRecord(null);\n\t$activity->setSong($songId);\n\t$activity->setStatus('A');\n\t$activity->setToUser(null);\n\t$activity->setType($type);\n\t$activity->setVideo(null);\n\treturn $activity;\n }", "function AddEventActivityType($activity_type)\n\t{\n\t\tif (empty($this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$activity_type = trim($activity_type);\n\t\tif (empty($activity_type)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$activity = $this->GetEventActivityType();\n\t\tif (!is_array($activity)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (array_search($activity_type, $activity)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$activity[] = $activity_type;\n\t\treturn $this->SetEventActivityType($activity);\n\t}", "public function create()\n {\n $type = TypeActivity::all();\n return view('activities.create', ['types' => $type]);\n }", "public function setType($type) {}", "public function make($type);", "public function store(CreateActivityTypeRequest $request)\n {\n $input = $request->all();\n $input['created_by'] = getLoggedInUserId();\n\n $this->activityTypeRepository->create($input);\n\n return $this->sendSuccess('Activity Type created successfully.');\n }", "public function create($type)\n {\n //\n }", "protected function addactivity($activity_type, $event_object, $fanpage_id, $target_user_id, $target_name, $message ){\r\n\t\t$data['activity_type'] = $activity_type;\r\n\t\t$data['event_object'] = $event_object;\r\n\t\t$data['facebook_user_id'] = $this->_user->facebook_user_id;\r\n\t\t$data['facebook_user_name'] = $this->_user->facebook_user_name;\r\n\t\t$data['fanpage_id'] = $fanpage_id;\r\n\t\t$data['target_user_id'] = $target_user_id;\r\n\t\t$data['target_user_name'] = $target_name;\r\n\t\t$data['message'] = $message;\r\n\t\t$act = new Model_FancrankActivities();\r\n\t\t$post = new Model_Posts();\r\n\t\t/*\r\n\t\tif ($data['activity_type'] == \"like-status\" || $data['activity_type'] == \"like-photo\" || \r\n\t\t\t $data['activity_type'] == \"like-video\" || $data['activity_type'] == \"like-link\"){\r\n\t\t\t$post->addLikeToPost($data['event_object']);\r\n\t\t}else if ($data['activity_type'] == \"unlike-status\" || $data['activity_type'] == \"unlike-photo\" || \r\n\t\t\t $data['activity_type'] == \"unlike-video\" || $data['activity_type'] == \"unlike-link\"){\r\n\t\t\t$post->subtractLikeToPost($data['event_object']);\r\n\t\t}else if ($data['activity_type'] == \"comment-status\" || $data['activity_type'] == \"comment-photo\" || \r\n\t\t\t $data['activity_type'] == \"comment-video\" || $data['activity_type'] == \"comment-link\"){\r\n\t\t\t$post->addCommentToPost($data['event_object']);\r\n\t\t}\r\n\t\t*/\r\n\t\t$act -> addActivities($data);\r\n\t}", "public static function create_type() {\n\t\tregister_post_type(\n\t\t\tself::TYPE,\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => 'Events',\n\t\t\t\t\t'singular_name' => 'Event',\n\t\t\t\t\t'add_new_item' => 'Add new event',\n\t\t\t\t\t'not_found' => 'No events found',\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'supports' => array( 'title' ),\n\t\t\t)\n\t\t);\n\t}", "public function bp_register_activity_actions()\n {\n Fossil::register_buddypress_activities( Fossil::POST_TYPE );\n FossilDimension::register_buddypress_activities( FossilDimension::POST_TYPE );\n FossilLocation::register_buddypress_activities( FossilLocation::POST_TYPE );\n Stratum::register_buddypress_activities( Stratum::POST_TYPE );\n Taxon::register_buddypress_activities( Taxon::POST_TYPE );\n FossilTaxa::register_buddypress_activities( FossilTaxa::POST_TYPE );\n TimeInterval::register_buddypress_activities( TimeInterval::POST_TYPE );\n }", "public function create(Request $request)\n {\n $request->validate([\n 'name' => 'required|string'\n ]);\n\n $activity_type = new ActivityType();\n $activity_type->name = $request->name;\n $activity_type->save();\n\n return redirect('activity-types')->with('status','Activity Type Added');\n }", "public function setType($t){\n $this->type = $t;\n }", "function __construct($type='simple')\n {\n $this->type = $type;\n }", "public function __construct($type)\n {\n $this->type = $type;\n }", "public function setActivity($value)\n {\n return $this->set('Activity', $value);\n }", "public function setType($type){ }", "function __construct($type) {\n\t$this->type = $type;\n\t}", "public static function set_activity($doc_id = NULL, $action_type = NULL)\n\t{\n\n\t\t$user = Auth::instance()->get_user();\n\n\t\t$activity = new Model_Activity();\n\t\t$activity\n\t\t\t->set_item_type('files')\n\t\t\t->set_action($action_type)\n\t\t\t->set_item_id($doc_id)\n\t\t\t->set_user_id($user['id'])\n\t\t\t->save();\n\t}", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);" ]
[ "0.62327427", "0.60593265", "0.60380274", "0.5858225", "0.5851745", "0.58347136", "0.5824459", "0.57949686", "0.578496", "0.5777673", "0.57599", "0.57420635", "0.5740492", "0.5735808", "0.5735501", "0.571925", "0.56785524", "0.5677396", "0.56560904", "0.56368405", "0.5631854", "0.56306547", "0.5624553", "0.5613545", "0.55978554", "0.55978554", "0.55978554", "0.55978554", "0.55978554", "0.55978554" ]
0.71056116
0
Get number of activity related to a user. Events: BeforeGetCount.
public function getCount($userID = '') { $this->SQL ->select('a.ActivityID', 'count', 'ActivityCount') ->from('Activity a') ->join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID'); if ($userID != '') { $this->SQL ->beginWhereGroup() ->where('a.ActivityUserID', $userID) ->orWhere('a.RegardingUserID', $userID) ->endWhereGroup(); } $session = Gdn::session(); if (!$session->isValid() || $session->UserID != $userID) { $this->SQL->where('t.Public', '1'); } $this->fireEvent('BeforeGetCount'); return $this->SQL ->get() ->firstRow() ->ActivityCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserCount()\n {\n return $this->userCount;\n }", "public function getUserCount() {\n return @$this->attributes['user_count'];\n }", "function getUserCount()\r\n {\r\n $db = JFusionFactory::getDatabase($this->getJname());\r\n $query = 'SELECT count(*) from #__'.$this->getTablename();\r\n $db->setQuery($query );\r\n\r\n //getting the results\r\n return $db->loadResult();\r\n }", "public function getCountUser()\n {\n return $this->users_model->countAll();\n }", "public function getCount()\n {\n return $this->appUser->count();\n }", "public static function getCountUser($model,$user)\n { \n $sql = \"SELECT COUNT(*) FROM $model WHERE user_id='$user'\";\n $count = Yii::app()->db->createCommand($sql)->queryScalar();\n return $count; \n }", "public function getActivitiesCount() : int;", "public function getUserCountAttribute()\n\t\t{\n\t\t if ( ! array_key_exists('userCount', $this->relations)) \n\t\t\t$this->load('userCount');\n\t\t \n\t\t $related = $this->getRelation('userCount');\n\t\t \n\t\t // then return the count directly\n\t\t return ($related) ? (int) $related->aggregate : 0;\n\t\t}", "public function getUserIdCount()\n {\n return $this->count(self::_USER_ID);\n }", "public function userCount()\n {\n return User::count();\n }", "public static function user_count() {\n $ret = 0;\n $database = new \\ZGZagua\\common\\database();\n\n $sql = \"SELECT count(id) contador FROM users WHERE 1\";\n\n $resultado = $database->query( $sql );\n\n if ( $row = mysqli_fetch_array( $resultado ) ) {\n $ret = $row[ 'contador' ];\n }\n\n return max( $ret, 100 );\n }", "private function getCount()\n {\n $bd = Core::getBdd()->getDb();\n $u_insc_c = \"SELECT DISTINCT COUNT(u.id) as c FROM c_user u\";\n $insc = 0 + $bd->query($u_insc_c)->fetchObject()->c;\n return ($insc);\n }", "function get_user_count() {\n\treturn get_site_option( 'user_count' );\n}", "function count(User $user) {\n $project_users_table = TABLE_PREFIX . 'project_users';\n $users_table = TABLE_PREFIX . 'users';\n return (integer) DB::executeFirstCell(\"SELECT COUNT(user_id) FROM $project_users_table, $users_table WHERE $project_users_table.project_id = ? AND ($project_users_table.user_id = $users_table.id AND $users_table.state >= ?)\", $this->object->getId(), STATE_VISIBLE);\n }", "public function record_count_activities() {\n return $this->db->count_all(\"page\");\n }", "function get_total_infor_of_user_course($id)\n\t{\n\t\t$counts = Activity::where('user_id', Auth::id())->get();\n\t\treturn count($counts);\n\t}", "function countUsers(){\n\t\n\t}", "public function getUsersCountAttribute()\n {\n if ( ! array_key_exists('usersCount', $this->relations)) $this->load('usersCount');\n\n $related = $this->getRelation('usersCount')->first();\n\n return ($related) ? $related->aggregate : 0;\n }", "public function getUsageCount()\n {\n $today = Carbon::now('Asia/Singapore')->toDateTimeString();\n $timezone = new Carbon('Asia/Singapore');\n $last_thirty_days = $timezone->subDays(30);\n\n return count($this->appUserBlurb->where('interaction_type', 'use')->whereBetween('created_at', array($last_thirty_days->toDateTimeString(), $today))->groupBy('app_user_id')->get());\n }", "function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }", "public function user_count() {\r\n\t\tif (is_array($this->users))\r\n\t\t\treturn sizeof($this->users);\r\n\t\t$this->users = [];\r\n\t\treturn 0;\r\n\t}", "public static function count_user_events($user_id = NULL) {\r\n global $uid;\r\n if (is_null($user_id)) {\r\n $user_id = $uid;\r\n }\r\n return Database::get()->querySingle(\"SELECT COUNT(*) AS count FROM personal_calendar WHERE user_id = ?d\", $user_id)->count;\r\n }", "public function getUsersCount()\n {\n return $this->count(self::_USERS);\n }", "function getALlUserCount()\n {\n return $this->db->count_all_results('users');\n }", "public static function totalAttempts($user)\n {\n return count(parent::find(array(\n \"conditions\" => \"loginAttemptUserID = ?1\",\n \"bind\" => array(1 => $user->getUserID())\n )));\n }", "public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }", "function getCount($user_name)\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering getCount(\".$user_name.\") method ...\");\n\t\t$query = \"select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name=? and vtiger_crmentity.deleted=0\";\n\t\t$result = $this->db->pquery($query,array($user_name),true,\"Error retrieving contacts count\");\n\t\t$rows_found = $this->db->getRowCount($result);\n\t\t$row = $this->db->fetchByAssoc($result, 0);\n\n\n\t\t$log->debug(\"Exiting getCount method ...\");\n\t\treturn $row[\"count(*)\"];\n\t}", "public function countNewsUser()\n {\n $countNewsUser = $this->_model->where('news_user_id', Auth::id())->count();\n\n return $countNewsUser;\n }", "public function countNewerThanFromUser(string $date, User $user): int{\n $query = <<<SQL\n SELECT count(id) from activities\n where ended_at>:date and user_id=:id and organization_id is not null and organization_id=:organization_id;\nSQL;\n $query = $this->db->prepare($query);\n $query->execute(['date' => $date, ':id' => $user->id(), ':organization_id' => $user->organizationId()]);\n return $query->fetchColumn() ?: 0;\n }", "public function getUsersCount()\n {\n return $this->manager->createQuery('SELECT COUNT(u) FROM App\\Entity\\User u')->getSingleScalarResult();\n }" ]
[ "0.67676497", "0.667351", "0.64818525", "0.64508", "0.6403577", "0.63891435", "0.6377725", "0.6372668", "0.6333107", "0.6314794", "0.6311484", "0.63040847", "0.62656504", "0.62403286", "0.62088674", "0.6181559", "0.61774576", "0.61334985", "0.61085916", "0.60603005", "0.6050853", "0.6049942", "0.6032727", "0.60209596", "0.60174674", "0.60155773", "0.60142004", "0.5989802", "0.5975799", "0.59504306" ]
0.67459255
1
Get number of activity related to a particular role.
public function getCountForRole($roleID = '') { if (!is_array($roleID)) { $roleID = [$roleID]; } return $this->SQL ->select('a.ActivityID', 'count', 'ActivityCount') ->from('Activity a') ->join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID') ->join('UserRole ur', 'a.ActivityUserID = ur.UserID') ->whereIn('ur.RoleID', $roleID) ->where('t.Public', '1') ->get() ->firstRow() ->ActivityCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userCountByRole($role)\n {\n return User::where('role', $role)->count();\n }", "public function getActivitiesCount() : int;", "function roleCount($UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n \n if($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n }\n $Res = $databaseManager->request(\n 'SELECT COUNT(*) AS Result FROM ' . $databaseManager->getTablePrefix()\n . 'userroles WHERE UserID=?'\n , [$UserID]);\n return (int) $Res[0]['Result'];\n\t}", "function count_role_users($roleid, $context, $parent=false) {\n global $CFG;\n\n if ($parent) {\n if ($contexts = get_parent_contexts($context)) {\n $parentcontexts = ' OR r.contextid IN ('.implode(',', $contexts).')';\n } else {\n $parentcontexts = '';\n }\n } else {\n $parentcontexts = '';\n }\n\n $SQL = \"SELECT count(u.id)\n FROM {$CFG->prefix}role_assignments r\n JOIN {$CFG->prefix}user u \n ON u.id = r.userid\n WHERE (r.contextid = $context->id $parentcontexts)\n AND r.roleid = $roleid\n AND u.deleted = 0\";\n\n return count_records_sql($SQL);\n}", "public function getWipeCount($role_id) {\n $rds = $this->_di->getShared('redis');\n $wipe_count_key = sprintf(self::$WIPE_COUNT_KEY, $role_id);\n $count = $rds->get($wipe_count_key);\n return intval($count);\n }", "public function getRole(): int\n {\n return $this->role;\n }", "public function getRoleID(string $role):string;", "public function getThreadsCountAttribute()\n {\n if (!array_key_exists('threadsCount', $this->relations)) {\n $this->load('threadsCount');\n }\n\n $related = $this->getRelation('threadsCount');\n\n // then return the count directly\n return ($related) ? (int) $related->aggregate : 0;\n }", "private function getAdminCount() {\n $roles_name = array();\n $get_roles = Role::loadMultiple();\n unset($get_roles[AccountInterface::ANONYMOUS_ROLE]);\n $permission = array('administer permissions', 'administer users');\n foreach ($permission as $value) {\n $filtered_roles = array_filter($get_roles, function ($role) use ($value) {\n return $role->hasPermission($value);\n });\n foreach ($filtered_roles as $role_name => $data) {\n $roles_name[] = $role_name;\n }\n }\n\n if (!empty($roles_name)) {\n $roles_name_unique = array_unique($roles_name);\n $query = db_select('user__roles', 'ur');\n $query->fields('ur', array('entity_id'));\n $query->condition('ur.bundle', 'user', '=');\n $query->condition('ur.deleted', '0', '=');\n $query->condition('ur.roles_target_id', $roles_name_unique, 'IN');\n $count = $query->countQuery()->execute()->fetchField();\n }\n\n return (isset($count) && is_numeric($count)) ? $count : NULL;\n }", "public function getActivityRewardCount()\n {\n return $this->count(self::_ACTIVITY_REWARD);\n }", "function getAllApplicationCount()\r\n {\r\n $db = db_connect();\r\n\r\n $sql = \"SELECT * FROM account WHERE role = :role: ORDER BY accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0\r\n ]);\r\n\r\n return $results->getNumRows();\r\n }", "function ipts_recount_clovek_role($clovek_id, $role) {\n\tipts_recount_clovek($clovek_id);\n}", "public function record_count_activities() {\n return $this->db->count_all(\"page\");\n }", "function getWaitListedApplicationCount()\r\n {\r\n $db = db_connect();\r\n $sql = \"SELECT account.* FROM account, application WHERE account.accountID = application.accountID AND \r\n account.role = :role: AND application.applicationStatus = :applicationStatus: ORDER BY \r\n account.accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0,\r\n 'applicationStatus' => 'W'\r\n ]);\r\n\r\n return $results->getNumRows();\r\n }", "public function getCommentsCountAttribute()\n {\n // if relation is not loaded already, let's do it first\n if ( ! array_key_exists('commentsCount', $this->relations) )\n {\n $this->load('commentsCount');\n }\n\n $related = $this->getRelation('commentsCount');\n\n // then return the count directly\n return ($related) ? (int) $related->aggregate : 0;\n }", "public function getProjectActivityCount($includeDeleted = false) {\n return $this->getProjectDao()->getProjectActivityCount($includeDeleted); \n }", "public function getApplicantCount()\n {\n $query = $this\n ->createQueryBuilder('a')\n ->select('COUNT(a)')\n ->getQuery();\n $cacheId = self::getCacheId(self::CACHE_ID_TOTAL_APPLICANTS_COUNTER);\n $query->useResultCache(true, 3600, $cacheId);\n return $query->getSingleScalarResult();\n }", "function cicleinscription_get_number_enrolled_course($courseid){\n\tglobal $DB;\n\t$sql = \"SELECT Count(*) AS qtde \n\t\t\tFROM {user_enrolments} \n\t\t\tWHERE enrolid IN(SELECT id \n FROM mdl_enrol \n WHERE courseid = ?)\";\t// Para recuperar apenas os inscritos com Funcao de estudante, basta fazer um join com a tabela {role_assignments} informando o roleid = 5\n\t return $DB->get_record_sql($sql, array($courseid))->qtde;\n}", "function get_all_roles_count()\n {\n $this->db->from('roles');\n return $this->db->count_all_results();\n }", "public function count_all_roles(){\n\t\treturn ORM::factory('role')->count_all();\n\t}", "public function getUsersCountAttribute()\n {\n if ( ! array_key_exists('usersCount', $this->relations)) $this->load('usersCount');\n\n $related = $this->getRelation('usersCount')->first();\n\n return ($related) ? $related->aggregate : 0;\n }", "function usp_ews_get_usercount($context_id, $userid) \n{\n global $DB;\n \n\t$result = 0;\n\t$sql = \"SELECT COUNT(userid) \n\t\t\tFROM {role_assignments} \n\t\t\tWHERE contextid = :contextid \n\t\t\t AND roleid=(SELECT min(roleid) FROM {role_assignments} \n\t\t\t\t\t\t WHERE contextid = :context_id \n\t\t\t\t\t\t AND userid = :userid);\";\n\n\t$params= array('contextid'=>$context_id, 'context_id'=>$context_id, 'userid'=>$userid);\n\n\t$result = $DB->count_records_sql($sql, $params);\n\t\n\t// returns number of users\n\treturn $result;\t\n}", "public function getNbActors(){\n $nbActors = DB::table('actors')\n ->count();\n\n return $nbActors;\n }", "public function getRole(): ?int\n {\n return $this->role ?? null;\n }", "public function getUserCountAttribute()\n\t\t{\n\t\t if ( ! array_key_exists('userCount', $this->relations)) \n\t\t\t$this->load('userCount');\n\t\t \n\t\t $related = $this->getRelation('userCount');\n\t\t \n\t\t // then return the count directly\n\t\t return ($related) ? (int) $related->aggregate : 0;\n\t\t}", "public function getRoleWeight() {\n if (isset($this->rRole)) {\n return $this->rRole->weight;\n }\n return 1000000;\n }", "public function getUserCountByRole($name)\n {\n $queryBuilder = $this->getRepository()->createQueryBuilder('UserMeta');\n $queryBuilder->select('COUNT(UserMeta.id)')\n ->where($queryBuilder->expr()->eq('UserMeta.key', ':key'))\n ->setParameter('key', 'ors_capabilities')\n ->andWhere($queryBuilder->expr()->like('UserMeta.value', ':value'))\n ->setParameter('value', \"%$name%\");\n\n return $queryBuilder->getQuery()->getOneOrNullResult(AbstractQuery::HYDRATE_SINGLE_SCALAR);\n }", "public function count(): int\n {\n if ($this->clause('action') !== self::ACTION_READ) {\n return 0;\n }\n\n if (!$this->_result) {\n $this->_execute();\n }\n\n if ($this->_result) {\n /** @psalm-suppress PossiblyInvalidMethodCall, PossiblyUndefinedMethod */\n return (int)$this->_result->total();\n }\n\n return 0;\n }", "public function countContractors()\n\t{\n\t\t$farmer = \"select id from users_roles where name = 'Contractor' \";\n\t\t$f = DB::query($farmer)->execute()->as_array();\n\t\t$f_id = @$f[0]['id']; \n\t\t\n\t\t//got it, lets proceed\n\t\tif(!is_null($f_id)){\n\t\t\t\n\t\t\t//lets count number of users subscribed to the contractor role\n\t\t\t$pple = \"select count(distinct(user_id)) as tmpvar from users_user_roles\nwhere role_id = $f_id \";\n\n\t\t\t$tmp \t= DB::query($pple)->execute()->as_array();\n\t\t\t$fcount = @$tmp[0]['tmpvar'];\n\t\t\treturn $fcount;\n\t\t}\n\t\treturn 0;\n\t\n\t\t\n\t}", "function count_activity($pid) {\n if ($result = $this->mysqli->query(\"SELECT * FROM activity\n\t\t\tWHERE destination_id='$pid'\")) {\n $row_cnt = $result->num_rows;\n return $row_cnt;\n }\n }" ]
[ "0.67970866", "0.6162685", "0.5945713", "0.59277034", "0.5857442", "0.5800211", "0.57581127", "0.57527333", "0.5712438", "0.5699519", "0.5694057", "0.5642243", "0.55072415", "0.54676723", "0.54248524", "0.54235333", "0.54157406", "0.5400899", "0.53566486", "0.5345942", "0.53253555", "0.5282203", "0.52789915", "0.5277772", "0.52753425", "0.5272192", "0.5257513", "0.5235433", "0.52291816", "0.52122456" ]
0.7460738
0
Get comments related to designated activity items. Events: BeforeGetComments.
public function getComments($activityIDs) { $result = $this->SQL ->select('c.*') ->from('ActivityComment c') ->whereIn('c.ActivityID', $activityIDs) ->orderBy('c.ActivityID, c.DateInserted') ->get()->resultArray(); Gdn::userModel()->joinUsers($result, ['InsertUserID'], ['Join' => ['Name', 'Photo', 'Email']]); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getActivityComments($activity_id)\n\t{\n\t\t$comments = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pac.id, pac.text, UNIX_TIMESTAMP(pac.created_on) AS created_on, pac.user_id\n\t\t\t FROM profiles_activity_comments AS pac\n\t\t\t WHERE pac.activity_id = ? AND pac.status = ?\n\t\t\t ORDER BY pac.created_on ASC', \n\t\t\tarray((int) $activity_id, (string) 'visible')\n\t\t);\n\n\t\t// add userinfo\n\t\tforeach($comments as &$comment)\n\t\t{\n\t\t\t$profile = FrontendProfilesModel::get($comment['user_id']);\n\t\t\t$comment['username'] = $profile->getDisplayName();\n\t\t\t$comment['avatar'] = $profile->getSetting('avatar');\n\t\t\t$comment['facebook_id'] = $profile->getSetting('facebook_id');\n\t\t\t$comment['url'] = $profile->getUrl();\n\t\t\t$comment['deletable'] = ($profile->getId() == FrontendProfilesAuthentication::getProfile()->getId());\n\t\t}\n\n\t\treturn $comments;\n\t}", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "public function getComments() {}", "public function listComments ($activityId, $optParams = array())\n {\n $params = array('activityId' => $activityId);\n $params = array_merge($params, $optParams);\n $data = $this->__call('list', array($params));\n if ($this->useObjects()) {\n return new CommentFeed($data);\n } else {\n return $data;\n }\n }", "public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}", "public function getComments()\n\t\t{\n\t\t\tif ($this->comments === NULL)\n\t\t\t{\n\t\t\t\t$this->comments = new ECash_Application_Comments($this->db, $this->application_id, $this->getCompanyId());\n\t\t\t}\n\n\t\t\treturn $this->comments;\n\t\t}", "public function getComments() {\n if(!isset($this->comments)) {\n $this->comments = MergeRequestComment::getListByExample(\n new DBExample(array(\n 'mergeRequestId' => $this->id\n )),\n null,\n array(),\n array(\n 'parentId' => DB::SORT_ASC,\n 'ctime' => DB::SORT_ASC\n )\n );\n }\n\n return $this->comments;\n }", "public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }", "public function getComments($wp_id, $options = array())\n {\n return $this->client->request('api/v3/work_packages/' . $wp_id . '/activities', 'get', $options);\n }", "public function GetAllComments() {\n if(isset($_GET['idNews']) && isset($_GET['pagComm'])){\n $idNews = $_GET['idNews'];\n $pagination = $_GET['pagComm'];\n\n $modelComment = new Comments(Database::instance());\n\n $comments = $modelComment->GetAllCommentsPagination($idNews, $pagination);\n\n $this->json($comments);\n }else if(isset($_GET['idNews'])){\n $idNews = $_GET['idNews'];\n $pagination = 0;\n\n $modelComment = new Comments(Database::instance());\n\n $comments = $modelComment->GetAllCommentsPagination($idNews, $pagination);\n\n $this->json($comments);\n } else {\n $this->json(\"No action\", 403);\n }\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function comments()\n {\n $get = $this->getGet('articleId');\n $result = Db::sharedDb()->comments($get['articleId']);\n\n return $this->successResponse($result);\n\n }", "public function list_comments()\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('get', $url, null, null);\n\n // This is needed for nextPage() and previousPage()\n $response['url'] = $url;\n\n $obj = Util\\Util::convertToTelnyxObject($response, $opts);\n return $obj;\n }", "public function getComments()\n {\n return $this->hasMany(Comment::class, ['created_by' => 'id']);\n }", "public function get_comments()\n {\n }", "public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }", "public function getComments() {\n \n return $this->comments;\n }", "public function comments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment')->where('parent_id', 0)->orderBy('updated_at', 'desc');\n\t}", "public function allComments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment');\n\t}", "public function getComments()\n\t{\n\n\t\treturn $this->comments;\n\t}", "public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }", "public function getComments()\n {\n if ($this->_commentCollection === null) {\n $entity = $this->getEntity();\n if ($entity instanceof \\Magento\\Sales\\Model\\Order\\Invoice) {\n $this->_commentCollection = $this->_invoiceCollectionFactory->create();\n } elseif ($entity instanceof \\Magento\\Sales\\Model\\Order\\Creditmemo) {\n $this->_commentCollection = $this->_memoCollectionFactory->create();\n } elseif ($entity instanceof \\Magento\\Sales\\Model\\Order\\Shipment) {\n $this->_commentCollection = $this->_shipmentCollectionFactory->create();\n } else {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('We found an invalid entity model.'));\n }\n\n $this->_commentCollection->setParentFilter($entity)->setCreatedAtOrder()->addVisibleOnFrontFilter();\n }\n\n return $this->_commentCollection;\n }", "public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }", "function process_comment_items($comments)\n{\n\t$ci =& get_instance();\n\n\tforeach($comments as &$comment)\n\t{\n\t\t// work out who did the commenting\n\t\tif($comment->user_id > 0)\n\t\t{\n\t\t\t$comment->name = anchor('admin/users/edit/' . $comment->user_id, $comment->name);\n\t\t}\n\n\t\t// What did they comment on\n\t\tswitch ($comment->module)\n\t\t{\n\t\t\tcase 'news': # Deprecated v1.1.0\n\t\t\t\t$comment->module = 'blog';\n\t\t\t\tbreak;\n\t\t\tcase 'gallery':\n\t\t\t\t$comment->module = plural($comment->module);\n\t\t\t\tbreak;\n\t\t\tcase 'gallery-image':\n\t\t\t\t$comment->module = 'galleries';\n\t\t\t\t$ci->load->model('galleries/gallery_images_m');\n\t\t\t\tif ($item = $ci->gallery_images_m->get($comment->module_id))\n\t\t\t\t{\n\t\t\t\t\t$comment->item = anchor('admin/' . $comment->module . '/image_preview/' . $item->id, $item->title, 'class=\"modal-large\"');\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (module_exists($comment->module))\n\t\t{\n\t\t\tif ( ! isset($ci->{$comment->module . '_m'}))\n\t\t\t{\n\t\t\t\t$ci->load->model($comment->module . '/' . $comment->module . '_m');\n\t\t\t}\n\n\t\t\tif ($item = $ci->{$comment->module . '_m'}->get($comment->module_id))\n\t\t\t{\n\t\t\t\t$comment->item = anchor('admin/' . $comment->module . '/preview/' . $item->id, $item->title, 'class=\"modal-large\"');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$comment->item = $comment->module .' #'. $comment->module_id;\n\t\t}\n\t\t\n\t\t// Link to the comment\n\t\tif (strlen($comment->comment) > 30)\n\t\t{\n\t\t\t$comment->comment = character_limiter($comment->comment, 30);\n\t\t}\n\t}\n\t\n\treturn $comments;\n}", "public function getComments($args) {\n $id = $args[2];\n\n // Get comment type instance\n $parent = \\Helper::getCommentType($args[1], $id);\n if($parent === FALSE) {\n throw new \\Exception('Type not implemented yet', 1);\n }\n\n // Filter access to items the user can not see\n if(!\\Auth::checkComment($args[1], $id)) {\n throw new \\Exception('You do not have permission to view comments for the given item', 3);\n }\n\n $comments = new \\Models\\Comments($parent);\n $comments->getInfoFromDatabase();\n\n return $this->getCommentsData($comments);\n }", "protected function get_comment_ids()\n {\n }", "public function getTabComments() {\r\n\t\t$tab_comment_model = $this->load_model('TabCommentModel');\r\n\t\t$data = $tab_comment_model->getTabComments($this->params['tab_id'], $this->params['limit'], $this->params['offset']);\r\n\r\n\t\t$this->sendResponse(1, $data);\r\n\t}" ]
[ "0.6552038", "0.64332867", "0.63541925", "0.6331541", "0.62704504", "0.6146638", "0.60818577", "0.60644215", "0.60119605", "0.59705955", "0.595191", "0.595191", "0.595191", "0.595191", "0.5944746", "0.5923064", "0.59192497", "0.59041405", "0.58724856", "0.58620995", "0.5836187", "0.5835553", "0.5831021", "0.5823964", "0.58206034", "0.5813776", "0.5787359", "0.5783191", "0.5762637", "0.5753781" ]
0.65658635
0
Join the users to the activities.
public static function joinUsers(&$activities) { Gdn::userModel()->joinUsers( $activities, ['ActivityUserID', 'RegardingUserID'], ['Join' => ['Name', 'Email', 'Gender', 'Photo']] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activities() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) && !get_user_option('display_activities') ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load view/user/activities.php file\n $this->body = 'user/activities';\n $this->user_layout();\n }", "public function inviteUser()\r\n {\r\n Invite::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->participantUsers);\r\n }", "public function getUserActivitiesAction()\n {\n $getOperations = false;\n $activity = new Workapp_Activity();\n $data = $this->getRequestData();\n if (isset($data['getoperations'])) {\n $getOperations = $data['getoperations'];\n }\n $this->_helper->json($activity->getActivityList(array('user_id' => $this->getDeviceSession()->getUserId(), 'getoperations' => $getOperations)));\n }", "public function users() {\n $this->template->content = View::instance(\"v_activities_users\");\n $this->template->title = \"Users\";\n\n # Build the query to get all the users\n $q = \"SELECT *\n FROM users\";\n\n # Execute the query to get all the users. \n # Store the result array in the variable $users\n $users = DB::instance(DB_NAME)->select_rows($q);\n\n # Build the query to figure out what connections does this user already have? \n # I.e. who are they following\n $q = \"SELECT * \n FROM users_users\n WHERE user_id = \".$this->user->user_id;\n\n # Execute this query with the select_array method\n # select_array will return our results in an array and use the \"users_id_followed\" field as the index.\n # This will come in handy when we get to the view\n # Store our results (an array) in the variable $connections\n $connections = DB::instance(DB_NAME)->select_array($q, 'user_id_followed');\n\n # Pass data (users and connections) to the view\n $this->template->content->users = $users;\n $this->template->content->connections = $connections;\n\n # Render the view\n echo $this->template;\n }", "public function join(User $user)\n {\n //\n }", "public function activities()\n {\n return $this->hasMany(Activity::class, 'activity_of_user_id', 'id');\n }", "public function executeAttend(sfWebRequest $request)\n {\n\t$this->activity = $this->getRoute()->getObject();\n\t\n\tif($this->activity->getStatus() == 'expired'){\n\t\t$this->getUser()->setFlash('notice', sprintf('this activity has been expired!'));\n\t\t$this->redirect('activity_show', $this->activity);\n\t}\n\tif($this->activity->getMaxAttenders() && ($this->activity->getRemainAttendersNum() == 0)){\n\t\t$this->getUser()->setFlash('notice', sprintf('you are too late! this activity has been fully booked!'));\n\t\t$this->redirect('activity_show', $this->activity);\n\t}\n\t$this->activity_organizer = $this->activity->getUser();\n\n $sf_guard_user = $this->getUser()->getGuardUser();\n\t\n\t$is_attender = $sf_guard_user->isAttendedActivity($this->activity->getId());\n\tif($is_attender)\n\t{\n\t $this->getUser()->setFlash('notice', sprintf('You have already joined this activity before!'));\n\t $this->redirect('activity_show', $this->activity);\n\t}else{\n $user_activity = new UserActivity();\n $user_activity->setUser($this->getUser()->getGuardUser());\n $user_activity->setActivity($this->activity);\n\t $user_activity->setType(0); //#(1:organizer, 0:attender) !! ....change into..\n\t $this->form = new UserActivityForm($user_activity);\n\t}\n }", "public function run()\n {\n $coach = App\\User::find(1);\n\n foreach (App\\User::all() as $user) {\n if ($user->id != 1) {\n if (in_array($user->id, [2,3,4,5,6])) {\n $coach->pupils()->attach([$user->id => ['created_at' => Carbon::now()]]);\n } else if (substr($user->email, 0, 5) != \"teste\") {\n $coach->coaches()->attach([$user->id => ['created_at' => Carbon::now()]]);\n }\n }\n }\n }", "public function run()\n {\n $users = User::all();\n foreach ($users as $user) {\n if ($user->id === 1) continue;\n $user->attractions()->attach(Attraction::inRandomOrder()->limit(3)->get());\n }\n }", "public function run()\n {\n factory(Activity::class, 50)->create()->each(function (Activity $a) {\n $users = User::all()->pluck('id')->toArray();\n $randomUserId = array_random($users);\n $a->users()->attach($randomUserId, [\n 'is_owner' => true,\n 'role' => 'role'\n ]);\n });\n }", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }", "public function joinAction()\n {\n $roomId = $this->_getParam('id');\n $nickname = $this->_getParam('nick_name');\n if ( ! $roomId OR ! $nickname) {\n $this->badRequestAction();\n }\n \n // validate the room id\n if (strlen($roomId) > 100) {\n $this->failure(ERROR_FORM_VALIDATION_FAILURE);\n }\n \n $userDto = Zend_Registry::get('api_user');\n $result = $this->getBusiness()->join($roomId, $userDto, $nickname);\n \n $this->fromArray($result);\n }", "public function run()\n {\n $user = User::find(1);\n $user->roles()->attach(1);\n\n $user2 = User::find(2);\n $user2->roles()->attach(2);\n }", "public function actionShowusersactivities()\n\t{\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->limit=6;\t\n\t\t$uid = Yii::app()->user->id; //logged in userId\n\t\t$activityArray = array(); //contains, all activities, Like,Dislikes,Become friends etc\n\t\t$str='';\n\t\t$limit = 10;\n\t\t$flag = (isset($_GET['flag']))?$_GET['flag']:'';\n\t\tif(!empty($uid))\n\t\t{\n\t\t\t// ** User Logged IN ***\n\t\t\t//Show Photo Likes activities of Me & friends of Me\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit,$uid);\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$uname = ($uid==$v['userid'])?'You':$v['username'];\n\t\t\t\t\t$owner_name = $v['ownername'];\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$owner_name.'&#39;s photo:';\n\t\t\t\t\t$src=Yii::app()->baseUrl.'/files/'.$v['owner_id'].'/thumbnail/'.$v['photos_name'];\t\t\t\t\n\t\t\t\t\t$file_path = Yii::getPathOfAlias('webroot').'/files/'.$v['owner_id'].'/'.$v['photos_name'];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($file_path)){\n\t\t\t\t\t\t$src=Yii::app()->theme->baseUrl.'/img/noimage.jpg';\n\t\t\t\t\t}\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.$src.'\" />';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t\n\t\t\t\t\t//Duplicate Testing\tDUMMY Data .......\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />';\n\t\t\t\t\t$activityArray['1410354280'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t$activityArray['1410354380'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\t\t\t\t\t\n\t\t\t\t\t//Duplicate Ends\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of Friends..ie who had recently become your friend\t\t\n\t\t\t$criteria->condition = \"t.user_id='\".$uid.\"' AND t.status=1\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['friend']['user_details_avatar'],'name'=>'you','message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Users..ie who had recently Send You Friends Request\t\t\n\t\t\t$criteria->condition = \"t.friend_id='\".$uid.\"' AND t.status=0\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' Had Sent You a Friend Request';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$v['user']['user_details_firstname'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Friend's friends..ie your friend who had add another friend\t\t\t\n\t\t\t$friends=UsersFriends::model()->getActivityFriends($limit,$uid);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t//where $[name] is your(loggedIn User) frnd , who also become frnd with $v['ffname']\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' and '.$v['ffname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Get List of users who started to follow you..\n\t\t\t$followers=UsersFollow::model()->getActivityFollow($limit,$uid);\n\t\t\tif(count($followers)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($followers as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' is now your follower';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tunset($followers);\n\t\t\t\n\t\t\t//Now get List of Extra Notification of Posly, only for Top-Header DUMMY Data .......\n\t\t\tif($flag==\"header\"){\n\t\t\t\t$msg = 'There is an event to be organised at bangalore, at 1-oct-14, for Fashion ..an fasion event';\n\t\t\t\t$activityArray['1410835502'] = array('avatar'=>'avatar1_small.jpg','name'=>'Posly','message'=>$msg,'image'=>''); \n\t\t\t\t//*Duplicate Testing Data\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ** User NOT Logged IN ***\n\t\t\t//Show general user Photo Likes activities , as no body has loggedIn\t\t\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit); \t\t\t\t\t\t\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v){\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$v['ownername'].'&#39;s photo:';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$v['username'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of any user who had recently become friends\n\t\t\t$criteria->condition = \"status=1\";\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$user = $v['user']['user_details_firstname'].' '.$v['user']['user_details_lastname'];\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$user,'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t}\n\t\t\n\t\t//Now Create the display Activity HTML\t\t\n\t\tif(count($activityArray)>0)\n\t\t{\n\t\t\tkrsort($activityArray); \n\t\t\t//Sort activity Array By Keys -- SORT\t\n\t\t\t$unread_notifycount=0;\n\t\t\t$user_notifyReaddate = (!empty($uid))?Yii::app()->user->getState(\"notify_readdate\"):'0';\t\t\t\n\t\t\tforeach($activityArray as $keys=>$values)\n\t\t\t{\t\t\t\n\t\t\t\t$fromurl=strstr($values['avatar'], '://', true);\n\t\t\t\tif($fromurl=='http' || $fromurl=='https')\n\t\t\t\t\t$avatar = $values['avatar']; \n\t\t\t\telse\n\t\t\t\t$avatar = Yii::app()->baseUrl.'/profiles/'.$values['avatar'];\n\t\t\t\tif($flag==\"header\")\n\t\t\t\t{\n\t\t\t\t\t//This is for Top-Header Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li> \n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<div class=\"main\">\n\t\t\t\t\t<span class=\"photo\">\n\t\t\t\t\t<img class=\"avatar-user-l img-responsive\" src=\"'.$avatar.'\" alt=\"\"/>\n\t\t\t\t\t</span>\t\t\t\t\t\n\t\t\t\t\t<div class=\"message\"> \n\t\t\t\t\t\t<span class=\"name\">'.$values['name'].'</span> '.$values['message'].' \n\t\t\t\t\t\t<div class=\"newtime\">'.$this->get_msgtime($keys).'</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</a> \n\t\t\t\t\t</li>\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t} else{\n\t\t\t\t\t//This for Side-Bar UserActivity/Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.$avatar.'\" />\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<span class=\"notimsg\"><span class=\"name\">'.$values['name'].'</span> '.$values['message'].'</span>'.$values['image'].'\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\t\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t//Now check For notify Cnt for LoggedIn user\t\t\t\t\n\t\t\t\tif(!empty($uid))\n\t\t\t\t{ //Condition if notify Date in DB is Less then Keys(notifyTimedate), then its an Unread\t\t\n\t\t\t\t\tif($user_notifyReaddate < $keys){\n\t\t\t\t\t\t$unread_notifycount++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!empty($uid)){\n\t\t\t\t$unread_notifycount = ($unread_notifycount==0)?'':$unread_notifycount;\n\t\t\t\tYii::app()->user->setState('notify_count', $unread_notifycount);\n\t\t\t}\n\t\t}\n\t\tunset($activityArray);\n\t\tif(empty($str)){\n\t\t\t//a Default Dummy status.\n\t\t\t$str='<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />\n\t\t\t<div class=\"message\"> <span class=\"name\">Chanh Ny</span> likes Chi Minh Anh photo. </div>\n\t\t\t</li>';\n\t\t}\t\t\n\t\techo $str;\t\t\n\t\tYii::app()->end();\t\n\t}", "public static function syncUsers()\n {\n $users = User::find()->where([User::tableName() . '.status' => 1])->all();\n\n foreach($users as $user)\n {\n $flag_ak_insert = 0;\n $password = $encrypted_password = ''; // when we create new user account in akaunting.\n\n $AK_user = new Users();\n $AK_user = Json::decode($AK_user->view($user->email));\n\n // IF user does not exist in Akaunting, we will create them first and then we will link them.\n if(empty($AK_user))\n {\n $flag_ak_insert = 1;\n // echo \"\\n\" . 'User ' . $user->email . ' does not exist in Akaunting, creating it.' . \"\\n\";\n\n $spaces = $user->getSpaces()->all();\n $spaces = array_values(ArrayHelper::map($spaces, 'id', 'id'));\n\n $companies = AkauntingCompany::findAll(['space_id' => $spaces]);\n $companies = array_values(ArrayHelper::map($companies, 'akc_id', 'akc_id'));\n\n $password = Yii::$app->getSecurity()->generateRandomString(12);\n $encrypted_password = Yii::$app->getSecurity()->encryptByPassword($password, $user->guid);\n\n $save_user = [\n 'name' => $user->getDisplayName(),\n 'email' => $user->email,\n 'password' => $password,\n 'password_confirmation' => $password,\n 'companies' => $companies,\n 'roles' => [Akaunting::ROLE_ID_MANAGER],\n ];\n\n $AK_user = new Users();\n $AK_user->save($save_user);\n\n $mail = Yii::$app->getMailer()->compose([\n 'html' => '@akaunting-finance/views/mails/NewAkauntingAccount',\n 'text' => '@akaunting-finance/views/mails/plaintext/NewAkauntingAccount'\n ], [\n 'login_url' => FinanceSetup::getValue('API_url'),\n 'user' => $user,\n 'password' => $password\n ]);\n\n if (isset(Yii::$app->params['adminBccEmail'])) {\n $mail->setBcc(Yii::$app->params['adminBccEmail']);\n }\n\n $mail->setTo($user->email);\n\n // Put temporarily for testing\n $mail->setBcc('[email protected]');\n\n $mail->setSubject('Your Akaunting Credentials.');\n // Yii::error('There is some issue in syncing user with akaunting.');\n if(!$mail->send())\n {\n Yii::error('Error sending Akaunting credential email ' . __CLASS__ . ' ' . __FUNCTION__);\n }\n\n $AK_user = Json::decode($AK_user->view($user->email));\n }\n\n // If user found from our Call, we will save them into HH\n if(!empty($AK_user))\n {\n if(!empty($AK_user['data']['companies']['data']))\n {\n foreach($AK_user['data']['companies']['data'] as $company)\n {\n $params = [\n 'user_id' => $user->id,\n 'akc_id' => $company['id'],\n 'aku_id' => $AK_user['data']['id']\n ];\n\n extract($params);\n\n $ak_company_user = self::findOne(['user_id' => $user_id, 'akc_id' => $akc_id, 'aku_id' => $aku_id]);\n\n if(empty($ak_company_user))\n {\n $ak_company_user = new self();\n $ak_company_user->setIsNewRecord(true);\n $ak_company_user->user_id = $user_id;\n $ak_company_user->akc_id = $akc_id;\n $ak_company_user->aku_id = $aku_id;\n\n if($flag_ak_insert == 1 && !empty($password))\n {\n $ak_company_user->aku_password = $encrypted_password;\n }\n\n if(!$ak_company_user->save())\n {\n Yii::error('Error in saving record in ' . self::tableName() . ' ' . __CLASS__ . ' ' . __FUNCTION__ . \"\\n\\n\" . Json::encode($ak_company_user->getErrors()));\n }\n }\n }\n }\n }\n else\n {\n Yii::error('There is some issue in syncing user with akaunting.');\n }\n }\n }", "public function ual_activity_login() {\n\n\t\t// Prevent user ID returning as 0.\n\t\t$user_reset = apply_filters( 'determine_current_user', false );\n\n\t\twp_set_current_user( $user_reset );\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged In', 'logged-in' );\n\t\t}\n\t}", "public function joinRoomAction()\n {\n \t$userDto = Zend_Registry::get('api_user');\n \t$rooms = $this->getBusiness()->getRoomByState($userDto, Dto_ChatRoomUser::STATE_JOIN);\n \t\n \t$roomArray = $rooms->toArray(array('room_id', 'created_at'));\n \t$this->success(array('rooms' => $roomArray));\n }", "public function join(User $user, Activity $activity)\n {\n\t\treturn !$activity->participants->contains($user->id);\n }", "public function userslist(Request $request) {\n\n $roles = DB::table('roles')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $userRoleRelations = DB::table('user_role_relations')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $userRoles = array();\n foreach ($userRoleRelations as $usrole) {\n $pc['id'] = $usrole->id;\n $pc['user_id'] = $usrole->user_id;\n $pc['role_id'] = $usrole->role_id;\n $role = Role::find($usrole->role_id);\n $pc['role_name'] = $role->name;\n $userRoles[] = $pc;\n }\n\n // filter apply if exists\n $userActivityFilter = request('userActivityFilter');\n $userRoleFilter = request('userRoleFilter');\n\n if ((!empty($userRoleFilter)) || (!empty($userActivityFilter))) {\n\n $users = User::select('users.id', 'users.first_name', 'users.last_name', 'users.is_active', 'users.email')\n ->leftjoin('user_role_relations', 'users.id', '=', 'user_role_relations.user_id')\n ->leftjoin('roles', 'roles.id', '=', 'user_role_relations.role_id')\n ->where('user_role_relations.deleted_at', '=', NULL)\n ->where('users.deleted_at', '=', NULL)\n ->where('roles.deleted_at', '=', NULL);\n if ($userRoleFilter != 'all') {\n $users->where('roles.id', '=', $userRoleFilter);\n }\n if (!empty($userActivityFilter)) {\n if ($userActivityFilter == 1) {\n $users->where('users.is_active', '=', $userActivityFilter);\n } else if ($userActivityFilter == 2) {\n $users->where('users.is_active', '=', 0);\n }\n }\n $users = $users->orderBy('users.id', 'desc')->groupBy('users.id')->get();\n// $users = $users->orderBy('users.id', 'desc')->distinct()->get();\n\n return view('user.usersfilter', compact('users', 'roles', 'userRoleRelations', 'userRoles'))->render();\n }\n\n\n $users = User::sortable()->whereNull('deleted_at')->orderBy('users.id', 'desc')->paginate(10);\n $modules = DB::table('modules')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $modulePermissions = DB::table('permissions')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $serviceProviders = array();\n $serviceProviderRoleIds = array();\n $serviceProviderRoles = DB::table('roles')->whereNull('deleted_at')->where('roles.is_service_provider', '=', true)->orderBy('id', 'desc')->get();\n if ($serviceProviderRoles) {\n foreach ($serviceProviderRoles as $serviceProviderRole) {\n $spr['role_id'] = $serviceProviderRole->id;\n $serviceProviderRoleIds[] = $spr;\n }\n }\n if (count($serviceProviderRoleIds) > 0) {\n $serviceProviders = User::sortable()\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.email', 'roles.name as name')\n ->leftjoin('user_role_relations', 'users.id', '=', 'user_role_relations.user_id')\n ->leftjoin('roles', 'roles.id', '=', 'user_role_relations.role_id')\n ->whereIn('user_role_relations.role_id', $serviceProviderRoleIds)\n ->where('user_role_relations.deleted_at', '=', NULL)\n ->where('users.deleted_at', '=', NULL)\n ->where('roles.deleted_at', '=', NULL)\n ->orderBy('users.id', 'desc')\n ->get();\n }\n //print_r($serviceProviders);exit;\n\n return view('user.userslist', compact('users', 'roles', 'userRoleRelations', 'userRoles', 'modules', 'modulePermissions', 'serviceProviders'));\n }", "public function join(Request $request, $id)\n {\n if (Auth::guest())\n abort(404);\n\n $activities = Activities::findOrFail($id);\n $student_id = Auth::user()->getKey();\n \n if (ActivitiesJoin::where('student_id', $student_id)->where('activities_id', $activities->id)->count() > 0)\n return back()->withInput()\n ->with([\n 'status' => 'fail',\n 'class' => 'danger',\n 'icon' => 'warning',\n 'message' => 'กิจกรรมนี้ได้เข้าร่วมแล้ว',\n ]);\n \n $activitiesJoin = ActivitiesJoin::create([\n 'student_id' => $student_id,\n 'activities_id' => $activities->id,\n 'status' => 0,\n ]);\n\n\n if (is_null($activitiesJoin))\n {\n return back()->with([\n 'status' => 'fail',\n 'class' => 'danger',\n 'icon' => 'warning',\n 'message' => 'ไม่สามารถเข้าร่วมกิจกรรมได้',\n ]);\n }\n\n return back()->with([\n 'status' => 'success',\n 'class' => 'success',\n 'icon' => 'checkmark-circle',\n 'message' => 'เข้าร่วมกิจกรรมแล้ว',\n ]);\n }", "public function run()\n {\n $user = User::find(1);\n $users = User::find([2,3,4,5,6]);\n \n $role = Role::whereName(\"admin\")->first();\n $userrole = Role::whereName(\"user\")->first();\n $user->roles()->attach($role->id);\n foreach($users as $user){\n $user->roles()->attach($userrole->id);\n }\n }", "public function userJoin() {\n return $this->belongsToMany('App\\Model\\User', 'trip_users');\n }", "public function users() {\n # Set up the View\n $this->template->content = View::instance(\"v_requests_users\");\n $this->template->title = \"Follow Others Prayer Rquests\";\n # query list of all users (except current user who is automatically followed)\n $q = \"SELECT * FROM users WHERE users.user_id !=\".$this->user->user_id;\n\n $users = DB::instance(DB_NAME)->select_rows($q);\n\n # Build query to get all the users from users_users followed by this user\n $q = \"SELECT *\n FROM users_users\n WHERE users_users.user_id = \".$this->user->user_id;\n \n # use select_array APi with user_id_followed as index\n # to facilitate view display code\n $connections = DB::instance(DB_NAME)->select_array($q, 'user_id_followed');\n\n # Pass data to the view\n $this->template->content->users = $users;\n $this->template->content->connections = $connections;\n # Render this view\n\n echo $this->template; \n\n }", "public function actionAutoAddInvites(){\n $users = User::model()->findAll(\"status = :status AND invitations < :invite\",array(\":status\"=>1,\":invite\"=>2));\n $userStats = UserStat::model()->findAll();\n $stat = array();\n foreach ($userStats as $userStat){\n $stat[$userStat->user_id] = $userStat;\n }\n \n // check all users\n foreach ($users as $user){\n if (!isset($stat[$user->id])){\n // not yet calculated %\n $c = new Completeness();\n $c->setPercentage($user->id);\n }else{\n //percentage in now add invitations\n if ($stat[$user->id]->completeness >= PROFILE_COMPLETENESS_MIN){\n if ($stat[$user->id]->invites_send == 0) $user->invitations +=4; // initial 4+1 invites after profile completed\n $user->invitations++;\n }\n if ($stat[$user->id]->invites_send > 5) $user->invitations+=2;\n if ($stat[$user->id]->invites_registered > 5) $user->invitations++;\n $user->save(); \n }\n }\n }", "public function run()\n {\n\n $users = User::all();\n $courses = Course::all('id');\n $last_course_index = count($courses) - 1;\n\n for ($i = 0; $i < 5; $i++) {\n $user = $users[$i];\n if (count($courses)) {\n $user->courses()->attach($courses[rand(0, $last_course_index)]);\n }\n }\n }", "public function invokeUsers()\r\n {\r\n if (!isset($_GET['users'])) {\r\n $users = $this->model->getUsers();\r\n include 'view/userslist.php';\r\n }\r\n }", "public function run()\n {\n //\n $users = User::all();\n $user = $users->first();\n $user_id = $user->id;\n\n $users = $users->slice(1);\n\n // 第一个用户关注所有用户\n $user->follow($users->pluck(\"id\")->toArray());\n\n // 除了第一个用户之外,所有用户都关注第一个用户\n foreach ($users as $user) {\n $user->follow($user_id);\n }\n }", "public function getActivities()\n {\n $enrollments = Enrollment::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $enrol = Enroll::where('id', $item->enrolid)->first();\n return ['type' => 'enroll',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $enrol->courseid)->first()->fullname,\n ];\n });\n\n $completions = Completion::latest('timecompleted')->take(4)->get()->sortBy('timecompleted')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n return ['type' => 'completion',\n 'ts' => $item->timecompleted,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $item->course)->first()->fullname,\n ];\n });\n\n $grades = Grades::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $grade = DB::table('mdl_grade_items')->where('id', $item->itemid)->first();\n\n return ['type' => 'grade',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $grade->courseid)->first()->fullname,\n 'score' => $item->finalgrade,\n ];\n });\n\n\n $merged = array_merge($enrollments->toArray(), $completions->toArray(), $grades->toArray());\n\n return collect($merged)->sortByDesc('ts')->take(4)->toArray();\n }", "function getJoinUserAffiliates($userId,$activityId){\n\n $data = array();\n $where = array('ua.user_id'=>$userId);\n $this->db->select('userAffiliateId,affiliate_name,if(aj.activityJoinId IS NULL,0,1) as isJoined');\n $this->db->from(USER_AFFILIATES.' as ua');\n $this->db->join(ACTIVITY_JOIN.' as aj','ua.userAffiliateId = aj.affiliate_id AND aj.activity_id = \"'.$activityId.'\" AND aj.user_id = \"'.$userId.'\"','left');\n $this->db->where($where);\n $q = $this->db->get();\n if($q->num_rows()){\n $data = $q->result();\n }\n return $data;\n\n }", "public function users(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n\n $users = User::join('companies', 'companies.companyIdx', '=', 'users.companyIdx')\n /* ->whereIn('users.userStatus',[0,1]) */\n ->get([\"users.*\", 'companies.*', 'users.created_at as createdAt']);\n foreach($users as $user){\n $count_all = User::where('companyIdx', $user->companyIdx)->where('userStatus', 2)->get()->count();\n $count_pending = LinkedUser::where('invite_userIdx', $user->userIdx)->get()->count();\n $count_products = OfferProduct::join('offers', 'offers.offerIdx', '=', 'offerProducts.offerIdx')\n ->join('providers', 'providers.providerIdx', '=', 'offers.providerIdx')\n ->join('users', 'users.userIdx', '=', 'providers.userIdx')\n ->where('users.userIdx', $user->userIdx)\n ->get()\n ->count();\n $user['count_all'] = $count_all;\n $user['count_pending'] = $count_pending;\n $user['count_products'] = $count_products;\n }\n $data = array('users');\n return view('admin.users', compact($data));\n }" ]
[ "0.6226891", "0.5920913", "0.58763665", "0.587031", "0.57926285", "0.57510555", "0.5684711", "0.5626242", "0.56209046", "0.5572398", "0.55466336", "0.5539136", "0.55229604", "0.5520257", "0.54925984", "0.54808366", "0.5477305", "0.54650885", "0.5382861", "0.53483295", "0.53434914", "0.5333564", "0.53253466", "0.5320477", "0.5299263", "0.5291017", "0.52677894", "0.5260156", "0.52522206", "0.5225389" ]
0.7971732
0
Get default notification preference for an activity type.
public static function notificationPreference($activityType, $preferences, $type = null) { if (is_numeric($preferences)) { $user = Gdn::userModel()->getID($preferences); if (!$user) { return $type == 'both' ? [false, false] : false; } $preferences = val('Preferences', $user); } if ($type === null) { $result = self::notificationPreference($activityType, $preferences, 'Email') || self::notificationPreference($activityType, $preferences, 'Popup'); return $result; } elseif ($type === 'both') { $result = [ self::notificationPreference($activityType, $preferences, 'Popup'), self::notificationPreference($activityType, $preferences, 'Email') ]; return $result; } $configPreference = c("Preferences.$type.$activityType", '0'); if ((int)$configPreference === 2) { $preference = true; // This preference is forced on. } elseif ($configPreference !== false) { $preference = val($type.'.'.$activityType, $preferences, $configPreference); } else { $preference = false; } return $preference; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDefault($type) {\r\n $default = $this->defaults[$type];\r\n if (empty($default))\r\n return 0;\r\n else\r\n return $default;\r\n }", "private function getDefaultStatusByType($type) {\n if (!in_array($type, ['groupex', 'personify'])) {\n return TRUE;\n }\n $config = $this->configFactory->get(self::CONFIG);\n return $config->get($type == 'groupex' ? 'groupex_default_status' : 'personify_default_status');\n }", "public static function getDefault()\r\n {\r\n return self::get('default');\r\n }", "public function getDefaultAttribute($type)\n\t\t{\n\t\t\tif(!isset($this->id))\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\tglobal $conn;\n\t\t\t\n\t\t\t$g = $conn->prepare(\"SELECT id FROM ServiCenter_TicketAttribute WHERE workspace = ? AND `default` = 1 AND type = ? LIMIT 1\");\n\t\t\t$g->bindparam(1, $this->id);\n\t\t\t$g->bindparam(2, $type);\n\t\t\t$g->execute();\n\t\t\t\n\t\t\tif($g->rowCount() != 1)\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\t$a = new WorkspaceAttribute($g->fetchColumn());\n\t\t\t\n\t\t\tif($a->load())\n\t\t\t\treturn $a;\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}", "public function getProfileDefault()\n {\n return $this->getConfig('packages/global_settings_default-profile');\n }", "private function getSetting($type) {\n\t\tforeach (self::$SETTINGS as $setting) {\n\t\t\tif (strcasecmp($setting->getName(), $type) == 0) {\n\t\t\t\treturn $setting;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getDefault()\n {\n return $this->config['config']['default'] ?? null;\n }", "public static function getDefault()\n {\n return self::$default;\n }", "function get_defaultsetting() {\n return $this->defaultsetting;\n }", "public function defaultSettings()\n\t{\n\t\treturn [\n\t\t\t'notifications' => [\n\t\t\t\t'team_event_create' => 1,\n\t\t\t\t'team_event_update' => 2,\n\t\t\t\t'team_event_delete' => 2,\n\t\t\t\t'team_stats' \t\t=> 1,\n\t\t\t\t'team_post' \t\t=> 1,\n\t\t\t\t'user_post' \t\t=> 2,\n\t\t\t\t'user_stats'\t\t=> 1,\n\t\t\t],\n\t\t];\n\t}", "function preference(\\Illuminate\\Database\\Eloquent\\Model $owner, string $key, $default = null)\n {\n return app('preferences')->getWithValue($owner, $key, $default);\n }", "public function get_type()\n\t{\n\t\treturn 'notification.type.pm';\n\t}", "public function getDefault()\n {\n return $this->get($this->default);\n }", "public function getNotificationCategory( $notificationType ) {\n\t\tif ( isset( $this->notifications[$notificationType]['category'] ) ) {\n\t\t\t$category = $this->notifications[$notificationType]['category'];\n\t\t\tif ( isset( $this->categories[$category] ) ) {\n\t\t\t\treturn $category;\n\t\t\t}\n\t\t}\n\n\t\treturn 'other';\n\t}", "function get_default_type()\n\t{\n\t\treturn 'normal';\n\t}", "public function getThemeKey($type = '') {\n if ($type === 'mobile') {\n $r = $this->config->get('Garden.MobileTheme', AddonManager::DEFAULT_MOBILE_THEME);\n } else {\n $r = $this->config->get('Garden.Theme', AddonManager::DEFAULT_DESKTOP_THEME);\n }\n return $r;\n }", "function get_default_comment_status($post_type = 'post', $comment_type = 'comment')\n {\n }", "function get_default_photo( $id, $type )\n\t{\n\t\t$default_photo = \"\";\n\n\t\t// get all images\n\t\t$img = $this->CI->Image->get_all_by( array( 'img_parent_id' => $id, 'img_type' => $type ))->result();\n\n\t\tif ( count( $img ) > 0 ) {\n\t\t// if there are images for wallpaper,\n\t\t\t\n\t\t\t$default_photo = $img[0];\n\t\t} else {\n\t\t// if no image, return empty object\n\n\t\t\t$default_photo = $this->CI->Image->get_empty_object();\n\t\t}\n\n\t\treturn $default_photo;\n\t}", "private function getDefaultIcon() {\n static $icon_map;\n if ($icon_map === null) {\n $types = PhabricatorPHIDType::getAllTypes();\n\n $map = array();\n foreach ($types as $type) {\n $icon = $type->getTypeIcon();\n if ($icon !== null) {\n $map[$type->getTypeConstant()] = $icon;\n }\n }\n\n $icon_map = $map;\n }\n\n $phid_type = phid_get_type($this->phid);\n if (isset($icon_map[$phid_type])) {\n return $icon_map[$phid_type];\n }\n\n return null;\n }", "function wpsl_get_default_setting( $setting ) {\n\n global $wpsl_default_settings;\n\n return $wpsl_default_settings[$setting];\n}", "public static function get_default_avatar( $type = null ) {\n\t\tif ( ! $type ) {\n\t\t\t$type = get_option( 'avatar_default', 'mystery' );\n\t\t}\n\t\tswitch ( $type ) {\n\t\t\tcase 'mm':\n\t\t\tcase 'mystery':\n\t\t\tcase 'mysteryman':\n\t\t\t\treturn plugin_dir_url( dirname( __FILE__ ) ) . 'img/mm.jpg';\n\t\t}\n\t\treturn apply_filters( 'semantic_linkbacks_default_avatar', $type );\n\t}", "public function getDefault()\n {\n return $this->default;\n }", "function get_default($setting_id) {\n if (isset($this->default_values[$setting_id])) {\n return $this->default_values[$setting_id];\n } else {\n return '';\n }\n }", "public function getDefault()\n {\n if($this->default === null) {\n return $this->first();\n }\n return $this->default;\n }", "public static function getDefault() {\n\t\tif (self::$defaultMailSender == null) {\n\t\t\tself::createDefault();\n\t\t}\n\t\t\n\t\treturn self::$defaultMailSender;\n\t}", "function store_setting_default($setting)\n {\n if (is_array($setting)) {\n return isset($setting['default']) ? $setting['default'] : null;\n }\n\n return $setting;\n }", "public function getDefault()\n {\n return $this->getOption('default');\n }", "public function getSettingType()\n {\n if (array_key_exists(\"settingType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"settingType\"], \"\\Beta\\Microsoft\\Graph\\Model\\GroupPolicySettingType\") || is_null($this->_propDict[\"settingType\"])) {\n return $this->_propDict[\"settingType\"];\n } else {\n $this->_propDict[\"settingType\"] = new GroupPolicySettingType($this->_propDict[\"settingType\"]);\n return $this->_propDict[\"settingType\"];\n }\n }\n return null;\n }", "private function getDefaultStatus(): string\n {\n return InviteStatus::pending()->value;\n }", "protected function get_default_project_type() {\n $str = CriticalI_Property::get('project.default_type', 'inside-public');\n \n if (strtolower(trim($str)) == 'outside-public')\n return CriticalI_Project::OUTSIDE_PUBLIC;\n else\n return CriticalI_Project::INSIDE_PUBLIC;\n }" ]
[ "0.63463676", "0.5919821", "0.5691028", "0.5616573", "0.55975455", "0.55756396", "0.5572349", "0.55621225", "0.54816735", "0.5472238", "0.54316956", "0.5423609", "0.534224", "0.5325544", "0.53147596", "0.52953213", "0.52949476", "0.5294879", "0.5278133", "0.5257361", "0.52479464", "0.52082306", "0.51903874", "0.5158017", "0.51345295", "0.5132457", "0.5129478", "0.51186603", "0.5112201", "0.5111426" ]
0.6372952
0
Takes an array representing an activity and builds the email message based on the activity's story and the contents of the global config Garden.Email.Prefix.
private function getEmailMessage($activity) { $message = ''; if ($prefix = c('Garden.Email.Prefix', '')) { $message = $prefix; } $isArray = is_array($activity); $story = $isArray ? $activity['Story'] ?? null : $activity->Story ?? null; $format = $isArray ? $activity['Format'] ?? null : $activity->Format ?? null; if ($story && $format) { $message .= Gdn_Format::to($story, $format); } return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sendEmailAboutCreatedStory($story)\n {\n /*\n Editor's Name\n Language\n Countries\n Title\n Category\n Snippet\n Link\n */\n $tableStory=Story::tableName();\n $story=Story::find()->where([$tableStory.'.id'=>$story->id])->joinWith(['relationCountries', 'relationSubCategories', 'relationLanguage', 'relationUser'])->one();\n\n //send all to this email\n $users[0][\"email\"]=\"[email protected]\";\n $users[0][\"name\"]=\"Eddie Rios\";\n\n $countries=[];\n foreach($story->relationCountries as $value)\n {\n $countries[]=$value->name;\n }\n\n $categories=[];\n foreach($story->relationSubCategories as $value)\n {\n $categories[]=$value->name;\n }\n $subject=$story->relationLanguage->name;\n $message=NULL;\n $message.=\"<b>ID: </b>\".$story->id.\"<br>\";\n $message.=\"<b>Editor's Name:</b> \".$story->relationUser->name.\"<br>\";\n $message.=\"<b>Language:</b> \".$story->relationLanguage->name.\"<br>\";\n $message.=\"<b>Countries:</b> \".implode(\",\", $countries).\"<br>\";\n $message.=\"<b>Title:</b> \".$story->title.\"<br>\";\n $message.=\"<b>Categories:</b> \".implode(\",\", $categories).\"<br>\";\n $message.=\"<b>Snippet:</b> \".$story->description.\"<br>\";\n $message.=\"<b>Link:</b> <a href='$story->link'>$story->link</a><br>\";\n\n $from[\"email\"]=$story->relationUser->email;\n $from[\"name\"]=$story->relationUser->name;\n\n CommonHelpers::sendEmailToMultiplePeople($subject, $message, $users, $from);\n }", "public function send_campaign( $args = [] ) {\n $defaults = [\n 'type' => 'regular',\n 'message' => '',\n 'folder_name' => 'Newsletters, daily',\n 'list_id' => '',\n 'group_category' => '',\n 'groups' => [],\n 'subject_line' => '',\n 'preview_text' => '',\n 'title' => '',\n 'from_name' => PEDESTAL_BLOG_NAME,\n 'reply_to' => PEDESTAL_EMAIL_CONTACT,\n 'use_conversation' => false,\n 'to_name' => '',\n 'authenticate' => true,\n 'auto_footer' => false,\n 'opens' => true,\n 'html_clicks' => true,\n 'text_clicks' => true,\n ];\n $args = wp_parse_args( $args, $defaults );\n\n // Sanitize/process values\n if ( empty( $args['message'] ) ) {\n return false;\n }\n\n $list_id = $this->sanitize_list_id( $args['list_id'] );\n if ( empty( $list_id ) ) {\n return false;\n }\n\n if ( ! is_array( $args['groups'] ) ) {\n $args['groups'] = [ $args['groups'] ];\n }\n\n $segment_opts = [];\n if ( ! empty( $args['groups'] ) && ! empty( $args['group_category'] ) ) {\n $group_ids = [];\n foreach ( $args['groups'] as $group ) {\n $group = $this->get_group( $group, $args['group_category'], $args['list_id'] );\n if ( ! $this->is_valid_group( $group ) ) {\n continue;\n }\n\n $group_ids[] = $group->id;\n\n if ( isset( $group->category_id ) ) {\n //\n $group_category_id = $group->category_id;\n }\n\n if ( isset( $group->list_id ) ) {\n $args['list_id'] = $group->list_id;\n }\n }\n\n if ( ! empty( $group_ids ) ) {\n $segment_opts = [\n 'match' => 'any', // or 'all'\n 'conditions' => [\n [\n 'condition_type' => 'Interests',\n 'op' => 'interestcontains',\n 'field' => 'interests-' . $group_category_id, // See https://stackoverflow.com/a/35810125/1119655\n 'value' => $group_ids,\n ],\n ],\n ];\n }\n }\n\n // Turn our flat list of arguments into the specific grouping MailChimp expects\n $campaign_args = [\n 'type' => $args['type'],\n 'recipients' => [\n 'list_id' => $list_id,\n ],\n 'settings' => [\n 'subject_line' => $args['subject_line'],\n 'preview_text' => $args['preview_text'],\n 'title' => $args['title'],\n 'from_name' => $args['from_name'],\n 'reply_to' => $args['reply_to'],\n 'use_conversation' => $args['use_conversation'],\n 'to_name' => $args['to_name'],\n 'authenticate' => $args['authenticate'],\n 'auto_footer' => $args['auto_footer'],\n ],\n // 'variate_settings' => [],\n 'tracking' => [\n 'opens' => $args['opens'],\n 'html_clicks' => $args['html_clicks'],\n 'text_clicks' => $args['text_clicks'],\n ],\n ];\n\n if ( ! empty( $args['folder_name'] ) ) {\n $folder_id = $this->get_campaign_folder_id( $args['folder_name'] );\n if ( $folder_id ) {\n $campaign_args['settings']['folder_id'] = $folder_id;\n }\n }\n\n if ( empty( $segment_opts ) ) {\n // No segment arguments were set and we don't want to send\n // the campaign to the entire list\n return false;\n }\n $campaign_args['recipients']['segment_opts'] = $segment_opts;\n $campaign = $this->create_campaign( $campaign_args );\n if ( ! is_object( $campaign ) || ! isset( $campaign->id ) ) {\n // Something went wrong!\n return false;\n }\n $campaign_id = $campaign->id;\n $message_args = [\n 'html' => $args['message'],\n ];\n $endpoint = \"/campaigns/$campaign_id/content\";\n $campaign_message = $this->put_request( $endpoint, $message_args );\n\n // Send the campaign\n $endpoint = \"/campaigns/$campaign_id/actions/send\";\n $sent = $this->post_request( $endpoint );\n return $campaign_id;\n }", "public function build()\n {\n $token = $this->user->verificationToken()\n ->where('type', 'activate')\n ->first();\n\n return $this->subject('Activate Your Account')\n ->view('activation_mail')\n ->with(['token' => $token]);\n }", "protected function renderActivities()\n {\n $activities = Yii::$app->getModule('activity')->getMailActivities($this->user, $this->interval);\n\n $result['html'] = '';\n $result['text'] = '';\n\n foreach ($activities as $activity) {\n $result['html'] .= $activity->render(BaseActivity::OUTPUT_MAIL);\n $result['text'] .= $activity->render(BaseActivity::OUTPUT_MAIL_PLAINTEXT);\n }\n\n return $result;\n }", "function sendFirstReminderEmails($rows) {\t\t\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->first_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->first_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\telse\t\t\t\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET first_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\t\t\t\t\r\n\t}", "function build_email_txt_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= 'Thanks,'.\"\\n\".\n\t\t\t\t'One nutty fan.';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public static function buildSubject($job) {\n\t\treturn \"Invitation To Bid: \" . $job['name'];\n\t}", "protected function mail_string($array) {\n return array_map(function ($el) use ($array) {\n return ($array[$el] ? \"$array[$el] \": \"\") .\"<$el>\";\n }, array_keys($array));\n }", "public function build() {\n\n //validate\n if (!$this->data instanceof \\App\\Models\\EmailQueue) {\n return;\n }\n\n //[attachement] send emil with an attahments\n if (is_array($this->attachment)) {\n return $this->from(config('system.settings_email_from_address'), config('system.settings_email_from_name'))\n ->subject($this->data->emailqueue_subject)\n ->with([\n 'content' => $this->data->emailqueue_message,\n ])\n ->view('pages.emails.template')\n ->attach($this->attachment['filepath'], [\n 'as' => $this->attachment['filename'],\n 'mime' => 'application/pdf',\n ]);\n } else {\n //[no attachment] send email without any attahments\n return $this->from(config('system.settings_email_from_address'), config('system.settings_email_from_name'))\n ->subject($this->data->emailqueue_subject)\n ->with([\n 'content' => $this->data->emailqueue_message,\n ])\n ->view('pages.emails.template');\n }\n }", "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "private function _build_attachments () {\n $sep = chr(13).chr(10);\n $ata = array();\n $k=0;\n\n foreach ((array) $this->attachments as $att) {\n $path = $att['path'];\n $name = $att['name'];\n $mimetype = $att['mimetype'];\n $disposition = $att['disposition'];\n $contentID = $att['cid'];\n $data = file_get_contents($path);\n\n $subhdr = '--'.$this->boundary.\"\\nContent-type: \".$mimetype.\";\\n\\tname=\\\"\".$name.\"\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: \".$disposition.\";\\n\\tfilename=\\\"\".$name.\"\\\"\\n\";\n if ($contentID) $subhdr .= 'Content-ID: <'.$contentID.\">\\n\";\n $ata[$k++] = $subhdr;\n $ata[$k++] = chunk_split(base64_encode($data)).\"\\n\\n\";\n }\n $this->full_body .= \"\\n\".implode($sep, $ata);\n }", "function nf_formatEmailMessage($type,$tid,$qid,$user) {\n global $CONF_NF,$_TABLES,$_CONF;\n\n $sql = \"SELECT taskname,prenotify_message,postnotify_message,reminder_message FROM {$_TABLES['nftemplatedata']} WHERE id='$tid'\";\n list ($taskname,$premessage,$postmessage, $remindermessage) = DB_fetchArray(DB_query($sql));\n $message = '';\n switch ($type) {\n case 'prenotify':\n if (trim($premessage) == '') {\n $message = $CONF_NF['prenotify_default_message'];\n } else {\n $message = $premessage;\n }\n break;\n case 'postnotify':\n if (trim($postmessage) == '') {\n $message = $CONF_NF['postnotify_default_message'];\n } else {\n $message = $postmessage;\n }\n break;\n case 'reminder':\n if (trim($remindermessage) == '') {\n $message = $CONF_NF['reminder_default_message'];\n } else {\n $message = $remindermessage;\n }\n break;\n case 'escalation':\n $message = $CONF_NF['escalation_message'];\n break;\n }\n\n $dateassigned = DB_getItem($_TABLES['nfqueue'],'createdDate',\"id='$qid'\");\n $processid = DB_getItem($_TABLES['nfqueue'],'nf_processID',\"id='$qid'\");\n if ($processid > 0) {\n $nfclass = new nexflow($processid);\n $pid = $nfclass->get_ProcessVariable('PID');\n }\n if (!isset($pid) OR $pid < 1 ) {\n $projectName = 'unknown';\n $projectlink = 'N/A';\n $pid = 0;\n } else {\n $projectName = DB_getItem($_TABLES['nfprojects'],'description',\"id=$pid\");\n $projectlink = $CONF_NF['RequestDetailLink_URL'] . '?id=' . $pid . '?appmode=';\n }\n $taskowner = COM_getDisplayName(nf_getAssignedUID($tid));\n $link = $CONF_NF['TaskConsole_URL'];\n $search = array ('[taskname]','[taskowner]','[user]','[dateassigned]','[newline]','[here]','[project]','[projectname]','[projectlink]','[siteurl]');\n $replace = array ($taskname,$taskowner,$user,$dateassigned,\"\\n\",$link,$pid,$projectName,$projectlink,$_CONF['site_url']);\n $message = str_replace($search,$replace,$message);\n\n if ($CONF_NF['debug']) {\n COM_errorLog(\"nf_formatEmailMessage => Type:$type, Message:$message\");\n }\n\n return $message;\n\n}", "private function format_organizer($stuff) {\n $num = 1;\n\n // Recognized activity types\n $valid = array('lesson', 'video', 'tutorial', 'lab',\n 'assignment', 'example', 'github', 'download', 'pdf');\n\n $result = '';\n foreach ($stuff as $week) {\n $number = (int) $week['num'];\n $topic = (string) $week->topic;\n\n // Collect the activities for this week\n $partial = '';\n foreach ($week->children() as $activity) {\n $type = (string) isset($activity['type']) ?\n $activity['type'] : $activity->getName();\n if (in_array($type, $valid)) {\n $item = (string) $activity;\n $name = (string) $activity['name'];\n $pdf = (string) $activity['pdf'];\n $active = ((string) $activity['active']) != 'n';\n $duedate = (string) isset($activity['duedate']) ?\n ' (due ' . $activity['duedate'] . ')' : '';\n $survey = (string) $activity['survey'];\n $link = (string) $activity['link'];\n\n // over-rides for special icons\n $icon = (string) isset($activity['icon']) ?\n $activity['icon'] : $type;\n\n $parms = array('type' => $type, 'item' => $item,\n 'name' => $name, 'typed' => ucfirst($type),\n 'duedate' => $duedate, 'pdf' => $pdf,\n 'icon' => $icon, 'survey' => $survey,\n 'ou' => $this->data['ou'],\n 'link' => $link);\n\n // replace survey code with appropriate link\n if (isset($activity['survey']))\n $parms['survey'] = $this->parser->parse('theme/_survey', $parms, true);\n\n // use external domain if so configured\n $site = (string) isset($activity['domain']) ?\n 'http://' . $activity['domain'] : '';\n $parms['site'] = $site;\n\n // generate a download link for PDF; not sure this is needed\n $download = (string) isset($activity['pdf']) ?\n $this->parser->parse('theme/_download', $parms, true) : '';\n $parms['download'] = $download;\n\t\t\t\t\t$parms['download'] = '';\t// cripple this until PDF generation in place\n\n // build the proper presentation link\n $kind = $this->organizer->kind($type, $name);\n $thelink = $this->parser->parse('theme/_show', $parms, true);\n if (!empty($link))\n $thelink = $this->parser->parse('theme/_link', $parms, true);\n if ($kind == 'md')\n $thelink = $this->parser->parse('theme/_display', $parms, true);\n\t\t\t\t\tif ($kind == 'pdf')\n $thelink = $this->parser->parse('theme/_pdf', $parms, true);\n $parms['thelink'] = $thelink;\n\n // build the optional presentation links\n $thelinks = $this->parser->parse('theme/__display', $parms, true);\n // cripple this until PDF generation in place\n //if ($kind != 'pdf')\n // $thelinks .= $this->parser->parse('theme/__pdf', $parms, true);\n $thelinks = ' | ' . $thelinks;\n if (!empty($link))\n $thelinks = '';\n $parms['thelinks'] = $thelinks;\n\n // distinguish between active or not activities\n $target = $active ? 'theme/_activity' : 'theme/_almost';\n\n // generate, finally, the single line for the organizer\n $partial .= $this->parser->parse($target, $parms, true);\n }\n }\n\n $parms = array('number' => $number, 'topic' => $topic,\n 'activities' => $partial, 'num' => $num ++);\n $result .= $this->parser->parse('theme/_week', $parms, true);\n }\n return $result;\n }", "private function newMediaReceivedMessageBody() {\n $worksReceived = array();\n $worksNotYetReceived = array();\n foreach ($this->referencedWorks as $referencedWork) {\n if (self::mediaReceivedFor($referencedWork)) $worksReceived[] = $referencedWork;\n else $worksNotYetReceived[] = $referencedWork;\n } \n $remainingWorksCount = $worksCount = count($worksReceived);\n $message = 'Thank you very much for your submission';\n $message .= ($worksCount > 1) ? 's ' : ' ';\n $message .= 'to the 2010 Sans Souci Festival of Dance Cinema. We have received the media for ';\n foreach ($worksReceived as $referencedWork) {\n $remainingWorksCount--;\n $terminator = ($remainingWorksCount == 0 && $worksCount > 1) ? '.' : '';\n $punctuation = ($remainingWorksCount > 0 && $worksCount > 2) ? ',' : $terminator;\n $message .= '\"' . $referencedWork['title'] . $punctuation . '\"';\n $conjunction = ($remainingWorksCount == 1) ? ' and ' : ' ';\n $message .= $conjunction;\n }\n $nextPhraseStart = ($remainingWorksCount == 0 && $worksCount > 1) ? 'We ' : 'and we ';\n $pieceString = ($worksCount == 1) ? 'it' : 'them'; // alternately: ? 'this piece' : 'these pieces';\n $entryString = ($worksCount == 1) ? 'entry' : 'entries';\n $message .= $nextPhraseStart;\n $message .= 'look forward to viewing ' . $pieceString . ' as we curate the festival. ';\n if (count($worksNotYetReceived) > 0) { // We have not received all the submissions entered for this person.\n $message .= 'We have not yet received '; // (or, at least not yet checked in) ';\n $remainingWorksCount = $worksCount = count($worksNotYetReceived);\n foreach ($worksNotYetReceived as $referencedWork) {\n $remainingWorksCount--;\n $terminator = ($remainingWorksCount == 0) ? '.' : '';\n $punctuation = ($remainingWorksCount > 0 && $worksCount > 2) ? ',' : $terminator;\n $message .= '\"' . $referencedWork['title'] . $punctuation . '\"';\n $disjunction = ($remainingWorksCount == 1) ? ' or ' : ' ';\n $message .= $disjunction;\n }\n }\n $message .= \"\\r\\n\\r\\n\" . 'You can expect to hear from us again sometime in July.';\n $message .= \"\\r\\n\\r\\n\" . 'Again, thanks for your ' . $entryString . '.' . \"\\r\\n\";\n return $message;\n }", "protected function buildContactSubject(array $data)\n {\n $info = $this->getWpSiteInformation();\n\n return 'Website Contact: '.htmlspecialchars($data['fullName']).' - '.$info['name'];\n }", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('[email protected]' => '[email protected]');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact [email protected] to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "function faculty_get_email( $metaArray, $white = false ) {\n if ( $white ) {\n return '<a class=\"font-weight-bold text-white\" href=\"mailto:'.$metaArray['email'][0].'\">'.$metaArray['email'][0].'</a>';\n }\n\n return '<a href=\"mailto:'.$metaArray['email'][0].'\">'.$metaArray['email'][0].'</a>';\n}", "function generateApprovedFriMessageBody($sender, $receiver) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\".$receivername.\" approved your MyNotes4u Friend Album</p>\n </body>\n </html>\";\n return $message;\n}", "private function emailTemplate($data) {\n $body = array_reduce($data, function($prevInput, $curInput) {\n return $prevInput . '<p style=\"font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:2px;\">' . $curInput['name'] . ': ' . $curInput['value'] . '</p>' . PHP_EOL;\n });\n\n $email = '<!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>New Online Donation</title>\n <style type=\"text/css\">\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important; }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important; }\n table[class=body] .content {\n padding: 0 !important; }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important; }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; }\n table[class=body] .btn table {\n width: 100% !important; }\n table[class=body] .btn a {\n width: 100% !important; }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; }}\n @media all {\n .ExternalClass {\n width: 100%; }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; }\n .btn-primary table td:hover {\n background-color: #34495e !important; }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; } }\n </style>\n </head>\n <body class=\"\" style=\"background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background-color:#f6f6f6;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;display:block;max-width:960px;padding:10px;width:100%;Margin:0 auto !important;\">\n <div class=\"content\" style=\"box-sizing:border-box;display:block;Margin:0 auto;max-width:100%;padding:10px;\">\n <span class=\"preheader\" style=\"color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0;\">New Form Submission</span>\n <table class=\"main\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background:#fff;border-radius:3px;width:100%;\">\n <tr>\n <td class=\"wrapper\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">\n <p style=\"font-family:sans-serif;font-size:24px;font-weight:normal;margin:0;Margin-bottom:24px;\">Here are the details:</p>\n ' . $body . '\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n </td>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>';\n \n return $email;\n }", "function NewSendEmail($SrcType,$SrcId,$to,$sub,&$letter,&$attachments=0,&$embeded=0,$from='') { \n global $FESTSYS,$CONF;\n \n// echo \"Debug: \" .( UserGetPref('EmailDebug')?2:0) . \"<p>\";\n $Send = 1;\n if (@ $CONF['testing']){\n if (strstr($CONF['testing'],'@')) { \n $to = $CONF['testing'];\n } else { \n echo \"<p>Would send email to \" . Pretty_Print_To($to);\n if ($from) echo \"From: \" . Pretty_Print_To($from);\n echo \" with subject: $sub<p>Content:<p>$letter<p>\\n\";\n \n echo \"Text: \" . ConvertHtmlToText($letter);\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would attach \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would attach \" . $att['AttFileName'] . \"<p>\"; \n }\n } else {\n echo \"Would Attach \" . $att . \"<p>\";\n }\n } \n } else {\n echo \"Would attach $attachments<p>\"; \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would embed \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would embed \" . $att['AttFileName'] . \"<p>\";\n }\n } else {\n echo \"Would embed \" . $att . \"<p>\"; \n }\n } \n } else {\n echo \"Would embed $embeded<p>\"; \n }\n }\n $Send = 0;\n// exit; // Uncomment to test in depth\n// return; // Under test this will then log, and not send\n }\n }\n $From = $FESTSYS['SMTPuser'];\n $Atts = [];\n \n $email = new PhpMailer(true);\n try {\n $email->SMTPDebug = ((Access('SysAdmin') && UserGetPref('EmailDebug'))?2:0); // 2 general testing, 4 problems...\n $email->isSMTP();\n $mailserv = $FESTSYS['HostURL'];\n if (Feature('SMTPsubdomain')) $mailserv = Feature('SMTPsubdomain') . \".\" . $mailserv;\n $email->Host = $mailserv;\n $email->SMTPAuth = true;\n $email->AuthType = 'LOGIN';\n $email->From = $email->Username = $FESTSYS['SMTPuser'] . \"@\" . $FESTSYS['HostURL'];\n $email->FromName = $FESTSYS['FestName'];\n $email->Password = $FESTSYS['SMTPpwd'];\n $email->SMTPSecure = 'tls';\n $email->Port = 587;\n $email->SMTPOptions = ['ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]];\n \n if ($from) {\n if (is_array($from)) {\n $email->setFrom($from[0],$from[1]);\n } else {\n $email->setFrom($from);\n }\n }\n \n if (is_array($to)) {\n if (is_array($to[0])) {\n foreach ($to as $i=>$too) {\n if (!isset($too[0])) continue;\n $a = $too[1];\n $n = (isset($too[2])?$too[2]:'');\n switch ($too[0]) {\n case 'to':\n $email->addAddress($a,$n);\n $To = \"$n <$a>\";\n break;\n case 'cc':\n $email->addCC($a,$n);\n break;\n case 'bcc':\n $email->addBCC($a,$n);\n break;\n case 'replyto':\n $email->addReplyTo($a,$n);\n break;\n case 'from':\n $email->setFrom($a,$n);\n $From = \"$n <$a>\";\n break;\n } \n }\n } else {\n $email->addAddress($to[0],(isset($to[1])?$to[1]:''));\n $To = $to[0]; \n }\n } else {\n $email->addAddress($to);\n }\n $email->Subject = $sub;\n $email->isHTML(true);\n $email->Body = $letter; // HTML format\n $email->AltBody = ConvertHtmlToText($letter); // Text format\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addAttachment($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],0];\n } else {\n $email->addAttachment($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],0];\n }\n } else { \n $email->addAttachment($att);\n $Atts[] = [\"\",$att,0];\n }\n } \n } else {\n $email->addAttachment($attachments);\n $Atts[] = [\"\",$attachments,0];\n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) { \n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addEmbeddedImage($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],1];\n } else {\n $email->addEmbeddedImage($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],1];\n }\n } else {\n $email->addEmbeddedImage($att);\n $Atts[] = [\"\",$att,1];\n }\n }\n } else {\n $email->addEmbeddedImage($embeded,0); \n $Atts[] = [\"\",$embeded,1];\n }\n }\n\n if ($Send) $email->Send();\n \n } catch (Exception $e) {\n echo 'Message could not be sent. Mailer Error: ', $email->ErrorInfo;\n }\n\n $EmLog = ['Type'=>$SrcType,'TypeId'=>$SrcId,'Subject'=>$sub,'FromAddr'=>json_encode($From),'ToAddr'=>json_encode($to), 'TextBody'=>$letter,'Date'=>time()];\n $logid = Insert_db('EmailLog', $EmLog);\n if ($Atts && $logid) {\n foreach ($Atts as $at) {\n $atc = ['EmailId'=>$logid,'AttName'=>$at[0],'AttFileName'=>$at[1],'AttType'=>$at[2]];\n Insert_db('EmailAttachments',$atc);\n }\n }\n}", "public function actionNotifyToJoin(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->subject = \"We are happy to see you soon on Cofinder\"; // 11.6. title change\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n $c = 0;\n foreach ($invites as $user){\n \n $create_at = strtotime($user->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue; \n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'invitation-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n $activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can \".$activation_url.\"!\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n Slack::message(\"CRON >> Invite to join reminders: \".$c);\n return 0;\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "private function notification_make_mail_html($userto, $courses, $publicids) {\r\n global $CFG, $OUTPUT;\r\n $posthtml = '<head>';\r\n $posthtml .= '</head>';\r\n\r\n $courses_list = \"<ul>\";\r\n foreach($courses as $course){\r\n $courses_list .= '<li>';\r\n if($this->tab == \"course\"){\r\n if(isset($course->course_demourl) && $course->course_demourl != null){\r\n $courses_list .= '<a target=\"_blank\" href=\"'.$course->course_demourl.'\">'.$course->fullname.' (Parcours en démonstration)</a>';\r\n } else{\r\n $courses_list .= '<a target=\"_blank\" href=\"'.$course->course_url.'\">'.$course->fullname.'</a>';\r\n }\r\n } else {\r\n if($course->source == 'local'){\r\n $local_url = $course->course_url.'?id='.$course->courseid;\r\n $courses_list .= '<a target=\"_blank\" href=\"'.$local_url.'\">'.$course->fullname.'</a>';\r\n } else {\r\n $courses_list .= '<a target=\"_blank\" href=\"'.$course->course_url.'\">'.$course->fullname.'</a>';\r\n }\r\n }\r\n $courses_list .= '</li>';\r\n }\r\n $courses_list .= '</ul>';\r\n\r\n $data = new stdClass();\r\n $data->username = $userto->firstname .\" \". $userto->lastname;\r\n $data->courses_list = $courses_list;\r\n $message_intro = get_string('email_message_intro_parcours','local_magistere_offers', $data);\r\n if($this->tab == 'formation'){\r\n $message_intro = get_string('email_message_intro_formation','local_magistere_offers', $data);\r\n }\r\n\r\n $publics_list = '<ul>';\r\n foreach($this->get_publics_by_stringids($publicids) as $public){\r\n $publics_list .= '<li>'.$public->name.'</li>';\r\n }\r\n $publics_list .= '</ul>';\r\n $publics_message = get_string('email_message_publics','local_magistere_offers', $publics_list);\r\n\r\n $link_preference = '<a target=\"_blank\" href=\"'.$CFG->wwwroot.'/local/magistere_offers/index.php?v=parcours&action=changepref\">'.get_string('email_message_preference_link', 'local_magistere_offers').'</a>';\r\n if($this->tab == 'formation'){\r\n $link_preference = '<a target=\"_blank\" href=\"'.$CFG->wwwroot.'/local/magistere_offers/index.php?v=formation&action=changepref\">'.get_string('email_message_preference_link', 'local_magistere_offers').'</a>';\r\n }\r\n\r\n $message_outro = get_string('email_message_outro', 'local_magistere_offers');\r\n\r\n $posthtml .= '<body id=\"notif_offers_email\">';\r\n $posthtml .= '<p>'.$message_intro.'</p>';\r\n $posthtml .= '<p>'.$publics_message.'</p>';\r\n $posthtml .= '<p>'.$link_preference.'</p>';\r\n $posthtml .= '</br>';\r\n $posthtml .= '<p>'.$message_outro.'</p>';\r\n $posthtml .= '</body>';\r\n\r\n $posthtml .= '<footer style=\"text-align:center;\">';\r\n $posthtml .= '<div style=\"margin:auto;display:inline-block;\">\r\n <img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAuCAIAAADiJ8FWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAB5USURBVHja7Fx5nFTVlT7nvqXq1drVVb0v0DQNCLLIKiqILCqiuEKMY6LzM9GYmExcJhPNJDEzMU4SdUyiJsYsuBEQN1AwrqACirLL2kA30N30UtXdtb+qt9wzf1R1dVV3NTYugZnh/PgDHq/eu8t3z/3Od859SERw2k7bF23s9BCcti/DxNNDcEIW0UyRoSKezAXZlTDuXN/ZEjVGeeSvjnBML1NOwYHC01vhIO1QSLv/4+43muIWAa4aZr9zUmGxchKWpUl041vtz+wIgYTAQZDwsmGOq2sd86ttXkU4DaxPNToWM7uTZlznJoHAwC6yQotQaj85LrZTNc5+vvlgRxJkBgCQNGfVOt68vEJk+A9uyZ6u5JilTYCACABABGAQcKoskG8d67p+pLPaKZ0GVh5rCOnLDoRXNsT2B/W4CTonAAJAWUCbACMLpIU19mvrnMPc8j+yVY/s7P7uW360pndAAgCdv3p5+YKhji/k+TsDiZUNMYnh4jrnMPfxkLG7K3nm0qOAiLmQJpPAoEKbsGph+bmnwOZ4CnGszR3qjz/oXN+WjKomMADWsyoBAUAzSTNoU2tiU3Pi/i3BqUWWuyZ55g+x/2PatqVDy45zEIA47AgkvxBg/XlP6LZ3/AnNBIBfbel+8qKSywZ+7CiPfOMZziXbQiQzEHvRhQKCgF0x428HoqcCsE6JqDBm8LvW+2e+0PL3xnjUIJQZigwAweRg9PwxCQBAZGhhUYO/czR+ySvHFr/WWh/U/gEtHOuTgGe5BwBAGF1o+fxPbo8b/7qhM8EJrQJahW7V/PcPuww+4DYiID4ys+jhecWTSy2gc0pyyr4ZwS3hqTCnJ38rrA9qt61rf/OQClZERCIAk4CTXRFGFspliiAx1Dj5VfNQWO+KGkAAIiJDIgCNlzjF319QfGWt40ttZHNUn/xcU3tYB0kAAtDMM8uUTYsqbZ87PNzckZiyogkgvbURB6/C6v9pSKFV+FQWv/JQ9OWG2FstamtQByHNudZeUzmrwvb/HVgNIe2yV1v3dCTRwgCADEIBpxVbrh3huGyovcYtIfSuv9aYsbFVXXog8n5Lwh8zQUREIJOA0+Nzi28eU/ClNvXDNvXWtf4DYV1EPMsnPz67eETBF8DzNrUnzn6+GaCHjHPyKMK+64YUDzrEa48bS/aEVhyKx5LmbRMKvjOu4P+7x4po5rQVzXv9SZRZig7XFcqPnV80t/pTmFNb3Lhvc9fvd4ZMDigicQDOV1xSes1w15cd6jdFdIlBheMLCx0+ak9MywVWoSLsu25I0YlrBxonmZ0S++DJ5Fic6KtvtKdQBQCQ5F87w/XR4qpPRRUAlNrE380s/mBR5VCXSDpHBoD4rXcC2/zJL7XNAuJQl/wFogoAbCL2n5L+Fwdjpw6qeqPCpMmX1Uf3d2k1bumGM5yykAbcq43RN47G21VTJ3CIWOeSrhzuONPbl7RuDyRfPBhtCOsxg2QBiyxsvM9y1XCHd2CisOxAZPXBaEoWIo3fMNb1lzklrDfKoY/akh+0qYEkt4s4pdg6q1IREFMb4tL6SCjJ5w+xrbu6cvZLLQ1BHUXsjBk//CDw+sJyADyOq1txIPJJQOvWOAcokNl4n3zdSKfPmh6HnZ3JlQejGsGlQ23TSvvGVh+0qWsOxxUBF9c5hg+wD4Y085WG2Kb2hD/BNU4igtcijCiQ5w+1jfLIPdQfAeBwRDsSNvZ29wk+UOPwZlO8wMJsAo4rslgFlpeYrmyI1gf1oMZNAkXEMkW8oFKZP8TGEI8b3ibWHI4lTDqnTFkw1JZqyZGI/vKhaHuM13rEG0c5Bcb6d2p1Y2xTe7JDNZMmSQL6LGxCkeXSobYyuzTgVhg36Kuvt67aFwGGwGnhKOfKBWUftyfv3dS5piEG1OPXCICTTRG+M8599+RCj0UAgL1d2sPbu5bsi2pJ3juhBABQ5ZH+ZXzBrWPd/RluWDPHL2s6HNJRQNL5BdW2Ny4vF3v6s7Ih+sjO4FtNKhiUfpaAM8qVe8/2zq5UpjzXvPloHBgyCXdcVw0A01c0Rw2ODMngLy4ou7LW2b+f3Unz0R3Bx3aFW0MaYA9zIwCCWq/006ner41yrT4cvf719mDUAACrIvx1Xsm1db2PemZ/+MY3202NA0F5gfy3i0tm5nJkg9Pju0IP7wge7NTS4Em9hQMAKFZ2xTD7zWcWzKpQAOCh7d3/8WFXSDOBIfbzNGQSEAHApGLLo7OKsyG+qyv5h52hJfsiMdXsfUVqnBieU2G99Uz3V0c4hXze6697Q99e608kTAAAxB9O89x/TtFf9obu3hDoCBuACATz6+zLLip1yULPTPEndod+vyt0KLtTlH5pqVv6xmjXt8a6KvrBC4no4e3dt7/tB4Wlf8LpR5M9f9gd7owY/d0rEUGCT6tSVl1WvrUjef3rbZ0xA2Sh/zohk0DjV45yPn1hqV3KwdaKg+HFq9tQYsTBI+P7V1eOSXtBumt94MHN3YAAYu/aIwDQuGIVfjfTe+eGrpDGAQF0vury8suGOm5/v+Phzd1oEUjn51Up719V1aclh8PaotfaNreoILM8s2gQED10vm/J3ujO9kRqayaDXFah/vrqEpsIAB2qMfKZo0HVRBFTLnZCmXXz4qpMtyMa/8Y77c/tDoPMIM9gQCqGZRJ79sLi8T7LmKVHiSAVyuW5OfM31ZxcpWxaVJUai6f2hb/3rj8UN0HO45gIAAwCg189yvnorOJUyzN2NKLXPXNEMwgFTM1OpUv88STPLWv9aRks9YSE+eQlZV8f5QKATzoTN77ZvrUlCTLm7xQn0KjGKz99YfG5Zba+HGv1kTiIkNEikeF9H3d3qibm27QRERVhU2ti1osti19v60xytAh5vS8KiIrw0v7ov2309xni3+0Mp8dT53dM9PSgCu5cH3jwoy6QGEosk7JIrxOZqQa/ZV0gZhAiACe3TZzoswLAjyZ7S9wScQIB93TrftXIfl1rzDj/xZbNbUm0CphvHaOIILI73u/8pFtLEz4AEDCsmUcieupfR8JGMMnTIT0AiNgSM8Nar7R11wb/c7vDqAiYfzAAEdDCONHN6/y/2REkDqk789+c8Xcy60jwpEkA8IvNXTf8vT2kcbTk3+4w1Rer8EJ99IKXmjviOeNwLGZqJkDPCKCAbXHzlncDwBB7+oUAwODNo3EA2BZIzH6xZWtbEhU2YKcYopU1hvRZLxxb1RjtC6ys8cmiqQyJE2mckpx03id2RInt7dIiei/803ca/WJMC/vz7sjmjkTmwjZ/YmOrChISgcXKrqlNs/W3mmIPbemGHpiSSaRzhgAmkc4JABmaBEaqKSac6ZUrHCIA+BRhRrkCJiHDrpjxcda7VINf90bb0aCO/WRDSu826VkHASlPGNjzl36OhRNl/vflhsgfd4Ygi1BSqv0GUa7UiQJGNN6mmoKIgwrHDXJKqIhsaX34RxsCIPaCIOVW+09QahHuDWgXrjoWyZlagtwupuaqL2RMKLUzf1xftKYtoJq9Kw2gFw8a7+08AIpoEF37Wtt7LfEc8t5/GSMA6VTqFC8fZi+1Cdv8yVca40SUveIzPSSNj/DJC2rsFgHXNqubWlTM2vgQIZHkD28PPnNhaerKJ51JUyeUkQw+e5h9lMeSQsAPNnb25lY1flaZ9d8mekZ6pIDKn9oXenpPBKRsck+1WTm1IU4xvX+Y9ElAu2RI+vqT+8LrGmOYG0OQSWASkxgAcY2AIYoDrEjIWso9pLsXiz32/KEY8NwZMqimQPJa2cGQEYwZgAhSz//rdE2tvcIuPrY1SADAsA/oKbPWOZW6pAfO8bXG9G+t9YOAyLIIiU5jSy2zK21ume3v1lYfjkcTZmbkUWI72hI/+jDw25lF6WZjnx5A9jZMBGBwMGFcmfWuszy3b+g8FNAyudHUjHjs4sJR9mFusS1uvn5EbehKZmYEBVR1/u13/e9cUVFsEwfMFZJBs6qVP88uzuR6l9eHb13rDxrUZ+GSTtee4fzDBcVuWQAA3aS7Pwg8uKU7G1sg4NZA0uCUqgVojpmZIVww1N4TjmnbOpIgstQzJ5dZX1tY7uupS5lbpWgmLN8f7Z0DghHu3sYXWnqh05FIPz+YNB/cHoRcekc6H1Mkf2O0e1aFDYDWt6p/2h3Z0ZFA6TMqLwRwMKRDriP5/lnun03zumTWFDVeOBhd2RBb16wSJ+A0pFCeV2W7fqTrkmr7obDeFDUe3BHMzDgR2CX80TSfTWQukc2uVoY4pVvWtkdUjjJmPIfC8D9mem8bX5CJGfd0JW9/P/DGkThmpAqJPboz9M0xrrFe6/HbDxoXZDavxn5Rte2bY9wftqlL90XAkoOqq0Y47j/Hl9GEQ0nzV1u7f701aPQ0HSW2uzXx4PbgL8/x5QcWEcgCPDzDl11B8JURrs3+5AMfd+f4RpPGFluemlci9QR0koC/Ptf3Qbu6sSXZ20MGIY3iBrlkBIDmqAEEBAACjilMv+LvR2JgEApIBLKID8/0+XKqnfDmM13L66OUCUpEnF5qzfLfGcaLQg/2l9ZHDvqTmIU50vm0MuuaheWFPfrChCLrV+qcl71ybFNbVoNPxHSTurMiYiIAhJtGu1OBVZVD+v4Ez/cneFY1RJfsCcsC3je9sMQmAcCCGnsqrH5gezDjFYFIEdgdEzyWHqQeCWtL9kUgy6sxTr+a6bttnCe7GaMLLasuLZ20vHl3QEt1BBG4Tr/dGXriggGBRQTAae5Q+0+nes4rT7Pvez/uJk69O5JB84fZn5tflk203Bbhvuk+ScCfbezshYTMlh6I/nBSgceSN9Vl8Gll1vG+vq25boRTkFgOMzBobqUi5coeiPjdcQWQSyCSnGs9bKNbM9PoYGDvmcu1LWpa1DD4RUNtfUIMAKhxyYqFpR/LqcQhTizqbWGnamb+XulIg+bdY2r2/kQEDqvwxOziDKpSVqSIT15YKg+S9PSnowwUESGbrnF6cm+oTyJ54TDHi5eWL5tfVluQowJGdd7fhWSHBeuOqVqS9wbIBo0rsdyWL29jEYT7zi7MlSnZ0vpIY1gfCFVItGRu0ZtXVGRQdSxm7OxMbx2peyQR/3uGLy99v2N8QVWBlOGRKGBzl7asPjqA8k5Ql6/aaahL8tkEyB3+SkceCbTGKUHfG3u3UCTM5pMAkDCoOWqmuR6HKcV5VphqcKOXS9PUYktBlis6FNaBIQEwCaeWWABAM/muzpwdCnR+aY1trC/Pw0cWyJcPs4PBP5scX+uSIAtGKLEHtoWmLD/66M7usMbh89lLDfEc+mHS10a4BhKBLx/mHFdsyYRQyCCe4B+3D5CQ0Pk9kwtvOCMHo283xcMxsxdFJk0psYz05K/jcFmEm0a7IDtiY7iyMTYgx7IKedotMbAwzHFFCHmrv4+r/UKBRUizSANiOgcAg0jLijIiep7J2NOl6RpPe12CaSW9Xd3dmXyvWQURwaQKlzjeZwGApqjRENb7BCYzSgcsVLp+pGtFffSzzf31Ixwv7o8QZXVcwO1+7bZ3/A9uD82tUBaPcM6t+iwVB3GDb/cns3uBEr7drB4K63n9K0MIaxxZjptoien53BUpinDT6L5i8sY2NVdQgM4Ev+3djryFPAhYH9JyKASDlphpci4OSOjyXaTB3Xl8q3IK6RiF064u7YJKm1VAtwWbwmmJ6I2j8fumkZQF7oTJH98Vyh7fYa6MT6U7NgTCqokyI52urrWnsN4aMxN6r/JEBCjiWcUDVlCN9cqKhakpkewE7cpa5x2TEw991EWykJpUBAARAbAxpD/RqT2xJ7yo1nHLWPecE4RXe9z0J8yc5cFwTWMMBi7YStUUZc9QRKe80+mQmFvuu+E0hI0cb8hwf7e2/zhJWIZ9uKlqksZPLAk9+DHH4yTsKu1CRo1dfSQGACLDqSWWlGqEAu5oS9y/pauXPyWMW9f632pMxzupIrtSu5DaH+9cH3ijMYYyI53XFlnunerNdK8P6kWBFcgD5i5dEtolhM9a6/HAeb57pnstSKTn1IuggGhhwHBFfXTuSy0/3Og3T+QVqpGS8PoquiizAf/0U48GjknyNCXWT4lEdtzX9Xk6AREJeDJKk8f5rExCTgAiW9uk7u5MjvFavjLc+ZdPwunQVWI/3dS1qSNxYaW9KWYsPxBpDhvYE/0iACH+cVdoZ0Bbsje8vS0BMiOTrCL+/nxvZgkKrC+2DZPybrI94QV8HjqEgPdN9y0a7rhzfWBti0o6ZXsORAAZieCXH3Y1Rc2n55WwwS1SiaGAoOcKUCkdbrBaCIMpxSdQ6SqzfOjTBz00Bp1fbpUFPBnA8sozK5R1R+IoMS1prjgUHeO1nFemjC6y7vEnQUJEIAHXHIqtORADBBARRMxmMCjisv3RZXsiICDIDHSuSGz5/NJ51Y5sZYsx5BmVBYF0/klncmpJ/tj7cFiP9Nl0TtwmFFnfvrJyqz/x1N7ws/sjgZgJDDOV6YhAVmHp7tAVw+yLhjsH80CfIrhlIRHP2p44TSuzji6QP3WqOZFLYtfUOc4vP4ES+Aq7mOPpiUoU8ZJRTv5pSCYiEXBamfX6kQ44KYcpGOJ3x7rXHVZTC+R324JX1NgnFFl/f75v1ostZFI6MyX1RrxgciYwyt0OSEQwCBJ8WoXy4ExfnxMEVQ7RpwgdcSN7A9/UnrhptDtvq1YcjJJBGRHy89jEIuvEIutdEz1vHY0v2Rd5tylOPQl1BCCGD20PXjnMMZijYwUWNqJAao8YGc5CBp1ZKP1pdsmXNDsTi6zPUDgrjQOyAH+ZU3wcbpN/luFk2Lwqe61XIoMQsUs1/+U9v2rwmRW2JfOK3RKjJCeTiBNxIp2DQf8+pfDrIx0UN9MXTSKNg8ZHFco/O8/74Vcq+59L8VqFkR4JzByu8drheHNUz8eRjaf2R+BzFLAnTB7VzVwhRrpxtHvdlRV3TykUs8mMyHYEtOaYMUiuelG1LYeqi7j6sOpX9eP/cKs/sXxfpF+x16fbnEpFtvSqlShgU8h4/mDs+L86FtNX1EfeaY6fZGA5ZfbLc7zAiQhQZu81qf/8VrvB6euj3Guvqby8zjHUJfoUodIunlehvHRZ2X+e7fvBWZ7zhihldrHYJtZ5pPk19r9eVLLtq1U/mep9pTF21aqWp/aG+njr0R45R15i2BzSv/eeP56rV8V083vv+btiBn7Wwfjj7uC4Z4+OeebojW+1fdyu9gl4fnGOt8ghZmejdU6xQRO6BUNtqYR9phdtEeOmtztiuTjO2IGg9p11HVOXN1+75ti05U3rj8VPqC9jCuXaAimHwyF8e11H3371WFgzH98VnLisefHq1jnPN/3rhnQly0k7V3hVreOKEY6X66MgM5TZ8n2RpElPzSs5y2d5+dLymM4TJskMnT1k8oxCy/uLqkNJbhLZJZbKeJhEd633P7ilG0x6tUWdVWnLPgd82VDb4zuCObMss5cOxs6PtPx8euGkIisAbPEnfvJh10fHVJQ/I6yeOxC55c0OYAgMntwVfnpv5LqRznsme4a7ZUlAg9Pf6sP+WBZ7I7LLbPDH4c8stJxbZt3QnMhkdVDCVw7Fz17RfP9078wKm1NmCKCZ1BDWf7Mj+PS+cCzBQWJoFSJJ85tr/ZsXV9kHnQkVGP7zKNcP3vVngkkU0K+as19q+cEkz02j3cWKIDI0OQ8k+EuHog9s7T7UrYOIaGFE8MCW4KVDHedXKCcNWAj45NySGUF9Z3sSLQxk9vLB2OTOpp9P9y6qc9ollrfk1d0TG8YNvnR/5Hc7Qzs7EiAyYOSSWZ9S1YuH2C4YYl97JJZTbSHi5vbExSuP+WwCAAZUAzh8NlSlfvPbnaHUYwEAZOQEz+yJvNAYq3GKdpGpJt/brZvZDMWk6SXWPlV4xzGR4S+nF5634lhO+CLhroB22autVS7JZxVEhIjBD0eMhGqChL3dEdn+oN4eN07o4Pj3xruXH4hsaU1knoMCRg36ycbOh3eEy+zMJjCN07G46Y/owDBTDZqKkLYHkmlg9Sf8A4QARNSXwxHhYPRVojwXXbLw4oKyRWtat7Um0cpAwvqgvvjvbbN2heZV2S4ZYh/lkawiy86gHQ7pH7SpH3UkN7Yl9geSgIgSIwBI8june325bkBAds8kz9rDsRxNPEX8AQJqukI3FRkTHVepyycNp67ZxZxsREpZUA2+J1XLm0r6ZKeoCW4b58a+j+kjROdcPLfcfvdUz/0fdlFW4WiqF00RvSmkp+kY67dCkuYlIxyVDgkAgDAnszaA4g0AFoH993m+BauORYzeVDQyBIZdCbMrUz/IoE9JCBnkcogXVyvprVBiuW8gsORL6YiIQr878yqO/X/NMD+BqXXLLywou+Wdjjcb4yBharDWHY2vOxz/8Uddw5xihUO0S0w1eSjB21XeGjN4SlMRECSGAGQCGPxr4wtun+Dp//y5VbZ7phX+4oMuyq26RMgpQyNOsogCYmIAfYgh9StmSqtUP55S+FFbIphVC5WCKwj5BCHNvHqU68Is/Z2lRV/MfnL/jO8vpns74safPwlTtjyW+j0bQPrU+JgS6yMzi2UB05OCmP0qBjjQfjyjwvbXC4tveL0jZlC2BIoM8ioyqdN7Nok9NMObSiwyAJhXqQDPFMgDAMysyCP2KCKbVmqFnvwAcbBa2bllee6scIhuC/YSQIPKbYJrgO2mxiWvXlh+97RCp8RI40CAEkML4wQHg/q7R9U1h6JrD6tb25MtUZ0DpARfEBA4kcaLFfbQrKKn5pVYBxCY75vu/cYEFxhE+TRvAiCDLAwfm+ErtQl9Cj4znqPSIbotQq8nN6jcLrgkBgDnlStPXVRc45bSwSwNkA0zCXR+yXDnsxeWSFkHbyodUoGc/WQotzN3HtUD/zSn9J6zCx0CksYHUu+pp85TALi8zv72lRVDXVJmUlwyy+mCTXRZBqR6V9e6nruktMYlpk7xD5jlIyCDQKdxPsvLl5bdNLog7VzuvffeScWWjR3Jw4EkmAAmzamx/WSKV8rntIY5hRcbY3GVg0lA9PNzvHmPxDglVqIIqxvjXOdgkkthfzzuuWEBcU6V7Ypae5tqNoZ1Q+PACRCAIQiY+twFMARAIAKTwCAgKFaEm8e6n72o9NOOIuLCGkdNgbjVnwzFeer8PhCBCWAQENV55KUXly4cZv/F1m5Vp959C+HmMa4KhwQATlkotLJXG2KgU6pHf5pdnDkBNrLA8vUzXDYZ64N6ROepe3reQqnkf4VDvO8c729mFom5VUYOiZXa2OrGGNc4mOBShD9eUDRigGqCOZW2S2tsx+LG4bBhZL+FExgEBgGC28IWDnM8MbvkromFjiwn6pRZkcLWNMa4TmCSWxGemF00/LiHuesK5BvOcCHDfd1GPMlT30sCDpD6DIJJwEEScFKx5dczfA/PLB7h6X1a+iR0KGm+06TuC2qjPNLFQ+zH+WJdU0R7/ajanTSnllhmlis4cIy+zZ94ryUhMZhXrdQVDDarsL9be/dYfOWh2JZAskPlZPKe0xQoClhoFWqd4owKZV6VMs5rKbadQPDRmTA2tSXeaIrv7jJiBreLONojz61SZpQrBRZhd1dywrImg3q/OyUx2P6Vquwvf3zUrm5oTSgCzqm21bnlvqW+AN0Jc39Q+6At8XF7oilmcgKvVRhbKM2ssE4utnqt4nHHShUZzKu2D+bk/v5ubVsg8f6xxMGQHtW5wLBCEcf5pLNLrXUFcppU5bMt/sT7LapVwDlVtrpBfyKgLWbs7kqub03s8GsdSYMICy1sZIF0dql1dKE8ypPnzNCp+0W/zoRxOGx0JQ2TIwIoEnpkocwh+qxfynfr7lrvf3Bzb30scSq0Cvv/aYjvVPpM3v8iO3W/Qeq1isdZ4oO0t5tjLxyIOi1sos86p8o2EEo2tMYf+ySUUx1v0tQSi085/fHf/3PA+vz22pHYwldajZ7ioOoC6cYznJfXOKucok9hCAhArTHz70dit78fULNC61Rcd+uZ7hNNkJ22/wVb4ee3i1a1vHEolqm3SVebSMxnZdUO0W0VQkneGNa740afc+6k8zHFlh3XVgt4GlinPVY/ixsEfQ5CCkgEAdUMxExIyaYMILfMgDghw0dmFJ1G1eex/8sc4trhDjCJcjVPRMDUCVWJoYiYG8+QQUjwyKyiWZW20+A47bHy23fGFWic/mtzd0fEABGB4UA+iADAJND5UI/80+mFN45yn0bGaY71KXYkov1qS/DtZrUhoutJDgBp6RUyyjEAw2qXeHG17cfTCivt0mlYnAbWYE0z6UBIW9+ibmxLHAzrEY04gIVBoVUY75XnVtnOLVOc8mlx4Quz/xkAPrxbakS+66YAAAAASUVORK5CYII=\">\r\n <img style=\"margin-left: 10px;\" src=\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/4Q/eRXhpZgAASUkqAAgAAAAHABIBAwABAAAAAQAAABoBBQABAAAAYgAAABsBBQABAAAAagAAACgBAwABAAAAAgAAADEBAgAcAAAAcgAAADIBAgAUAAAAjgAAAGmHBAABAAAApAAAANAAAACA/AoAECcAAID8CgAQJwAAQWRvYmUgUGhvdG9zaG9wIENTNCBXaW5kb3dzADIwMTk6MTI6MTAgMTc6MjQ6MjAAAAADAAGgAwABAAAA//8AAAKgBAABAAAAyAAAAAOgBAABAAAAPQAAAAAAAAAAAAYAAwEDAAEAAAAGAAAAGgEFAAEAAAAeAQAAGwEFAAEAAAAmAQAAKAEDAAEAAAACAAAAAQIEAAEAAAAuAQAAAgIEAAEAAACoDgAAAAAAAEgAAAABAAAASAAAAAEAAAD/2P/gABBKRklGAAECAABIAEgAAP/tAAxBZG9iZV9DTQAC/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAMQCgAwEiAAIRAQMRAf/dAAQACv/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFCI8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A7vo/RejWdIwbLMDGe9+PU5zjTWSSWNJJ9it/sHof/ldi/wDbNf8A5BP0P/kXp/8A4Wp/89sXM/Xj62dY6H1LHxsA0+nbSbHeqwuO7eWaEPZ+an4sUskuCNX4rZzEI8Utnpf2D0P/AMrsX/tmv/yCX7B6H/5XYv8A2zX/AOQXm/8A45P1n8cb/tp3/pVWumfXj649Uz6On4n2X1sh21pdU7a0Ab7LX/pfo1sbuVg8jlAJJiANTqwjm8RIAuz4PffsHof/AJXYv/bNf/kEv2D0P/yuxf8Atmv/AMgrtbXtra17t7wAHPiJPd20fR3Llvrh9YOs9GyscYnojHyGOgvaXO3sP6Tgs2t2PrVKchAWdvBvcty8+YyjFjIE5AkcR4fl9TufsHof/ldi/wDbNf8A5BL9g9D/APK7F/7Zr/8AILhP+f8A9YvHH/7bd/6UXR/Uz6w9R607NGd6f6uKvT9Npb9P1d26XP8A9E1MjnhKQiLstvmPhPM4MUsszDghV8MrPqlwdv6za630bo9XTnvrwMZrhZSJFNfBtqB/MV79g9D/APK7F/7Zr/8AIKPX/wDkt/8AxlH/AJ+qWipXOaH7B6H/AOV2L/2zX/5BMeh9BBDT0/Ek8D0a5Mf2FoLK6/g5OXVjvw2TmYlv2nFsLtrW2Ma7bVb+f6GW1z8S/Z/g7vUSUkd0b6vMkPwcNsczVUP++pO6N9X2mHYOG08waqx/31Yr+h5dV111lDH1nOyMt9tjmEFluB9le93qfRrdlu+z+n/3G/nPYpU9By6cVuPQxl+Ix+A/BLnB1ldFeTVl5GHZc8u9ejCrr34Vm7e+r9B+ksq9a1Kdf9kfVzX9Sw/a7a79FVo4/mH2/SUD076si2qr7FiF1+70yKayDtiW7wzbu19qx3dAz34PV8b7K21mRjXDDGQa3Xsvs+0FuMzKb/PYbHZDrMe3J/WMf7RdX+k/wWg/pVrOuOyaccV4jqcVgFbaYL678nIuD22e9np/aK7/AFKf8J/wqSm4Oj/V4tLhg4ZaDBPpVQD/AJqdnROgPaHMwMRzTw4U1kf9QuYq+rHVK+m5OOcRptyGY4YGvYGsFGW/KdTZV/M2WbLn5NGR/wCgtvp+l+s9dgVOqpc1zCw+o90uFYc7c7d6jm48V+7/AD/9J+kSUh/YPQ//ACuxf+2a/wDyCrdU6J0WvpmW9nT8Zr20WFrhTXIIY7X6C2FU6t/yVm/+F7f+ockp/9D0fof/ACL0/wD8LU/+e2Lgf8aX/LOF/wCFj/58K77of/IvT/8AwtT/AOe2LD+tfQei9VzmW59+TVbjUCGY5r1a57tvssZZY+zc1/0FPyuSOPKJS2osWeBnjMY7vmWFitybYttGPQ0tFlpBcZcdldVNLfffkWv9tdTf+Mt9Opi6jpnQLei/WDAtOScfLF+1mJk1P/S1uHpXDFzMT16spzGW+/8ARY/pfz99dVS08P6l/VevKosxuo5xtL4q2ODSTHv2Wsx2OZ7He6yqzfsV3E6P0XpW4YuZk025dZFmddtfYKw8VUYw+1V72e/+ar9H9L6f6z6uxW8vOQlYjI0RVcPdgxcsY0SBxA3dvXrkf8YePSOmVZD7H+r67W018t1a/wBQdtns3P8AUW3j9RwG0V4lWRY57oqptdNj3lw9t29+/fzu/SLCzfq/0zJbTVmdT6lfU31bA61zSK9jhQ91nq0eq3c87avZs2ep/gllZQTExiLt1/h+THizwzZJ8Htm+ERMpS01eCXaf4tP5zqfwx//AHYTf80vqpqf2jlwIkjaQA6Nn/ab87ctv6r9J6T0yzLb06+691gr9b1o9u31fTDdtdX77lBiwzjMSI0F/k6/xH4ryuflMuLHKRnPhq418uSE/wDuW91//kt//GUf+fqlorO6/wD8lv8A+Mo/8/VLRVp514e93XB0n9UOccg4Wecnd6xcHAv/AGX6O/8AStzfW2egyn/tN6nr/wDaZbPUDkt6FmCh15ubcyHUG8v2+pUT6Lnl2R/M/wA76P6L+eV7rN/UKG47+nlj7vV9+K+B69YY+y2imxxb6WTsZ6mO/wDmfUZ6d/6J/q1Zb/rM8YOPm47xkY7bHX5zywtNeEbrMVr31+19FtP88/1WfzXT87/CpKbHWg7IxnX4rsgmzIxceysC0M9Nl4+0v9Fu39DZTdazKtb7Lqa/+DWdmftMfbDS/L9VvT2fYPR9csOYLsv6Db9zLPd9m9T7V+i+x/zn6qrV2f1KgZ27OB+yZuHiAuZWAG5B6f6tj4j9JtzL/T/62gnrvUXYlGV6zabMu3MotoLGu+ytx2ZT2XncWOc/Efi0sy/Vf6N32n9H6f6ukpMw9VDczHb6zs9uXbdjNe6z0i30fUx/0u7b9g+0/o/S3f8AB7PUU8Rzz0ul9D805uRTXj2i4va9tln8/kWNtY+inKo23P8AYz7P/g/5r0U2N1zPezJx8rZR1ShlNIoa0uqddc65tGdjOcWvycK+uv1/RZZ61NdGTTZ+mqT9O+sL8u7p3r210B2NlnqFJ2jbk4j8XHvZue7dWyl9uR/1r07ElNfAHUr8vpbcwZbba/tFHUDuubW5+MK68fIOz0qfTytv2ivb+jt9VVsZ/WD0+45Ds4PGC53T43+ocv18z1N0+59mz9mfZ6839B6H/A/alrdI6ll5Wfk132zXVlZNFYHpBpFXpenTt3fafWY19j923Z/4EgY3U8/Ixcq05XpupfmhjopLS3Gvtpraxm5136Oqpn2h9rP8IkpepvVq82vebrsbJyWG5rDZGPexjXXemXn1LukZXv8AY72Y2R/paL/1XX6t/wAlZv8A4Xt/6hyH0O7IyOlYuVkXC9+TVXduDQ0D1GMeWt2e3ZvLtiJ1f/krN/8AC9v/AFDklP8A/9H0fof/ACL0/wD8LU/+e2Kn1q7NZl1toxbr6vRe51lVlrAHg/oqttD2tc6z+p/brVzof/IvT/8AwtT/AOe2K8kp56x+Wxtzhg5b9m40BuVfNga41+7/AELneyytn59b1C617WbrMHLIZrL8i+GvD7GN1935lbLfW/mf0v6SytdIkkp52x+WabHUYmWbG1VWVNfkXw59jtltB91bm/Z/zv8AtxRNuYH2Vjp+a5zLLK2EZVoa/YWejZvc72Myv1j0/wDRejV9o9P7R6i6RJJTzvr2GNuJnOduLXt9e4GuWtfT6vu93q7/APAer6H+FV/pFlrn3tsx76NoZBvsfaHEh2/0vV+jsd+7/OLTSSU53X/+S3/8ZR/5+qWis7rwJ6Y8ASfUo0H/AB1S0UlPK5H1qyqMBmdkYlLy+rNsx9rj7bcIXP8ASfvbv2ZOPj2/rDP5mz9D6Vn84tHPz7cfpOXnejVdaxwr2vY+oPbubXttba31Pa6yz/SVqwOgdI9F9H2YGp9VlBaXOP6O93qZVbNzv0bch/8AP7P53+wjXdLwr8e7GurNlOQQ60Oe8lxG3b7y7f7fTb+ckpqdb6jhdJorstpqey2xnrglrNtLSyu7MLXB3qtxN9fsQ+v9Q/Zm22rGpuN9WQbi/QuFFL8musuDXbmv9L0/f9BX3dKwHttbZWbBkVvquD3OfuZZ/OsPqOd9NQs6L024AW0+oBQcUNe57gKiHVuaGudt3ure+t1/8/s/wiSmlT1S6zK6fQ+mpzMh7xuLH1lnp0NvaamXN93ue6r1G+z0/wDttVMjrDaYGXh44OQwuxryP0Zyd1rfsd8jfXZkto3Y13+Ht/Vv5/0ftGy/o+A8M3McXVOD6n+pYHscGGj9FaH+rX+ic+vax/56k/pXTrKXUW0Mspeyut1T/c3bUd9HsfLW+k872u/fSU5DOr3g519WE227FsvrDKanmx7an1Mda2yG13P2W+q/EY/17dnp0erYo0dcxnXYRbVjDH6h+jZmBrhVa51j634brNm/DzW1srf9izWfp8qz7DXZ62PYtf8AY/T4eBWQLLHXOAe8D1XOFrrmgP8AZbvb9Nn0EzOidLY4ObTqHNefc8hz2Pdk123NL9t1rMix13qXb3+r70lNfoHUsjqFDX2VsqYGT6bGvaGkPtp2tfY1tVrP0H+D/m/8xW+rf8lZv/he3/qHJ8TpuHhBoxmFgY0sYC5zgA53qP2tsc7bvf8ASTdW/wCSs3/wvb/1DklP/9KhX/NV/wBRv5ApLzdJJT6QkvN0klPpCS83SSU+kJLzdJJT6JkfzD/7P/VsRXcn4rzZJJT6QkvN0klPpCS83SSU+kJLzdJJT6QkvN0klPpCZ/8ANv8A6jvyFecJJKf/2f/tFORQaG90b3Nob3AgMy4wADhCSU0EBAAAAAAAKxwBWgADGyVHHAIAAAIAAhwCBQAXMjAxNF9NRU5sb2dvX2hvcml6b250YWwAOEJJTQQlAAAAAAAQWDW9qyYQReGD1gdPdZ0kUThCSU0D7QAAAAAAEABIAAAAAQACAEgAAAABAAI4QklNBCYAAAAAAA4AAAAAAAAAAAAAP4AAADhCSU0EDQAAAAAABAAAAB44QklNBBkAAAAAAAQAAAAeOEJJTQPzAAAAAAAJAAAAAAAAAAABADhCSU0nEAAAAAAACgABAAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEAL2ZmAAEAoZmaAAYAAAAAAAEAMgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklNA/gAAAAAAHAAAP////////////////////////////8D6AAAAAD/////////////////////////////A+gAAAAA/////////////////////////////wPoAAAAAP////////////////////////////8D6AAAOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EHgAAAAAABAAAAAA4QklNBBoAAAAAA3kAAAAGAAAAAAAAAAAAAAA9AAAAyAAAACIAbABvAGcAbwBfAG0AaQBuAGkAcwB0AGUAcgBlAF8AZQBkAHUAYwBhAHQAaQBvAG4AXwBuAGEAdABpAG8AbgBhAGwAZQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAyAAAAD0AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAABAAAAAAAAUmN0MQAAAAQAAAAAVG9wIGxvbmcAAAAAAAAAAExlZnRsb25nAAAAAAAAAABCdG9tbG9uZwAAAD0AAAAAUmdodGxvbmcAAADIAAAABnNsaWNlc1ZsTHMAAAABT2JqYwAAAAEAAAAAAAVzbGljZQAAABIAAAAHc2xpY2VJRGxvbmcAAAAAAAAAB2dyb3VwSURsb25nAAAAAAAAAAZvcmlnaW5lbnVtAAAADEVTbGljZU9yaWdpbgAAAA1hdXRvR2VuZXJhdGVkAAAAAFR5cGVlbnVtAAAACkVTbGljZVR5cGUAAAAASW1nIAAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAAAAAAAABMZWZ0bG9uZwAAAAAAAAAAQnRvbWxvbmcAAAA9AAAAAFJnaHRsb25nAAAAyAAAAAN1cmxURVhUAAAAAQAAAAAAAG51bGxURVhUAAAAAQAAAAAAAE1zZ2VURVhUAAAAAQAAAAAABmFsdFRhZ1RFWFQAAAABAAAAAAAOY2VsbFRleHRJc0hUTUxib29sAQAAAAhjZWxsVGV4dFRFWFQAAAABAAAAAAAJaG9yekFsaWduZW51bQAAAA9FU2xpY2VIb3J6QWxpZ24AAAAHZGVmYXVsdAAAAAl2ZXJ0QWxpZ25lbnVtAAAAD0VTbGljZVZlcnRBbGlnbgAAAAdkZWZhdWx0AAAAC2JnQ29sb3JUeXBlZW51bQAAABFFU2xpY2VCR0NvbG9yVHlwZQAAAABOb25lAAAACXRvcE91dHNldGxvbmcAAAAAAAAACmxlZnRPdXRzZXRsb25nAAAAAAAAAAxib3R0b21PdXRzZXRsb25nAAAAAAAAAAtyaWdodE91dHNldGxvbmcAAAAAADhCSU0EKAAAAAAADAAAAAI/8AAAAAAAADhCSU0EEQAAAAAAAQEAOEJJTQQUAAAAAAAEAAAAAThCSU0EDAAAAAAOxAAAAAEAAACgAAAAMQAAAeAAAFvgAAAOqAAYAAH/2P/gABBKRklGAAECAABIAEgAAP/tAAxBZG9iZV9DTQAC/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAMQCgAwEiAAIRAQMRAf/dAAQACv/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFCI8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A7vo/RejWdIwbLMDGe9+PU5zjTWSSWNJJ9it/sHof/ldi/wDbNf8A5BP0P/kXp/8A4Wp/89sXM/Xj62dY6H1LHxsA0+nbSbHeqwuO7eWaEPZ+an4sUskuCNX4rZzEI8Utnpf2D0P/AMrsX/tmv/yCX7B6H/5XYv8A2zX/AOQXm/8A45P1n8cb/tp3/pVWumfXj649Uz6On4n2X1sh21pdU7a0Ab7LX/pfo1sbuVg8jlAJJiANTqwjm8RIAuz4PffsHof/AJXYv/bNf/kEv2D0P/yuxf8Atmv/AMgrtbXtra17t7wAHPiJPd20fR3Llvrh9YOs9GyscYnojHyGOgvaXO3sP6Tgs2t2PrVKchAWdvBvcty8+YyjFjIE5AkcR4fl9TufsHof/ldi/wDbNf8A5BL9g9D/APK7F/7Zr/8AILhP+f8A9YvHH/7bd/6UXR/Uz6w9R607NGd6f6uKvT9Npb9P1d26XP8A9E1MjnhKQiLstvmPhPM4MUsszDghV8MrPqlwdv6za630bo9XTnvrwMZrhZSJFNfBtqB/MV79g9D/APK7F/7Zr/8AIKPX/wDkt/8AxlH/AJ+qWipXOaH7B6H/AOV2L/2zX/5BMeh9BBDT0/Ek8D0a5Mf2FoLK6/g5OXVjvw2TmYlv2nFsLtrW2Ma7bVb+f6GW1z8S/Z/g7vUSUkd0b6vMkPwcNsczVUP++pO6N9X2mHYOG08waqx/31Yr+h5dV111lDH1nOyMt9tjmEFluB9le93qfRrdlu+z+n/3G/nPYpU9By6cVuPQxl+Ix+A/BLnB1ldFeTVl5GHZc8u9ejCrr34Vm7e+r9B+ksq9a1Kdf9kfVzX9Sw/a7a79FVo4/mH2/SUD076si2qr7FiF1+70yKayDtiW7wzbu19qx3dAz34PV8b7K21mRjXDDGQa3Xsvs+0FuMzKb/PYbHZDrMe3J/WMf7RdX+k/wWg/pVrOuOyaccV4jqcVgFbaYL678nIuD22e9np/aK7/AFKf8J/wqSm4Oj/V4tLhg4ZaDBPpVQD/AJqdnROgPaHMwMRzTw4U1kf9QuYq+rHVK+m5OOcRptyGY4YGvYGsFGW/KdTZV/M2WbLn5NGR/wCgtvp+l+s9dgVOqpc1zCw+o90uFYc7c7d6jm48V+7/AD/9J+kSUh/YPQ//ACuxf+2a/wDyCrdU6J0WvpmW9nT8Zr20WFrhTXIIY7X6C2FU6t/yVm/+F7f+ockp/9D0fof/ACL0/wD8LU/+e2Lgf8aX/LOF/wCFj/58K77of/IvT/8AwtT/AOe2LD+tfQei9VzmW59+TVbjUCGY5r1a57tvssZZY+zc1/0FPyuSOPKJS2osWeBnjMY7vmWFitybYttGPQ0tFlpBcZcdldVNLfffkWv9tdTf+Mt9Opi6jpnQLei/WDAtOScfLF+1mJk1P/S1uHpXDFzMT16spzGW+/8ARY/pfz99dVS08P6l/VevKosxuo5xtL4q2ODSTHv2Wsx2OZ7He6yqzfsV3E6P0XpW4YuZk025dZFmddtfYKw8VUYw+1V72e/+ar9H9L6f6z6uxW8vOQlYjI0RVcPdgxcsY0SBxA3dvXrkf8YePSOmVZD7H+r67W018t1a/wBQdtns3P8AUW3j9RwG0V4lWRY57oqptdNj3lw9t29+/fzu/SLCzfq/0zJbTVmdT6lfU31bA61zSK9jhQ91nq0eq3c87avZs2ep/gllZQTExiLt1/h+THizwzZJ8Htm+ERMpS01eCXaf4tP5zqfwx//AHYTf80vqpqf2jlwIkjaQA6Nn/ab87ctv6r9J6T0yzLb06+691gr9b1o9u31fTDdtdX77lBiwzjMSI0F/k6/xH4ryuflMuLHKRnPhq418uSE/wDuW91//kt//GUf+fqlorO6/wD8lv8A+Mo/8/VLRVp514e93XB0n9UOccg4Wecnd6xcHAv/AGX6O/8AStzfW2egyn/tN6nr/wDaZbPUDkt6FmCh15ubcyHUG8v2+pUT6Lnl2R/M/wA76P6L+eV7rN/UKG47+nlj7vV9+K+B69YY+y2imxxb6WTsZ6mO/wDmfUZ6d/6J/q1Zb/rM8YOPm47xkY7bHX5zywtNeEbrMVr31+19FtP88/1WfzXT87/CpKbHWg7IxnX4rsgmzIxceysC0M9Nl4+0v9Fu39DZTdazKtb7Lqa/+DWdmftMfbDS/L9VvT2fYPR9csOYLsv6Db9zLPd9m9T7V+i+x/zn6qrV2f1KgZ27OB+yZuHiAuZWAG5B6f6tj4j9JtzL/T/62gnrvUXYlGV6zabMu3MotoLGu+ytx2ZT2XncWOc/Efi0sy/Vf6N32n9H6f6ukpMw9VDczHb6zs9uXbdjNe6z0i30fUx/0u7b9g+0/o/S3f8AB7PUU8Rzz0ul9D805uRTXj2i4va9tln8/kWNtY+inKo23P8AYz7P/g/5r0U2N1zPezJx8rZR1ShlNIoa0uqddc65tGdjOcWvycK+uv1/RZZ61NdGTTZ+mqT9O+sL8u7p3r210B2NlnqFJ2jbk4j8XHvZue7dWyl9uR/1r07ElNfAHUr8vpbcwZbba/tFHUDuubW5+MK68fIOz0qfTytv2ivb+jt9VVsZ/WD0+45Ds4PGC53T43+ocv18z1N0+59mz9mfZ6839B6H/A/alrdI6ll5Wfk132zXVlZNFYHpBpFXpenTt3fafWY19j923Z/4EgY3U8/Ixcq05XpupfmhjopLS3Gvtpraxm5136Oqpn2h9rP8IkpepvVq82vebrsbJyWG5rDZGPexjXXemXn1LukZXv8AY72Y2R/paL/1XX6t/wAlZv8A4Xt/6hyH0O7IyOlYuVkXC9+TVXduDQ0D1GMeWt2e3ZvLtiJ1f/krN/8AC9v/AFDklP8A/9H0fof/ACL0/wD8LU/+e2Kn1q7NZl1toxbr6vRe51lVlrAHg/oqttD2tc6z+p/brVzof/IvT/8AwtT/AOe2K8kp56x+Wxtzhg5b9m40BuVfNga41+7/AELneyytn59b1C617WbrMHLIZrL8i+GvD7GN1935lbLfW/mf0v6SytdIkkp52x+WabHUYmWbG1VWVNfkXw59jtltB91bm/Z/zv8AtxRNuYH2Vjp+a5zLLK2EZVoa/YWejZvc72Myv1j0/wDRejV9o9P7R6i6RJJTzvr2GNuJnOduLXt9e4GuWtfT6vu93q7/APAer6H+FV/pFlrn3tsx76NoZBvsfaHEh2/0vV+jsd+7/OLTSSU53X/+S3/8ZR/5+qWis7rwJ6Y8ASfUo0H/AB1S0UlPK5H1qyqMBmdkYlLy+rNsx9rj7bcIXP8ASfvbv2ZOPj2/rDP5mz9D6Vn84tHPz7cfpOXnejVdaxwr2vY+oPbubXttba31Pa6yz/SVqwOgdI9F9H2YGp9VlBaXOP6O93qZVbNzv0bch/8AP7P53+wjXdLwr8e7GurNlOQQ60Oe8lxG3b7y7f7fTb+ckpqdb6jhdJorstpqey2xnrglrNtLSyu7MLXB3qtxN9fsQ+v9Q/Zm22rGpuN9WQbi/QuFFL8musuDXbmv9L0/f9BX3dKwHttbZWbBkVvquD3OfuZZ/OsPqOd9NQs6L024AW0+oBQcUNe57gKiHVuaGudt3ure+t1/8/s/wiSmlT1S6zK6fQ+mpzMh7xuLH1lnp0NvaamXN93ue6r1G+z0/wDttVMjrDaYGXh44OQwuxryP0Zyd1rfsd8jfXZkto3Y13+Ht/Vv5/0ftGy/o+A8M3McXVOD6n+pYHscGGj9FaH+rX+ic+vax/56k/pXTrKXUW0Mspeyut1T/c3bUd9HsfLW+k872u/fSU5DOr3g519WE227FsvrDKanmx7an1Mda2yG13P2W+q/EY/17dnp0erYo0dcxnXYRbVjDH6h+jZmBrhVa51j634brNm/DzW1srf9izWfp8qz7DXZ62PYtf8AY/T4eBWQLLHXOAe8D1XOFrrmgP8AZbvb9Nn0EzOidLY4ObTqHNefc8hz2Pdk123NL9t1rMix13qXb3+r70lNfoHUsjqFDX2VsqYGT6bGvaGkPtp2tfY1tVrP0H+D/m/8xW+rf8lZv/he3/qHJ8TpuHhBoxmFgY0sYC5zgA53qP2tsc7bvf8ASTdW/wCSs3/wvb/1DklP/9KhX/NV/wBRv5ApLzdJJT6QkvN0klPpCS83SSU+kJLzdJJT6JkfzD/7P/VsRXcn4rzZJJT6QkvN0klPpCS83SSU+kJLzdJJT6QkvN0klPpCZ/8ANv8A6jvyFecJJKf/2ThCSU0EIQAAAAAAVQAAAAEBAAAADwBBAGQAbwBiAGUAIABQAGgAbwB0AG8AcwBoAG8AcAAAABMAQQBkAG8AYgBlACAAUABoAG8AdABvAHMAaABvAHAAIABDAFMANAAAAAEAOEJJTQQGAAAAAAAHAAgBAQABAQD/4RJaaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA0LjIuMi1jMDYzIDUzLjM1MjYyNCwgMjAwOC8wNy8zMC0xODoxMjoxOCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0idXVpZDo1RDIwODkyNDkzQkZEQjExOTE0QTg1OTBEMzE1MDhDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDNTlGNkZGQ0QxMzkxMUU4OTFDNUJBQzk5MjMyMUFBRiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowREJDQzI4NDY5MUJFQTExQjE3RjgzRDc2RjJEQTJCMSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBJbGx1c3RyYXRvciBDQyAyMi4xIChNYWNpbnRvc2gpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAxOS0xMi0wM1QwMToxMDo1NyswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMTktMTItMTBUMTc6MjQ6MjArMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMTktMTItMTBUMTc6MjQ6MjArMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvanBlZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgdGlmZjpPcmllbnRhdGlvbj0iMSIgdGlmZjpYUmVzb2x1dGlvbj0iNzIwMDAwLzEwMDAwIiB0aWZmOllSZXNvbHV0aW9uPSI3MjAwMDAvMTAwMDAiIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiIHRpZmY6TmF0aXZlRGlnZXN0PSIyNTYsMjU3LDI1OCwyNTksMjYyLDI3NCwyNzcsMjg0LDUzMCw1MzEsMjgyLDI4MywyOTYsMzAxLDMxOCwzMTksNTI5LDUzMiwzMDYsMjcwLDI3MSwyNzIsMzA1LDMxNSwzMzQzMjtDNENFOTFCMUJEMzYxQkUyRUY3MkZGQjlGRjU2NTFGNyIgZXhpZjpQaXhlbFhEaW1lbnNpb249IjIwMCIgZXhpZjpQaXhlbFlEaW1lbnNpb249IjYxIiBleGlmOkNvbG9yU3BhY2U9IjY1NTM1IiBleGlmOk5hdGl2ZURpZ2VzdD0iMzY4NjQsNDA5NjAsNDA5NjEsMzcxMjEsMzcxMjIsNDA5NjIsNDA5NjMsMzc1MTAsNDA5NjQsMzY4NjcsMzY4NjgsMzM0MzQsMzM0MzcsMzQ4NTAsMzQ4NTIsMzQ4NTUsMzQ4NTYsMzczNzcsMzczNzgsMzczNzksMzczODAsMzczODEsMzczODIsMzczODMsMzczODQsMzczODUsMzczODYsMzczOTYsNDE0ODMsNDE0ODQsNDE0ODYsNDE0ODcsNDE0ODgsNDE0OTIsNDE0OTMsNDE0OTUsNDE3MjgsNDE3MjksNDE3MzAsNDE5ODUsNDE5ODYsNDE5ODcsNDE5ODgsNDE5ODksNDE5OTAsNDE5OTEsNDE5OTIsNDE5OTMsNDE5OTQsNDE5OTUsNDE5OTYsNDIwMTYsMCwyLDQsNSw2LDcsOCw5LDEwLDExLDEyLDEzLDE0LDE1LDE2LDE3LDE4LDIwLDIyLDIzLDI0LDI1LDI2LDI3LDI4LDMwOzgzQkQ0MUM2QkZFQ0IyRjIxQTVGNEE0MDE1NjlGMTk0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6ODZhOTIyMTAtODExNi00MjMxLWJjZjItYjk0MDIzZmU4OTkxIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg2YTkyMjEwLTgxMTYtNDIzMS1iY2YyLWI5NDAyM2ZlODk5MSIvPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowQ0JDQzI4NDY5MUJFQTExQjE3RjgzRDc2RjJEQTJCMSIgc3RFdnQ6d2hlbj0iMjAxOS0xMi0xMFQxNzoyNDoyMCswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENTNCBXaW5kb3dzIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowREJDQzI4NDY5MUJFQTExQjE3RjgzRDc2RjJEQTJCMSIgc3RFdnQ6d2hlbj0iMjAxOS0xMi0xMFQxNzoyNDoyMCswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENTNCBXaW5kb3dzIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8ZGM6dGl0bGU+IDxyZGY6QWx0PiA8cmRmOmxpIHhtbDpsYW5nPSJ4LWRlZmF1bHQiPjIwMTRfTUVObG9nb19ob3Jpem9udGFsPC9yZGY6bGk+IDwvcmRmOkFsdD4gPC9kYzp0aXRsZT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD94cGFja2V0IGVuZD0idyI/Pv/uACFBZG9iZQBkQAAAAAEDABADAgMGAAAAAAAAAAAAAAAA/9sAhAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgICAgICAgICAgIDAwMDAwMDAwMDAQEBAQEBAQEBAQECAgECAgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwP/wgARCAA9AMgDAREAAhEBAxEB/8QA5AAAAgICAgMBAAAAAAAAAAAAAAgGBwUJAwQBCgsCAQEBAAEFAQEBAAAAAAAAAAAAAQcCBQYICQQDChAAAAQEBAUBBwUBAQAAAAAAAAYHCAECBAURIRIDMRYYOAkQMEBBIhc3GjITNhkKIDkRAAEEAgEBBAgEBAUFAQAAAAQCAwUGAQcIABESE5gUFdY3tzh42BAhFrYxIpcJMiM0NRdBUYE2dhgSAAIBAwMBAwQOCAcAAAAAAAECAwARBCExBRIQQQZRE5PTMEBhcSIyQjNzsxSUtAcg8IE0dNQVNaHBYpU2djf/2gAMAwEBAhEDEQAAAPbAupjpAAAAAAFdVokAAAAxxkQACjS/bJRyHZtNedMShz6de+jrnmqoOPZV1c8B7oBsS5p1Qa/keD1MVs0DW01JHbN5P1UuO+U3K0CbT2kF/MDSiZixn82X1V87A3I4KzD9GLy87/K7s+SfnB9Hv6/eW/n7jvZXwC3+Zj8ulMWcFNEnI+U6vRLsTkKhOwtpoxiQ9cBYo+YcafNi9VvOvcPgvNO3LCmV/bj6W9moFs3O/m3dIv664Z83Ifcd7K+AW/zMfl0pi9kSxWbS1RG2qVpKkvmk9lkBYtkni2TA2cm7bfp6ybwS3Pj+ma7Hu7S8M5Ku3BO1FL/hvvg2I8iwU5W741UxWzTSI1SYypQ9sWlty6b3iqKypII24NK/mArIS6v7csd8soXonp2h8ZGtRTFzQqa3alrn6E2W2rKrlmaVKttjstNaGBplYxZ5MGZg5THncMid4UxZGLAt4JnCDEDWZp0zJFcLHK2JTTWyrDTHwAAAAAAratIgAAAAAABRh//aAAgBAgABBQCPH3iPEpli5HMw9KSojpSVETtVU7akq9iWlqb9faEuW36yFIfWQpAtGi2muj/4+HxEfYR4t/jgsAygHIb11p0lBgt8lzscscZQiv8AHvbx4oB94Aq0DfPSnKvMtvKVTS1NHvVV4tdHNV1M9bVhFf497ePGxX27Fq7dQCwipXJWavclUw7wuFXVVVfVVqfE+41f00JA+mhHFmsNpL9P7ePH3iPH3iPH3j//2gAIAQMAAQUA1TDVMNURqmGqYaphqmGqYaphqmGqYRmmx1TDVMNUw1TDVMNUw1TDVMNUw1TDVMNUwhGOIMF9oi1Z+oVPx1Cp+NtwBE3tyn3Y7+wj6Rm5cD5/Vo5wf1aOcC8t+PrdDSJuPpCGIwhhhlkOAjwmhDCbCEfSHGPFYvtsIQjEITt23eUUI6baoiqru6f3B5YPvwJuMIYjTEQxxhjEYRxhCIz9MxhEQhj6Q4x4rD9tgm3LEm6V6KyVph2d/ZqNuwpwfDJslEubBOKg8sH35E3GEctQhHOGUdXzQjgIRwGQxzhNhDHKMcRDiLrarffLf9HE2FOlCeU0k5IK89FT02xSbBSei50iFnr2d0OvZ3QVBYFIWi9iPEQwiIQEeE2QjgIccPljwh+nH5RDjHjDjhEZj4cBnj6R9Jv1QhiNIhnGGcfjpGAwiMMsI4whj6x4+yjxhHCGoQjhERjjHViMRCOAxGOWrH0hxjhjkMhkMhkMhkMhkMhHDHIZDIZDIZDIZDIZDIZDIf/aAAgBAQABBQBnTKmbmBo3QoyEdCjIh0KMhHQoyEdCjIR0JshHQoyEdCjIR0JshHQoyEMjZYzgws96E2QjoUZCOhNkI6FGQjoUZCOhRkI6FGQiVlbCp7v0JshHQoyEdCjIR0JshDn2TMzszaWR9mLmnEp+01C/yW/HKPyW/HKKT/Sh48K+rLN53zEXnLuQTdqCQ/kDMMH5AzCw0F5SQPaT4ML7KPR86yqO21RDA5FxJvMh2cOvKImKvU91VZu0hsMSsW1MJlJubwWHr+4ZT1U8Y52V9UUP9HY9rDI+zHzgSxm8VwhCMY+A60pte/J4HkWwvGhvOxq/ZH+djtCDDOyhX3A2NHzfa39I6ZK9aVQSMqpGtszbiDe6Vx6eE1Bj4sLJrBvqcprZElvm9UNysm7fFbZ0TSOTnAs7RS7qa/VIUWsxWVosnQ5Oy7WGR9mHm8/8sB42dxrdGZWokxv57c/YTDYDVazet6QkapUc71amKGP87HaEGF9lC8o+oR9WDb8digbx7WdvSnqI0g9E1YVOR++MLUzcbgs7G1QXE3ri0tWlvvCipysaxW6wMQWQpJmuDET8rS2mprykH1b2uNBlawozse1hkfZi8WxpQaG57rFPC7RmMjMH8TVPbD6ljE08Mxedwg5AKy9Mq8fhpuO6zzxK2SSLRvEPHdZMRW2kFOQwzsoDuDwsDfDQ6xyCgpQbSaTiXtOYZMeIq7RImqryrcXlmW5W4tgJLlUkMD4kYPU9+dm5My3PdfvMQyvdPIuHY9rDI+zF3J+pkubmU3HFA0Wu+OURixUBuVNvsxhTE6poqh7JjrU6ulotrikJvt1vjgUKtFxaOfCqfSUGGdlC8L6YEhPUnkBJcppWFdLSlLW1pNJGQFHLLfEnU1BiQ/fbOd3o3H0tQVN106PSGMiuFLpwWyV/KKHRBzK7OYsGtODVXngiux7WGR9mNZRUdwptgrlmmq4lgtRmvKZJyYrNQlIrWyHLRc03cikq/F7cKhW3YUNrtlsiGGdlC3IXe1VUHZ8dexTnFXmw3xWGxmhBDmpt/Stqh3Qdu1gYJtEq+ytIN1DfVvYoV18s5VaNeigpJaYgbC4pZB8almTmrTgr3MlEp2Pawzkxun2Wi80O7HNDuxzQ7sc0O7HNDuxzQ7sc0O7HNDuxzQ7sc0O7DITG6fZZ3zQ7sc0O7HNDuxzQ7sc0O7HNDuxzQ7sc0O7HNDuxzQ7sc0O7HNDuw6AyOr3W0f/aAAgBAgIGPwA+2TXG+GeHMQ5LLZlTzjFUuqM56mAYj4KnuOtq+d4v7w3qa+d4v7w3qaeWXI4lYlBJY5LAAAXJJMVgANSe4VPjpkxzKjleuPqKPY26kLKrFT3EqCR3VLynIFvs6EAhenqNyB8EMy9R12Bva5tYGvms30S+sr5nN9EvrKnzeMWUQxydB84oU9QUNoAW0sw9h0q/6RrwT9NL+Gm7Lk6Vz8nFzmNTJAs1tzA8gR1B7gzMgbyp1KdCezlsKRQevHktcBrMFJUgEHUEAjS99taB9zs5P+NP1cftA14J+nl/Dzdiz8JiTZvILKPs+BErdDRKV87lZUysvTIoDDGHWqxsysqSTANFntzniXmOP5DkcVgOHyJcbkvOoRYTHIaMHDxhr50TL5xukqr9VrNj5eO8U4AJV1KsAwDAkEAi6kEaagg7Gp45+QgXIjQuUMiBwoF7lSbgEbG1ZWZIqh5ZGchQFUFiToo0A12HZyf8afq4/aBrD5zg8w4/K47ExyAKxUlSpNnDKbqxGoO9f82m9FjeprEln8bZRMMnWoVYkXq7utUjVZANwsgZQdbX1puXl5szcmZfOedmihndX7ihmjk6On5ATpCfJAtWRm5uQ8uZM5d3clmdmN2ZmNySSbknWsjOzuFWTLlcs7F5blj36OAPIALADQaV/YU9JN6yv7CnpJvWVJi8PhiGB36yAWa7WAv8JmOwHfb9AeyH2Db2b3O0+2T7Z//aAAgBAwIGPwDc1ua3NbmtzW5rc1ua3NbmtzR1O9fGNbmtzW5rc1ua3NfGNfGNbmtzXxjW/Zm85yIf7FjgFugAt8JlQWBKjdhuRpW2d6JPW1tneiT1tJFDFntKxsAIkJJOwA87qTUMzQvGzqD0vbqW4vZgCwBHeATr31xP5deCI4Tz+YsjIZjIsCCKNpGaWSOKXzS2UgO6hOsqpYFhX714Y/3B/wCVr958Mf7g/wDK1xfg/wDMKTAbl8vAXMj+yTGePzTyywjqYxx2frhe62OljfWwo9pHfQ07jVxvQv5KYW2oVt+tqI/QNeKPo4/r4uywGtcUmfGHk83KYb7CVULBrbEhQxXyN0kajs/LvxTizOhxOaw2fpleEPEciNZo3kR42WOSMsknwwpQsGutwZOk3XqNj5R3HTTX3NOzwN/1OD8dn9ho9lga3ret/wBR2AXo69mnYKNeKfoo/r4uxoeRnjx8QxXnzJCvUJCG6IIIyGJj1Hnz0kuoYM8cRIlxP6XwfGZmDhTqf6lBFPghHB1jEKv05ExsOgxN0DqVinSSaWbHlV4jezKQwNiQbEXGhBB8hBFcTm8P4P5Sfic3LXGiyUxMh8dpmcR9AmSMxsysQGUMWHeK8M+EsXImlx+MwIMVXmkaaRhBEsYLyuS8h+D8ZiTa3Z4G/wCpwfjs/sNEUfeq9A1f36A7ta9zsv7lAe//AI1ah5aHZk8VymOJcCYAOhLLcAhhqpVhYgHQjav+Lxeln9bWRHF4Xx+mVeluoyMQP9LO5MZ7iyFWtpe1f05OLEeB0dBjieSFWXvDCJ06+r5Ra5b5RN6hxcWFY8aNQqqoAVVAsAANAANABtXCeDfCH5r5WB4Y46AQ4+PFjYPRFGtyFHViszEklmZ2Z3YszMWJNf8AtOb924/+Ur/2nN+68f8AydYXiP8AM7xTLy3N42KuNHLJHDGVgV3kEYEEcSkB5Ha5Ut8K17AAUeweWrW1NCjbymiO69G/fW2t6Hvf51e3fX7ewdvd2bCjpRGld1d3affomt9K3q1a0de+hrQN9DW9WvrR19mNEURbuq9aVe1ftr3ezard1G/YKOtb1vW9b1vW9b1vW9b0da3ret63ret63ret63ret63r/9oACAEBAQY/AOLU9PcS+M03OTfHPSUvMzMvofVklLS8tJ60rJslKSkiZVXjD5GQMfW6++6tbrrq1KUrKs5z18m/FXy9aj9kOvk44q+XrUfsh18m/FXy9aj9kOvk34q+XrUfsh18m/FXy9aj9kOvk34q+XrUfsh18m/FXy9aj9kOvk34q+XrUfsh18m/FXy86j9kOvk34q+XrUfsh1xhnZ/iZxmnJuX0VrGRlpiX0PqySlJOQMqUW+WdISBlVeLNMKfWpbjri1LWvOc5znOevk34q+XnUfsh18m/FXy9aj9kOvk34q+XrUfsh18m/FXy9aj9kOvk34q+XrUfsh18m/FXy9aj9kOvk34q+XrUfsh07X0cTOIip4eOHmH4ROh9NKl2YgskoISVdjcVXJjccUYE8y2/lGGlusrThWVIVjHyb8VfLzqP2Q6+Tfir5etR+yHXyb8VfL1qP2Q6+Tfir5edR+yHXIeXh+I/GOJlorRm2pKLlI3QmqgZGNkQaDYCQjwDRao0SGaGS0lxp1tSVtrThSc4zjGeuI30xaF+FdU62DyG2m1YXqDrQCMkrG1VYxmZsCx5afia2LiNjHzY5kpzEjNM5XhT7eEt95Xbns7M/wC2cj/6UxHtz1/tnI/+lMR7c9CAR8DyYPkDyhgQAAtRRhJpxxjyBgwgxmbut4kssl1LbTaMZUtasJxjOc9Qs8VATlWfmIwOScrlmajmLDCKMZQ/6tm2ImSmI4eTFwvuvNslPpbcxlPfznGerFuzaz0k3Tqy9FsGsQbcYXPmPS8kNFisQsVJysRmZMw+Vhahx3FkeCla0oVhCuz/AEG+/wCmQHtd1/oN9/0yA9rup/ZemGbgzXK3by6RIpukCzXpHM0HEQ809kYRmSk0uhehzjHY5lac5X3sd38u3PXFH6ftU/syI/HQG/Ii7Gx+haBi3E8tKMW0C/XidIzFh1vRitwYdXHEy8VKaFnb4NYjXRX2mn64PJJeQ5ltjKOZ1hVtu4VCAheQf9sULSNbrnqCNxRdMcidm6/rFkii+9FySpKa2hTLA9JSDxa3yI5+RQwIodQqVZ2vQ9q7Gs5ukdw8jXNd8Yd6xuRg7hpnZwWwarC5407Klm4sgGVgtogOFPUieLZy8stZUGa7ktUQ8Rv96g2C+7nA1t/cB21U53S9X2HU6LvOd490/SNHnRavx9nrKLHV+XndfXe8NTT0TJmBFWAJHoa5ZCcIYI/t4XbXnLbkTK0rlFbZCi2eTyJVtcTR0RTuLO8rWS/IU8mirep+xcbN1wwTOI7uUNyA74rbaA/8nPIUSanNyW6P0zyH1DqSG2k1bNXwsTTNZWDjVpHcNwqVwjyIsay2Cu3nZcgrxmRx1qGJnGchkCpGxhuKo1u3DeS4EnUnMmeuiNoP1BJ+xiqdy4umntP2bjYbW4liVGI0vVqgRG3vBzjCWXpaCeyC66Zg1XHfa23bPt2UmNh8Xde2mWl75b9dS1P2hdbawBLzVnq1YrDKZqryNeFjMOKa7oIihJ3CMi5cYwtv8OS30/7k+HVj64jfTHoX4V1Trl7jHZ/6jSlfn/2TtnX6s/8Ansx+CU4xlSlZ7qUpxnKlK7M57Epx25znsx/060gFsaHFmnGoDZEtrts7DbgIGzIGpGTUDLvDu9rT5UbEgSLgfbjOWT8MvI7HG0Kx1sjXs/EmS7my6tY6TXGgYCMspIdtkq9KkV6WHiZVolhwiENDwchxLLrjORvERjCkpz01hxOUOYbRhxGcLwpC8JxhaFYc/wAzCkqxnGcK/mxn+P5/htn6irB8Pdc/hxR+n7VP7MiOtPUU2lX+6WbeVitFVooFHDqr6HJqo0ef2LLjy5lpt1UDi2v0nVzyGnVLU24sfwu9hxbaV60g6fWNpWy2bL2ls/SDdMCrULBWmjbd07TpS/X+g7HjbvaKoirzEXUoZ45h3LjwMgKph4Qh5koVx+P3/tXTNnnAJRNe1CbWT6nUJy7Axe877W9XZqUzFyNkxXi6zY7ZNRrEm2yeWC+OpshXijt+Im4v7B455s7lm1jL7/vlmjNd0+djpxri/iuH12PtB5UsKQbfKePJMk1XBSMijZCWkUth9DLblp2ht7QFjXrbYV+1ZtCuxtf1pQXArIDyC2xV67o6TmBH9pz4s3tBu2HQJ02cZmLJFNJbIbHw0G4+jYMdduPM3C7Jq279SYv9FVrqtxOyA79y4sgOmNebqDno6yiwVjhtly6cQJlphJw5xCAyAzVowK+y3A1e56qQIXoY3UQ+kB4ulVg9P663iVaNb62pmiosCSzKBXSa9Ryca/3RY0YON8dwoluPy87jee1b/wAeitYzms8Qm6Nn2C20GsvyVokYiBeloC6RM5TJe1xWw7TBA05oUZY5RMiESIMKjCFpZRjjTaqrxnPt2ttmzNEk+P1r19rXXAcBEXblw9MjgAQj1itVRkatY9gYJIdsbo7SBkYOxmTfSt/OM3CKjNFzOi53Seu9FxSITOs6vByoYnJ60GVjUOktdwVVm5Ut6z3K70j1f6mAYaBbJEYccdwP4L2dmyW2KvtCkyWm4zXNu2XVCa9BT9mrurtn2YmnV/cAYtPtVjAuGu4+ygFiSrsCTKSUU4G7kgNCcJUs2pVpo2XDZ13Rtoxl5jia/JUOzVLYpdjEq5lZmYycNLlMm/pUt3v+ioHyPhtxDq0ut5VyX+n/AHL8OrH1xG+mLQvwrqnXL7/46m/Fag/g/Ebhs9W1LRZKtFM7X5RXeWhv1HEXCSDkf0NpbSlDlYuZVLVaUMIHeuL2QHyZcQN4d4oCJVliRpjGnOPvFjeVF0VsuHKO5+aqpO4+IKKVPBnKdOobGqoazFtb83KahA+IRddIxFCYJSQ+N6P3kuMTdYm4ixQpLpjA0vBSQcvGEPxxpEbIMsHgPECPOAyIjrDyUrzlt5paFdik5xiwxdm2XQYqxVavFWmYqh9yrYNnDhRgXpDB70EZJsyTApAzKlNurbS2vH54V2dXvYx4kYAbfbhY7gUFCxQkHFDPWGWKlFtgw4KGw45rtJ7ctNpwnC85z2fn+G2vqKsHw81z+HFH6ftU/syI64pbOo66Y6Jx+2Dsi62CHtc3NwZFgYumkNhamj4+GNiKxZ2xXhDb0k15x9ru5aFy2lOVOd9Gv9l3CV1Zseck+W+8eWW9qvIkWiqVI2U2fxsc410+ia4dEgbLJ4jKLVIuGcfkJLCH5QoIh/wR/SksjQGjKujWFat0BcNFS8THrl7dnX8DUtIbxoWy4WqBzKoKQtMq+mnUAaIwa8G1l4txRSmkIx4Gd/UixM63r09sGk3Sia6YhZyxTkTEgWWjvQTEpb7CbU4KRfKVYZF951gONy2yI00lK3HFLziM0fS4bRFHlmYnhmqz2QOzbBkk3m0cW9s6yvZMial2miNV+NPrlBLBDaZGLfcKlUvEOpQJhBG5tz2K6UOD2rPN8VITS9Zi2bAfRKpT+J3Ikfk3ERd8sZAYE5ZJnad/WQNJGiRYrcLG4GQKwU62+4VGbeVO6+pG4tb7k0Dt3UdbSbYbZr1a9GBbMizK7f7EqArU6SjYcHuyzAqKBi05hM5AKbaNcHcaeqFetJ9XolVTsOs2m6A0G3zhdlahaQM7ZIGPh7PKUcESbfktnBxZJjT0dHMJiQHB8qIUUvw6RpSGudEkdcaZ5+1Lkzp1c9LWZ6xxmioy+EbSltXz77NYyM5ao24zkqxDus5yAxDvCDr7uRO87vDbgFxp8AROzvBPZelFEpmpFcXs3hTsLYewGQdixSI8Vgil7C/XSox1YBijAWUrJShx3uN4s/Imwu0EC4EU/Q2p6dSQp2fka7E661vvmL3tsOTsVkJqIZU9abpKgNggDNxQwQIwTeXHHVEveHux2m29ReiLqHSMaZ1MSIrC9DshT2zLRfKHV5PvZw9q420Xv1hX4zOMYr6SCQB+6A2GyzyW+n/cnw6sfXEb6Y9C/CuqdbBq27qMDsrWNocptcslHkp+Qq0fYFzl9q8ZCMG2GLfGOiBBLCSIS6+hxOENs5yrPc73VggjuFJjrEerKq5K18rfdoFuAosJLT0qXHYh7a82CmPBicqSghxCyUvN5Zwvtz3d1tU3guSeJXKqzEXxtupbTuNzcbkLBORS65QxSZ6eswtgLHg8lPO194c1UcUzhxeErU2mb45WPTAuv9KVmqUuhoi9d3PZdORbZ66iESyamRVNYWGvlTcUDT4502bPk1lOHIeTh5bnYtK2IWs1CVrWsalV4xigDVKqvJjHa7F1ZiRZioirxYDKoUeLab9CHHQleXlIxltPh/njcm7dscQpa4bLbo8Zua2TFgI20CJcbDa0TIcXS4i2InsV1+3sSVebCIjAm8qiGSQsqYbZfYTnIF04jOVq1ABPHWGvNFbmlExIsfZW6nMyY0iuyxvreDi5hsvtJaYSp5gB9xtpWPCw6GOniJPsvyQZB8d6yi93xYxQgRUWGa56UVasNjqHJk8tdxzCVLdFIQnGctK7LTF8W9Xnau14TeHjJCPNTZW8zFtXWa0maPaRaJOWL7YxKWot/LLyhvSwHsIyrGMrV1xR+n7VH7MiPw5l7rpdxvewuPL1Qdou/dTwE/O2G4cdLFLaXBlaNyb02FHHv2WBihLBNoHu0FG5Y8ON8GxAt4fjjmzddblpk5P/AP584S2HW8Ry0XHTVfMq8vX9uwY1c2Zi9KkrUxZDZjj5SrTXLoJ6MIWt9wshDyu8ju55qV8HZ+z5GB0voDjlfaWITyJ2tMAwp93p/IhdrsJw5V+KANHtgEZHFELIbWxlTA5DWG1ttLTrSA5ObStA+tY3+2Xwr2vqOal9t2qAEv1qvdUuRvKHdUvsRiyR8pZNnUy3AQob75Eg8/WxyGiW8Mrk1uL1HydmJ6+7JnqhxT17O8pOL5LhSbNujRs7tLdsFC8gKHr5TjLlS5OQur6bB2P1aEwC3amCz4dxGDsxjg+hJvi/M3y4TfHvSGnebO1GIizxJU5sGkMAx9jjNRbLXsG0A3TEfvHXY1xNyrwn5NmRiY/vI7HcozY9hDbzhkaas/8Abz0LuSpettm+ha/cCt+190OGX0CuHzyK0LKyNSh4pok9A+CfRmGm1L7v5Z5WvS92jpSn1PnXQK5AEzfJHZELY6fBz3FPRVoiKbQNOBKVXLDD2bblpw0RFukNtrXLn5UGpbOMdXykquEWxVQ+CNKuh9ctfJS+6MrVakyt73yBnNhxLdTdWL+rRaWIrCSXFRyspDHQopCM99uoa6B2luIiqWXh1b9/NRTW/dqs4PvTPIvXjkLcmYTFvajkjDw0m/HtCJDTHYi3FCKYyz2o/Dkt9P8AuT4dWPriN9MWhfhXVOtobALashA1XiI6QdYqFqkqVZX0qsEQLhqGskPFzUqCY5kjswgcR94rGcsIRlTuOog8Q7l5LyMyzpQEWpUzkdI2KxP2nc0TKT4kMG5IF14N1EBFgoaMbJSEeGel9ktgbDWVYpMk/cuZhg12g7PMj5A36p9yHdqdNrFvlYebwqwtthSrCbaKE41lWcsl95C+zPcwtqNNtvKi7GVeSqslFmR+82ptxSrIHo1waQo6XZvL9gnomQ3xFNEgBdpqEAlOoQvOBEE63okDsrlawXszXDmyYiUf5CSBcaCAPV6dZDIaTXFSBy2ZyOduTQRDeO1DZIz+MKV3U4VrQ29SHMOpSm1NJ2belYi4PkNYbMwZW4GLkSo2DjzJcanPzdpuctFrj4MUQd3Ms88w4N32vS1Bgw8LsfmO45PtUAunzEtu6ThKnZ4vYsZrAqNl2bSVLuRMWLWpraAsPPsmKZPiZVttlQ7mDo9ZVviBtl8xJU+iylij7DgPd8ooT0CsVeo2SUt8G+3LPv2ikNu2KQCTIRrJWXya3KYZadwy141yMqEzsadjYLZl0qT0hsy7KvMyQdUZcirGkRcmogrDVcNKhFvhoQtSFodyv8lqcQjrij9P2qf2ZEdce6BXNcMX2X5C3+0a7hiSrozUI+tytY1fddsOmzDjldsBBEaZX6CeyjI7a3UlqZTlHhrW43V6nD6PGruxLzyN2Vxb29DbDt1ToONe7V1npeU3kh232aOirVGXCnXTV4rB0FJiOPqKZlBEOMMrUS2M/v03StUtTFondZj2CiQdqq5sRYnNobIq2t4CxC3JmALgrdGKLtAEi2U6O2p6N7Vpxh5KWVbK28brBmyv1ukEOPUeh1yLkLXsQ9sVmPrmtK4woMLE3J2mZWLFRw7+EMqeeawpKEYz3ahtii0+lXmiSdBj9tayjSoyHGhiBZevYtEIRHLdipEavmGMFpwp9sfLjDi1d5PbjOOqhJxWiKVX7RsTiNpjlOCVbtzVWqy8hUNzTNhhqlrViZMpmW5S6iyNcShbCiERnjFjoQTnKs5TzIt7GhoZsrjZsEvUk7HqssGh7ajMFr2gXx8jB7dXWmNih6xscMdgY1L/AGktPtfyNYbdc5HaxnuNlWiN2cbWgJyNocwzVm4PburyH6wNnZWobs7U8Ny0BW5mztxk0M4AOZCS2GmSm0NGBEEbGpo2gtWRll1Vv9zT01L52BT87EmJZOsqtts690ipuUoKfsQIdUuSHXmklMSSsiGZbbcw0nxZ/llYtJ0ib1GJXaaezsZdkqNrDrEtZ9kwmsiqNvg5+rpP0jZtTFT7Mjd2TkHjVeLYLcU6+sR1vGhnJPRlFDsm87Rsqj1bYUhtqosUvELQNcm7OjrdCbKEqciTPa/vlXjyPVjqBhn8P4Sh8ZrClKRV7fJQo1fMsUSPKqiwbBG2yOaZK7yxCYuzRCW46eiZETuEiFNIbw8O8hWUIVnKcclvp/3J8OrH1xG+mPQvwrqnTocgIMcI9hOHhTGGiRncIWlxGHWHkLacwhxGFY7cZ7FYxn+OOlHjV2CHOW4l5RrERHtFqeQ88Ql1RLY6XsuJIIccwrvduFrUr+Ks5ylea9B5Wl6RISvMSBlSSJhOUS76Vej9uHpROewlX+J/H+PKuk16codQlYNsgcxmKNrsS+CMaJ4HoZwg6hO4IeHkZrLL7WEOtZbRlCsZSnsj/V1bggsxLJI8YoWJAZcj2Te/k1oNxDGHB0G5cVl7CM48XKs5V25znoRP6fhO7H4ESAn1UB3QkgOuPg4Ex4HYNgJ95a2u53fDWvOU9mc56l6lNVKuSdXnwjY2brxkNHvQ8qBJIabkAz49Y+RShzUMIw6lac4XhCe3t7uOxKXa1AOJQygdCXIeOXhI7bi3m2E4UNnCWW3nVLSnH8uFKznGO3Oei8xscDH5PKcOOyCIOJk057CUumF5Ybb9IKdwjGFOL7VqxjHbn8vw4o/T9qn9mRHXHLYcFdoypn8eNjWvYwUfK1Em0hWoy0aj2BqLMWaoS2VYiLEBjNhlGYcbU6twgdpOcJR3+9Rdkv7Rj7Rf43k5s7lZtKTvOsw5+A2hfNhaIleOsVXh60Ja4dFNpGu9akgCw4uCJInGYplb77zzpLz2OPK9hQFXLRYtezQdng9aMj1qDi9Z7YrWzqtU69r4W2hJj4COEqQUK0lcq88kJGXFLW7ntxVidt7KirJTqxdv1uxSajULJr5tchFVd2Gp/g2SP2bJz7JEBPSRsu84pxxBZGREJaH9Dwt63cftQ7ZgYeI/5BuM5qB6xa4NsETq3V112A/czdNvRmb+JJ2qKg4uXkoiJk1SAZIQr4+ctOeiYQ7WpOp3mmyIFM4h6V4l1SP2fqEfYL0UFo+Xsk7Wtj5KRd62M/YypSwIedFSM0OlwJlSVYzjPW9o2L2xHuar5K3uubH2nX5qjKLuothBoWuddXUWlWuNs8RCRUTsSC1oG46gmHLXFFklLGypDjDQx6bZc5CCu0VvP/mnV2yKVFKg7TQGDBqtD2nXpjz0xINW2l7FqlddiLGG96OHJhl4X6O0SKI+zuLYsbe6M5Jbb5A43m3MF6eZKvtEZXq+jakNqFRuZF4eZH9ZVOlKackXY5akYlTEoHxhTeW7bu6N2tRoDcF511rbXGyLDUdMNwdU3wzS7rXLRYbnv6hZvZUfeb3ba/EnVtqQYJBIi4eaNQhx5Kh2htWk1S00GFg9c753nvljUjWpnTtKRJu8NYu6zPoGuKQ9exv+PaHB+mFziRGHiGn5w8p5toVh70dMDVpaViZgqEGeCaIgKyPTa+HGILIVCwcBVxj5VELBVuHUxHhsqKJd9HGRlx1bmVKzyW+n/cvw6sfXFlmD03x/koRrjlpFqHkZbkrsWElD4pvWlZTHmyUMHxPnxIiQKEwhx4Vo81sdxWW0kPJThxXuO44eajZ32cde47jh5qNnfZx17juOHmo2d9nHXuO44eajZ32cde47jh5qNnfZx17juOHmo2d9nHXuO44eanZ32cde47jh5qNnfZx17juOHmo2d9nHXuO44eajZ32cdcYGoPTegJGGb0TrFEWfLcldiwsmYAmoxeBST4gTifPixpbzOMKcYbOLQ0rOUpdcxjvZ9x3HDzUbO+zjr3HccPNRs77OOvcdxw81Gzvs469x3HDzUbO+zjr3HccPNRs77OOvcdxw81Gzvs469x3HDzUbO+zjr3HccPNTs77OOvcdxw81Gzvs469x3HDzUbO+zjr3HccPNRs77OOvcdxw81Gzvs465ENS+mePgMU5ovbaJM2O5M7HlZAOPXQLAkwoGLJ4lQw0kYOPlS2mHDBUPLxhCnm8ZytP/9k=\" >\r\n </div>';\r\n $posthtml .= '</footer>';\r\n\r\n return $posthtml;\r\n }", "public function actionNoActivity(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail']; \n \n $users = User::model()->findAll(\"(lastvisit_at + INTERVAL 2 MONTH) < CURDATE() AND newsletter=1\");\n $c = 0;\n foreach ($users as $user){\n $lastvisit_at = strtotime($user->lastvisit_at);\n\n if ($lastvisit_at < strtotime('-1 year')) continue; // we give up after a year\n //if ($lastvisit_at > strtotime('-2 month')) continue; // don't notify before inactive for 2 months\n \n if (!\n (($lastvisit_at >= strtotime('-3 month')) || \n (($lastvisit_at >= strtotime('-7 month')) && ($lastvisit_at < strtotime('-6 month'))) || \n (($lastvisit_at >= strtotime('-12 month')) && ($lastvisit_at < strtotime('-11 month'))) )\n ) continue;\n \n//set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'no-activity-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n $message->subject = $user->name.\" did you forget about us?\";\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n //\n //$activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"Since your last visit we got some awesome new \".mailButton('projects', absoluteURL().'/project/discover','link', $mailTracking,'projects-button').\" and interesting \".\n mailButton('people', absoluteURL().'/person/discover','link', $mailTracking,'people-button').\" signup at Cofinder.\n <br /><br />\n Why don't you check them out on \".mailButton('Cofinder', 'http://www.cofinder.eu','success', $mailTracking,'cofinder-button');\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n \n Slack::message(\"CRON >> No activity reminders: \".$c);\n }", "function _build_attachement()\r\n\t\t{\r\n\t\t$this->boundary= \"------------\" . md5( uniqid(\"myboundary\") ); // TODO : variable bound\r\n\r\n\t\t$this->headers .= \"MIME-Version: 1.0\\nContent-Type: multipart/mixed;\\n boundary=\\\"$this->boundary\\\"\\n\\n\";\r\n\t\t$this->fullBody = \"This is a multi-part message in MIME format.\\n--$this->boundary\\nContent-Type: text/plain; charset=utf-8\\n\"\r\n\t\t\t. \"Content-Transfer-Encoding: 7bit\\n\\n\" . $this->body .\"\\n\";\r\n\t\t$sep= chr(13) . chr(10);\r\n\r\n\t\t$ata= array();\r\n\t\t$k=0;\r\n\r\n\t\t// for each attached file, do...\r\n\t\tfor( $i=0; $i < sizeof( $this->aattach); $i++ )\r\n\t\t\t{\r\n\t\t\t$filename = $this->aattach[$i];\r\n\t\t\t$basename = $this->aattachname[$i];\r\n\t\t\t$ctype = $this->actype[$i]; // content-type\r\n\t\t\t$disposition = $this->adispo[$i];\r\n \t\t\tif( ! file_exists( $filename) )\r\n\t\t\t\t{\r\n\t\t\t\techo \"Class Mail, method attach : file $filename can't be found\";\r\n\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t$subhdr= \"--$this->boundary\\nContent-type: $ctype;\\n name=\\\"$basename\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disposition;\\n filename=\\\"$basename\\\"\\n\";\r\n\t\t\t$ata[$k++] = $subhdr;\r\n\t\t\t// non encoded line length\r\n\t\t\t$linesz= filesize( $filename)+1;\r\n\t\t\t$fp= fopen( $filename, 'r' );\r\n\t\t\t$data= base64_encode(fread( $fp, $linesz));\r\n\t\t\tfclose($fp);\r\n\t\t\t$ata[$k++] = chunk_split( $data );\r\n \t}\r\n\t\t$this->attachment= implode($sep, $ata);\r\n\t\t}", "function generateFriMessageBody($user, $content, $friend_id) {\n $approve_url = SMTP_ENDPOINT.\"?type=friend&&from=\".$user['id'].\"&&to=\".$content['id'].\"&&friend_id=\".$friend_id.\"&&status=approved\";\n $delete_url = SMTP_ENDPOINT.\"?type=friend&&from=\".$user['id'].\"&&to=\".$content['id'].\"&&friend_id=\".$friend_id.\"&&status=delete\";\n $message = \"\";\n\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\n Hello \".$content['first_name'].\" \".$content['last_name'].\"!\n </p>\n <p>\n You have been invited to become part of \".$user['first_name'].\" \".$user['last_name'].\" MyNotes4u Friend Album.\n </p>\n <p>\n <span><a href=\".$approve_url.\">Approve</a></span>&nbsp;&nbsp;&nbsp;&nbsp;\n <span><a href=\".$delete_url.\">Delete</a></span>\n </p>\n </body>\n </html>\";\n return $message;\n}", "function send_notification_mail($notification_array){\n\t\n\t$type = $notification_array['type'];\n\t\n\t//To send follow notification email\t\n\tif($type === 'follow'){\n\t\t\n\t\t$following_username = $notification_array['following_username'];\n\t\t$followed_username = $notification_array['followed_username'];\n\t\t$to_email = $followed_email = $notification_array['followed_email'];\n\t\n\t}\n\t//To send comment notification email\t\n\telseif($type === 'comment'){\n\t\t\n\t\t$commentAuthorUsername = $notification_array['commentAuthorUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t//To send like notification email\t\n\telseif($type === 'like'){\n\t\t\n\t\t$likerUsername = $notification_array['likerUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t\n\tob_start();\n\tinclude('email_templates/notification.php');\n\t$notification_template = ob_get_contents();\t\t\t\n\tob_end_clean();\n\t\n\t\n\t\n\t$to = '[email protected]'; \n\t/*$to = $to_email; //please uncomment this when in live*/\n\t$strSubject = \"Notification mail\";\n\t$message = $notification_template; \n\t$headers = 'MIME-Version: 1.0'.\"\\r\\n\";\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1'.\"\\r\\n\";\n\t$headers .= \"From: [email protected]\"; \n\t\n\tif(mail($to, $strSubject, $message, $headers)){\n\t\treturn 'Mail send successfully';\n\t}else{\n\t\treturn 'Could not send email';\n\t} \n\t\n}", "function generateFamMessageBody($user, $content, $relation, $family_id) {\n $receiver_name = $content['first_name'].\" \".$content['last_name'];\n $family_relation = $relation;\n $sender = $user['first_name'].\" \".$user['last_name'];\n $approve_url = SMTP_ENDPOINT.\"?type=family&&from=\".$user['id'].\"&&to=\".$content['id'].\"&&relation=\".$family_relation.\"&&family_id=\".$family_id.\"&&status=approved\";\n $delete_url = SMTP_ENDPOINT.\"?type=family&&from=\".$user['id'].\"&&to=\".$content['id'].\"&&relation=\".$family_relation.\"&&family_id=\".$family_id.\"&&status=delete\";\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\n Hello \".$receiver_name.\",\n </p>\n <p>\n You have been invited to become part of \".$sender.\" MyNotes4u Family Album.\n </p>\n <p>\n <span><a href=\".$approve_url.\">Approve</a></span>&nbsp;&nbsp;&nbsp;&nbsp;\n <span><a href=\".$delete_url.\">Delete</a></span>\n </p>\n </body>\n </html>\";\n return $message;\n}", "private function mail_att($htmlContent,$anhang)\n {\n\n // Recipient \n $to = $this->tl_turnierpaare_ergebniss_email;\n \n // Sender \n $from = $this->tl_turnierpaare_ergebniss_email_absender; \n $fromName = $this->tl_turnierpaare_ergebniss_email_name;\n \n // Email subject \n $subject = $this->tl_turnierpaare_ergebniss_email_subject;\n\n \n // Header for sender info \n $headers = \"From: $fromName\".\" <\".$from.\">\"; \n \n // Boundary \n $semi_rand = md5(time()); \n $mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\"; \n \n // Headers for attachment \n $headers .= \"\\nMIME-Version: 1.0\\n\" . \"Content-Type: multipart/mixed;\\n\" . \" boundary=\\\"{$mime_boundary}\\\"\"; \n \n // Multipart boundary \n $message = \"--{$mime_boundary}\\n\" . \"Content-Type: text/html; charset=\\\"UTF-8\\\"\\n\" . \n \"Content-Transfer-Encoding: 7bit\\n\\n\" . $htmlContent . \"\\n\\n\"; \n\n //$anhang ist ein Mehrdimensionals Array\n //$anhang enthält mehrere Dateien\n \n if(is_array($anhang) AND is_array(current($anhang)))\n {\n foreach($anhang AS $dat)\n {\n $data = chunk_split(base64_encode($dat['data']));\n $message.= \"--\".$mime_boundary.\"\\r\\n\";\n $message.= \"Content-Disposition: attachment;\\r\\n\";\n $message.= \"\\tfilename=\\\"\".$dat['name'].\"\\\";\\r\\n\";\n $message.= \"Content-Length: .\".$dat['size'].\";\\r\\n\";\n $message.= \"Content-Type: \".$dat['type'].\"; name=\\\"\".$dat['name'].\"\\\"\\r\\n\";\n $message.= \"Content-Transfer-Encoding: base64\\r\\n\\r\\n\";\n $message.= $data.\"\\r\\n\";\n }\n $message .= \"--\".$mime_boundary.\"--\";\n }\n else if(strlen($anhang['name'])>0) //Nur 1 Datei als Anhang\n {\n\n $data = chunk_split(base64_encode($anhang['data']));\n $message.= \"--\".$mime_boundary.\"\\r\\n\";\n $message.= \"Content-Disposition: attachment;\\r\\n\";\n $message.= \"\\tfilename=\\\"\".$anhang['name'].\"\\\";\\r\\n\";\n $message.= \"Content-Length: .\".$dat['size'].\";\\r\\n\";\n $message.= \"Content-Type: \".$anhang['type'].\"; name=\\\"\".$anhang['name'].\"\\\"\\r\\n\";\n $message.= \"Content-Transfer-Encoding: base64\\r\\n\\r\\n\";\n $message.= $data.\"\\r\\n\";\n $message .= \"--\".$mime_boundary.\"--\";\n }\n \n $returnpath = \"-f\" . $from; \n\n if(mail($to, $subject, $message, $headers, $returnpath)){\n return true;\n } else{ \n return false;\n }\n }", "public function actionOrganizersAlert(){\n\t\t$startDate = new \\Datetime();\n\t\t$startDate->modify('next friday');\n\n\t\t\n\t\t$events = $this->getEvents( 9 , self::ALL_FILTER, $startDate );\n\t\t$events_per_email = array();\n\n \tforeach ($events as $event) {\n \t\t// var_dump($event);\n \t\t// Official creator of the event\n \t\tif( isset($event['email']) ){\n \t\t\t$email = $event['email'];\n \t\t\t$emails[ $email ] = $email;\n \t\t\t$events_per_email[$email][$event['id']] = $event;\n \t\t}\n \t\t\n \t\t// Mailto in the event\n \t\tif( isset($event['description']) ){\n \t\t\t$event_html = $event['description'];\n \t\t\t// preg_match_all(\"#mailto:([a-z0-9\\.\\-\\_]*@[a-z0-9\\.\\_\\-]*)#\",$event_html,$matches1,PREG_SET_ORDER);\n\t\t\t\tpreg_match_all('/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i',$event_html,$matches,PREG_SET_ORDER);\n\n\t\t\t\tif($matches){\n\t\t\t\t\tforeach($matches as $match){\n\t\t\t\t\t\t$email = $match[0];\n\t\t\t\t\t\tif( strlen($email) > 5 ){\n\t\t\t\t\t\t\t$emails[$email] = $email;\n\t\t\t\t\t\t\t$events_per_email[$email][$event['id']] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n \t\t\n \t}\n\n\n \t$emails = array_filter( $emails , function($email){\n \t\t$excludes = array( '[email protected]' , '[email protected]', '[email protected]', '[email protected]');\n \t\tif( !in_array( $email, $excludes ) ){\n \t\t\treturn true;\n \t\t}\n \t\treturn false;\n \t} );\n\n \tvar_dump(array_values($emails));\n \t// die();\n \tforeach ($emails as $email) {\n \t\tYii::$app->mailer->compose('alert',[ 'events' => $events_per_email[$email]])\n\t ->setFrom('[email protected]')\n\t ->setBcc('[email protected]')\n\t \t->setTo($email)\n\t ->setSubject('Milonga.be : please check your events')\n\t ->send();\n \t}\n\t}" ]
[ "0.5560377", "0.54029775", "0.5395132", "0.5394951", "0.5346519", "0.52990043", "0.525433", "0.5243421", "0.5223076", "0.52200687", "0.5208568", "0.5173874", "0.5169956", "0.5167497", "0.51482075", "0.5122063", "0.5080077", "0.5069892", "0.50665975", "0.50541687", "0.50418115", "0.50320864", "0.50059235", "0.5005689", "0.49770877", "0.4972965", "0.4966869", "0.49390084", "0.4926404", "0.49235678" ]
0.69526505
0
Save a comment on an activity.
public function comment($comment) { $comment['InsertUserID'] = Gdn::session()->UserID; $comment['DateInserted'] = Gdn_Format::toDateTime(); $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress()); $this->Validation->applyRule('ActivityID', 'Required'); $this->Validation->applyRule('Body', 'Required'); $this->Validation->applyRule('DateInserted', 'Required'); $this->Validation->applyRule('InsertUserID', 'Required'); $this->EventArguments['Comment'] = &$comment; $this->fireEvent('BeforeSaveComment'); if ($this->validate($comment)) { $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY); $_ActivityID = $comment['ActivityID']; // Check to see if this is a shared activity/notification. if ($commentActivityID = val('CommentActivityID', $activity['Data'])) { Gdn::controller()->json('CommentActivityID', $commentActivityID); $comment['ActivityID'] = $commentActivityID; } $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment'); if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) { return false; } // Check for spam. $spam = SpamModel::isSpam('ActivityComment', $comment); if ($spam) { return SPAM; } // Check for approval $approvalRequired = checkRestriction('Vanilla.Approval.Require'); if ($approvalRequired && !val('Verified', Gdn::session()->User)) { LogModel::insert('Pending', 'ActivityComment', $comment); return UNAPPROVED; } $iD = $this->SQL->insert('ActivityComment', $comment); if ($iD) { // Check to see if this comment bumps the activity. if ($activity && val('Bump', $activity['Data'])) { $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]); if ($_ActivityID != $comment['ActivityID']) { $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]); } } // Send a notification to the original person. if (val('ActivityType', $activity) === 'WallPost') { $this->notifyWallComment($comment, $activity); } } return $iD; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(iEntityComment $entity);", "public function save(Comment $comment)\n {\n $commentData = array(\n 'episode_id' => $comment->getEpisode()->getId(),\n 'user_id' => $comment->getAuthor()->getId(),\n 'content' => $comment->getContent(),\n );\n\n if ($comment->getId())\n {\n // The comment has already been saved : update it\n $this->getDb()->update('comments', $commentData, ['id' => $comment->getId()]);\n } else\n {\n // The comment has never been saved : insert it\n $this->getDb()->insert('comments', $commentData);\n $id = $this->getDb()->lastInsertId();\n $comment->setId($id);\n }\n }", "function save_comment($comment_id)\n {\n }", "protected function SaveActionIdToComment()\n {\n $sActionId = TTools::GetUUID();\n $this->sqlData['action_id'] = $sActionId;\n $this->AllowEditByAll(true);\n $this->Save();\n $this->AllowEditByAll(false);\n }", "public function save(Comment $comment)\n {\n $commentdata = array(\n 'art_id' => $comment->getArticle()->getId(),\n 'com_author' => $comment->getAuthor(),\n 'com_content' => $comment->getContent(),\n 'com_mail' => $comment->getMail(),\n 'parent_id' => $comment->getParent(),\n 't_date' => $comment->getDate(),\n 't_state'=> $comment->getState()\n ); \n \n if($comment->getId())\n {\n var_dump($commentdata);\n $this->getDb()->update('t_comment',$commentdata,array('com_id' => $comment->getId()));\n }\n else\n {\n $this->getDb()->insert('t_comment', $commentdata);\n $id = $this->getDb()->lastinsertID();\n $comment->setId($id);\n }\n }", "public function save(Comment $comment)\n {\n $this->add($comment);\n }", "function saveComment(){\n\t\t$this->layout = 'ajax';\n\t\t$user_id = $_POST['user_id'];\n\t\t$feeds_id = $_POST['business_feeds_id'];\n\t\t$comment = $_POST['comment'];\n\t\t$membership_id = $_POST['membershipPlan'];\n\n\t\t$saveData['user_id'] = $user_id;\n\t\t$saveData['feed_id'] = $feeds_id;\n\t\t$saveData['comment'] = $comment;\n\t\tif($membership_id != 1){\n\t\t\t$saveData['status'] = 1;\n\t\t} else {\n\t\t\t$saveData['status'] = 2;\n\t\t}\n\n\t\t$this->Comment->save($saveData);\n\n\t\t$this->set('comment', $comment);\n\n\t\t$last_id = $this->Comment->id;\n\t\t$commentArr = $this->Comment->find('first', array('conditions'=>array('Comment.id'=>$last_id, 'Comment.status'=>'1')));\n\t\t$this->set('commentArr', $commentArr);\n\t\tif(!empty($commentArr)){\n\t\t$userr_id = $commentArr['Comment']['user_id'];\n\t\t$this->set('userr_id', $userr_id);\n\t\t}\t\n\t\t$this->set('last_id', $last_id);\n\t}", "public function save(Comment $comment) {\n $commentData = array(\n 'billet_id' => $comment->getBillet()->getBilletId(),\n 'com_content' => $comment->getContent(),\n 'usr_id' => $comment->getAuthor()->getId(),\n 'parent_id' => 0,\n 'com_depth' => 0,\n );\n\n if ($comment->getCommentId()) {\n // The comment has already been saved : update it\n $this->getDb()->update('t_comment', $commentData, array('com_id' => $comment->getCommentId()));\n } else {\n // The comment has never been saved : insert it\n $this->getDb()->insert('t_comment', $commentData);\n // Get the id of the newly created comment and set it on the entity.\n $commentId = $this->getDb()->lastInsertId();\n $comment->setCommentId($commentId);\n }\n }", "public function commentStore() {\n\t\t$post_id = $_POST['post_id'];\n\t\t$text = $_POST['text'];\n\t\t$comment = new Comment([$post_id, $text]);\n\t\t$comment->save();\n\t}", "public function saveAnswer(Comment $comment) {\n $commentData = array(\n 'billet_id' => $comment->getBillet()->getBilletId(),\n 'parent_id' => $comment->getCommentId(),\n 'usr_id' => $comment->getAuthor()->getId(),\n 'com_content' => $comment->getContent(),\n 'com_depth' => $comment->getDepth()+1,\n );\n\n if ($comment->getCommentId()) {\n // The answer has never been saved : insert it\n $this->getDb()->insert('t_comment', $commentData);\n // Get the id of the newly created answer and set it on the entity.\n\n $commentId = $this->getDb()->lastInsertId();\n $comment->setCommentId($commentId);\n }\n }", "function bp_activity_action_post_comment() {\n\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );\n\n\t$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );\n\t$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );\n\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please do not leave the comment area blank.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n\t}\n\n\t$comment_id = bp_activity_new_comment( array(\n\t\t'content' => $content,\n\t\t'activity_id' => $activity_id,\n\t\t'parent_id' => false\n\t));\n\n\tif ( !empty( $comment_id ) )\n\t\tbp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );\n\n\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n}", "public function save()\n\t{\n\t\t// Check for request forgeries.\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view \t= $this->getCurrentView();\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.add' ) )\n\t\t{\n\t\t\t$view->setMessage( 'ACL: Not allowed to add comments', SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$element\t= JRequest::getString( 'element', '' );\n\t\t$group\t\t= JRequest::getString( 'group', SOCIAL_APPS_GROUP_USER );\n\t\t$uid\t\t= JRequest::getInt( 'uid', 0 );\n\t\t$input\t\t= JRequest::getVar( 'input', '' , 'post' , 'none' , JREQUEST_ALLOWRAW );\n\t\t$data\t\t= JRequest::getVar( 'data', array() );\n\t\t$streamid\t= JRequest::getVar( 'streamid', '' );\n\t\t$parent\t\t= JRequest::getInt( 'parent', 0 );\n\n\t\t$compositeElement = $element . '.' . $group;\n\n\t\t$table\t\t= Foundry::table( 'comments' );\n\n\t\t$table->element = $compositeElement;\n\t\t$table->uid = $uid;\n\t\t$table->comment = $input;\n\t\t$table->created_by = Foundry::user()->id;\n\t\t$table->created = Foundry::date()->toSQL();\n\t\t$table->parent = $parent;\n\t\t$table->params = $data;\n\n\t\t$state\t\t= $table->store();\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\tif( $streamid )\n\t\t{\n\t\t\t$stream = Foundry::stream();\n\t\t\t$stream->updateModified( $streamid );\n\t\t}\n\n\t\t// Process mentions for this comment\n\t\tif( isset( $data['mentions']) && !empty( $data[ 'mentions' ] ) )\n\t\t{\n\t\t\tforeach( $data[ 'mentions' ] as $row )\n\t\t\t{\n\t\t\t\t$mention \t\t= (object) $row;\n\n\t\t\t\t$tag \t\t\t= Foundry::table( 'Tag' );\n\t\t\t\t$tag->offset\t= $mention->start;\n\t\t\t\t$tag->length\t= $mention->length;\n\t\t\t\t$tag->type \t\t= $mention->type;\n\n\t\t\t\tif( $tag->type == 'hashtag' )\n\t\t\t\t{\n\t\t\t\t\t$tag->title = $mention->value;\n\t\t\t\t}\n\n\t\t\t\tif( $tag->type == 'entity' )\n\t\t\t\t{\n\t\t\t\t\t$value \t\t\t\t= (object) $mention->value;\n\t\t\t\t\t$tag->item_id \t\t= $value->id;\n\t\t\t\t\t$tag->item_type \t= SOCIAL_TYPE_USER;\n\t\t\t\t}\n\n\t\t\t\t$tag->creator_id \t= Foundry::user()->id;\n\t\t\t\t$tag->creator_type \t= SOCIAL_TYPE_USER;\n\n\t\t\t\t$tag->target_id \t= $table->id;\n\t\t\t\t$tag->target_type \t= 'comments';\n\n\t\t\t\t$tag->store();\n\t\t\t}\n\t\t}\n\n\t\t$dispatcher = Foundry::dispatcher();\n\n\t\t$comments \t= array( &$table );\n\t\t$args \t\t= array( &$comments );\n\n\t\t// @trigger: onPrepareComments\n\t\t$dispatcher->trigger( $group , 'onPrepareComments' , $args );\n\n\t\treturn $view->call( __FUNCTION__, $table );\n\t}", "public function saveComment(comment $comment){\n\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP'];} \n\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; }\n\n\t\telse { $ip = $_SERVER['REMOTE_ADDR'];}\n\n $data = array(\n\n 'comment_system_type_id' => $comment->comment_system_type_id,\n\n 'comment_by_user_id' => $comment->comment_by_user_id,\n\n\t\t\t'comment_content' => $comment->comment_content,\n\n\t\t\t'comment_status' => $comment->comment_status,\t\t\t \n\n\t\t\t'comment_added_ip_address' => $ip,\n\n\t\t\t'comment_refer_id' => $comment->comment_refer_id,\n\n\t\t\t'comment_added_timestamp' =>date(\"Y-m-d H:i:s\"),\n\n );\n\n $comment_id = (int)$comment->comment_id;\n\n if ($comment_id == 0) {\n\n $this->insert($data);\n\n\t\t\treturn $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n\n } else {\n\n if ($this->getComment($comment_id)) {\n\n $this->update($data, array('comment_id' => $comment_id));\n\n } else {\n\n throw new \\Exception('Comment id does not exist');\n\n }\n\n }\n\n }", "public function save($id, $comment)\n {\n $comments = $this->session->get('comments', []);\n $comments[$id] = $comment;\n $this->session->set('comments', $comments);\n\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $comment = Comments::findFirstByid($id);\n if (!$comment) {\n $this->flash->error(\"comment does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n\n if (!$comment->save()) {\n\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"edit\",\n \"params\" => array($comment->id)\n ));\n }\n\n $this->flash->success(\"comment was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n\n }", "public function Save() {\n $msg = null;\n if($this['id']) {\n $this->db->ExecuteQuery(self::SQL('update comment'), array($this['data'], $this['filter'], $this['id']));\n $msg = 'update';\n } else {\n $this->db->ExecuteQuery(self::SQL('insert comment'), array($this['data'], $this['filter'], $this->user['id'], $this['idContent']));\n $this['id'] = $this->db->LastInsertId();\n $msg = 'created';\n }\n $rowcount = $this->db->RowCount();\n if($rowcount) {\n $this->AddMessage('success', \"Successfully {$msg} comment\");\n } else {\n $this->AddMessage('error', \"Failed to {$msg} comment \");\n }\n return $rowcount === 1;\n }", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "public function save(Comment $comment)\n {\n if ($comment->isValid()) {\n $comment->isNew() ? $this->add($comment) : $this->update($comment);\n }\n }", "public function comedit()\n {\n $commentId = Input::get('pk');\n //get the new marks\n $comment = Input::get('value');\n //get the Student Data Row to be updated with new marks\n $commentData = Comments::whereId($commentId)->first();\n $commentData->content = $comment;\n\n $commentData->save();\n\n\n\n }", "public function commentUpdate() {\n\t\t$id = $_POST['id'];\n\t\t$text = $_POST['text'];\n\t\t$c = Comment::find($id);\n\t\t$c->text = $text;\n\t\t$c->save();\n\t}", "public function save($activity) {\r\n\t\t$stmt = $this->db->prepare(\"INSERT INTO activities (nombre, descripcion, dia, hora_inicio, hora_fin, plazas, entrenador) VALUES (?, ?, ?, ?, ?, ?, ?)\");\r\n\t\t$stmt->execute(array($activity->getNombre(), $activity->getDescripcion(), $activity->getDia(), $activity->getHoraInicio(), $activity->getHoraFin(), $activity->getPlazas(), $activity->getEntrenador()));\r\n\t\t$stmt = $this->db->query(\"SELECT MAX(id) FROM activities\");\r\n\t\t$id = $stmt->fetch();\r\n\t\treturn $id;\r\n\t}", "public function saveReporting(Comment $comment) {\n $commentData = array(\n 'com_reporting'=> $comment->getCommentId(),\n );\n // The comment has already been saved : update it\n $this->getDb()->update('t_comment', $commentData, array('com_id' => $comment->getCommentId()));\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function store(Request $request)\n {\n \n $comment = new Comment;\n $comment->comment = $request->comment_content;\n $comment->user()->associate($request->user());\n $commentPic = DB::table('comments')\n ->join('users','comments.user_id','=','users.id')\n ->join('profiles','users.id','=','profiles.user_id')\n ->select('comments.*','profiles.profilepic_path as pic')\n ->get();\n // dd($request);\n $forum = Forum::find($request->forum_id);\n $forum->comments()->save($comment);\n\n /* hualilidefengexian : Testing out the activity log*/\n \n $user = Auth::user()->id;\n\n activity()\n ->performedOn($comment)\n ->causedBy($user)\n ->withProperties(['commented' => $request->comment_content, 'forum_id'=>$forum ->id])\n ->log('Commented on forums');\n\n /* end of testing */\n\n return back();\n\n \n\n //dd(Forum::find($request->forum_id));\n // $comment = new Comment;\n\n // $comment->comment = $request->comment;\n\n // $comment->user()->associate($request->user());\n\n // $forum_post = Forum::find($request->forum_id);\n\n // $forum_post->comments()->save($comment);\n\n // return back();\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function postComment($episodeId, $author, $comment){\n $req = $this->db->prepare('INSERT INTO comments (episode_id, author, comment, comment_date, reported) VALUES (?, ?, ?, NOW(), 0)');\n $newComment = $req->execute(array($episodeId, $author, $comment));\n return $newComment;\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "protected function comment_save($edit) {\n global $user;\n if (!form_get_errors()) {\n $edit += array(\n 'mail' => '',\n 'homepage' => '',\n 'name' => '',\n 'status' => user_access('post comments without approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED,\n );\n if ($edit['cid']) {\n // Update the comment in the database.\n db_query(\"UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d\", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);\n\n // Allow modules to respond to the updating of a comment.\n comment_invoke_comment($edit, 'update');\n\n // Add an entry to the watchdog log.\n watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));\n }\n else {\n // Add the comment to database.\n // Here we are building the thread field. See the documentation for\n // comment_render().\n if ($edit['pid'] == 0) {\n // This is a comment with no parent comment (depth 0): we start\n // by retrieving the maximum thread level.\n $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));\n\n // Strip the \"/\" from the end of the thread.\n $max = rtrim($max, '/');\n\n // Finally, build the thread field for this new comment.\n $thread = int2vancode(vancode2int($max) + 1) .'/';\n }\n else {\n // This is comment with a parent comment: we increase\n // the part of the thread value at the proper depth.\n\n // Get the parent comment:\n $parent = _comment_load($edit['pid']);\n\n // Strip the \"/\" from the end of the parent thread.\n $parent->thread = (string) rtrim((string) $parent->thread, '/');\n\n // Get the max value in _this_ thread.\n $max = db_result(db_query(\"SELECT MAX(thread) FROM {comments} WHERE thread LIKE '%s.%%' AND nid = %d\", $parent->thread, $edit['nid']));\n\n if ($max == '') {\n // First child of this parent.\n $thread = $parent->thread .'.'. int2vancode(0) .'/';\n }\n else {\n // Strip the \"/\" at the end of the thread.\n $max = rtrim($max, '/');\n\n // We need to get the value at the correct depth.\n $parts = explode('.', $max);\n $parent_depth = count(explode('.', $parent->thread));\n $last = $parts[$parent_depth];\n\n // Finally, build the thread field for this new comment.\n $thread = $parent->thread .'.'. int2vancode(vancode2int($last) + 1) .'/';\n }\n }\n\n if (empty($edit['timestamp'])) {\n $edit['timestamp'] = time();\n }\n\n if ($edit['uid'] === $user->uid && isset($user->name)) { // '===' Need to modify anonymous users as well.\n $edit['name'] = $user->name;\n }\n\n db_query(\"INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')\", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $edit['status'], $thread, $edit['name'], $edit['mail'], $edit['homepage']);\n $edit['cid'] = db_last_insert_id('comments', 'cid');\n\n // Tell the other modules a new comment has been submitted.\n comment_invoke_comment($edit, 'insert');\n\n // Add an entry to the watchdog log.\n watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));\n }\n _comment_update_node_statistics($edit['nid']);\n\n // Clear the cache so an anonymous user can see his comment being added.\n cache_clear_all();\n\n // Explain the approval queue if necessary, and then\n // redirect the user to the node he's commenting on.\n if ($edit['status'] == COMMENT_NOT_PUBLISHED) {\n drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));\n }\n else {\n comment_invoke_comment($edit, 'publish');\n }\n return $edit['cid'];\n }\n else {\n return FALSE;\n }\n }", "public function actionSaveNew()\n {\n $now = new DateTime();\n\n $comment = new SensorarioComments();\n $comment->attributes = $_POST['SensorarioModuleComment'];\n $comment->save();\n\n echo json_encode(true);\n\n Yii::app()->end();\n }", "public static function storeActivity($title = null, $details = null, $url = null)\n {\n $ip = Helpers::getIP();\n $externalIp = Helpers::getExternalIP();\n $useragent = $_SERVER['HTTP_USER_AGENT'];\n $user = Auth::user()->id;\n\n if (null == $url) {\n $url = url()->current();\n }\n\n Activity::create([\n 'ipaddress' => $ip,\n 'externalip' => $externalIp,\n 'useragent' => $useragent,\n 'url' => $url,\n 'title' => $title,\n 'details' => $details,\n 'user_id' => $user,\n 'is_read' => false,\n ]);\n }" ]
[ "0.6986315", "0.67054135", "0.66061455", "0.64837795", "0.6474487", "0.63229394", "0.61861134", "0.6157749", "0.61107874", "0.60575956", "0.60386467", "0.6024631", "0.600439", "0.5914258", "0.58688784", "0.58667433", "0.5836492", "0.5823082", "0.5810805", "0.57949275", "0.57782286", "0.57511187", "0.5730449", "0.56624895", "0.56591034", "0.564802", "0.56383723", "0.5627538", "0.56057733", "0.56057054" ]
0.69958353
0
Send all notifications in the queue.
public function sendNotificationQueue() { foreach ($this->_NotificationQueue as $userID => $notifications) { if (is_array($notifications)) { // Only send out one notification per user. $notification = $notifications[0]; /* @var Gdn_Email $Email */ $email = $notification['Email']; if (is_object($email) && method_exists($email, 'send')) { $this->EventArguments = $notification; $this->fireEvent('BeforeSendNotification'); try { // Only send if the user is not banned $user = Gdn::userModel()->getID($userID); if (!val('Banned', $user)) { $email->send(); $emailed = self::SENT_OK; } else { $emailed = self::SENT_SKIPPED; } } catch (phpmailerException $pex) { if ($pex->getCode() == PHPMailer::STOP_CRITICAL && !$email->PhpMailer->isServerError($pex)) { $emailed = self::SENT_FAIL; } else { $emailed = self::SENT_ERROR; } } catch (Exception $ex) { switch ($ex->getCode()) { case Gdn_Email::ERR_SKIPPED: $emailed = self::SENT_SKIPPED; break; default: $emailed = self::SENT_FAIL; } } try { $this->SQL->put('Activity', ['Emailed' => $emailed], ['ActivityID' => $notification['ActivityID']]); } catch (Exception $ex) { // Ignore an exception in a behind-the-scenes notification. } } } } // Clear out the queue unset($this->_NotificationQueue); $this->_NotificationQueue = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flushNotificationQueue() {\r\n\t\t// Logfile entries\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Log the message\r\n\t\t\t$this->log($message);\r\n\t\t}\r\n\t\t$sendNotifications = Configure::read('Alert.send');\r\n\t\tif (!$sendNotifications) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Email notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\r\n\t\t\t$this->sendAlertEmail($message);\r\n\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// 1/4 of a second is enough here.\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\t\t// Pushover Notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Send out notifications through Pushover\r\n\r\n\t\t\t$this->sendPushoverAlert($message);\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// We don't want to get ourselves banned from Pushover...\r\n\t\t\t// 1/4 of a second should suffice\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\r\n\t}", "public function send_queue()\n\t{\n\t\t$sql = 'SELECT *\n\t\t\t\tFROM ' . SQL_PREFIX . 'notify\n\t\t\t\tORDER BY notify_time';\n\t\t$result = Fsb::$db->query($sql, 'notify_');\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\t// Suppression des elements directement, afin d'eviter un double envoie\n\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'notify';\n\t\t\tFsb::$db->query($sql);\n\t\t\tFsb::$db->destroy_cache('notify_');\n\n\t\t\t// Envoie du message\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$this->method = (isset($this->ext[$row['notify_method']])) ? $row['notify_method'] : NOTIFY_MAIL;\n\t\t\t\t$this->subject = $row['notify_subject'];\n\t\t\t\t$this->body = $row['notify_body'];\n\t\t\t\t$this->bcc = explode(\"\\n\", $row['notify_bcc']);\n\t\t\t\t$return = $this->send(false);\n\t\t\t\t$this->reset();\n\n\t\t\t\t// En cas d'echec du message on le reinsere dans la base de donnee\n\t\t\t\tif (!$return && $row['notify_try'] < Notify::MAX_TRY)\n\t\t\t\t{\n\t\t\t\t\t$row['notify_try']++;\n\t\t\t\t\tunset($row['notify_id']);\n\t\t\t\t\tforeach ($row AS $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_numeric($k))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($row[$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tFsb::$db->insert('notify', $row, 'INSERT', true);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t\tFsb::$db->query_multi_insert();\n\t\t}\n\t\tFsb::$db->free($result);\n\t}", "public function flush(): void\n {\n foreach ($this->eventRegistry->dequeueEvents() as $event) {\n $this->eventBus->dispatch($event);\n }\n }", "public function action_sendmails(){\r\n\t\techo 'Send mails from queue'.\"\\n\";\n\t\t$mails = Model_Mail::getQueuedToSend();\n\t\t$swiftMail = email::connect();\r\n\t\t\t\t\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(array($mail->from));\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->to));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tModel_Mail::setSent($mail->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo 'Sended '.count($mails).' e-mail'.\"\\n\";\r\n\t}", "public function flush()\n {\n $queueSize = count($this->queue);\n if ($queueSize > 0) {\n $this->logInfo('Flushing queue of size ' . $queueSize);\n $this->getTransport()->send($this->queue);\n $this->queue = array();\n }\n }", "public function fireQueue()\n {\n $count = NewsletterEmailQueue::count();\n\n if ($count === 0) {\n $this->info('There are no emails to send');\n return;\n }\n\n if (!$this->confirm(sprintf('There\\'s %d emails in the send queue. Are you sure you want to send them out now? [yes|no]', $count), true)) {\n return;\n }\n\n // Mail\n $transport = Swift_MailTransport::newInstance();\n $email = NewsletterEmail::findOrFail(1);\n\n $html = View::make('emails.dinner_confirmation.html')\n ->with('body', $email->body)\n ->render();\n\n $body = (new \\TijsVerkoyen\\CssToInlineStyles\\CssToInlineStyles($html, file_get_contents(base_path() . '/public/assets/css/email.css')))\n ->convert();\n\n $transport = Swift_MailTransport::newInstance();\n $mailer = Swift_Mailer::newInstance($transport);\n $emails = User::hasStudentGroup()->get()->lists('email');\n\n foreach ($emails as $email)\n {\n $this->info(sprintf('Sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n $message = Swift_Message::newInstance();\n\n $message->setFrom(array('[email protected]' => 'EESoc'));\n $message->setReplyTo('[email protected]');\n $message->setTo($email);\n $message->setSubject('EESoc Dinner Confirmation');\n $message->setBody($html, 'text/html');\n\n if (isset($plaintext))\n $message->addPart($plaintext, 'text/plain');\n\n if ($mailer->send($message)) {\n $this->info(sprintf('Successfully sent email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n\n // Remove from queue\n $queue->delete();\n } else {\n $this->error(sprintf('Something went wrong while sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n }\n }\n }", "private function dispatchNotifications() {\n $this->channels->each(function($channel) {\n $notifiable = new AnonymousNotifiable();\n $notifiable->route($channel->type, $channel->endpoint);\n DispatchNotification::dispatch($notifiable, $this->notification);\n });\n }", "public function processQueue()\n {\n $gate_arr = config('gates');\n foreach ($gate_arr as $gate_item) {\n $this->sendSmsOne($gate_item['name']);\n }\n }", "public function enqueueAll($messages = array()) {\n $this->_events->enqueueAll($messages);\n }", "public function sendBulk(array $notifications);", "public static function _send_deferred_notifications() {\n\t\t$email_notifications = self::get_email_notifications( true );\n\t\tforeach ( self::$deferred_notifications as $email ) {\n\t\t\tif (\n\t\t\t\t! is_string( $email[0] )\n\t\t\t\t|| ! isset( $email_notifications[ $email[0] ] )\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$email_class = $email_notifications[ $email[0] ];\n\t\t\t$email_notification_key = $email[0];\n\t\t\t$email_args = is_array( $email[1] ) ? $email[1] : array();\n\n\t\t\tself::send_email( $email[0], new $email_class( $email_args, self::get_email_settings( $email_notification_key ) ) );\n\t\t}\n\t}", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function FlushQueue()\n {\n do\n {\n $result = $this->FlushMsg();\n } while ($result);\n }", "private function dispatchDigestNotification() : void\n {\n foreach ($this->users as $user) {\n if (!$user->unreadNotifications->isEmpty()) {\n dispatch((new SendUnreadDigestJob($user)));\n }\n }\n }", "protected function sendStuckNotifications()\n {\n if (!$this->stuckThreshold) {\n return; // no threshold, no notifications\n }\n\n $limit = new DateTime();\n $limit->modify(\"-$this->stuckThreshold\");\n\n $stuckQuery = $this->entityManager->createQuery(\n 'SELECT COUNT(aj.id) AS stuckedCount, MIN(COALESCE(aj.scheduledAt, aj.createdAt)) AS minTime\n FROM App\\Model\\Entity\\AsyncJob aj\n WHERE aj.finishedAt IS NULL AND COALESCE(aj.scheduledAt, aj.createdAt) <= :dateLimit'\n );\n $stuckQuery->setParameter(\"dateLimit\", $limit);\n $stuckResult = $stuckQuery->getSingleResult();\n\n $count = (int)$stuckResult[\"stuckedCount\"];\n if ($count) {\n $maxDelay = (new DateTime())->diff(new DateTime($stuckResult[\"minTime\"]));\n $this->sender->send($count, $maxDelay);\n }\n }", "public static function flush($queue) {\n foreach (static::$flushers[$queue] as $flusher) {\n // We will simply spin through each payload registered for the event and\n // fire the flusher, passing each payloads as we go. This allows all\n // the events on the queue to be processed by the flusher easily.\n if (!isset(static::$queued[$queue])) {\n continue;\n }\n\n foreach (static::$queued[$queue] as $key => $payload) {\n array_unshift($payload, $key);\n\n call_user_func_array($flusher, $payload);\n }\n }\n }", "public function sendBulk(array $notifications)\n {\n foreach ($notifications as $notification) {\n $this->send($notification);\n }\n }", "public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }", "public function realSend() {\n\t\tBrightUtils::inBrowser();\n\t\t$sql = 'SELECT id, pageId, `groups` FROM `mailqueue` WHERE issend=0';\n\t\t$mailings = $this -> _conn -> getRows($sql);\n\t\t\n\t\t$user = new User();\n\t\tforeach($mailings as $mailing) {\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=1 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t\t$groups = explode(',', $mailing -> groups);\t\t\t\n\t\t\t$emails = $user -> getUsersInGroups($groups, false, true);\n\t\t\t$this -> _send($mailing -> pageId, $emails);\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=2 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t}\n\t}", "public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }", "public function sendRemaining()\n {\n $notifications = Notifications::find([\n 'conditions' => 'sent = ?1 AND UNIX_TIMESTAMP() - created_at <= ?2',\n 'order' => 'created_at DESC',\n 'limit' => 1000,\n 'bind' => [\n 1 => Notifications::STATUS_NOT_SENT, // Only unsent messages\n 2 => 7 * 24 * 60 * 60, // For last 7 days\n ],\n ]);\n\n foreach ($notifications as $notification) {\n $this->send($notification);\n }\n }", "public function runNotifications():void;", "public function emailQueue() {\n\t\t$this->EmailQueue->processQueue(); exit;\n\t}", "public function flushAll();", "public function dispatch()\r\n {\r\n foreach($this->broadcast as $event => $data) {\r\n $this->execute($event);\r\n }\r\n }", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "public function sendToMultiple()\n {\n $token = array('Registratin_id1', 'Registratin_id2'); // array of push tokens\n $message = \"Test notification message\";\n\n $this->load->library('fcm');\n $this->fcm->setTitle('Test FCM Notification');\n $this->fcm->setMessage($message);\n $this->fcm->setIsBackground(false);\n // set payload as null\n $payload = array('notification' => '');\n $this->fcm->setPayload($payload);\n $this->fcm->setImage('https://firebase.google.com/_static/9f55fd91be/images/firebase/lockup.png');\n $json = $this->fcm->getPush();\n\n /** \n * Send to multiple\n * \n * @param array $token array of firebase registration ids (push tokens)\n * @param array $json return data from getPush() method\n */\n $result = $this->fcm->sendMultiple($token, $json);\n }", "public function flushAll(){\n\n //get flush All\n $this->client->flushall();\n }", "public function action_sendnewsletters()\n\t{\n\t\techo 'Send newsletters from queue'.\"\\n\";\n\t\t$mails = Model_Newsletter::getQueuedToSend();\n\t\t$swiftMail = email::connect();\n\t\t$done_item = array();\n\t\t$done_newsletter = array();\n\t\tif (!count($mails))\n\t\t{\n\t\t\techo 'Nothing to send';\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(Model_Mail::EMAIL_ADMIN);\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->subscriber_email));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tif (!in_array($mail->newsletter_id, $done_newsletter))\n\t\t\t\t{\n\t\t\t\t\tarray_push($done_newsletter, $mail->newsletter_id);\t\n\t\t\t\t}\n\t\t\t\tarray_push($done_item, $mail->newsletter_queue_id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tModel_Newsletters::moveToArchive($done_item);\n\t\tModel_Newsletters::setSent($done_newsletter);\n\t\techo 'Sended '.count($done).' e-mail'.\"\\n\";\n\t}", "private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }" ]
[ "0.7394986", "0.68472946", "0.6576856", "0.65762043", "0.6549178", "0.6432119", "0.63901544", "0.6358515", "0.6330749", "0.6294968", "0.62443763", "0.6195702", "0.6163093", "0.609171", "0.6089085", "0.6012481", "0.5986223", "0.5968316", "0.5962382", "0.5957441", "0.59543717", "0.59318525", "0.59275675", "0.5889547", "0.58828837", "0.5878832", "0.5854902", "0.58110833", "0.5796", "0.5792485" ]
0.7632366
0
Notify the user of wall comments.
protected function notifyWallComment($comment, $wallPost) { $notifyUser = Gdn::userModel()->getID($wallPost['ActivityUserID']); $activity = [ 'ActivityType' => 'WallComment', 'ActivityUserID' => $comment['InsertUserID'], 'Format' => $comment['Format'], 'NotifyUserID' => $wallPost['ActivityUserID'], 'RecordType' => 'ActivityComment', 'RecordID' => $comment['ActivityCommentID'], 'RegardingUserID' => $wallPost['ActivityUserID'], 'Route' => userUrl($notifyUser, ''), 'Story' => $comment['Body'], 'HeadlineFormat' => t('HeadlineFormat.NotifyWallComment', '{ActivityUserID,User} commented on your <a href="{Url,url}">wall</a>.') ]; $this->save($activity, 'WallComment'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "function wp_new_comment_notify_moderator($comment_id)\n {\n }", "public function notifyUser(&$comment) {\n if (!$comment instanceof modxTalksPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n\n $link = $this->generateLink($cid, $idx, 'full');\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n $subject = $this->modx->lexicon('modxtalks.email_comment_approved');\n $text = $this->modx->lexicon('modxtalks.email_user_approve_comment', array(\n 'link' => $link,\n ));\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * Get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * Send notifications to user\n */\n $success = false;\n if (!empty($user['email'])) {\n if ($this->sendEmail($subject, $body, $user['email'])) {\n $success = true;\n }\n }\n\n return $success;\n }", "function notifyComments($cids, $type)\r\n {\r\n $my = JFactory::getUser();\r\n\r\n $database =& JFactory::getDBO();\r\n\r\n\r\n if (is_array($cids)) {\r\n $cids = implode(',',$cids);\r\n }\r\n\r\n $sentemail = \"\";\r\n $database->setQuery(\"SELECT * FROM #__comment WHERE id IN ($cids)\");\r\n $rows = $database->loadObjectList();\r\n if ($rows) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$my->id.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $myemail = $database->loadResult();\r\n $_notify_users = $this->_notify_users;\r\n\r\n foreach($rows as $row) {\r\n $this->_notify_users = $_notify_users;\r\n $this->setIDs($row->id, $row->contentid);\r\n $this->resetLists();\r\n $this->lists['name'] \t= $row->name;\r\n $this->lists['title'] \t= $row->title;\r\n $this->lists['notify'] \t= $row->notify;\r\n $this->lists['comment']\t= $row->comment;\r\n\r\n $email_writer = $row->email;\r\n /*\r\n * notify writer of approval\r\n */\r\n if ($row->userid > 0) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$row->userid.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $result = $database->loadAssocList();\r\n if ($result) {\r\n $user = $result[0];\r\n $email_writer = $user['email'];\r\n }\r\n }\r\n\r\n if ($email_writer && $email_writer != $myemail) {\r\n switch ($type) {\r\n \t\t\tcase 'publish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($temp=array($email_writer));\r\n $exclude = $myemail ? ($email_writer.','.$myemail): $email_writer;\r\n } else {\r\n $exclude = $myemail ? $myemail:\"\";\r\n }\r\n\t\t\t /*\r\n\t\t\t * notify users, moderators, admin\r\n\t\t\t */\r\n switch ($type) {\r\n case 'publish':\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n//\t \t \techo implode(',', $notification->getMailList($row->contentid));\r\n $templist = $this->getMailList($row->contentid, $exclude);\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($templist);\r\n }\r\n }\r\n return $sentemail;\r\n }", "public function notifyModerators(&$comment) {\n if (!$comment instanceof modxTalksPost && !$comment instanceof modxTalksTempPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n if ($comment instanceof modxTalksPost) {\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n $link = $this->generateLink($cid, $idx, 'full');\n $subject = $this->modx->lexicon('modxtalks.email_new_comment');\n $text = $this->modx->lexicon('modxtalks.email_added_new_comment', array(\n 'link' => $link,\n 'name' => $user['name'],\n ));\n } elseif ($comment instanceof modxTalksTempPost) {\n $subject = $this->modx->lexicon('modxtalks.email_new_premoderated_comment');\n $text = $this->modx->lexicon('modxtalks.email_user_add_premoderated_comment', array(\n 'name' => $user['name'],\n ));\n }\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * send notifications\n */\n $success = false;\n\n $emails = $this->getUsersEmailsByGroups($this->config['moderator'], $comment);\n\n /**\n * send notifications to moderators\n */\n if (!empty($emails)) {\n if ($this->sendEmail($subject, $body, $emails)) {\n $success = true;\n }\n }\n\n return $success;\n }", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "protected function comments_bubble($post_id, $pending_comments)\n {\n }", "private function notify_new_approved_comment( $comment, $post ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $comment->user_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $user = get_user_by( 'id', $comment->user_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'comment_id' => $comment->comment_ID,\n\t\t\t'content' => get_comment_excerpt( $comment ),\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'url' => get_comment_link( $comment ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "function wp_notify_postauthor($comment_id, $deprecated = \\null)\n {\n }", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public static function sendUserNotification()\n {\n $con = $GLOBALS[\"con\"];\n $sqlGetCount = \"SELECT staff_id, notification_counter from user\";\n $result = mysqli_query($con, $sqlGetCount);\n while ($row = mysqli_fetch_assoc($result)) {\n $count = 1;\n $count += (int)$row['notification_counter'];\n $user = $row['staff_id'];\n $sqlAddCount = \"update user set notification_counter = $count where staff_id = $user\";\n mysqli_query($con, $sqlAddCount);\n }\n }", "function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)\n{\n\tglobal $bb_cfg, $lang, $db;\n\tglobal $userdata;\n\n\tif (!$bb_cfg['topic_notify_enabled'])\n\t{\n\t\treturn;\n\t}\n\n\t$current_time = time();\n\n\tif ($mode != 'delete')\n\t{\n\t\tif ($mode == 'reply')\n\t\t{\n\t\t\t$sql = \"SELECT ban_userid\n\t\t\t\tFROM bb_banlist\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$user_id_sql = '';\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\tif (isset($row['ban_userid']) && !empty($row['ban_userid']))\n\t\t\t\t{\n\t\t\t\t\t$user_id_sql .= ', ' . $row['ban_userid'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"SELECT u.user_id, u.user_email, u.user_lang\n\t\t\t\tFROM bb_topics_watch tw, bb_users u\n\t\t\t\tWHERE tw.topic_id = $topic_id\n\t\t\t\t\tAND tw.user_id NOT IN (\" . $userdata['user_id'] . \", \" . ANONYMOUS . $user_id_sql . \")\n\t\t\t\t\tAND tw.notify_status = \" . TOPIC_WATCH_UN_NOTIFIED . \"\n\t\t\t\t\tAND u.user_id = tw.user_id\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$update_watched_sql = '';\n\t\t\t$bcc_list_ary = array();\n\n\t\t\tif ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t// Sixty second limit\n\t\t\t\t@set_time_limit(60);\n\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif ($row['user_email'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$bcc_list_ary[$row['user_lang']][] = $row['user_email'];\n\t\t\t\t\t}\n\t\t\t\t\t$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];\n\t\t\t\t}\n\t\t\t\twhile ($row = $db->sql_fetchrow($result));\n\n\t\t\t\t//\n\t\t\t\t// Let's do some checking to make sure that mass mail functions\n\t\t\t\t// are working in win32 versions of php.\n\t\t\t\t//\n\t\t\t\tif (preg_match('/[c-z]:\\\\\\.*/i', getenv('PATH')) && !$bb_cfg['smtp_delivery'])\n\t\t\t\t{\n\t\t\t\t\t$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';\n\n\t\t\t\t\t// We are running on windows, force delivery to use our smtp functions\n\t\t\t\t\t// since php's are broken by default\n\t\t\t\t\tif (!@$ini_val('sendmail_path')) {\n\t\t\t\t\t$bb_cfg['smtp_delivery'] = 1;\n\t\t\t\t\t$bb_cfg['smtp_host'] = @$ini_val('SMTP');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sizeof($bcc_list_ary))\n\t\t\t\t{\n\t\t\t\t\trequire SITE_DIR . 'includes/emailer.php';\n\t\t\t\t\t$emailer = new emailer($bb_cfg['smtp_delivery']);\n\n\t\t\t\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($bb_cfg['script_path']));\n\t\t\t\t\t$script_name = ($script_name != '') ? $script_name . '/viewtopic.php' : 'viewtopic.php';\n\t\t\t\t\t$server_name = trim($bb_cfg['server_name']);\n\t\t\t\t\t$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';\n\t\t\t\t\t$server_port = ($bb_cfg['server_port'] <> 80) ? ':' . trim($bb_cfg['server_port']) . '/' : '/';\n\n\t\t\t\t\t$orig_word = array();\n\t\t\t\t\t$replacement_word = array();\n\t\t\t\t\tobtain_word_list($orig_word, $replacement_word);\n\n\t\t\t\t\t$emailer->from($bb_cfg['board_email']);\n\t\t\t\t\t$emailer->replyto($bb_cfg['board_email']);\n\n\t\t\t\t\t$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);\n\n\t\t\t\t\t@reset($bcc_list_ary);\n\t\t\t\t\twhile (list($user_lang, $bcc_list) = each($bcc_list_ary))\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->use_template('topic_notify', $user_lang);\n\n\t\t\t\t\t\tfor ($i = 0; $i < count($bcc_list); $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->bcc($bcc_list[$i]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The Topic_reply_notification lang string below will be used\n\t\t\t\t\t\t// if for some reason the mail template subject cannot be read\n\t\t\t\t\t\t// ... note it will not necessarily be in the posters own language!\n\t\t\t\t\t\t$emailer->set_subject($lang['Topic_reply_notification']);\n\n\t\t\t\t\t\t// This is a nasty kludge to remove the username var ... till (if?)\n\t\t\t\t\t\t// translators update their templates\n\t\t\t\t\t\t$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);\n\n\t\t\t\t\t\t$emailer->assign_vars(array(\n\t\t\t\t\t\t\t'EMAIL_SIG' => (!empty($bb_cfg['board_email_sig'])) ? str_replace('<br />', \"\\n\", \"-- \\n\" . $bb_cfg['board_email_sig']) : '',\n\t\t\t\t\t\t\t'SITENAME' => $bb_cfg['sitename'],\n\t\t\t\t\t\t\t'TOPIC_TITLE' => $topic_title,\n\n\t\t\t\t\t\t\t'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . \"=$post_id#$post_id\",\n\t\t\t\t\t\t\t'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . \"=$topic_id&unwatch=topic\")\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$emailer->send();\n\t\t\t\t\t\t$emailer->reset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\tif ($update_watched_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE bb_topics_watch\n\t\t\t\t\tSET notify_status = \" . TOPIC_WATCH_NOTIFIED . \"\n\t\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\t\tAND user_id IN ($update_watched_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT topic_id\n\t\t\tFROM bb_topics_watch\n\t\t\tWHERE topic_id = $topic_id\n\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\n\t\tif (!$notify_user && !empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"DELETE FROM bb_topics_watch\n\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t\telse if ($notify_user && empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"INSERT INTO bb_topics_watch (user_id, topic_id, notify_status)\n\t\t\t\tVALUES (\" . $userdata['user_id'] . \", $topic_id, 0)\";\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t}\n}", "public function alertComment($id,$alertComment)\n\t{\n\t\t$commentsManager = new Comments();\n\t\t$alertComments = $commentsManager-> updateComment($id,$alertComment); //appel d'une fonction d'un objet\n\t\trequire('view/ViewFrontEnd/signalCommentView.php');\n\t}", "public function getCommentsForWallpostAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n\t$blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n\t\n\techo Zend_Json::encode( \\Extended\\comments::getCommentsForWallpost( \\Auth_UserAdapter::getIdentity()->getId(), $params['wallpost_id'], $params['offset'], 10, $blocked_user ) );\n\t\n\n\tdie;\n }", "public function onNewComment(CommentEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewComment')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->comment_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "protected function sendNotification(){\n\t\t$events = Event::getEvents(0);\n\t\t\n\t\t\n\t\tforeach($events as $event)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$eventType = $event['eventType'];\n\t\t\t$message = '';\n\t\t\n\t\t\t//notify followers\n\t\t\tif($eventType == Event::POST_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' added a new post.';\n\t\t\telse if($eventType == Event::POST_LIKED)\n\t\t\t\t$message = $event['raiserName'] . ' liked a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t$message = $event['raiserName'] . ' flagged a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' commented on a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::RESTAURANT_MARKED_FAVOURITE)\n\t\t\t\t$message = $event['raiserName'] . ' marked a restaurant as favourite.';\n\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t$message = $event['raiserName'] . ' is now following ' . $event['relatedUserName'];\n\t\t\n\t\t\tif(!empty($message))\n\t\t\t{\n\t\t\t\t//fetch all followers of the event raiser or related user\n\t\t\t\t$sql = Follower::getQueryForFollower($event['raiserId']);\n\t\t\n\t\t\t\tif($event['relatedUserId'])\n\t\t\t\t\t$sql .= ' OR f.followedUserId =' . $event['relatedUserId'];\n\t\t\n// \t\t\t\t$followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// \t\t\t\tforeach($followers as $follower)\n// \t\t\t\t{\n// \t\t\t\t\tif($follower['id'] != $event['raiserId'] && $follower['id'] != $event['relatedUserId'])\n// \t\t\t\t\t{\n// // \t\t\t\t\t\t$did = Notification::saveNotification($follower['id'], Notification::NOTIFICATION_GROUP_WORLD, $message, $event['id']);\n// // \t\t\t\t\t\terror_log('DID : => '.$did);\n// \t\t\t\t\t\t//send push notification\n// \t\t\t\t\t\t/**----- commented as no followers will be notified, as suggested by the client\n// \t\t\t\t\t\t$session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// \t\t\t\t\t\tif($session)\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t$session->deviceBadge += 1;\n// \t\t\t\t\t\t$session->save();\n// \t\t\t\t\t\tsendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// \t\t\t\t\t\t}\n// \t\t\t\t\t\t*****/\n// \t\t\t\t\t}\n// \t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//notify the related user\n\t\t\tif($event['relatedUserId'] && $event['relatedUserId'] != $event['raiserId'])\n\t\t\t{\n\t\t\t\tif($eventType == Event::POST_LIKED)\n\t\t\t\t\t$message = $event['raiserName'] . ' liked your post.';\n\t\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t\t$message = $event['raiserName'] . ' flagged your post.';\n\t\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t\t$message = $event['raiserName'] . ' commented on your post.';\n\t\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t\t$message = $event['raiserName'] . ' is now following you.';\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_COMMENT){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a comment.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_POST){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a post.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($message))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\t\t\t\t\t$session = Session::model()->findByAttributes(array('userId'=>$event['relatedUserId']));\n// \t\t\t\t\terror_log('SESSION_LOG : '. print_r( $session, true ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!is_null($session) && !empty($session) && $session->deviceToken)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$notifyData = array(\n// \t\t\t\t\t\t\t\t\"id\" => $notfyId,\n// \t\t\t\t\t\t\t\t\"receiverId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"notificationGroup\" => Notification::NOTIFICATION_GROUP_YOU,\n\t\t\t\t\t\t\t\t\"alert\" => $message,\n// \t\t\t\t\t\t\t\t\"eventId\" => $event['id'],\n// \t\t\t\t\t\t\t\t\"isSeen\" => \"0\",\n\t\t\t\t\t\t\t\t\"eventType\" => $eventType,\n// \t\t\t\t\t\t\t\t\"raiserId\" => $event['raiserId'],\n// \t\t\t\t\t\t\t\t\"raiserName\" => $event['raiserName'],\n// \t\t\t\t\t\t\t\t\"relatedUserId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"relatedUserName\" => $event['relatedUserName'],\n\t\t\t\t\t\t\t\t\"elementId\" => $event['elementId'],\n\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n// \t\t\t\t\t\t\t\t\"isNotified\" => $event['isNotified'],\n\t\t\t\t\t\t\t\t'badge' => $session->deviceBadge,\n\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo 'Notify Data : ';\n// \t\t\t\t\t\tprint_r($notifyData);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$session->deviceBadge += 1;\n\t\t\t\t\t\t$session->save();\n\t\t\t\t\t\tsendApnsNotification($session->deviceToken, $message, $session->deviceBadge, $notifyData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}elseif( isset($event['message']) && $event['message'] !=null){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$devices = array();\n\t\t\t\t$sql = 'SELECT id, deviceToken, deviceBadge from session where role=\"manager\"';\n\t\t\t\t\n\t\t\t $rows = Yii::app()->db->createCommand($sql)->queryAll(true);\n\t\t \t$chunk=1;\t\t \n\t\t \n\t\t\t\tforeach ($rows as $row){\n\t\t\t\t\t$devices[] = array(\n\t\t\t\t\t\t\t'deviceToken'=>$row['deviceToken'],\n\t\t\t\t\t\t\t'notifyData' => array('aps'=> array(\n\t\t\t\t\t\t\t\t\t\"alert\" => $event['message'],\n\t\t\t\t\t\t\t\t\t\"eventType\" => $event['eventType'],\n\t\t\t\t\t\t\t\t\t\"elementId\" => $event['id'],\n\t\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n\t\t\t\t\t\t\t\t\t'badge' => $row['deviceBadge'],\n\t\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($chunk > 4){\n\t\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\t\t$chunk=1;\n\t\t\t\t\t\t$devices = array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$chunk++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($devices)){\n\t\t\t\t\techo 'Sending...'.date(DATE_RFC850).\"\\n\";\n\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\techo 'done '.date(DATE_RFC850).\"\\n\";\n\t\t\t\t}\n// \t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\n// \t\t\t\t$insertSql = 'INSERT into notification (receiverId, notificationGroup, message, eventId) (select id, \"1\", \"'.$event['message'].'\", '.$event['id'].' from user where isDisabled = 0 and role=\"manager\")';\n// \t\t\t\tYii::app()->db->createCommand($insertSql)->query();\n\t\t\t\t\n\t\t\t}\n\t\t\tEvent::model()->updateByPk($event['id'], array('isNotified'=>1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function commentsAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\t$id = $this->_request->getPost('id');\r\n\r\n\t\t\tif (!v::intVal()->validate($id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post value: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID');\r\n\t\t\t}\r\n\r\n\t\t\t$start = $this->_request->getPost('start', 0);\r\n\r\n\t\t\tif (!v::intVal()->validate($start))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect start value: ' .\r\n\t\t\t\t\tvar_export($start, true));\r\n\t\t\t}\r\n\r\n\t\t\t$limit = 30;\r\n\t\t\t$model = new Application_Model_Comments;\r\n\t\t\t$comments = $model->findAllByNewsId($id, [\r\n\t\t\t\t'limit' => $limit,\r\n\t\t\t\t'start' => $start,\r\n\t\t\t\t'owner_thumbs' => [[55,55]]\r\n\t\t\t]);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\r\n\t\t\tif (count($comments))\r\n\t\t\t{\r\n\t\t\t\tforeach ($comments as $comment)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['data'][] = My_ViewHelper::render('post/_comment', [\r\n\t\t\t\t\t\t'user' => $user,\r\n\t\t\t\t\t\t'comment' => $comment,\r\n\t\t\t\t\t\t'post' => $post,\r\n\t\t\t\t\t\t'limit' => 250\r\n\t\t\t\t\t]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$count = max($post->comment - ($start + $limit), 0);\r\n\r\n\t\t\t\tif ($count > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['label'] = $model->viewMoreLabel($count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tMy_Log::exception($e);\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t\t'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}", "public function stream_comments(){\n\t\t$timestamp = (int) trim( $_GET['timestamp'] );\n\t\t$sess_id = (int) trim( $_GET['sess_id'] );\n\t\t$condo_id = (int) trim( $_GET['condo_id'] );\n\t\t$lastId = isset( $_GET['lastId'] ) && !empty( $_GET['lastId'] ) ? $_GET['lastId'] : 0;\n\n\t\tif( empty( $timestamp ) ){\n\t\t\tdie( json_encode( array( 'status' => 'error' ) ) );\n\t\t}\n\n\t\t$time_wasted = 0;\n\t\t$lastIdQuery = '';\n\t\tif( !empty( $lastId ) ){\n\t\t\t$lastIdQuery = ' AND id > ' . $lastId;\n\t\t}\n\n\t\t$new_messages_check = $this->db->query(\"SELECT * FROM notifications WHERE condo_id=$condo_id and msg_time >= {$timestamp}\" . $lastIdQuery .\" AND read_noti=0 ORDER BY id DESC\");// AND session_id=\".$this->session->userdata('resident_id').\"\n\t\t$num_rows = $new_messages_check->num_rows();\n\t\tif($num_rows <=0){\n\t\t\n\t\t\twhile( $num_rows <= 0 ){\n\t\t\t\tif( $num_rows <= 0 ){\n\t\t\t\t\t\n\t\t\t\t\t// 40 Seconds are enough to forbid the request and send another one\n\t\t\t\t\tif( $time_wasted >= 60 ){\n\t\t\t\t\t\tdie( json_encode( array( 'status' => 'no-results', 'lastId' => 0, 'timestamp' => time() ) ) );\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsleep( 1 );\n\t\t\t\t\t$new_messages_check = $this->db->query(\"SELECT * FROM notifications WHERE condo_id=$condo_id and msg_time >= {$timestamp}\" . $lastIdQuery . \" AND read_noti=0 ORDER BY id DESC\");// AND session_id=\".$this->session->userdata('resident_id').\"\n\t\t\t\t\t$num_rows = $new_messages_check->num_rows();\n\t\t\t\t\t$time_wasted += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$new_messages = array();\n\t\tif( $num_rows >= 1){\n\t\t\tforeach($new_messages_check->result_array() as $row){\n\t\t\t\t$noti_id = $row['id'];\n\t\t\t\t$curr_session_id = $row['session_id'];\n\t\t\t\t$posted_by = $row['person_id'];\n\t\t\t\t$log_content = $row['code'];\n\t\t\t\t$facility_id = $this->General_model->get_value_by_id('condo_facilities', $row['facility_id'], 'name');\n\t\t\t\t\n\t\t\t\t$display_field_actor = '';\n\t\t\t\tif($curr_session_id == $sess_id){\n\t\t\t\t\t$display_field_actor = 'your';\n\t\t\t\t} else if($curr_session_id == $posted_by){\n\t\t\t\t\t$display_field_actor = 'his/her';\n\t\t\t\t} else {\n\t\t\t\t\t$display_field_actor = $this->General_model->get_value_by_id('residents', $curr_session_id, 'name').'\\'s';\t\t\t}\n\t\t\t\tif($posted_by == 0){\n\t\t\t\t\t$actor = '';\t\n\t\t\t\t} else {\n\t\t\t\t\t$actor = $this->General_model->get_value_by_id('residents', $posted_by, 'name');\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//if($posted_by!=$sess_id){\n\t\t\t\t\t$new_messages[] = array( \n\t\t\t\t\t\t'id' \t\t\t \t\t=> $row['id'],\n\t\t\t\t\t\t'person_id' \t \t\t => $posted_by, \n\t\t\t\t\t\t'session_id' \t => $curr_session_id,\n\t\t\t\t\t\t'facility_id' \t => $facility_id,\n\t\t\t\t\t\t'display_field_actor' => $display_field_actor,\n\t\t\t\t\t\t'actor' \t\t\t\t => $actor,\n\t\t\t\t\t\t'code' \t\t => $log_content,\n\t\t\t\t\t\t'insertDate' \t => $row['insertDate'],\n\t\t\t\t\t\t'icount' => $num_rows\n\t\t\t\t\t );\n\t\t\t\t//}\n\t\t\t}\n\t\t}\n\t\t$last_msg = end( $new_messages );\n\t\t$last_id = $last_msg['id'];\n\t\t\n\t\tdie( json_encode( array( 'status' => 'results', 'timestamp' => time(), 'lastId' => $last_id, 'data' => $new_messages ) ) );\n\t}", "public function notify(quipComment &$comment) {\n if (!$this->_loadLexicon()) return false;\n $this->xpdo->lexicon->load('quip:emails');\n \n /* get the poster's email address */\n $posterEmail = false;\n $user = $comment->getOne('Author');\n if ($user) {\n $profile = $user->getOne('Profile');\n if ($profile) {\n $posterEmail = $profile->get('email');\n }\n }\n\n /* get email body/subject */\n $properties = $comment->toArray();\n $properties['url'] = $comment->makeUrl('',array(),array('scheme' => 'full'));\n $body = $this->xpdo->lexicon('quip.email_notify',$properties);\n $subject = $this->xpdo->lexicon('quip.email_notify_subject');\n\n /* send notifications */\n $success = true;\n $notifyEmails = $this->get('notify_emails');\n $emails = explode(',',$notifyEmails);\n\n /* send notifications to notify_emails subjects */\n if (!empty($emails)) {\n $this->sendEmail($subject,$body,$emails);\n }\n\n /* now send to notified users */\n $notifiees = $this->getMany('Notifications');\n /** @var quipCommentNotify $notification */\n foreach ($notifiees as $notification) {\n $email = $notification->get('email');\n /* remove invalid emails */\n if (empty($email) || strpos($email,'@') == false) {\n $notification->remove();\n continue;\n }\n /* don't notify the poster, since they posted the comment. */\n if ($posterEmail == $email) {\n continue;\n }\n\n $notification->send($comment,$properties);\n }\n\n return $success;\n }", "function wp_send_new_user_notifications($user_id, $notify = 'both')\n {\n }", "public function FbPublishComments($fb_page_id, $fb_object_id) {\n $mode = \\Drupal::request()->get('mode');\n if (isset($mode) && $mode == 'ajax') {\n $op = \\Drupal::request()->get('op');\n if ($op == 'publish') {\n $message = \\Drupal::request()->get('message');\n $requests['message'] = $message;\n } elseif ($op == 'Remove') {\n } else {\n //edit comment\n $op = 'Edit';\n $message = \\Drupal::request()->get('message');\n $requests['message'] = $message;\n }\n }\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $properties = ['token_access'];\n $network_properties = $this->getKabbodeNetworkStatusProperty(166, $current_uid, $properties);\n $access_token = $network_properties['token_access'];\n $facebookHelper = new FacebookHelperFunction();\n $output = $facebookHelper->facebookCommentOperations($access_token, $fb_page_id, $fb_object_id, $requests, $op);\n $json_response = json_encode($output);\n return new JsonResponse($json_response);\n }", "public function actionComments()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render(\n\t\t\t'comments',\n\t\t\tarray(\n\t\t\t\t'_Comments' => Feedback::model()->findAll(array('order'=>'date_inserted DESC'))\n\t\t\t)\n\t\t);\n\t}", "public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }", "public function trigger_notification()\n\t{\n \t\t\n\t\t $result=$this->Fb_common_func->send_notification($this->facebook,'Skywards meet me here!',array('100001187318347','1220631499','1268065008','1347427052','566769531'),'467450859982651|cf5YXgYRZZDJuvBF1_ZOyDyRJHM','100001187318347');\n\n\t echo $result;\n\t}", "public function createComment(Request $request)\n {\n\n $validator = Validator::make($request->all(), [\n 'comment' => 'required',\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $comment = new BlogComment();\n $comment->user_id = Auth::id();\n $comment->blog_id = $request->bid;\n $comment->comment = $request->comment;\n $comment->save();\n\n $comment = BlogComment::with('user')->find($comment->id);\n\n //send email here\n $comment->notify(new BlogCommentNotification($comment));\n\n return redirect()->back();\n }", "public function notifyUser()\n { \n $message = trim(Input::get('message'));\n $apiType = trim(Input::get('apiType'));\n $mobileNotificationService = App::make('MobileNotificationService');\n $mobileNotificationService->notifyMobileAppUser($message, $apiType, App::environment('production')); \n }", "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "function SendCheckinCommentsNotifications($job, &$log){\n\t$dbHandle = DbHandler::getConnection();\n\t$user_collection = $dbHandle->users;\n $user_args= json_decode ($job->workload(), true);\n $log[] = \"Received job: \" . $job->handle() . \"\\n\";\n\n\t//args from comments\n\t$update_id = $user_args['update_id'];\n\t$listing_id = $user_args['listing_id'];\n\t$timestamp = $user_args['time'];\n\t$uid = $user_args['uid'];\n\t$users = new CreateUser();\n\t$notification = new Notifications();\n\t$comments = new CheckinComments();\n\t$comment_list = $comments->getCheckinComments($update_id, $listing_id, $timestamp);\n\t$friends_uids = array();\n\t$poke_friends = array();\n\tforeach ($comment_list as $comment){\n\t\t$commented_uid = $comment['uid'];\n\t\tif (!in_array($comment['uid'], $friends_uids) && $comment['uid'] != $uid){\n\t\t\t$friends_uids[] = intval ($comment['uid']);\n\t\t\t$poke_friends[] = \"\".$comment['uid'];\n\t\t\t$log[] = \"adding for notification \". $commented_uid;\n\t\t}\n\t}\n\n\tif ($uid != $update_id){\n\t\t$friends_uids[] = intval ($update_id); //add checked in users id too.\n\t\t$poke_friends[] = \"\".$update_id;\n\t}\n\n\t$checkedin_user = $user_collection->findOne(array('uid' => intval ($update_id)), array('name'));\n\t$checkedin_user_name = $checkedin_user['name'];\n\t$commented_user = $user_collection->findOne(array('uid' => intval ($uid)), array('name'));\n\t$commented_user_name = $commented_user['name'];\n\n\tif ($commented_user_name == $checkedin_user_name){\n\t\t$message = \"$commented_user_name commented on his checkin\";\n\t}\n\telse{\n\t\t$message = \"$commented_user_name commented on $checkedin_user_name's checkin\";\n\t}\n\n\t$device_tokens = $users->getDeviceTokens($friends_uids);\n\t$type = 7; //only push for comments on checkins\n\t$args = array ('from_id' => $uid, 'message' => $message, 'type' => $type, 'is_read' => 0);\n\t$result = $notification->insertNotification($args, $poke_friends, $device_tokens, $message, true);\n \tif ($result) {\n \t$log[] = \"Notifications successfully posted\";\n } else {\n \t$log[] = \"Error in posting notifications\";\n }\n\treturn;\n}", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }" ]
[ "0.6721527", "0.6454394", "0.6018375", "0.586746", "0.5833153", "0.58151126", "0.57634693", "0.57367605", "0.5712675", "0.5706983", "0.56504023", "0.56215703", "0.5575981", "0.5510384", "0.5497398", "0.5495088", "0.5491293", "0.5467793", "0.54651666", "0.54533005", "0.5451134", "0.5450709", "0.5443153", "0.54329306", "0.54275715", "0.5412332", "0.54122144", "0.5408835", "0.5384788", "0.5372546" ]
0.6786185
0
Get the exact timestamp to prune.
private function getPruneDate() { if (!$this->pruneAfter) { return null; } else { $tz = new \DateTimeZone('UTC'); $now = new DateTime('now', $tz); $test = new DateTime($this->pruneAfter, $tz); $interval = $test->diff($now); if ($interval->invert === 1) { return $now->add($interval); } else { return $test; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prunable()\n {\n return static::where(static::UPDATED_AT, '<=', now()->subWeek());\n }", "public function getRemovalTime(): ?string;", "public function getRemovalTime(): ?string;", "function timestamp() {\n\t\tif (isset($this->_timestamp)) return $this->_timestamp;\n\t\t$this->_timestamp = 0;\n\t\tforeach (new DirectoryIterator($this->data_path()) as $child) {\n\t\t\t$filename = $child->getFilename();\n\t\t\tif ($filename[0] == '.') continue;\n\t\t\tif ($child->getMTime() > $this->_timestamp) $this->_timestamp = $child->getMTime();\n\t\t}\n\t\treturn $this->_timestamp;\n\t}", "public static function timestamp() {}", "function get_unix_time()\n {\n return $this->timestamp;\n }", "public function timestamp() {\n return strtotime($this->updated_at);\n }", "public function timestampableOnPrePersist()\n {\n return $this->fulfillUTCNow();\n }", "private static function getOldestTemporaryArchiveToKeepThreshold()\n {\n $temporaryArchivingTimeout = Rules::getTodayArchiveTimeToLive();\n if (Rules::isBrowserTriggerEnabled()) {\n // If Browser Archiving is enabled, it is likely there are many more temporary archives\n // We delete more often which is safe, since reports are re-processed on demand\n return Date::factory(time() - 2 * $temporaryArchivingTimeout)->getDateTime();\n }\n\n // If cron core:archive command is building the reports, we should keep all temporary reports from today\n return Date::factory('yesterday')->getDateTime();\n }", "public function getTimestamp() { \n\t\tif ($this->change) {\n\t\t\t$this->_calc();\n\t\t}\n\t\t\n\t\treturn $this->timestamp; \n\t}", "public function timestamp();", "public function timestampableOnPreUpdate()\n {\n return $this->fulfillUTCNow();\n }", "public function getTimeDeleted()\n {\n return $this->TIME_DELETED;\n }", "public function getTimestamp()\n {\n return strtotime($this->getValue());\n }", "public function getLastSearchTs()\n {\n return $this->get(self::_LAST_SEARCH_TS);\n }", "public function _getTimestamp()\n {\n $DateTime = new DateTime($this->_getDatePublish());\n return $DateTime->getTimestamp();\n }", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public function prune()\n {\n if (OTU_BLACKLIST_LIFETIME == -1) {\n return 0;\n }\n\n $sql = \"SELECT \" . \\call_user_func([$this->className, 'getDatabaseTableIndexName']) . \"\n FROM \" . \\call_user_func([$this->className, 'getDatabaseTableName']) . \"\n WHERE time < ?\";\n $stmt = \\wcf\\system\\WCF::getDB()->prepareStatement($sql);\n $stmt->execute([TIME_NOW - OTU_BLACKLIST_LIFETIME * 86400]);\n $entryIDs = [];\n while ($entryID = $stmt->fetchColumn()) {\n $entryIDs[] = $entryID;\n }\n\n return \\call_user_func([$this->className, 'deleteAll'], $entryIDs);\n }", "public function expirationTimestamp()\n {\n if ($this->expiration instanceof \\DateTime) {\n return $this->expiration->getTimestamp();\n }\n }", "public function getPurgeExecuted()\n {\n $days = $this->config->getConfig(JobConfig::XML_PATH_PURGE_EXECUTED);\n $days = !empty((int) $days) ? (int) $days : JobConfig::DEFAULT_PURGE_EXECUTED;\n\n return date('Y-m-d H:i:s', strtotime(' -' . $days . ' day'));\n }", "function get_variable_time() {\n\t\t$datetime = $this->get_option( 'queue_datetime', true );\n\n\t\tif ( ! $datetime ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$timestamp = strtotime( $datetime, current_time( 'timestamp' ) );\n\n\t\t$date = new DateTime();\n\t\t$date->setTimestamp( $timestamp );\n\t\t$date->convert_to_utc_time();\n\n\t\treturn $date;\n\t}", "public function newest_entry_start()\n\t{\n\t\treturn ee()->localize->format_date('%Y-%m-%d %H:%i', ee()->localize->now - 604800);\n\t}", "public function valueOf()\n {\n return $this->getPreciseTimestamp(3);\n }", "public function getUnsentOrderCutoffDate()\n {\n return date('Y-m-d H:i:s', strtotime('-'.$this->getUnsentOrderCutoff().' days'));\n }", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function prune() {\n\n /*\n * DELETE FROM `NewsItem`\n * WHERE pubDate <= DATE_SUB(NOW(), INTERVAL $this->_params->itemLifetime MINUTE);\n */\n $where = $this->getAdapter()->quoteInto('pubDate <= DATE_SUB(NOW(), INTERVAL ? MINUTE)', $this->_params->itemLifetime);\n return $this->delete($where);\n }", "public function getLeftDistributeTime()\n {\n return $this->get(self::_LEFT_DISTRIBUTE_TIME);\n }" ]
[ "0.5823448", "0.55826706", "0.55826706", "0.55026174", "0.5438007", "0.5398086", "0.53891337", "0.53462356", "0.532332", "0.52882826", "0.5283254", "0.5280578", "0.5277334", "0.5274549", "0.5268591", "0.5259671", "0.5231141", "0.5231141", "0.5231141", "0.5223417", "0.5211883", "0.5201104", "0.5190038", "0.51808065", "0.5170957", "0.51640713", "0.5141684", "0.51400894", "0.5126767", "0.5120353" ]
0.71749717
0
A test for creating a new task
public function testNewTask() { $userId = User::first()->value('id'); $response = $this->json('POST', '/api/v1.0.0/users/'.$userId.'/tasks', [ 'description' => 'A new task from PHPUnit', ]); $response ->assertStatus(200) ->assertJson([ 'description' => 'A new task from PHPUnit', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateTask()\n {\n }", "public function test_create_task()\n {\n \n $response = $this->post('/task', [\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '12:22',\n 'project_id' => 1,\n ]);\n $response->assertStatus(302);\n }", "public function testCreateTask()\n {\n $this->logInUserObject();\n $crawler = $this->client->request('GET', '/tasks/create');\n $form = $crawler->selectButton('Ajouter')->form();\n $form['task[title]'] = 'Titre test';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->task = $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a été bien été ajoutée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function test_create_task_all_fields_correct()\n {\n\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = User::factory()->create()->createToken('my-app-token')->plainTextToken;\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(201)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Task created successfully.\");\n }", "public function testTask()\n {\n $task = new Task();\n $user = new User();\n\n $this->assertNull($task->getId());\n $task->setTitle('test');\n $this->assertSame('test', $task->getTitle());\n $task->setContent('testcontent');\n $this->assertSame('testcontent', $task->getContent());\n $task->toggle(true);\n $this->assertTrue( $task->isDone());\n $task->setUser($user);\n $this->assertInstanceOf(User::class, $task->getUser());\n $task->setCreatedAt(new \\DateTime());\n $this->assertNotEmpty($task->getCreatedAt());\n }", "public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }", "public function testCreateTaskPage()\n {\n $this->client->request('GET', '/tasks/create');\n\n $this->assertSame(200, $this->client->getResponse()->getStatusCode());\n }", "public function testCreateAndFindTask()\n\t{\n\t\t$user = factory(User::class)->create();\n\t\tPassport::actingAs($user);\n\t\t$category = factory(Category::class)->create(['user_id' => $user->id]);\n\t\t$array_task = array(\n\t\t\t'category_id' => $category->id,\n\t\t\t\"description\" => \"Needs to study more\"\n\t\t);\n\n\t\t$task = factory(Task::class)->create($array_task);\n\n\t\t$response = $this->get('api/categories/' . $category->id . '/tasks/' . $task->id);\n\n\t\t$response->assertStatus(200);\n\t\t$this->assertDatabaseHas('tasks', $array_task);\n\t}", "public function testTask()\n\t{\n \n //Need also define the ssh keys and password in config.php\n \n //Insert first a task\n \n /*$arr_task=['name_task' => 'live', 'descripton_task' => 'Script for check if server is alive', 'arguments' => [], 'status' => 0, 'url_return' => '', 'server' => SERVER_REMOTE];\n \n $new_task=$m->task->insert($arr_task);\n \n $id=$m->task->insert_id();\n \n $this->assertNotFalse($new_task);\n \n $arr_task['IdTask']=$id;*/\n \n //Select task from db\n \n //Execute task\n \n $task=new Task(SERVER_REMOTE);\n \n $task->files=[['vendor/phangoapp/leviathan/tests/script/alive.sh', 0755]];\n \n $task->commands_to_execute=[['/bin/bash', 'vendor/phangoapp/leviathan/tests/script/alive.sh', ''], ['sudo', 'vendor/phangoapp/leviathan/tests/script/alive.sh', '']];\n \n $task->delete_files=['vendor/phangoapp/leviathan/tests/script/alive.sh'];\n \n $task->delete_directories=['vendor/phangoapp/leviathan/tests'];\n \n $task->name_task='Live';\n \n $task->description_task='Check if server is alive';\n \n $task->codename_task='live';\n \n $result=$task->exec();\n \n echo $task->txt_error;\n \n $this->assertTrue($result);\n \n \n \n }", "public function testGetTask()\n {\n }", "public function testDeleteTask()\n {\n }", "public function createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}", "public function testSaveTask()\r\n {\t\t\r\n $task = new SyncTask(); \r\n $task->subject = \"UnitTest TaskName\"; \r\n $task->startdate = strtotime(\"11/17/2011\");\r\n $task->duedate = strtotime(\"11/18/2011\");\r\n $obj = $this->backend->saveTask(\"\", $task);\r\n\t\t$tid = $obj->id;\r\n\r\n // Make sure we have a new task id\r\n $this->assertTrue(is_numeric($tid) && $tid > 0);\r\n\r\n // Make sure backend had fully populated task\r\n $obj = new CAntObject($this->dbh, \"task\", $tid, $this->user);\r\n $this->assertEquals($obj->getValue(\"name\"), $task->subject);\r\n $this->assertEquals(strtotime($obj->getValue(\"start_date\")), $task->startdate);\r\n $this->assertEquals(strtotime($obj->getValue(\"deadline\")), $task->duedate);\r\n\r\n // Cleanup\r\n $obj->removeHard();\r\n\t}", "public function test_todo()\n {\n $login=User::factory()->create();\n $this->actingAs($login);\n $task=Task::factory()->create();\n $this->assertDatabaseHas('Tasks',['description'=>$task->description,'user_id'=>$task->user_id]);\n \n }", "public function testGetTasksById()\n {\n\n }", "public function create(TaskInterface $task): void;", "public function testCreate()\n {\n $taskData = new Task();\n $taskData->setTitle('The Avengers');\n $taskData->setContent('Must defeat Thanos!');\n\n $container = self::$kernel->getContainer();\n\n $em = $container->get('doctrine.orm.entity_manager');\n $em->persist($taskData);\n $em->flush();\n\n $task = $container->get('doctrine')\n ->getRepository(Task::class)->find(1);\n\n $this->assertNotNull($task);\n $this->assertSame('The Avengers', $task->getTitle());\n $this->assertSame('Must defeat Thanos!', $task->getContent());\n }", "public function create(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}", "public function testGetTasks()\n {\n }", "protected function Create() {\n // Assignment: Generate unique id for the new task\n $this->TaskId = $this->getUniqueId();\n $this->TaskName = 'New Task';\n $this->TaskDescription = 'New Description';\n }", "public function testGetTaskInstanceVariable()\n {\n }", "public function testGetTasks()\n {\n\n }", "public function show_create_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n\n factory(User::class, 5)->create();\n\n $response = $this->get('/tasks_php/create');\n $response->assertSuccessful();\n $response->assertViewIs('tasks.create_task');\n\n $users = User::all();\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Create Task:');\n }", "public function testCreateTaskVariable()\n {\n }", "public function testExecuteTaskAction()\n {\n }", "function test_save()\n {\n\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n\n //Act\n $test_task->save();\n\n //Assert\n $result = Task::getAll();\n $this->assertEquals($test_task, $result[0]);\n\n }", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function testCreateTaskComments()\n {\n }", "public function test_create_item() {}", "public function test_create_item() {}" ]
[ "0.8670612", "0.8393524", "0.82477623", "0.7898734", "0.767466", "0.7442585", "0.7409591", "0.74009186", "0.73935616", "0.7385936", "0.73331815", "0.7245637", "0.7225112", "0.71625626", "0.7153543", "0.7144056", "0.7140956", "0.7132784", "0.71198916", "0.7077728", "0.7072341", "0.7071825", "0.70589715", "0.6990927", "0.69613194", "0.6924255", "0.68677866", "0.6835848", "0.6832946", "0.6832946" ]
0.84925294
1
A test for reading specified task
public function testReadTask() { $userId = User::first()->value('id'); $taskId = Task::orderBy('id', 'desc')->first()->id; $response = $this->json('GET', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId); $response ->assertStatus(200) ->assertJson([ 'description' => 'A new task from PHPUnit', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTask() ;", "public function testGetTask()\n {\n }", "public function getTask() {}", "public function getTask() {}", "public function getTask() {}", "abstract protected function checkIfInstanceOf($task);", "public function testCreateTask()\n {\n }", "public function getTask();", "public function getTask();", "public function getTask(array $task);", "public function testRead()\n {\n }", "public function testGetTaskInstanceVariable()\n {\n }", "public static function taskGet($taskId);", "public function testGetTasks()\n {\n }", "public function testGetSubTasks()\n {\n }", "public function testAntBackendGetTask()\r\n\t{\r\n $task = new SyncTask(); \r\n $task->subject = \"UnitTest TaskName\"; \r\n $task->startdate = strtotime(\"11/17/2011\");\r\n $task->duedate = strtotime(\"11/18/2011\");\r\n $obj = $this->backend->saveTask(\"\", $task);\r\n\t\t$tid = $obj->id;\r\n\r\n // Query Tasks\r\n $syncTask = $this->backend->getTask($tid);\r\n $this->assertEquals($syncTask->subject, $task->subject);\r\n $this->assertEquals($syncTask->startdate, $task->startdate);\r\n $this->assertEquals($syncTask->duedate, $task->duedate);\r\n \r\n // Cleanup\r\n $obj->removeHard();\r\n\t}", "public function testGetTasks()\n {\n\n }", "public function testTask()\n\t{\n \n //Need also define the ssh keys and password in config.php\n \n //Insert first a task\n \n /*$arr_task=['name_task' => 'live', 'descripton_task' => 'Script for check if server is alive', 'arguments' => [], 'status' => 0, 'url_return' => '', 'server' => SERVER_REMOTE];\n \n $new_task=$m->task->insert($arr_task);\n \n $id=$m->task->insert_id();\n \n $this->assertNotFalse($new_task);\n \n $arr_task['IdTask']=$id;*/\n \n //Select task from db\n \n //Execute task\n \n $task=new Task(SERVER_REMOTE);\n \n $task->files=[['vendor/phangoapp/leviathan/tests/script/alive.sh', 0755]];\n \n $task->commands_to_execute=[['/bin/bash', 'vendor/phangoapp/leviathan/tests/script/alive.sh', ''], ['sudo', 'vendor/phangoapp/leviathan/tests/script/alive.sh', '']];\n \n $task->delete_files=['vendor/phangoapp/leviathan/tests/script/alive.sh'];\n \n $task->delete_directories=['vendor/phangoapp/leviathan/tests'];\n \n $task->name_task='Live';\n \n $task->description_task='Check if server is alive';\n \n $task->codename_task='live';\n \n $result=$task->exec();\n \n echo $task->txt_error;\n \n $this->assertTrue($result);\n \n \n \n }", "public function testReadAll()\n {\n }", "public function run($task, $params);", "public function testListTaskVariables()\n {\n }", "abstract public function canHandle(Task $task);", "function get_task_by_filename($filename) {\n\n // Run all adhoc tasks.\n foreach ($this->task_records as $record) {\n $thetask = $this->fetch_task_from_record($record);\n if ($thetask) {\n //mtrace('filename: ' . $thetask->get_custom_data()->filename . \"\\n\\n\");\n if ($thetask->get_custom_data()->filename == $filename) {\n return $thetask;\n } else {\n $this->adhoc_task_release($thetask);\n }//end of if classname\n } else {\n continue;\n }//end of if thetask\n }//end of foreach\n return false;\n }", "function textblock_security_is_task($textblock) {\n if (preg_match(\"/^ \\s* task: \\s* (\".IA_RE_TASK_ID.\") \\s* $/xi\", $textblock, $matches)) {\n return $matches[1];\n }\n return false;\n}", "function taskNotFound( $task ) {\n\t\techo 'Task ' . $task . ' not found';\n\t\treturn null;\n\t}", "public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}", "public function testTask1(){\n\n }", "public function testGetFilenameFromParamNoFile()\n {\n //create class\n $task = new UserTask();\n\n //create params\n $params = [[]];\n\n //call method\n $result = $this->callMethod(\n $task,\n 'getFilenameFromParam',\n $params\n );\n\n //check result\n $this->assertEquals(date('Y-m-d').\".txt\", $result);\n\n }", "public function testTask2(){\n\n }", "public function testGetTasksById()\n {\n\n }" ]
[ "0.6576651", "0.6382481", "0.6323863", "0.6323646", "0.6323646", "0.6312364", "0.6279334", "0.6234213", "0.6234213", "0.6128328", "0.6038611", "0.5960838", "0.59547156", "0.59520555", "0.5891957", "0.5879511", "0.5876832", "0.5860958", "0.58601487", "0.5831636", "0.57921076", "0.57691985", "0.5739237", "0.5720552", "0.57137865", "0.5697111", "0.5678378", "0.5675865", "0.56668395", "0.5664969" ]
0.7486764
0
A test for updating specified task
public function testUpdatedTask() { $userId = User::first()->value('id'); $taskId = Task::orderBy('id', 'desc')->first()->id; $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [ 'description' => 'An updated task from PHPUnit', 'completed' => true, ]); $response ->assertStatus(200) ->assertJson([ 'description' => 'An updated task from PHPUnit', 'completed' => true, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateTask()\n {\n }", "public function testUpdate()\n {\n $this->actingAs(User::factory()->make());\n $task = new Task();\n $task->title = 'refined_task';\n $task->completed = false;\n $task->save();\n\n $response = $this->put('/tasks/' . $task->id);\n\n $updated = Task::where('title', '=', 'refined_task')->first();\n\n $response->assertStatus(200);\n $this->assertEquals(true, $updated->completed);\n }", "public function test_edit_task()\n {\n Task::create([\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date' => '2020-12-12 12:22:00',\n 'project_id' => 1\n ]);\n $response = $this->post('/task/update', [\n 'task_id' => 1,\n 'name' => 'Updated task name', \n 'priority' => 'normal', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '10:08',\n 'project_id' => '1',\n ]);\n $response->assertStatus(302);\n }", "public function testUpdateTask()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $id = $this->task->getId();\n\n $crawler = $this->client->request('GET', '/tasks/'.$id.'/edit');\n\n $form = $crawler->selectButton('Modifier')->form();\n $form['task[title]'] = 'Titre';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été modifiée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testUpdateTaskInstanceVariable()\n {\n }", "function updateTask() {\n\t\t$rating = $this -> getTaskRating();\n\t\tif (!is_null($this -> data)) {\n\t\t\tif (!empty($this -> data)) {\n\t\t\t\t//if user has not missed any events and not added any events rate his task with 1\n\t\t\t\tif ($this -> missed == 0) {\n\t\t\t\t\tif (empty($this -> rating)) {\n\t\t\t\t\t\t$rating = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE Task SET rating =\" . $rating . \", isRated=1, missed=\" . $this -> missed . \" WHERE TaskId=\" . $this -> data[0]['TaskId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t\t$this -> updateUser();\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'update task with id=' . $this -> data[0]['TaskId'] . ' error' . $stmt -> errorInfo(), $this -> id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\tnew Email('failed', 'update task, data is empty error', $this -> id);\n\t\t\t}\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'update task, data is empty', $this -> id);\n\t\t}\n\t}", "public function updated($task)\n {\n $task->notifyMembers('Updated');\n }", "public function testSuccessfullUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => true,\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n 'id' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n ]);\n }", "public function editTask()\n\t{\n\t\t$jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $update = [ 'task' => $_POST['etask'], 'id' => $_POST['taskid']];\n $update = Validator::cleanData($update);\n\n if (Validator::isEmpty($update)) {\n View::jsonResponse(['status' => 401, 'message' => 'There are empty fields!']);\n }\n\n (new Task())->update($update)->execute();\n\n View::jsonResponse(['status' => 200, 'message' => 'Task edited successful!']); \n \n\t}", "public function test_update_item() {}", "public function test_update_item() {}", "public function testGetTask()\n {\n }", "public function update(Request $request, Task $task)\n {\n //\n }", "public function update(Request $request, Task $task)\n {\n //\n }", "public function testTask()\n {\n $task = new Task();\n $user = new User();\n\n $this->assertNull($task->getId());\n $task->setTitle('test');\n $this->assertSame('test', $task->getTitle());\n $task->setContent('testcontent');\n $this->assertSame('testcontent', $task->getContent());\n $task->toggle(true);\n $this->assertTrue( $task->isDone());\n $task->setUser($user);\n $this->assertInstanceOf(User::class, $task->getUser());\n $task->setCreatedAt(new \\DateTime());\n $this->assertNotEmpty($task->getCreatedAt());\n }", "public function testGetTasksById()\n {\n\n }", "public function testDeleteTask()\n {\n }", "public function testTask()\n\t{\n \n //Need also define the ssh keys and password in config.php\n \n //Insert first a task\n \n /*$arr_task=['name_task' => 'live', 'descripton_task' => 'Script for check if server is alive', 'arguments' => [], 'status' => 0, 'url_return' => '', 'server' => SERVER_REMOTE];\n \n $new_task=$m->task->insert($arr_task);\n \n $id=$m->task->insert_id();\n \n $this->assertNotFalse($new_task);\n \n $arr_task['IdTask']=$id;*/\n \n //Select task from db\n \n //Execute task\n \n $task=new Task(SERVER_REMOTE);\n \n $task->files=[['vendor/phangoapp/leviathan/tests/script/alive.sh', 0755]];\n \n $task->commands_to_execute=[['/bin/bash', 'vendor/phangoapp/leviathan/tests/script/alive.sh', ''], ['sudo', 'vendor/phangoapp/leviathan/tests/script/alive.sh', '']];\n \n $task->delete_files=['vendor/phangoapp/leviathan/tests/script/alive.sh'];\n \n $task->delete_directories=['vendor/phangoapp/leviathan/tests'];\n \n $task->name_task='Live';\n \n $task->description_task='Check if server is alive';\n \n $task->codename_task='live';\n \n $result=$task->exec();\n \n echo $task->txt_error;\n \n $this->assertTrue($result);\n \n \n \n }", "public function testExecuteTaskAction()\n {\n }", "public function testItCanRunItemUpdate()\n {\n Artisan::call('item:update');\n\n // If you need result of console output\n $resultAsText = Artisan::output();\n\n $this->assertRegExp(\"/Item #[0-9]* updated\\\\n/\", $resultAsText);\n }", "public function update(Request $request, Task $task)\n {\n $task_id = $task->id;\n\n if (auth()->user()->isManager(auth()->user()->id)) {\n if ($request->finish_editing == 'Yes') {\n $put = Task::find($task_id);\n $put->override_status = 'Yes';\n $put->save();\n return redirect()->back()->with('message', 'semd to approver successfully')->with('status', 1);\n } else {\n /**\n * if manager edited any data during requisition after approver data\n * action delete this approver approved status from tasksstatus table\n */\n if($task->manager_override_chunck == null){\n TaskHelper::ManagerOverrideData($task_id);\n }\n }\n }\n\n //End\n\n $getResource = TaskSite::select('resource_id')->where('task_id', $task->id)->get();\n if (isset($getResource)) {\n $checkResource = TaskHelper::arrayExist($getResource, 'resource_id', $request->site_head);\n if ($checkResource == true) {\n return redirect()->back()->with('message', 'This person already assign as resource.please at first remove from resource')->with('status', 0);\n }\n }\n\n if($request->anonymousproof_details){\n if (auth()->user()->isManager(auth()->user()->id)) {\n /*\n && $request->anonymous_proof_details\n Task::where('id', $task->id)\n ->update(['anonymous_proof_details' => $request->anonymous_proof_details]);\n */\n\n\n $atts = Task::find($task->id);\n $atts->anonymous_proof_details = $request->anonymous_proof_details;\n $atts->save();\n\n }\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isManager(auth()->user()->id) && $request->task_assigned_to_head == 'Yes') {\n\n $atts = Task::find($task->id);\n $atts->task_assigned_to_head = $request->task_assigned_to_head;\n $atts->save();\n\n TaskHelper::statusUpdate([\n 'code' => TaskHelper::getStatusKey('task_assigned_to_head'),\n 'task_id' => $request->task_id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_assigned_to_head')\n ]);\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isApprover(auth()->user()->id)) {\n TaskHelper::statusUpdateOrInsert([\n 'code' => TaskHelper::getStatusKey('task_approver_edited'),\n 'task_id' => $request->task->id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_approver_edited')\n ]);\n }\n\n\n // store\n $attributes = [\n 'task_type' => $request->task_type,\n 'project_id' => $request->project_id,\n 'task_code' => $request->task_code ?? null,\n 'task_name' => $request->task_name,\n 'site_head' => $request->site_head,\n 'task_details' => $request->task_details,\n 'task_assigned_to_head' => $request->task_assigned_to_head,\n ];\n //return redirect()->back()->with('message', 'Edited Successfully')->with('status', 1);\n //dd($attributes);\n try {\n $task = $this->task->update($task->id, $attributes);\n\n return back()\n ->with('message', 'Successfully saved')\n ->with('status', 1)\n ->with('task', $task);\n } catch (\\Exception $e) {\n return view('task::edit', $task->id)->with(['status' => 0, 'message' => 'Error']);\n }\n }", "public function testAssignTask()\n {\n // workflow, rule, action and object\n $this->task = factory(TaskEloquent::class)->create([\n 'user_id' => null,\n 'person_id' => null,\n ]);\n\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_ASSIGN,\n 'target_class' => '',\n 'target_field' => '',\n 'value' => '',\n 'task_id' =>$this->task->getKey(),\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n\n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'assign task to user',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $this->task->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function updateTask(){\n $input_data = $this->_cleanInputs($_POST);\n if(sizeof($input_data)){\n $this->response = verifyCSRFToken();\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n //{\"tasks_name\":\"\",\"tasks_description\":\"\",\"roles\":[\"1\",\"12\",\"2\",\"18\",\"3\"]}\n $this->response = $this->validateTask($input_data,\"update\");\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n \n $task = new Tasks();\n $task = $task->find($input_data['tasks_id']);\n $task->tasks_name = $input_data['tasks_name'];\n $task->tasks_description = $input_data['tasks_description'];\n $user_info = $_SESSION['user_info'];\n $task->user_id = $user_info['user_id'];\n $task::$conn->beginTransaction();\n $this->response = $task->save();\n if($this->response->status === true){\n //Map roles with the tasks\n $roles = isset($input_data['roles']) && is_array($input_data['roles'])?$input_data['roles']:array();\n $this->response = $task->mapTaskWithRoles($task::$conn,$task->tasks_id, $roles);\n if($this->response->status === false){\n $task::$conn->rollback();\n $this->response->msg = \"Failed to update.\";\n }\n else{\n $task::$conn->commit();\n $this->response->msg = \"Successfully updated.\";\n }\n }\n \n }\n else{\n $this->response->set([\n \"status\"=>false,\n \"msg\"=>\"No input parameter.\",\n \"status_code\"=>403\n ]);\n }\n return $this->sendResponse($this->response);\n }", "public function edit(Task $task)\n {\n\n }", "public function edit(Task $task)\r\n {\r\n //\r\n }", "protected function editTaskAction() {}", "public function testGetTaskInstanceVariable()\n {\n }", "public function testJobUpdate()\n {\n\n }", "public function testSaveTask()\r\n {\t\t\r\n $task = new SyncTask(); \r\n $task->subject = \"UnitTest TaskName\"; \r\n $task->startdate = strtotime(\"11/17/2011\");\r\n $task->duedate = strtotime(\"11/18/2011\");\r\n $obj = $this->backend->saveTask(\"\", $task);\r\n\t\t$tid = $obj->id;\r\n\r\n // Make sure we have a new task id\r\n $this->assertTrue(is_numeric($tid) && $tid > 0);\r\n\r\n // Make sure backend had fully populated task\r\n $obj = new CAntObject($this->dbh, \"task\", $tid, $this->user);\r\n $this->assertEquals($obj->getValue(\"name\"), $task->subject);\r\n $this->assertEquals(strtotime($obj->getValue(\"start_date\")), $task->startdate);\r\n $this->assertEquals(strtotime($obj->getValue(\"deadline\")), $task->duedate);\r\n\r\n // Cleanup\r\n $obj->removeHard();\r\n\t}", "public function edit(Task $task)\n {\n //var_dump($task);\n }" ]
[ "0.8209953", "0.7795147", "0.7661127", "0.7642155", "0.7198463", "0.6787412", "0.6751222", "0.667324", "0.665346", "0.6643765", "0.6643765", "0.66080624", "0.6578544", "0.6578544", "0.65190035", "0.64863056", "0.64849263", "0.6449534", "0.6446178", "0.64306325", "0.6428317", "0.6426768", "0.64169264", "0.64059395", "0.6389993", "0.63725734", "0.6358434", "0.63524574", "0.63396645", "0.6313178" ]
0.8433676
0
Init JSON REST API Menu routes.
function wp_rest_menus_init() { if ( ! defined( 'JSON_API_VERSION' ) && ! in_array( 'json-rest-api/plugin.php', get_option( 'active_plugins' ) ) ) { $class = new WP_REST_Menus(); add_filter( 'rest_api_init', array( $class, 'register_routes' ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(){\n add_action('rest_api_init', function () {\n register_rest_route( 'v2/rest-menu', 'menus',array(\n 'methods' => 'GET',\n 'callback' => array($this,'get_list_of_menus')\n ));\n });\n\n //End point to get the specified menu list of items\n add_action('rest_api_init', function () {\n register_rest_route( 'v2/rest-menu', 'menus/(?P<menu_url>[\\w\\-]+)',array(\n 'methods' => 'GET',\n 'callback' => array($this,'get_menu')\n ));\n });\n \n }", "function add_menus_endpoint() {\n\n\t\tif ( $this->config[\"rest\"][\"menus\"] ) {\n\t\t\tregister_rest_route(\n\t\t\t\tWPN_REST_URL,\n\t\t\t\t'/menus',\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => 'GET',\n\t\t\t\t\t'callback' => array( $this, 'api_list_menus' )\n\t\t\t\t) );\n\n\n//\t\t\tregister_rest_route(\n//\t\t\t\tWPN_REST_URL,\n//\t\t\t\t'/menus/(?P<slug>[0-9a-zA-Z(-]+)',\n//\t\t\t\tarray(\n//\t\t\t\t\t'methods' => 'GET',\n//\t\t\t\t\t'callback' => array( $this, 'api_menu_by_id_slug' )\n//\t\t\t\t) );\n\n\t\t\tregister_rest_route(\n\t\t\t\tWPN_REST_URL,\n\t\t\t\t'/menus/(?P<id>\\d+)',\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => 'GET',\n\t\t\t\t\t'callback' => array( $this, 'api_menu_by_id_slug' )\n\t\t\t\t) );\n\t\t}\n\t}", "function create_initial_rest_routes()\n {\n }", "public function set_menu_list()\r\n {\r\n $controllerData = $this->setUrlController;\r\n $controllerData = urldecode($controllerData);\r\n $getUrlSegment = explode('/', $controllerData);\r\n $controllerSet = isset($_GET['page']) && trim($_GET['page']) !== '' ?\r\n $_GET['page'] : $this->config['controller_default'];\r\n\r\n $methodSet = isset($_GET['method']) && trim($_GET['method']) !== '' ?\r\n $_GET['method'] : $this->config['method_default'];\r\n\r\n $realControllerName = ucfirst($controllerSet);\r\n $realControllerName = str_replace('-', '_', $realControllerName);\r\n\r\n include $this->bootstrap->base_config_dir . 'Routes.php';\r\n\r\n //add menu by foreach all menu list item array\r\n // list main menu plugin\r\n $xCounterMenu = 0;\r\n foreach ($menu_list as $keyItem => $valueItem) {\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_menu_page(\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_icon'], // icon plugin\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }\r\n $xCounterMenu++;\r\n }\r\n\r\n // list sub main menu plugin\r\n $yCounterMenu = 0;\r\n foreach ($menu_list_sub as $keyItem => $valueItem) {\r\n\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_submenu_page(\r\n $valueItem['menu_item']['page_slug_current'], // slug current menu\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }else{\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'], // slug current menu\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $_SESSION['controller_data_sub']['page_render'], // render\r\n $_SESSION['controller_data_sub']['page_menu_position'] // item position\r\n );\r\n }\r\n \r\n $yCounterMenu++;\r\n }\r\n }", "public function initialize()\n\t{\n\t\t/**\n\t\t * In the URI this module is prefixed by '/<%= module.slug %>'\n\t\t */\n\t\t$this->setPrefix('/<%= module.slug %>');\n\n\t\t/**\n\t\t * Configure the instance\n\t\t */\n\t\t$this->setPaths(\n\t\t\t[\n\t\t\t\t'module' => '<%= module.slug %>',\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\View\\\\',\n\t\t\t\t'controller' => 'index',\n\t\t\t\t'action' => 'index'\n\t\t\t]\n\t\t);\n\n\t\t/**\n\t\t * Default route: '<%= module.slug %>-api-root'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/api',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\API\\\\'\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-api-root');\n\n\t\t/**\n\t\t * API Controller route: '<%= module.slug %>-api-controller'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/api/:controller',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\API\\\\',\n\t\t\t\t'controller' => 1\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-api-controller');\n\n\t\t/**\n\t\t * API Action route: '<%= module.slug %>-api-action'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/api/:controller/:action/:params',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\API\\\\',\n\t\t\t\t'controller' => 1,\n\t\t\t\t'action' => 2,\n\t\t\t\t'params' => 3\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-api-action');\n\n\t\t/**\n\t\t * Default route: '<%= module.slug %>-view-root'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/view',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\View\\\\'\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-view-root');\n\n\t\t/**\n\t\t * View Controller route: '<%= module.slug %>-view-controller'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/view/:controller',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\View\\\\',\n\t\t\t\t'controller' => 1\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-view-controller');\n\n\t\t/**\n\t\t * View Action route: '<%= module.slug %>-view-action'\n\t\t */\n\t\t$this->addGet(\n\t\t\t'/api/:controller/:action/:params',\n\t\t\t[\n\t\t\t\t'namespace' => '<%= project.namespace %>\\<%= module.namespace %>\\Controllers\\View\\\\',\n\t\t\t\t'controller' => 1,\n\t\t\t\t'action' => 2,\n\t\t\t\t'params' => 3\n\t\t\t]\n\t\t)->setName('<%= module.slug %>-view-action');\n\n\t\t/**\n\t\t * Add all <%= project.namespace %>\\<%= module.namespace %> specific routes here\n\t\t */\n\t}", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "public function initialize() {\n $this->setPaths(\n [\n 'namespace' => 'ReIndex\\Controller',\n 'controller' => 'footer'\n ]);\n\n $this->setHostname(Di::getDefault()['config']['application']['domainName']);\n\n $this->addGet('/tour/', ['action' => 'tour']);\n $this->addGet('/help/', ['action' => 'help']);\n $this->addGet('/legal/', ['action' => 'legal']);\n $this->addGet('/privacy/', ['action' => 'privacy']);\n $this->addGet('/careers/', ['action' => 'career']);\n $this->addGet('/advertising/', ['action' => 'advertising']);\n $this->addGet('/contacts/', ['action' => 'contact']);\n $this->addGet('/info/', ['action' => 'info']);\n }", "function rest_api_init() {\n\trest_api_register_rewrites();\n\n\tglobal $wp;\n\t$wp->add_query_var( 'rest_route' );\n}", "public function init() {\n add_action( 'rest_api_init', array($this, 'register_route'));\n add_action( 'wp_enqueue_scripts', array($this, 'enqueue_script'));\n\t}", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "public function initRoutes(App $app);", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function init()\n\t{\n\t\t$this -> view -> navigation = $navigation = Engine_Api::_() -> getApi('menus', 'core') -> getNavigation('advmenusystem_admin_main', array(), 'advmenusystem_admin_global_settings');\n\t}", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "private function loadRoute()\n\t{\n\t\t/*\n\t\t* Se o controller nao for passado por GET,\n\t\t* assume-se como padrão o controller 'IndexController';\n\t\t*/\n\t\t$this->st_controller = isset($_REQUEST['controle']) ? $_REQUEST['controle'] : 'index';\n\t\t\n\t\t/*\n\t\t* Se a action nao for passada por GET,\n\t\t* assume-se como padrão a action 'IndexAction';\n\t\t*/\n\t\t$this->st_action = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'index';\n\t}", "protected function _initRouter() {\r\n\t\t$front = $this->bootstrap('FrontController')->getResource('FrontController');\r\n\t\t$router = $front->getRouter();\r\n\t\t$router->addRoute('Accueil', new Zend_Controller_Router_Route('accueil', array('module' => 'Shop', 'controller' => 'index', 'action' => 'index')));\r\n\t\t$router->addRoute('monCompte', new Zend_Controller_Router_Route('compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'tableau-bord')));\r\n\t\t$router->addRoute('connexionClient', new Zend_Controller_Router_Route('connexion', array('module' => 'Shop', 'controller' => 'index', 'action' => 'login')));\r\n\t\t$router->addRoute('deconnexion', new Zend_Controller_Router_Route('deconnexion', array('module' => 'Shop', 'controller' => 'index', 'action' => 'logout')));\r\n\t\t$router->addRoute('newCompte', new Zend_Controller_Router_Route('nouveau_compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout')));\r\n\t\t$router->addRoute('panier', new Zend_Controller_Router_Route('panier/:rm', array('module' => 'Shop', 'controller' => 'client', 'action' => 'panier','rm'=>'')));\r\n\t\t$router->addRoute('menu', new Zend_Controller_Router_Route('menu', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'login')));\r\n\t\t$router->addRoute('carnetAdresse', new Zend_Controller_Router_Route('carnet_adresses', array('module' => 'Shop', 'controller' => 'client', 'action' => 'carnet-adresse')));\r\n\t\t$router->addRoute('informationCompte', new Zend_Controller_Router_Route('information_compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'information-compte')));\r\n\t\t$router->addRoute('mesCommandes', new Zend_Controller_Router_Route('mes_commandes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'client', 'action' => 'commande','orderBy'=>'Id_Desc', 'page'=>'')));\r\n\t\t$router->addRoute('ajoutAdresse', new Zend_Controller_Router_Route('ajouter_adresse', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-carnet-adresse')));\r\n\t\t$router->addRoute('modifierAdresse', new Zend_Controller_Router_Route('modifier_adresse/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-carnet-adresse')));\r\n\t\t$router->addRoute('supprimerAdresse', new Zend_Controller_Router_Route('supprimer_adresse/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'delete-carnet-adresse','id' => '')));\r\n\t\t$router->addRoute('mesFichesCommandes', new Zend_Controller_Router_Route('fiches_commandes/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'fiche-commande','id' => '')));\r\n\t\t$router->addRoute('listeCommandes', new Zend_Controller_Router_Route('liste_commandes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'liste', 'orderBy'=>'Id_Asc', 'page'=>'')));\r\n\t\t$router->addRoute('fichesCommandes', new Zend_Controller_Router_Route('fiche_commande/:id', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'fiche')));\r\n\t\t$router->addRoute('livreCommandes', new Zend_Controller_Router_Route('livre_commande/:id/:islivre', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'envoye')));\r\n\t\t$router->addRoute('ficheProduitAdmin', new Zend_Controller_Router_Route('fiche_produit_admin/:id', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'fiche-produit')));\r\n\t\t$router->addRoute('listeProduit', new Zend_Controller_Router_Route('liste_produit/:orderBy/:page/:mode', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'liste', 'orderBy'=>'Ligne_Asc', 'page'=>'', 'mode' => 'now_futur')));\r\n\t\t$router->addRoute('ajoutProduit', new Zend_Controller_Router_Route('ajout_produit', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'ajout')));\r\n\t\t$router->addRoute('listeClient', new Zend_Controller_Router_Route('liste_client/:orderBy/:page', array('module' => 'Shop', 'controller' => 'client', 'action' => 'liste','orderBy'=>'', 'page'=>'')));\r\n\t\t$router->addRoute('ajoutClient', new Zend_Controller_Router_Route('ajout_client', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-admin')));\r\n\t\t$router->addRoute('statutProduit', new Zend_Controller_Router_Route('statut_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'statut')));\r\n\t\t$router->addRoute('supprimerProduit', new Zend_Controller_Router_Route('supprimer_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'delete')));\r\n\t\t$router->addRoute('modifierProduit', new Zend_Controller_Router_Route('modifier_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'update')));\r\n\t\t$router->addRoute('ficheClient', new Zend_Controller_Router_Route('fiche_client/:id', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'fiche-client')));\r\n\t\t$router->addRoute('supprimerClient', new Zend_Controller_Router_Route('supprimer_client/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'delete')));\r\n\t\t$router->addRoute('listeCategorie', new Zend_Controller_Router_Route('liste_categorie/:id/:orderBy', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'liste','id'=>'','orderBy'=>'Id_Asc')));\r\n\t\t$router->addRoute('ajoutCategorie', new Zend_Controller_Router_Route('ajout_categorie', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'ajout')));\r\n\t\t$router->addRoute('supprimerCategorie', new Zend_Controller_Router_Route('modifier_categorie', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'update')));\r\n\t\t$router->addRoute('parametre', new Zend_Controller_Router_Route('parametres', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'parametre')));\r\n\t\t$router->addRoute('catalogue', new Zend_Controller_Router_Route('catalogue/:orderBy/:page', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'catalogue', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('recherche', new Zend_Controller_Router_Route('recherche/:mot/:orderBy/:page', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'catalogue', 'mot'=>'', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('new', new Zend_Controller_Router_Route('new/:orderBy/:page', array('module' => 'Shop', 'controller' => 'index', 'action' => 'new', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('topVentes', new Zend_Controller_Router_Route('top_ventes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'index', 'action' => 'top-ventes', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\n\t}", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "public function init() {\n\n\t\t$token = $this->get_token();\n\n\t\tif ( ! $token || ! $this->is_valid_token( $token ) ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tforeach ( $this->routes as $route => $class ) {\n\n\t\t\tif ( class_exists( $class ) ) {\n\n\t\t\t\tnew $class( $route );\n\n\t\t\t}\n\n\t\t}\n\n\t\tadd_filter( 'rest_index', [ $this, 'hide_from_rest_index' ], PHP_INT_MAX );\n\t\tadd_filter( 'rest_pre_serve_request', [ $this, 'send_headers' ], PHP_INT_MAX, 4 );\n\t\tadd_filter( 'rest_send_nocache_headers', '__return_true', PHP_INT_MAX );\n\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shops' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shop' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/manager', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'register_shop_manager' ),\n\t\t\t)\n\t\t) );\n\t}", "public function rest_api_init_action() {\r\n \r\n register_rest_route('api-bearer-auth/v1', '/login', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_login'],\r\n 'args' => [\r\n 'username' => [\r\n 'required' => true,\r\n ],\r\n 'password' => [\r\n 'required' => true,\r\n ],\r\n ]\r\n ]);\r\n \r\n register_rest_route('api-bearer-auth/v1', '/tokens/refresh', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_refresh_token'],\r\n 'args' => [\r\n 'token' => [\r\n 'required' => true\r\n ]\r\n ]\r\n ]);\r\n \r\n }", "function onibus_endpoint_init() {\n\n\t$namespace = API_VERSAO;\n\n register_rest_route( $namespace, '/onibus/get-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/set-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'POST',\n\t 'callback' \t=> 'set_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_all_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/(?P<id>\\d+)',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_onibus_by_id',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/create/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'adicionar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/update/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'editar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/delete/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'deletar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n\n}", "protected function initRoutes() {\n\t\t$routes['index'] = array(\n\t\t\t'route' => '/',\n\t\t\t'controller' => 'IndexController',\n\t\t\t'action' => 'index'\n\t\t);\n\n\t\t$routes['home'] = array(\n\t\t\t'route' => '/home',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'home'\n\t\t);\n\n\t\t$routes['autenticar'] = array(\n\t\t\t'route' => '/autenticar',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'autenticar'\n\t\t);\n\n\t\t$routes['editar'] = array(\n\t\t\t'route' => '/editar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editar'\n\t\t);\n\n\t\t$routes['sair'] = array(\n\t\t\t'route' => '/sair',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'sair'\n\t\t);\n\t\t##### Fim rotas principais #####\n\n\t\t// ***** Inicio usuario ***** //\n\t\t$routes['usuario'] = array(\n\t\t\t'route' => '/usuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'usuario'\n\t\t);\n\n\t\t$routes['cadastrar'] = array(\n\t\t\t'route' => '/cadastrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrar'\n\t\t);\n\n\t\t$routes['registrar'] = array(\n\t\t\t'route' => '/registrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrar'\n\t\t);\n\n\t\t$routes['acaousuario'] = array(\n\t\t\t'route' => '/acaousuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesUsuario'\n\t\t);\n\n\t\t$routes['editaruser'] = array(\n\t\t\t'route' => '/editaruser',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarUser'\n\t\t);\n\t\t##### Fim usuario #####\n\n\t\t// ***** Inicio Produto ***** //\n\t\t$routes['produto'] = array(\n\t\t\t'route' => '/produto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'produto'\n\t\t);\n\n\t\t$routes['cadastrarprod'] = array(\n\t\t\t'route' => '/cadastrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrarProd'\n\t\t);\n\n\t\t$routes['registrarprod'] = array(\n\t\t\t'route' => '/registrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrarProd'\n\t\t);\n\n\t\t$routes['acaoproduto'] = array(\n\t\t\t'route' => '/acaoproduto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesProduto'\n\t\t);\n\n\t\t$routes['editarprod'] = array(\n\t\t\t'route' => '/editarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarProd'\n\t\t);\n\t\t##### Fim Produtos #####\n\t\t\n\t\t// ***** Inicio carrinho ***** //\n\t\t$routes['carrinho'] = array(\n\t\t\t'route' => '/carrinho',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'carrinho'\n\t\t);\n\n\t\t$routes['finalizar'] = array(\n\t\t\t'route' => '/finalizar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'finalizar'\n\t\t);\n\t\t##### Fim carrinho #####\n\t\t\n\t\t// ***** Inicio pedido ***** //\n\t\t$routes['pedido'] = array(\n\t\t\t'route' => '/pedido',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'pedido'\n\t\t);\n\t\t##### Fim pedido #####\n\n\t\t// ***** Inicio Relatorio ***** //\n\t\t$routes['relatorio'] = array(\n\t\t\t'route' => '/relatorio',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'relatorio'\n\t\t);\n\t\t##### Fim Relatorio #####\n\t\t$this->setRoutes($routes);\n\t}", "function json_oauth_api_routes( $data ) {\n\tif (empty($data['authentication'])) {\n\t\t$data['authentication'] = array();\n\t}\n\n\t$data['authentication']['oauth1'] = array(\n\t\t'request' => home_url( 'oauth1/request' ),\n\t\t'authorize' => home_url( 'oauth1/authorize' ),\n\t\t'access' => home_url( 'oauth1/access' ),\n\t\t'version' => '0.1',\n\t);\n\treturn $data;\n}", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "public function add_rest_api_routes() {\n\t\t// Clerk setting get configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/getconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'getconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Clerk setting set configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/setconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'setconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/product',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'product_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/page',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'page_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Category endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/category',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'category_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Order endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/order',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'order_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Customer endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/customer',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'customer_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/version',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'version_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/plugin',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'plugin_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Log endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/log',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'log_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\t}", "public function testMenuRouteTest()\n {\n $user = $this->_getAdminUser();\n $response = $this->actingAs($user, 'admin')->get(route('admin.menu.index'));\n $response->assertStatus(200);\n $response->assertSee('Menu');\n\n //\n $data['name'] = 'test menu';\n $data['identifier'] = 'test-menu';\n $data['menu_json'] = '[[{\n \"name\": \"Kitchen\",\n \"params\": \"kitchen\",\n \"route\": \"category.view\",\n \"children\": [\n []\n ]\n }]]';\n $response = $this->post(route('admin.menu.store'), $data);\n\n $response->assertRedirect(route('admin.menu.index'));\n }", "public function init() {\n\t$this->_helper->_acl->allow(null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('type', array('xml','json'))\n\t\t->initContext();\n }" ]
[ "0.7516352", "0.7454535", "0.6957139", "0.64791995", "0.6430401", "0.64226484", "0.63903356", "0.6367173", "0.62440395", "0.62321734", "0.6204807", "0.6195651", "0.617921", "0.6161933", "0.6116668", "0.61141205", "0.61058915", "0.6099145", "0.6080863", "0.6078309", "0.6076984", "0.60708493", "0.6064631", "0.60639215", "0.6062346", "0.605546", "0.6039592", "0.60386044", "0.6038281", "0.60316473" ]
0.8010276
0
Logs an emerg message.
public function emerg($message) { $this->log($message, self::EMERG); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function emerg($message)\n {\n static::_log(self::EMERG, $message);\n }", "public function emerg($message)\r\n {\r\n $this->log($message, SF_LOG_EMERG);\r\n }", "public static function emerg() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_EMERG, $args);\n\t}", "public function emerg($msg, $category='application'){\n\t\t$this->log($msg, 0, $category);\n\t}", "function errlog($msg) {\n file_put_contents('php://stderr', $msg );\n }", "public function err($message)\r\n {\r\n $this->log($message, SF_LOG_ERR);\r\n }", "public function err($message)\n {\n $this->log($message, self::ERR);\n }", "public function emergency($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "public static function errorLog($msg) {\r\n\t\t// disable error log if we are running in a CLI environment\r\n\t\tif (php_sapi_name () != 'cli') {\r\n\t\t\terror_log ( $msg );\r\n\t\t}\r\n\t\r\n\t\t// uncomment this if you want to see the errors on the page\r\n\t// print 'error_log: '.$msg.\"\\n\";\r\n\t}", "protected function error($msg) {\n error_log($msg);\n }", "public static function errorLog($msg)\n\t{\n\t\t// disable error log if we are running in a CLI environment\n\t\tif (php_sapi_name() != 'cli') {\n\t\t\terror_log($msg);\n\t\t}\n\t\t// uncomment this if you want to see the errors on the page\n\t\t// print 'error_log: '.$msg.\"\\n\";\n\t}", "private function error_report($msg){\n die($msg);\n }", "function logError (string $msg, bool $fatal = false): void {\n\tlogString('('.$_SERVER['REMOTE_ADDR'].') ('.date('Y-m-d H:i:s').') ['.($fatal ? 'Fatal ' : '').'Error] '.$msg);\n\tif ($fatal) die('Fatal Error');\n}", "public function printError() {\n\t\t\tfwrite(STDERR, $this->message);\n\t\t}", "public function severe($msg) {\n\t\tif ( $this->level <= self::SEVERE && !empty($msg) ) {\n\t\t\t$this->writeLog(\"SEVERE: \".$msg);\n\t\t}\n\t}", "function log_error( $msg ){\n self::system_log( $msg, 'ERROR' );\n }", "public function emergency($message, array $context = array())\n {\n if ($this->activated) {\n $this->log(LogLevel::EMERGENCY, $message, $context);\n }\n }", "public static function debug($msg) {\n\t\ttrigger_error($msg, E_USER_WARNING);\n\t}", "public function emergency($message, array $context = []) : void\n {\n $this->log(__FUNCTION__, $message, $context);\n }", "public function error($msg){\n\t\tif($this->debugLevel >= self::LOG_ERROR){\n\t\t\t$this->_log($msg, self::LOG_ERROR);\n\t\t}\n\t}", "public function emergency($message, array $context = array())\n {\n $this->log(self::LEVEL_FATAL, $message, $context);\n }", "public function logError() {}", "function error($error_msg)\n\t{\n\t\tdie(\"<b>\" . $this->app_name . \" FATAL ERROR</b>: \" . $error_msg);\n\t}", "function logException ($ex) {\n\t\techo \"Should log: \".$ex->getMessage();\n\t}", "function my_error($msg) {\n\theader('HTTP/1.1 500 Internal Server Error');\n\ttrigger_error($msg,E_USER_ERROR);\n}", "public function emergency($message, array $context = [])\n {\n $this->writeLog(__FUNCTION__, $message, $context);\n }", "protected function log($msg)\n {\n if ($this->debug===true) {\n error_log($msg, 0);\n }\n }", "function go500($msg = '') {\n\terror_log( '500: ' . $msg );\n\tstatus_header( 500 );\n\techo $msg;\n\texit;\n}", "public function UnhandeldException(){\n\t\t$this -> message = \"An unhandeld exception was thrown. Please infrom...\";\n\t}", "public static function err() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_ERR, $args);\n\t}" ]
[ "0.780564", "0.7763627", "0.7588366", "0.72344834", "0.6411417", "0.636041", "0.6360281", "0.6120802", "0.5876493", "0.5844073", "0.5836323", "0.5743309", "0.5741324", "0.5729126", "0.56831366", "0.55680954", "0.5556902", "0.5534434", "0.5517829", "0.55130124", "0.5511658", "0.5482415", "0.54655266", "0.541774", "0.54159254", "0.53963137", "0.53792125", "0.53700256", "0.53684807", "0.5362555" ]
0.81022674
0
Logs an alert message.
public function alert($message) { $this->log($message, self::ALERT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function alert($message)\r\n {\r\n $this->log($message, SF_LOG_ALERT);\r\n }", "public function alert($message) {\n if (!$this->logging_enabled) {\n return;\n }\n \n $this->logger->alert($message);\n }", "public static function alert($message)\n {\n static::_log(self::ALERT, $message);\n }", "public function logAlert($message, array $context = array()) { return $this->_logger->alert($message,$context); }", "public function alert($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "public static function alert() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_ALERT, $args);\n\t}", "public function alert($msg, $category='application'){\n\t\t$this->log($msg, 1, $category);\n\t}", "public function logAlert($message, array $context = array())\r\n {\r\n if ($this->logger) {\r\n $this->logger->alert($message, $context);\r\n }\r\n }", "public function alert($message, array $context = [])\n {\n $this->writeLog(__FUNCTION__, $message, $context);\n }", "public static function alert($message, $context = array()){\n\t\treturn \\Monolog\\Logger::alert($message, $context);\n\t}", "public function alert(string $message, array $context = []){\n if($this->logger !== null){\n $this->logger->alert($message, $context);\n }\n\n if($this->messagePanel !== null){\n $this->messagePanel->addMessage($message, LogLevel::ALERT);\n }\n }", "public function alert($message, array $context = [])\n {\n $this->log('alert', $message, $context);\n }", "public function alert($message, array $context = []) : void\n {\n $this->log(__FUNCTION__, $message, $context);\n }", "public function alert($message, array $context = array())\n {\n // TODO: Implement alert() method.\n self::log(LogLevel::ALERT, $message, $context);\n }", "public function alert($msg) {\n $this->callMethod( 'alert', array($msg) );\n }", "public static function alert($message, array $context = array())\r\n {\r\n self::log(Level::ALERT, $message, $context);\r\n }", "public function alert($message, array $context = array())\n {\n $this->log(LogLevel::ALERT, $message, $context);\n }", "public function alert($message, array $context = array())\n {\n $this->log(LogLevel::ALERT, $message, $context);\n }", "public function alert($message, array $context = array())\n {\n if ($this->activated) {\n $this->log(LogLevel::ALERT, $message, $context);\n }\n }", "public function alert($message, array $context = array())\n {\n $this->saveLogMessage(LogLevel::ALERT, $message, $context);\n }", "public function alert($message, array $context = [])\n {\n $this->log('ALERT', $message, $context);\n }", "public function alert($message, array $context = array())\n {\n $this->log(PsrLogLevel::ALERT, $message, $context);\n }", "public function alert($message, array $context = []) {\n\t\t$this->log(Util::ERROR, $message, $context);\n\t}", "public function alert($message, array $context = [])\n {\n $this->log(AuditLevels::ALERT, $message, $context);\n }", "public function alert($message, array $context = array()) {\n $this->logger->fatal($this->interpolate($message, $context));\n }", "public static function log($message){\n Craft::getLogger()->log($message, \\yii\\log\\Logger::LEVEL_INFO, 'craft-trade-account-notifications');\n }", "public function alert($message, array $context = array())\n {\n file_put_contents($this->filename, 'ALERT: '. json_encode($context) . ' - ' . $message . \"\\r\\n\", FILE_APPEND);\n }", "public function alert($message, array $context = [])\n {\n return $this->writeLog(__FUNCTION__, $message, $context);\n }", "function alert($message, array $context = array());", "function alert($msg){\n\tglobal $knj_web;\n\t\n\t$msg = strtr($msg, array(\n\t\t\"\\n\" => \"\\\\n\",\n\t\t\"\\t\" => \"\\\\t\",\n\t\t\"\\r\" => \"\",\n\t\t\"\\\"\" => \"\\\\\\\"\"\n\t));\n\t\n\t$knj_web[\"alert_sent\"] = true;\n\t?><script type=\"text/javascript\">alert(\"<?=$msg?>\");</script><?\n}" ]
[ "0.792286", "0.77471215", "0.7622396", "0.74325097", "0.7398907", "0.72769624", "0.7269653", "0.725747", "0.69509465", "0.6900326", "0.6888471", "0.6880999", "0.6831517", "0.68169975", "0.67862177", "0.67519397", "0.67359066", "0.67359066", "0.6674611", "0.6655878", "0.6649", "0.6629931", "0.65758353", "0.6537247", "0.6508801", "0.642909", "0.63704014", "0.63678384", "0.6356267", "0.63321686" ]
0.7875222
1
Logs a notice message.
public function notice($message) { $this->log($message, self::NOTICE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notice($message)\r\n {\r\n $this->log($message, SF_LOG_NOTICE);\r\n }", "public static function notice() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_NOTICE, $args);\n\t}", "public static function notice($message)\n {\n static::_log(self::NOTICE, $message);\n }", "public function notice($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "public static function notice($inMessage) {\n\t\tself::getInstance()->log($inMessage, systemLogLevel::NOTICE);\n\t}", "public function logNotice($message, array $context = array()) { return $this->_logger->notice($message,$context); }", "public function notice(string $message, array $context = []){\n if($this->logger !== null){\n $this->logger->notice($message, $context);\n }\n\n if($this->messagePanel !== null){\n $this->messagePanel->addMessage($message, LogLevel::NOTICE);\n }\n }", "public static function notice($message, $context = array()){\n\t\treturn \\Monolog\\Logger::notice($message, $context);\n\t}", "public function notice($msg, $category='application'){\n\t\t$this->log($msg, 5, $category);\n\t}", "public static function notice($message, array $context = array())\r\n {\r\n self::log(Level::NOTICE, $message, $context);\r\n }", "public function notice($message, array $context = []) {\n\t\t$this->log(Util::INFO, $message, $context);\n\t}", "public function notice()\n {\n }", "public function notice($message, array $context = array())\n {\n self::log(LogLevel::NOTICE, $message, $context);\n }", "public function notice($message, array $context = array())\n {\n if ($this->activated) {\n $this->log(LogLevel::NOTICE, $message, $context);\n }\n }", "public function notice($message, array $context = array())\n {\n $this->log(LogLevel::NOTICE, $message, $context);\n }", "public function notice($message, array $context = array())\n {\n $this->log(LogLevel::NOTICE, $message, $context);\n }", "public function notice($message, array $context = [])\n {\n $this->writeLog(__FUNCTION__, $message, $context);\n }", "public function notice($message, array $context = [])\n {\n $this->log('notice', $message, $context);\n }", "public function notice($message, array $context = []) : void\n {\n $this->log(__FUNCTION__, $message, $context);\n }", "public function notice($message, array $context = array())\n {\n $this->log(PsrLogLevel::NOTICE, $message, $context);\n }", "public function logNotice($message, array $context = array())\r\n {\r\n if ($this->logger) {\r\n $this->logger->notice($message, $context);\r\n }\r\n }", "public function notice($message, array $context = [])\n {\n $this->log(AuditLevels::NOTICE, $message, $context);\n }", "public function notice($message, array $context = array())\n {\n $this->saveLogMessage(LogLevel::NOTICE, $message, $context);\n }", "public function notice($message, array $context = [])\n {\n $this->log('NOTICE', $message, $context);\n }", "public function notice($message, array $context = array()) {\n $this->logger->info($this->interpolate($message, $context));\n }", "public function notice($message, array $context = array())\n {\n $this->log(self::LEVEL_INFO, $message, $context);\n }", "public function event_notice($who, $message)\r\n\t{\r\n\t\r\n\t}", "public function notice(string $text);", "function notice($message, array $context = array());", "public static function notice($message, array $context = array()): string\n {\n /** @noinspection PhpVoidFunctionResultUsedInspection */\n return static::getLogger()->notice($message, $context);\n }" ]
[ "0.80893046", "0.78994167", "0.77570814", "0.7723626", "0.7700615", "0.73285633", "0.72878313", "0.7201445", "0.7164861", "0.7145621", "0.7129099", "0.7109875", "0.7074625", "0.70635086", "0.70628226", "0.70628226", "0.705589", "0.7021605", "0.70157313", "0.70043015", "0.6995181", "0.6990199", "0.6987785", "0.69658256", "0.69458276", "0.69147325", "0.68107986", "0.67906034", "0.673939", "0.67145574" ]
0.8131184
0
Logs a debug message.
public function debug($message) { $this->log($message, self::DEBUG); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function debug($message)\r\n {\r\n $this->log($message, SF_LOG_DEBUG);\r\n }", "public function debug($message) {}", "public function logDebug($message) {\n $this->log($message);\n }", "public function debug(string $message);", "public static function debug($message)\n\t{\n\t\tstatic::write('Debug', $message);\n\t}", "public function debug($message)\n {\n if ($this->debugMode)\n {\n $this->log($message);\n }\n }", "public function log_debug( $message ) {\n\t\tGFAPI::log_debug( $message );\n\t}", "public function logDebug($message)\n\t{\n\t\t$this->log($message, self::DEBUG);\n\t}", "public static function debug($message){\n\t\tif(Functions::$runmode == Functions::$RUNMODE_DEBUG){\n\t\t\techo 'DEBUG: '.$message.\"\\n\";\n\t\t}\n\t}", "public function debug($message) {\n\t\tif ($this->debug)\n\t\t\techo \"cobweb: DEBUG {$message}\\n\";\n\t}", "public function debug($message)\n {\n self::log($message, Zend_Log::DEBUG);\n }", "public function debug($message)\n {\n }", "public function debug($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "public static function debug() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_DEBUG, $args);\n\t}", "public function debug( $message ) {\n\t\tif ($this->logfile === null)\n\t\t\t$this->setLogfile(\"Debugger.log\");\n\t\t$string = date('j.m H:m:s',time()). \" $message\\n\";\n\t\t\t\n\t\tfwrite($this->logfile, $string);\n\t}", "public static function debug()\n {\n foreach (func_get_args() as $message) {\n if (is_null($message))\n $message = 'NULL';\n if (!is_string($message))\n $message = print_r($message, true);\n static::_log(self::DEBUG, $message);\n }\n }", "public function debug($msg){\n\t\tif($this->debugLevel >= self::LOG_DEBUG){\n\t\t\t$this->_log($msg, self::LOG_DEBUG);\n\t\t}\n\t}", "public function debug( $msg )\n {\n if ( DEBUG )\n {\n echo $msg;\n }\n }", "protected function debugLog($message)\n {\n if (null !== $this->logger) {\n $this->logger->addDebug($message);\n }\n }", "public function debug($message) {\r\n\t\tif($this->isDebug()) {\r\n\t\t\techo microtime(true) . \": \";\r\n\t\t\tvar_dump($message);\r\n\t\t}\r\n\t}", "static private function debug($message) {\n if (self::getConfig('debug')) {\n print_r($message);\n print_r(PHP_EOL);\n }\n }", "public function debug($message): void\n\t{\n\t\t$message = $this->logMessToArray($message);\n\t\t$this->log(array_merge(['SEVERITY' => 'DEBUG'], $message));\n\t}", "public static function debug($message) {\n\t\tif (constant('ENVIRONMENT') === 'DEV') {\n\t\t\tself::log(self::TYPE_DEBUG, $message);\n\t\t}\n\t}", "public static function debug($message)\n {\n if (!self::$output) {\n return;\n }\n self::$output->debug($message);\n }", "function debug($message);", "private function debug($msg) {\r\n if ($this->debug) {\r\n echo '[debug] ' . $msg . '<br>';\r\n }\r\n }", "function debug($msg)\n{\n _log($msg, Zend_Log::DEBUG);\n}", "function debug($message, $query = \"\") {\n global $logger;\n\t $logger->debug(\"$message \" . \"[ $query ]\" . \"\\n\");\n }", "public static function debug() {\n $args = func_get_args();\n self::log(count($args) === 1 ? current($args) : $args);\n }", "public function debugMessage ($message)\n {\n if (sfConfig::get('sf_web_debug'))\n {\n sfWebDebug::getInstance()->logShortMessage($message);\n }\n }" ]
[ "0.7897121", "0.7822938", "0.7822187", "0.7805242", "0.77773756", "0.77471685", "0.7694217", "0.7665123", "0.76640314", "0.76290345", "0.76179177", "0.7615208", "0.75734806", "0.7556127", "0.7532402", "0.74798304", "0.74146616", "0.7400949", "0.7394262", "0.7386865", "0.7386494", "0.73659456", "0.73595095", "0.7335619", "0.7300567", "0.72103554", "0.71499676", "0.7133915", "0.7118919", "0.7083539" ]
0.78865284
1
Listens to application.log events.
public function listenToLogEvent(sfEvent $event) { $priority = isset($event['priority']) ? $event['priority'] : self::INFO; $subject = $event->getSubject(); $subject = is_object($subject) ? get_class($subject) : (is_string($subject) ? $subject : 'main'); foreach ($event->getParameters() as $key => $message) { if ('priority' === $key) { continue; } $this->log(sprintf('{%s} %s', $subject, $message), $priority); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerEvents(): void\n {\n Event::listen(MessageLogged::class, function (MessageLogged $e) {\n if( app()->bound('current-context') )\n app('current-context')->log((array)$e);\n });\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "public function listen() {\n\t\t$fields = wp_parse_args( $_POST, array(\n\t\t\t'check' => '',\n\t\t\t'log-level' => '',\n\t\t\t'log-engine' => '',\n\t\t) );\n\n\t\tforeach ( $fields as &$single_field ) {\n\t\t\t$single_field = sanitize_text_field( $single_field );\n\t\t}\n\n\t\tif ( ! wp_verify_nonce( $fields['check'], 'logging-controls' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Fires before log settings are committed.\n\t\t *\n\t\t * This will not happen unless a nonce check has already passed.\n\t\t */\n\t\tdo_action( 'tribe_common_update_log_settings' );\n\n\t\t$this->update_logging_level( $fields['log-level'] );\n\t\t$this->update_logging_engine( $fields['log-engine'] );\n\n\t\t/**\n\t\t * Fires immediately after log settings have been committed.\n\t\t */\n\t\tdo_action( 'tribe_common_updated_log_settings' );\n\n\t\t$data = array(\n\t\t\t'logs' => $this->get_available_logs(),\n\t\t);\n\n\t\tif ( ! empty( $fields['log-view'] ) ) {\n\t\t\t$data['entries'] = $this->get_log_entries( $fields['log-view'] );\n\t\t}\n\n\t\twp_send_json_success( $data );\n\t}", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }", "public static function listen($callback){\n\t\t\\Illuminate\\Log\\Writer::listen($callback);\n\t}", "function changeLogs() {\n\n }", "public function logs()\n {\n $this->_display('logs');\n }", "public function log($log);", "public static function bootLoggable()\n {\n static::observe(app(LoggableObserver::class));\n }", "function notify($event)\n {\n if(SWConfig::read_values('statuswolf.debug'))\n {\n $this->loggy = new KLogger(ROOT . 'app/log/', KLogger::DEBUG);\n }\n else\n {\n $this->loggy = new KLogger(ROOT . 'app/log/', KLogger::INFO);\n }\n\n $this->auth_log_messages[] = $event;\n\n $this->loggy->logDebug(json_encode($this->auth_log_messages));\n }", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "protected function log() {\n }", "function log_event( $plugin_name, $log_msg, $log_type, $file, $line ) {\t\t$allowed = get_transient( 'ti_log_allowed' );\n\t\tif ( is_array( $allowed ) && in_array( $plugin_name, $allowed ) ) {\n\t\t\t$logs = get_transient( 'ti_log' . $plugin_name );\n\t\t\tif ( ! $logs ) {\n\t\t\t\t$logs = array();\n\t\t\t}\n\t\t\t$logs[] = array(\n\t\t\t\t'type' => $log_type,\n\t\t\t\t'msg' => $log_msg,\n\t\t\t\t'time' => date( 'F j, Y H:i:s', current_time( 'timestamp', true ) ),\n\t\t\t\t'file' => $file,\n\t\t\t\t'line' => $line,\n\t\t\t);\n\t\t\t// keep only the last LOG_LENGTH logs\n\t\t\t$logs = array_slice( $logs, 0 - self::LOG_LENGTH );\n\t\t\tset_transient( 'ti_log' . $plugin_name, $logs, self::LOG_OPTION_EXPIRY_MINS * MINUTE_IN_SECONDS );\n\t\t}\n\t}", "protected function log( $log )\n {\n if( $this->getLogger() === null )\n return;\n\n $this->getLogger()->log( 'Clickatell: ' . $log, $this->getLogLevel() );\n }", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function log($log) {\n //$this->log = $log;\n }", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "public function __logEvent($msg)\n {\n if ($this->logger) {\n $this->logger->log($msg, 'info', 'queries');\n }\n }", "public function logEvents(array $auditLogs);", "function write_log($log) {\n $orderLog = new Logger('order');\n $orderLog->pushHandler(new StreamHandler(storage_path('logs/frontend.log')), Logger::INFO);\n $orderLog->info('OrderLog', $log);\n}", "protected function logfile_init() { \n if ($this->LOGGING) { \n $this->FILE_HANDLER = fopen($this->LOGFILE,'a') ; \n $this->debug(); \n } \n }", "public function collectLogFiles()\r\n {\r\n $folder = array($this->app_root.'/logs');\r\n $files_found = $this->findFiles($folder, array(\"log\"));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }", "protected function _write($event)\n {\n $this->logs[] = $event;\n }", "public function collect_logs()\n {\n $body = file_get_contents(\"php://input\");\n $r = @file_get_contents('/tmp/apple.push.log');\n file_put_contents('/tmp/apple.push.log', $r . $body);\n return 'success'; \n }", "public function boot()\n {\n $maxFiles = 5;\n\n $handlers[] = (new StreamHandler(storage_path(\"logs/lumen.log\")))\n ->setFormatter(new LineFormatter(null, null, true, true));\n\n $this->app['log']->setHandlers($handlers);\n }", "public static function init()\n {\n $output = \"[%datetime%] %channel% %level_name% > %message%\\n\\n\";\n $formatter = new LineFormatter($output, null, true);\n\n $stream = new StreamHandler('../debug/main.log');\n\n $stream->setFormatter($formatter);\n\n self::$logger['main'] = new \\Monolog\\Logger('Main');\n self::$logger['main']->pushHandler($stream);\n\n self::$logger['db'] = self::$logger['main']->withName('Database');\n self::$logger['auth'] = self::$logger['main']->withName('Auth');\n self::$logger['upload'] = self::$logger['main']->withName('Uploader');\n\n // self::$logger['exception']\n // = self::$logger['main']->withName('Unhandled');\n // ErrorHandler::register(self::$logger['exception']);\n }" ]
[ "0.6846003", "0.6786884", "0.6655856", "0.65006036", "0.6401487", "0.6283839", "0.62186724", "0.62067926", "0.6196551", "0.61863434", "0.6136199", "0.61125666", "0.6085583", "0.6059643", "0.5958108", "0.58831453", "0.5854818", "0.58254457", "0.58240366", "0.5823652", "0.58146244", "0.57743204", "0.5766347", "0.5734122", "0.5694738", "0.56867236", "0.5685073", "0.566214", "0.5646749", "0.56293714" ]
0.693072
0
Execute Job Fetch a job from the queue, and route it to the correct job handler.
public function executeJob() { // Fetch a job echo "_"; $job = $this->queue ->watch('testtube') ->ignore('default') ->reserve(); // Ensure we got a job. if ($job !== false) { // Extract job data. $jobData = json_decode($job->getData()); switch ($jobData->Name) { case 'Wait': $result = $this->wait($jobData->Time); break; default: // Job definition unknown. break; } if (isset($result) && $result === true) { // Job succeeded. Remove it. $this->queue->delete($job); } else { // Job Failed. Bury it. $this->queue->bury($job); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n\t{\n\t\t$this->dispatcher->dispatchNow($this->job);\n\t}", "public function handle()\n {\n $queue = 'fila_teste';\n $job = (new TestJob())->onQueue($queue);\n dispatch($job);\n }", "public function handle()\n {\n $job = (new SendRequestJob)\n ->onQueue('sender:request')\n ->delay(Carbon::now()->addSeconds(5));\n\n dispatch($job);\n }", "public function handle()\n {\n $data = Order::query()->where('status',1)->get();\n Log::notice('推送进队列的任务'.json_encode($data));\n ChangeOrderJob::dispatch($data);\n }", "public function handle()\n {\n Bus::chain([\n new SaveOrdersJob($this->parser('orders.json')),\n new SaveCustomersJob($this->parser('customers.json')),\n new SaveProductsJob($this->parser('products.json')),\n ])->dispatch();\n\n\n }", "public function handle()\n {\n (new RebateOrderRepository())->rebateOrderFromJob($this->id);\n }", "public function processed($job)\n {\n $this->client->queue($this->queueName)->processed($job);\n }", "public function handle()\n {\n // Serialize in case generateUniqueId() has been overridden and is non-scalar.\n $uniqueId = serialize($this->generateUniqueId());\n\n $this->cacheJob($uniqueId);\n\n (new \\ReflectionMethod($this->debounceable, 'dispatch'))\n ->invoke(null, $uniqueId, ...$this->jobArgs)\n ->delay(Carbon::now()->addSeconds($this->waitTime));\n }", "public function handle()\n {\n $orders = Order::whereIn(Order::FIELD_STATUS, [Order::STATUS_UNPAID, Order::STATUS_PENDING])->get();\n foreach ($orders as $order) {\n /**\n * @var Order $order\n */\n OrderHandleJob::dispatch($order->getAttribute(Order::FIELD_TRADE_NO));\n }\n $this->_out->writeln(\"orders count: \" . count($orders));\n }", "public function handle()\n {\n $headers = MailHeaderUpdate::where('disabled', 0)->orderby('last_header_update', 'asc')->limit(100)->get();\n if (!is_null($headers)) {\n foreach ($headers as $header) {\n $job = (new GetCharacterMailHeaders($header->character_id))\n ->delay(Carbon::now()->addSeconds(5));\n dispatch($job);\n }\n }\n }", "public function execute() {\n\t\tContext::get()->setSourceType( 'job-runner' );\n\t\t// Get some defaults from configuration\n\t\t$basePath = 'maintenance/job-runner/';\n\n\t\t$consumer = new JobQueueConsumer(\n\t\t\t$this->getOption( 'queue' ),\n\t\t\t$this->getOptionOrConfig( 'time-limit', $basePath . 'time-limit' ),\n\t\t\t$this->getOptionOrConfig( 'max-messages', $basePath . 'message-limit' )\n\t\t);\n\n\t\t$startTime = time();\n\t\t$messageCount = $consumer->dequeueMessages();\n\n\t\t$successCount = $consumer->getSuccessCount();\n\t\t$elapsedTime = time() - $startTime;\n\t\tLogger::info(\n\t\t\t\"Processed $messageCount ($successCount successful) jobs in $elapsedTime seconds.\"\n\t\t);\n\t}", "public function perform(JobHandler $job)\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\tEvent::trigger('afterFork', $job);\n\t\t\t$result = $job->perform();\n\t\t} catch (Exception $e) {\n\t\t\t$context = array('job' => $job, 'exception' => $e);\n\t\t\t$this->logger->log(LogLevel::CRITICAL, '{job} has failed {exception}', $context);\n\t\t\t$job->fail($e);\n\t\t\treturn;\n\t\t} catch (Error $e) {\n\t\t\t$context = array('job' => $job, 'exception' => $e);\n\t\t\t$this->logger->log(LogLevel::CRITICAL, '{job} has failed {exception}', $context);\n\t\t\t$job->fail($e);\n\t\t\treturn;\n\t\t}\n\n\t\t$job->updateStatus(Status::STATUS_COMPLETE, $result);\n\t\t$this->logger->log(LogLevel::NOTICE, '{job} has finished', array('job' => $job));\n\t}", "protected function dispatch($job)\n {\n return app(Dispatcher::class)->dispatch($job);\n }", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function handle()\n {\n $plan = get_current_plan();\n Log::info(__CLASS__, ['任务触发', $plan]);\n dispatch(new SendWxMsg([\n 'type' => 3,\n 'model'=> $plan\n ]));\n }", "public function handle()\n {\n //获取订阅的用户\n $list = User::where('is_sub',1)->get();\n if($list){\n foreach ($list as $key => $value) {\n $job = (new SendToFood($value));\n dispatch($job);//分发任务到队列\n }\n }\n \n \n }", "public function handle()\n {\n // find content that needs to be published and dispatch jobs\n $contents = \\App\\ScheduleContent::where('status', 'Scheduled')\n ->where('schedule_on', '<', Carbon::now())\n ->get();\n\n foreach ($contents as $content) {\n \\App\\Jobs\\ScheduleContent::dispatch($content);\n }\n\n }", "public function handle()\n {\n //One hour is added to compensate for PHP being one hour faster \n $now = date(\"Y-m-d H:i\", strtotime(Carbon::now()->addHour()));\n logger($now);\n\n $messages = Message::get();\n if($messages !== null){\n //Get all messages that their dispatch date is due\n $messages->where('date_string', $now)->each(function($message) {\n if($message->delivered == 'NO')\n {\n $users = User::all();\n foreach($users as $user) {\n dispatch(new SendMailJob(\n $user->email, \n new NewArrivals($user, $message))\n );\n }\n $message->delivered = 'YES';\n $message->save(); \n }\n });\n }\n }", "public function handle()\n {\n $options = $this->gatherProcessingOptions();\n\n $this->registerLogWriters($options->connectionName);\n $this->listenForEvents();\n\n $nameResolver = new NameResolver(\n $this->getEvent($options->connectionName),\n $options->service\n );\n\n $consumer = (new ConsumerFactory($this->context, $this->laravel[AmqpTopic::class]))\n ->make($nameResolver);\n\n $processor = new MessageProcessor(\n $this->events,\n $this->exceptions,\n new JobsFactory($this->laravel, $this->context, $consumer),\n $options\n );\n\n (new Worker($consumer, $processor, $this->exceptions))->work($options);\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function handle()\n {\n $job = new StartExportJob(1,20,'2016-01-01','2016-01-05');\n\n dispatch($job);\n $this->info(\"TestCommand complete\");\n }", "public function handle(): int\n {\n $this->info('Dispatching Starmap Download');\n\n $this->createDiskIfNotExists();\n\n $this->dispatcher->dispatch(new DownloadStarmapJob($this->option('force') === true));\n\n if ($this->option('import') === true) {\n $this->info('Starting Import');\n $this->dispatcher->dispatch(new ImportStarmap());\n }\n\n return 0;\n }", "public function handle()\n {\n try {\n $result = $this->messageSender->dispatchMessage([\n \"to\" => [\n [\n \"email\" => $this->option('to_email'),\n \"name\" => $this->option('to_name')\n ]\n ],\n \"subject\" => $this->option('subject'),\n \"content\" => [\n \"type\" => $this->option('type'),\n \"value\" => $this->option('body')\n ]\n ]);\n\n $this->info(sprintf(\n 'A Job with id %s got created to send the message',\n $result[\"id\"]\n ));\n } catch (\\Exception $e) {\n $this->error(sprintf('Something gone wrong: %s'. $e->getMessage()));\n }\n }", "public function handle()\r\n {\r\n $currentTime = time();\r\n $emailPlaybook = EmailPlaybook::where('msgscheduled', 'Activated')\r\n ->where('message_total_level', '>', 0)\r\n ->where('last_message_sent_at', '<=', $currentTime)\r\n ->get();\r\n if($emailPlaybook){\r\n foreach ($emailPlaybook as $key => $playbook) {\r\n // $this->queueEmailMsg($playbook);\r\n }\r\n }\r\n }", "public function handle()\n {\n $queue = $this->choice('Queue?', ['default', 'rabbitmq']);\n $connection = $this->choice('Connection?', ['redis', 'rabbitmq']);\n\n $payload = [\n 'test' => now()->toDateTimeString(),\n ];\n\n \\App\\Jobs\\TestJob::dispatch($payload, $queue)->onConnection($connection);\n }", "public function handle()\n {\n $users = DB::table('users')->select('amount_to_bill', 'mobile_number')->get();\n foreach ($users as $user) {\n BillUserJob::dispatch($user);\n }\n }", "public function handle()\n {\n $job = new ImportIntoEventsDB();\n\n $job->execute();\n\n\n echo 'completed job';\n echo PHP_EOL;\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $options = $this->options();\n\n ProductsDispatcher::dispatch($options)\n ->onConnection('redis')\n ->onQueue('products');\n }", "public function handle() {\n $lookback = $this->argument('lookback') ?: 5;\n $jobName = $this->getJobName($this->argument('type'));\n $delay = $this->option( 'delay' ) ?: null;\n\n $job = new DataProcessingJob($jobName, str_random(16), $lookback, $this->option('runtime-threshold'));\n\n $validDelayPresent = ( !is_null( $delay ) && is_numeric( $delay ) && $delay > 0 );\n if ( $validDelayPresent ) {\n $job->delay( $delay * 60 ); #convert to seconds\n }\n\n $this->dispatch($job);\n }", "public function fire($job, $data ) {\n\n if( $job->attempts() > 10 ){ //remove job after 10 tries\n return $job->delete();\n }\n\n if( !isset($data['endpoint']) || !isset($data['username']) || !isset($data['password']) || !isset($data['statement']) ){\n \\Log::error('Insufficient data passed to xapi statement job', $data);\n return $job->delete();\n }\n\n //Setup the endpoint and version\n $this->lrs->setEndpoint( $data['endpoint'] );\n $this->lrs->setVersion( \"1.0.1\" );\n\n //Set the auth details\n switch( $data['type'] ){\n default:\n case \"basic\":\n $this->lrs->setAuth( $data['username'], $data['password']);\n break;\n }\n\n $error_msg = 'XAPI error - failed sending statement';\n\n try {\n //Send the statement\n //This will attempt to push the statement a maximum of 3 times before deleting the job and creating an error\n $response = $this->lrs->saveStatement($data['statement']);\n if( $response->success ){\n //remove the job if succesfull\n return $job->delete();\n } else {\n $content = json_decode($response->content, true);\n if( isset($content['message']) && isset($content['message'][0]) ){\n $error_msg .= \" - \".$content['message'][0];\n }\n \\Log::error($error_msg, [\n 'content' => $content,\n 'data' => $data\n ]);\n return $job->release(10);\n }\n } catch (\\Exception $e) {\n $error_msg .= \" - \".$e->getMessage();\n \\Log::error($error_msg, [\n 'exception' => $e,\n 'data' => $data\n ]);\n return $job->release(10);\n }\n\n }" ]
[ "0.7066629", "0.6593937", "0.65892214", "0.6543415", "0.6393264", "0.62661105", "0.623233", "0.6220209", "0.61153495", "0.60868347", "0.60743356", "0.60598594", "0.605346", "0.6028326", "0.60160184", "0.6013495", "0.6002732", "0.59658456", "0.5926079", "0.5922979", "0.5892775", "0.5886121", "0.5880869", "0.5878373", "0.58748317", "0.5865392", "0.58614814", "0.5857824", "0.58461326", "0.58410734" ]
0.67726266
1
Gets users from Log
public function getUsersFromLog() { $select = parent::select()->from($this,array('username'=>'username')) ->distinct()->order(array("username asc")); $results = self::fetchAll($select)->toArray(); $res = array(); return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_users() {\n\t\t\t$users = wp_cache_get( 'mycred_users' );\n\n\t\t\tif ( false === $users ) {\n\t\t\t\t$users = array();\n\t\t\t\t$blog_users = get_users( array( 'orderby' => 'display_name' ) );\n\t\t\t\tforeach ( $blog_users as $user ) {\n\t\t\t\t\tif ( false === $this->core->exclude_user( $user->ID ) )\n\t\t\t\t\t\t$users[ $user->ID ] = $user->display_name;\n\t\t\t\t}\n\t\t\t\twp_cache_set( 'mycred_users', $users );\n\t\t\t}\n\n\t\t\treturn apply_filters( 'mycred_log_get_users', $users );\n\t\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function usersLogged(){\n $repository = $this->doctrine->getRepository('AppBundle:User');\n $users = $repository->getActive();\n \n return $users;\n }", "function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}", "function getUsers(){\n }", "function getUsers(){\n }", "public function user_logs(Request $request)\n { \n return DB::select('SELECT * FROM authentication_log WHERE authenticatable_id = '.$request->user()->id);\n }", "public function getLogOn() {\n $conn = $this->getConnection();\n $getQuery = \"SELECT * from logon group by username\";\n $q = $conn->prepare($getQuery);\n $q->execute();\n return $q->fetchAll();\n }", "public function listLog ( $options, $user_id ) { }", "public function getAll($user = \"\")\n {\n $log = $user == \"\" ? R::findAll('mcslogs') : R::findAll('mcslogs',' user = :user', array( ':user' => $user ));\n return $log;\n }", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getUserLog($user_id){\n $sql = 'SELECT * FROM `user_log` WHERE `user_id` = :user_id';\n $sth = $this->db->prepare($sql);\n $sth->execute([\n ':user_id' => $user_id,\n ]);\n\n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }", "private function getLoginInfos()\r\n\t\t{\t\r\n\t\t\t$request = \"SELECT * FROM `bpcms_users` WHERE Username='\".$this->logInfos['username'].\"'\";\r\n\t\t\t$request = mysql_query($request);\r\n\t\t\t$result = mysql_fetch_assoc($request);\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}", "function get_users()\n {\n //Unimplemented\n }", "public function get_users(){\n\tif(!$this->user) {\n\t Router::redirect('/');\n\t}else {\n\t $q = \"SELECT username, lastseen FROM users\";\n\t $lastseen = DB::instance(DB_NAME)->select_rows($q);\n\t echo json_encode($lastseen);\n\t}//end else \n }", "function get_logins() {\n if ( is_user_logged_in() ) {\n global $wpdb;\n $table_name_logs = $wpdb->prefix . 'heartbeattimelogger_logs';\n\n $user_id;\n // $_COOKIE[\"uid\"]\n if ( isset( $_POST[\"uid\"] ) ) {\n $user_id = $_POST[\"uid\"];\n } else {\n error_log('No uid presente en el $_POST');\n }\n\n // Obtener o crear el registro de tiempo del usuario si existe.\n $logins = $wpdb->get_results( \"SELECT userid, ip_add, datetime FROM $table_name_logs ORDER BY userid;\");\n\t \n wp_send_json_success( $logins );\n\n }\n }", "public function index_get()\n {\n return $this->lib_rest_users->getLoggedUser();\n }", "public function findUsers();", "public function findUsers();", "public function getLTIUsers();", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function getLoggedUsers() {\n\n\t\treturn BaseQuery::create(\"User\")\n\t\t\t->filterBySession(null, Criteria::ISNOTNULL)\n\t\t\t->find();\n\n\t}", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "public static function getUsers() {\n\t\t$res = self::$db->query(\"SELECT id, email, username, logins, last_login FROM `\".self::$users_tbl.\"` ORDER BY username\");\n\t\t$row = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $row;\n\t}", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function listar(){\n $user = \\Auth::user();\n $usuario = \\Auth::user()->rol;\n DB::select('call logs(\"'.$user->name.'\", \"Listar\", \"'.$usuario.'\")');\n if($user->rol != \"Administrador\"){\n $users = User::where('activo', '1')->paginate(5);\n }else if($user->rol == \"Administrador\"){\n $users = User::paginate(5);\n }\n return view('user.listar', [\n 'users' => $users\n ]);\n }" ]
[ "0.72054565", "0.6933988", "0.6933988", "0.6933988", "0.691851", "0.68692523", "0.6857383", "0.6857383", "0.6725469", "0.6721534", "0.66879785", "0.66812724", "0.6663052", "0.6641834", "0.6639234", "0.6625462", "0.66092324", "0.6559821", "0.65580195", "0.6521863", "0.6489833", "0.6489833", "0.6488068", "0.6470603", "0.64662164", "0.6465317", "0.6457477", "0.64567477", "0.64149487", "0.639439" ]
0.76628155
0
Retrieves logs by event id
public function recoverLogsbyEventId($eventid) { $select = parent::select()->where('idEvento =?',$eventid)->order('id asc'); $res = parent::fetchAll($select)->toArray(); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logs($id);", "public function get($id)\n {\n $log = R::load('mcslogs',$id);\n return $log;\n }", "public function get(string $id)\n {\n $ch = curl_init($this->url(\"/api/logs/{$id}\"));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers());\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return $this->processResult($status, $result);\n }", "function get_audit_trail_by_Id($log_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $log_id\n ));\n \n $output = $this->result('i', $parameter_array);\n $row = mysqli_fetch_assoc($output);\n \n return $row;\n }", "public function get_log($idlog) {\r\n\t\treturn $this->edb->selectWhere ( \"log\", array (\r\n\t\t\t\t'logID' => $idlog \r\n\t\t) );\r\n\t}", "public function retrieve_log($id)\n {\n $this->db->where('id', $id);\n $result = $this->db->get('login_log');\n return $result->row_array();\n }", "public function getLogs($id)\n {\n return Import::findOrFail($id)->importLogs()->get(['data', 'message'])->toArray();\n }", "public function retrieveEventLog($eventLogId)\n {\n return $this->start()->uri(\"/api/system/event-log\")\n ->urlSegment($eventLogId)\n ->get()\n ->go();\n }", "public function getLogIdFromEventId($event_id) {\n\t\t$event_id = intval($event_id);\n\t\t$res = $this->query(\"SELECT id FROM $this->table_log WHERE event_id=$event_id\");\n\t\tif ($res->num_rows == 0) return 0;\n\t\t$row = $res->fetch_assoc();\n\t\treturn intval($row['id']);\n\t}", "public function get_log_entry_by_id( $id ) {\n\t\t$post = get_post( $id );\n\n\t\treturn $this->wp_to_obj( $post );\n\t}", "public function get_logs( $action_id ) {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\n\t\t$records = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$wpdb->actionscheduler_logs} WHERE action_id=%d\", $action_id ) );\n\n\t\treturn array_map( [ $this, 'create_entry_from_db_record' ], $records );\n\t}", "public function getFromDb($id) {\n\t\t$db = $this->connection();\n\n\t\t$sql = \"SELECT * FROM \" . SCRAPE_LOG_TABLE . \" WHERE \" . ID_COLUMN . \" = ?\";\n\t\t$params = array($id);\n\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute($params);\n\n\t\t$result = $query->fetch();\n\n\t\tif ($result) {\n\t\t\t$scrapeLog = new \\model\\ScrapeLog($result[ID_COLUMN], $result[SCRAPE_LOG_TABLE_NAME_COLUMN], $result[SCRAPE_LOG_NEW_RECORDS_COLUMN], \n\t\t\t$result[SCRAPE_LOG_STARTED_AT_COLUMN], $result[SCRAPE_LOG_FINISHED_AT_COLUMN]);\n\t\t\treturn $scrapeLog;\n\t\t}\n\n\t\treturn null;\n\t}", "public function getLogById($id)\n {\n $log = $this->createQueryBuilder()\n ->select('l.*')\n ->from($this->tableName, 'l')\n ->where('l.id = :id')\n ->setParameter(':id', $id)\n ->execute()\n ->fetch();\n\n if (false !== $log) {\n return new Log($log);\n }\n }", "public function getEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n $event = $this->model->getEvent($id);\n\n $this->send(200, $event);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('OjsUserBundle:EventLog')->find($id);\n\n if (!$entity)\n throw $this->createNotFoundException('notFound');\n\n $token = $this\n ->get('security.csrf.token_manager')\n ->refreshToken('ojs_admin_event_log'.$entity->getId());\n\n return $this->render(\n 'OjsAdminBundle:AdminEventLog:show.html.twig',\n ['entity' => $entity, 'token' => $token]\n );\n }", "public function getEventById($id){\n $this->db->query('SELECT * FROM events WHERE id = :id');\n $this->db->bind(':id', $id);\n\n $row = $this->db->single();\n return $row;\n }", "public function event( $id ) {\n\t\treturn $this->client->getEvent( [ 'id' => $id ] );\n\t}", "public function getlog($idEvento)\n {\n try{\n $select = parent::select()->where('idEvento =?',$idEvento)->order('id asc');\n $res = parent::fetchAll($select)->toArray();\n $result = array();\n \n\t\t\t foreach($res as $r){\n if (self::isJSON($r['msj'])) // Si el mensaje es json\n\t\t\t\t {\n $msg = json_decode($r['msj']);\n \tif(isset($msg->type))\n \t{\n \t\tif($msg->type) \n {\n\t\t\t\t\t\t if($msg->type == \"comment\")\n $result[] =$r['username'].\": \".$r['fecha'].\" - \".$msg->result;\n else{\n\t\t\t\t\t\t$result[] = $r['fecha'].\" - \".$msg->result;}\n\t\t\t\t\t}\t\n \t}\n\t\t\t\t \n \n }\n\t\t\t\t else // Si el mensaje no es json\n\t\t\t\t {\n\t\t\t\t\t $result[] = $r['fecha'].\" - \".$r['msj'];\n\t\t\t\t }\n\t\t\t\t \n }\n //file_put_contents ( \"LOG.txt\" , json_encode($result),FILE_APPEND);\n return $result;\n }catch(Zend_Exception $e){\n return array('fail'=>array($e->getCode()=>$e->getMessage()));\n }\n }", "public function getOne($id){\n $repo = $this->om->getRepository(Event::class);\n return $repo->find($id);\n }", "private function get($event_id)\n {\n $query = sprintf(\"SELECT * FROM petermeter_events WHERE id= '%s';\", $event_id);\n $resultaat = mysql_query($query);\n $this->vulop($resultaat);\n }", "public static function listerLogsParAction($idAction){\n\t\n\t\t$action = Action::getActionById($idAction);\n\t\t\n\t\tif($action == null){\n\t\t\treturn;\n\t\t}\n\t\t$logs = Log::getLogsParCodeAction($action);\n\t\n\t\t$listeLogs = FctLog::creerTableauLogPourJson($logs);\n\t\n\t\treturn $listeLogs;\n\t}", "public static function get($id = null) {\n\n if(!isset($id))\n return Model\\Event::all();\n else\n return Model\\Event::where('event_id', '=', $id)->get()->first();\n\n }", "public function show($id)\n {\n return $this->eventService->getEvent($id);\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "public function getEvents($id)\n {\n return [];\n }", "public function indexLog($id)\n\t{\n\t\t// Mostrar el log seleccioando\n\t\t$logs = \\App\\Models\\LogAplicaciones::find($id);\n\n\t\treturn response()->json($logs);\n\t}", "public function showLogs($idApp)\n\t{\n\t\t$aplicacion = \\App\\Models\\Aplicacion::find($idApp);\n\t\t$aplicacion::with('logs')->get();\n\t\t$ly_datos = array();\n\n\t\tif ($aplicacion->logs != null){\n\t\t\t$str_retorno = '[';\n\n\n\t\t\t$ly_logs = $aplicacion->logs->toArray();\n\n\t\t\t\n\t\t\tforeach ($ly_logs as $log){\n\t\t\t\t$obj_log = \\App\\Models\\LogAplicaciones::find($log['Id']);\n\t\t\t\tarray_push($ly_datos, $obj_log);\n\t\t\t}\n\t\t\treturn response()->json([\n\t\t\t\t\"logs\" => $ly_datos\n\t\t\t]);\n\n\t\t}else{\n\t\t\treturn response()->json([\n\t\t\t\t\"msg\" => \"No se encontraron logs\"\n\t\t\t]\n\t\t\t);\n\t\t}\n\t\t\n\t}", "function get_by_id($id){\n $id = (int)$id; //this is typecasting - if on the off chance a string got in here instead of a number, it will force it to be a number (SQL injection prevention), stored in $id\n $sql = \"SELECT * FROM runlogs WHERE id = '$id'\"; //change from users to projects for this case if copied from users\n\n $runlog = $this->select($sql)[0]; //sql only brings back one from database, so we need to put a number\n\n return $runlog; //brings it back\n }", "public function getLogs()\n\t{\n $start = $_GET['_start'] ?: 0;\n $limit = $_GET['_limit'] ?: $this->defaults['logs_per_page'];\n $logger = new Logger($this->module);\n $response = $logger->getList($start, $limit);\n $this->printJSON($response);\n }", "public function index($id)\n {\n $logs = WorkLog::where('recruit_id', $id)->orderBy('entry_datetime', 'DESC')->get();\n return $this->sendResponse($logs->toArray(), 'Work logs retrieved successfully.');\n }" ]
[ "0.7322623", "0.70409906", "0.68879616", "0.6855762", "0.68266594", "0.68149966", "0.6746951", "0.6599362", "0.64486474", "0.6395067", "0.6380585", "0.6326018", "0.62807786", "0.6181381", "0.61398286", "0.6132706", "0.61318535", "0.6114356", "0.60991955", "0.60923445", "0.60865957", "0.60472625", "0.6046672", "0.6031664", "0.60167557", "0.6008846", "0.59953904", "0.5988113", "0.5986324", "0.5967155" ]
0.7130078
1
Add new IP. return Location
public static function add($ip) { //SELECT * FROM `ip2location_db11` WHERE INET_ATON('116.109.245.204') <= ip_to LIMIT 1 $location = self::where('ip_address', '=', $ip)->first(); if (!is_object($location)) { $location = new self(); } $location->ip_address = $ip; // Get info try { if (!(strpos($ip, ":") > -1)) { // Code for IPv4 address $ip_address... $location_table = table('ip2location_db11'); } else { // Code for IPv6 address $ip_address...ip2location_db11_ipv6 $location_table = table('ip2location_db11_ipv6'); } $location_tables = \DB::select('SHOW TABLES LIKE "'.$location_table.'"'); // Local service if (count($location_tables)) { // Check for ipv4 or ipv6 if (!(strpos($ip, ":") > -1)) { $aton = $ip; $records = \DB::select("SELECT * FROM `".$location_table."` WHERE INET_ATON(?) <= ip_to LIMIT 1", [$aton]); } else { $aton = Dot2LongIPv6($ip); $records = \DB::select("SELECT * FROM `".$location_table."` WHERE ? <= ip_to LIMIT 1", [$aton]); } if (count($records)) { $record = $records[0]; $location->country_code = $record->country_code; $location->country_name = $record->country_name; $location->region_name = $record->region_name; $location->city = $record->city_name; $location->zipcode = $record->zip_code; $location->latitude = $record->latitude; $location->longitude = $record->longitude; } else { throw new \Exception("IP address [$ip] can not be found in local database: "); } // Remote service } else { $result = file_get_contents('http://freegeoip.net/json/'.$ip); $values = json_decode($result, true); $location->fill($values); } } catch (\Exception $e) { echo $e->getMessage(); // Note log LaravelLog::warning('Cannot get IP location info: ' . $e->getMessage()); } $location->save(); return $location; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function locate($ip);", "abstract public function getIpLocation($ip);", "public function add($param)\n {\n $sentence = new SentenceUtil();\n $sentence->addCommand(\"/ip/address/add\");\n foreach ($param as $name => $value) {\n $sentence->setAttribute($name, $value);\n }\n $this->talker->send($sentence);\n return \"Sucsess\";\n }", "public static function ip2Address($ip){\n\n //Could we return from recently fetched ones?\n if(array_key_exists($ip,self::$RECENT_IP2ADDRESSES)){\n return self::$RECENT_IP2ADDRESSES[$ip];\n }\n\n \n //$ip_database_path=//self::basePath().'/database/geoip2';\n \n $city_database=base_path().'/'.ltrim(config('laradmin.geoip.db_city_filename','\\\\/'));//$ip_database_path.'/GeoLite2-City.mmdb';\n //$country_database=$ip_database_path.'/GeoLite2-Country.mmdb';\n\n // This creates the Reader object, which should be reused across\n // lookups.\n $reader = new \\GeoIp2\\Database\\Reader($city_database);\n\n // Replace \"city\" with the appropriate method for your database, e.g.,\n // \"country\".\n\n $record = $reader->city($ip);\n $address=[];\n\n $address['latitude']=$record->location->latitude;\n $address['longitude']=$record->location->longitude;\n $address['city_name']=$record->city->name; \n $address['country_name']=$record->country->name;\n //$address['country_iso_code']=$record->country->isoCode; NOTE: OPEN THIS IF NEEDED\n\n\n // Save some recent address: TODO: Change this to proper catching so that it can be used across sessions.\n self::$RECENT_IP2ADDRESSES[$ip]=$address;\n if(count(self::$RECENT_IP2ADDRESSES)>3){\n array_shift(self::$RECENT_IP2ADDRESSES);\n }\n\n return $address;\n \n }", "protected function ip_address()\n\t{\n\t\t//return $this->ip2int(ipaddress::get());\n\t\t//return $this->ip2int(server('REMOTE_ADDR'));\n\t\treturn server('REMOTE_ADDR');\n\t}", "public function addIp($data) {\n\n $this->db->query('INSERT INTO Ip (Ip, Atempts) VALUES (:ip, :atempts)');\n\n //Bind values \n $this->db->bind(':ip', $data['ip']);\n $this->db->bind(':atempts', $data['atempts']);\n\n //Execute\n if ($this->db->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function addNameserverIp(string $ip): bool {}", "public function addAddress()\n\t{\n\t\treturn $this->editAddress();\n\t}", "function addARecord( $ip ) {\n\t\tglobal $wgAuth;\n\n\t\t$arecords = array();\n\t\tif ( isset( $this->hostInfo[0]['arecord'] ) ) {\n\t\t\t$arecords = $this->hostInfo[0]['arecord'];\n\t\t\tarray_shift( $arecords );\n\t\t}\n\t\t$arecords[] = $ip;\n\t\t$values = array();\n\t\t$values['arecord'] = $arecords;\n\t\t$success = LdapAuthenticationPlugin::ldap_modify( $wgAuth->ldapconn, $this->hostDN, $values );\n\t\tif ( $success ) {\n\t\t\t$wgAuth->printDebug( \"Successfully added $ip to $this->hostDN\", NONSENSITIVE );\n\t\t\t$this->domain->updateSOA();\n\t\t\t$this->fetchHostInfo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to add $ip to $this->hostDN\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}", "private function logIpAddress($address){\r\n\t\t\t$escaped = mysql_real_escape_string($address);\r\n\t\t\t$sql \t= \"insert ignore into usage_ip_log (`ip_address`) values (\\\"$escaped\\\");\";\r\n\t\t\t$res \t= $this->query_runner->runQuery($sql);\r\n\t\t\t$id \t= mysql_insert_id($this->connection->getDbLink());\r\n\t\t\tif($id == 0){\r\n\t\t\t\t$id = $this->lookupIpAddress($address);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $id;\r\n\t\t}", "public function addLocation(string $location);", "public function add_user($ip){\n\t\t$query = \"INSERT INTO nodes(\n user_ip,\n\t\t\tuser_join_time) \n\t\t\tVALUES(?, NOW()) \n ON DUPLICATE KEY UPDATE user_ip = ?, user_join_time = NOW();\n\t\t\";\n\t\t\t\n\t\t$stmt = $this->prepare_statement($query);\n if(!$stmt)\n return NULL;\n\t\t$bind = $stmt->bind_param(\"ss\", $ip, $ip);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\t\t\t\n\t\treturn $stmt->insert_id;\n\t}", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }", "public function run()\n {\n IpLocation::factory(3)->create();\n }", "public function setIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->ip = $var;\n\n return $this;\n }", "private function _addIpToStorage($ip)\n {\n if(isset($this->_ipStorage[$ip]))\n {\n $this->_ipStorage[$ip]++;\n }\n else\n {\n $this->_ipStorage[$ip] = 1;\n } \n }", "public function Persona (){ \n\n $this->ip=$this->getIP();\n }", "protected function validateAndAddIp(string $ip): void\n {\n $ip = trim($ip);\n\n if (empty($ip)) {\n return;\n }\n\n // Split IP and subnet if needed\n if (strpos($ip, '/') !== false) {\n [$ip, $subnet] = explode('/', $ip, 2);\n } else {\n $subnet = false;\n }\n\n // If IPv6, subnet 128 can be omitted\n if ($subnet === '128' && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $subnet = false;\n }\n\n // If IPv4, subnet 32 can be omitted\n if ($subnet === '32' && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $subnet = false;\n }\n\n // Compress and validate IP-address\n $ipBin = inet_pton($ip);\n\n if ($ipBin === false) {\n $this->logWarn(\"Invalid IP address: '{$ip}'\");\n\n return;\n }\n\n $ip = inet_ntop($ipBin);\n\n if ($ip === false) {\n $this->logWarn(\"Invalid IP address: '{$ip}'\");\n\n return;\n }\n\n // Add back subnet to the IP\n $ip .= ($subnet !== false ? '/' . $subnet : '');\n\n $this->list[] = $ip;\n }", "public function setIpAddress($ip_address);", "public function _before_index(){\n// $ip = get_client_ip();\n// $res = $ip_class->getlocation('113.102.162.102');\n// print_r($res);\n \n \n }", "public function ObtenerIp()\n { \n\n return str_replace(\".\",\"\",$this->getIP()); //Funcion que quita los puntos de la IP\n\n }", "public function addwhitelistip() \n\t{\n\t\tUserModel::authentication();\n\t\t\n\t\tSecurityModel::add_ip_whitelist();\n }", "public function add_ip_binding($param){\n $input = array(\n 'command' => '/ip/hotspot/ip-binding/add'\n );\n $out = array_merge($input, $param);\n return $this->query($out);\n }", "public function getIp() : IpAddress\n {\n return new IpAddress('0.0.0.0');\n }", "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "function phpTrafficA_addUniqueIP($table, $connection, $ip, $datefirst, $datelast) {\n$long = ip2long($ip);\n$sql3 = \"UPDATE ${table}_iplist SET count=count+1,last='$datelast' WHERE ip=$long\";\n$res3 = mysql_query($sql3);\nif (mysql_affected_rows() < 1) {\n\t$req4 =\"INSERT INTO ${table}_iplist SET ip=$long, first='$datefirst', last='$datelast', count='1'\";\n\t$res4 = mysql_query($req4);\n}\nreturn 1;\n}", "public function addNumeroIP( $numero ) {\n $this->setNumeroIP($this->numero_ip.$numero);\n }", "public function getIpAddress();", "public function ipAddress(){\n return $this->getServerVar('REMOTE_ADDR');\n }" ]
[ "0.66183376", "0.6586684", "0.613517", "0.60299194", "0.58661515", "0.58242047", "0.57887936", "0.57871616", "0.5775166", "0.5760948", "0.5745111", "0.5744345", "0.5729159", "0.5713666", "0.5710293", "0.5704768", "0.5695915", "0.56580955", "0.5656616", "0.5645171", "0.56242776", "0.5614054", "0.55891716", "0.5588279", "0.55756617", "0.5574358", "0.5562106", "0.5559336", "0.55477655", "0.55190635" ]
0.70226157
0
List a single member
protected function listSingleMember($id) { parent::listSingleMember($id); $objMember = $this->Database->prepare("SELECT * FROM tl_member WHERE id=?") ->limit(1) ->execute($id); if ($this->show_member_name) { global $objPage; $objPage->pageTitle = trim(htmlspecialchars($objMember->firstname . " " . $objMember->lastname)); } $this->Template->membergroups = deserialize($objMember->groups, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "public function show(Members $member)\n {\n return $member;\n }", "public function testListMembers()\n {\n }", "public function listMembers() {\n\t\t/*\n\t\t\tActions should be added to the array like so:\n\t\t\t\t[actions] =>\n\t\t\t\t\t\t[n]\n\t\t\t\t\t\t\t[title] => action title\n\t\t\t\t\t\t\t[controller] => action controller\n\t\t\t\t\t\t\t[action] => action name\n\t\t\t\t\t\t\t[params] => array of params\n\t\t*/\n\t\t$this->__paginateMemberList($this->Member->getMemberSummaryAll(true));\n\t}", "function getMembers(){\n\t\treturn $this->members;\n\t}", "public function show(Member $member)\n {\n return $member;\n }", "public function members_list() {\n\t\tif (!in_array($this->type, $this->membership_types)) {\n\t\t\tredirect(base_url('members/list/active'));\n\t\t}\n\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\t\t$data['user_mode'] = $this->session->userdata('mode');\n\t\t$data['members'] = $this->get_members($this->type);\n\t\t$data['api_ver_url'] = FINGERPRINT_API_URL . \"?action=verification&member_id=\";\n\t\t$data['total_count'] = count($this->get_members($this->type));\n\n\t\t$this->breadcrumbs->set([ucfirst($data['type']) => 'members/list/' . $data['type']]);\n\n\t\tif ($this->type === 'guest') {\n\t\t\t$data['guests'] = $this->get_guests();\n\t\t}\n\n\t\t$this->render('list', $data);\n\t}", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function get_members()\n\t{\n\t\treturn $this->members;\n\t}", "public function getMember()\n {\n return $this->member;\n }", "public function memberList($eid = 1) {\n $config = $this->config('simple_conreg.settings.'.$eid);\n $countryOptions = SimpleConregOptions::memberCountries($eid, $config);\n $types = SimpleConregOptions::badgeTypes($eid, $config);\n $digits = $config->get('member_no_digits');\n\n switch(isset($_GET['sort']) ? $_GET['sort'] : '') {\n case 'desc':\n $direction = 'DESC';\n break;\n default:\n $direction = 'ASC';\n break;\n }\n switch(isset($_GET['order']) ? $_GET['order'] : '') {\n case 'Name':\n $order = 'name';\n break;\n case 'Country':\n $order = 'country';\n break;\n case 'Type':\n $order = 'badge_type';\n break;\n default:\n $order = 'member_no';\n break;\n }\n\n $content = array();\n\n //$content['#markup'] = $this->t('Unpaid Members');\n\n $content['message'] = array(\n '#cache' => ['tags' => ['simple-conreg-member-list'], '#max-age' => 600],\n '#markup' => $this->t('Members\\' public details are listed below.'),\n );\n\n $rows = [];\n $headers = [\n 'member_no' => ['data' => t('Member No'), 'field' => 'm.member_no', 'sort' => 'asc'],\n 'member_name' => ['data' => t('Name'), 'field' => 'name'],\n 'badge_type' => ['data' => t('Type'), 'field' => 'm.badge_type', 'class' => [RESPONSIVE_PRIORITY_LOW]],\n 'member_country' => ['data' => t('Country'), 'field' => 'm.country', 'class' => [RESPONSIVE_PRIORITY_MEDIUM]],\n ];\n $total = 0;\n\n foreach ($entries = SimpleConregStorage::adminPublicListLoad($eid) as $entry) {\n // Sanitize each entry.\n $badge_type = trim($entry['badge_type']);\n $member_no = sprintf(\"%0\".$digits.\"d\", $entry['member_no']);\n $member = ['member_no' => $badge_type . $member_no];\n switch ($entry['display']) {\n case 'F':\n $fullname = trim(trim($entry['first_name']) . ' ' . trim($entry['last_name']));\n if ($fullname != trim($entry['badge_name']))\n $fullname .= ' (' . trim($entry['badge_name']) . ')';\n $member['name'] = $fullname;\n break;\n case 'B':\n $member['name'] = trim($entry['badge_name']);\n break;\n case 'N':\n $member['name'] = t('Name withheld');\n break;\n }\n $member['badge_type'] = trim(isset($types[$badge_type]) ? $types[$badge_type] : $badge_type);\n $member['country'] = trim(isset($countryOptions[$entry['country']]) ? $countryOptions[$entry['country']] : $entry['country']);\n\n // Set key to field to be sorted by.\n if ($order == 'member_no')\n $key = $member_no;\n else\n $key = $member[$order] . $member_no; // Append member number to ensure uniqueness.\n if (!empty($entry['display']) && $entry['display'] != 'N' && !empty($entry['country'])) {\n $rows[$key] = $member;\n }\n $total++;\n }\n\n // Sort array by key.\n if ($direction == 'DESC')\n krsort($rows);\n else\n ksort($rows);\n\n $content['table'] = array(\n '#type' => 'table',\n '#header' => $headers,\n //'#footer' => array(t(\"Total\")),\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n\n $content['summary_heading'] = [\n '#markup' => $this->t('Country Breakdown'),\n '#prefix' => '<h2>',\n '#suffix' => '</h2>',\n ];\n\n $rows = array();\n $headers = array(\n t('Country'),\n t('Number of members'),\n );\n $total = 0;\n foreach ($entries = SimpleConregStorage::adminMemberCountrySummaryLoad($eid) as $entry) {\n if (!empty($entry['country'])) {\n // Sanitize each entry.\n $entry['country'] = trim($countryOptions[$entry['country']]);\n $rows[] = $entry;\n $total += $entry['num'];\n }\n }\n //Add a row for the total.\n $rows[] = array(t(\"Total\"), $total);\n $content['summary'] = array(\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n // Don't cache this page.\n //$content['#cache']['max-age'] = 0;\n\n return $content;\n }", "public function getMemberList()\n {\n $memberList = '';\n foreach($this->Residents as $resident) {\n $memberList .= (string)$resident->get('Rooms') . ', ';\n //$memberList .= (string)$resident . ', ';\n }\n $memberList = substr($memberList, 0,-2);\n\n return $memberList;\n }", "public function getMembers() {\n return $this->parseData($this->sql['mem']);\n }", "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "function listMemberStatus() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\n\t\t// only show orders if user has access\n\t\tif($page->validatePath(\"/janitor/admin/user/members/list\")) {\n\n\t\t\tinclude_once(\"classes/users/superuser.class.php\");\n\t\t\t$model = new SuperUser();\n\t\t\t$IC = new Items();\n\n\t\t\t$memberships = $IC->getItems(array(\"itemtype\" => \"membership\", \"status\" => 1, \"extend\" => true));\n\n\t\t\t$_ .= '<div class=\"members\">';\n\t\t\t$_ .= '<h2>Member status</h2>';\n\n\t\t\tif($memberships) {\n\t\t\t$_ .= '<ul class=\"members\">';\n\t\t\t\tforeach($memberships as $membership) {\n\t\t\t\n\t\t\t\t\t$_ .= '<li class=\"'.superNormalize($membership[\"name\"]).'\">';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '<a href=\"/janitor/admin/user/members/list/'.$membership[\"id\"].'\">'.$membership[\"name\"].'</a> ';\n\t\t\t\t\t$_ .= '<span class=\"count\">'.$model->getMemberCount(array(\"item_id\" => $membership[\"id\"])).'</span>';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\n\t\t}\n\n\t\treturn $_;\n\t}", "public function showMembers() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get all of the members from the db.\n $included_members = $memberModel->getAll();\n $data = array(\"included_members\" => $included_members);\n return $this->render(\"listMembers\", $data);\n }", "public function getMemberList() {\n\t\tif ( !is_object($this->memberList) ) {\n\t\t\t$this->memberList = t3lib_div::makeInstance('tx_passwordmgr_model_groupMemberList');\n\t\t\t$this->memberList->init($this['uid']);\n\t\t}\n\t\treturn($this->memberList);\n\t}", "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "public function compactList(){\n $output = array();\n $members = $this->members;\n foreach ($members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'num_boats' => count($value['boats'])\n );\n array_push($output, $member);\n }\n return $output;\n }", "public function members()\n\t{\n\t\treturn $this->members;\n\t}", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function verboseList(){\n $output = array();\n foreach ($this->members as $value) {\n }\n foreach ($this->members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'firstName' => $value['firstName'],\n 'lastName' => $value['lastName'],\n 'birthNumber' => $value['birthNumber'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'boats' => $value['boats']\n );\n array_push($output, $member);\n }\n return $output;\n }", "public function __get( $member ){\n\n return $this->find($member);\n\n }", "public function index()\n {\n return MembersResource::collection(Member::latest()->get());\n }", "public function getMember(): MemberInterface;", "public function list();", "public function list();" ]
[ "0.68089825", "0.663058", "0.6592705", "0.6573975", "0.6494073", "0.6411961", "0.6405116", "0.6318606", "0.6318606", "0.6318606", "0.62821597", "0.6200862", "0.61569846", "0.6152546", "0.6113011", "0.61033684", "0.60949504", "0.6083615", "0.60793775", "0.60156137", "0.60078007", "0.60003525", "0.5998732", "0.59957534", "0.59800005", "0.59638834", "0.59251904", "0.59081817", "0.5865953", "0.5865953" ]
0.67103815
1
clear all templates that have been loaded this is needed in a few places (e.g. setup_fatal_error_context) when we have to discard all previously loaded templates.
public static function resetTemplates() { self::$_template_names = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearTemplateCache()\n {\n $this->loadedTemplates = array();\n }", "public function deleteCompiledTemplates() {\n\t\t// templates\n\t\t$filenames = glob(WCF_DIR.'templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t\t\n\t\t// acp templates\n\t\t$filenames = glob(WCF_DIR.'acp/templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t}", "public static function cleanTemplatesCache()\r\n {\r\n $path = APP_VAR_DIR.'/_compiled/site/*';\r\n exec('rm -rf '.$path);\r\n return true;\r\n }", "public function clearCache() {\n\t\tif (isset($this->twig) && $this->twig instanceof \\Twig_Environment) {\n\t\t\t$cacheDir = $this->twig->getCache(true);\n\n\t\t\tif (isset($cacheDir) && \\is_string($cacheDir)) {\n\t\t\t\t$cacheFiles = new \\RecursiveIteratorIterator(\n\t\t\t\t\tnew \\RecursiveDirectoryIterator($cacheDir),\n\t\t\t\t\t\\RecursiveIteratorIterator::LEAVES_ONLY\n\t\t\t\t);\n\n\t\t\t\tforeach ($cacheFiles as $cacheFile) {\n\t\t\t\t\tif ($cacheFile->isFile()) {\n\t\t\t\t\t\t$filename = $cacheFile->getFilename();\n\n\t\t\t\t\t\tif (!empty($filename) && $filename[0] !== '.') {\n\t\t\t\t\t\t\t@\\unlink($cacheFile->getRealPath());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new TemplateManagerSetupError();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new TemplateManagerSetupError();\n\t\t}\n\t}", "public function delTemplateData() {\r\n\t\t$this->templateData = [];\r\n\t}", "protected function uninstall_templates()\n {\n // initialize the Finder\n $finder = new Finder();\n // we need only the top level\n $finder->depth('== 0');\n // get all directories in the /Examples\n $finder->directories()->in(MANUFAKTUR_PATH.'/TemplateTools/Examples');\n \n foreach ($finder as $directory) {\n $template_name = $directory->getFilename();\n $target_directory = CMS_PATH.'/templates/'.$template_name;\n \n if ($this->app['filesystem']->exists($target_directory)) {\n // the template exists - remove it\n $this->app['filesystem']->remove($target_directory);\n }\n \n $this->app['db']->delete(CMS_TABLE_PREFIX.'addons', \n array('type' => 'template', 'directory' => $template_name));\n }\n }", "public function removeAllTemplateFiles()\n {\n $config = $this->getAlertingConfigs();\n $config['template_files'] = null;\n\n $this->op->request('POST', '/api/prom/configs/alertmanager', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ],\n 'json' => $config,\n ]);\n }", "public function clear_header_cache() {\n\t\t$wpuCache = WPU_Cache::getInstance();\n\t\t$wpuCache->template_purge();\n\t}", "public function clearCachedDefinitions();", "function _ut_remove_default_vc_templates( $data ) {\r\n \r\n $data = array();\r\n \r\n return $data;\r\n \r\n}", "public function reset() : void\n {\n $this->getFilesystemLoader()->reset();\n }", "public function clearRtfPlugins()\n {\n $this->collRtfPlugins = null; // important to set this to NULL since that means it is uninitialized\n }", "public static function clear()\n {\n self::$context = new Context();\n self::$macros = array();\n self::$citationItem = false;\n self::$context = new Context();\n self::$rendered = new Rendered();\n self::$bibliography = null;\n self::$citation = null;\n\n self::setLocale(Factory::locale());\n self::$locale->readFile();\n }", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "protected function clearFiles()\n {\n $dir = __DIR__ . '/../lang/i18n';\n FileSystem::clearDirectory($dir);\n }", "final public function clearViewsCache() {\n\t\t$this->allViews = null;\n\t}", "public function __destruct()\n {\n\t\t\n $data = $this->data;\n\t\t\n\t\t foreach ($this->template as $key => $value) {\n try {\n include_once($value);\n } catch (Exception $e) {\n include_once($this->error['404']);\n }\n }\n\n $this->renderFooter();\n\n }", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "function destroy()\n\t{\n\t\t$this->_tpldata = array('.' => array(0 => array()));\n\t\t$this->vars = &$this->_tpldata['.'][0];\n\t\t$this->xs_started = 0;\n\t}", "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}", "function unset_template()\r\n\t{\r\n\t\t$this->_template = null;\r\n\t\t$this->set_mode(self::OUTPUT_MODE_NORMAL);\r\n\t}", "public function clearAllPlugins()\n {\n $this->collAllPlugins = null; // important to set this to NULL since that means it is uninitialized\n }", "public function reset()\n\t{\n\t\t$this->hasScripts = false;\n\t\t$this->cssFiles = array();\n\t\t$this->css = array();\n\t\t$this->scriptFiles = array();\n\t\t$this->scripts = array();\n\t\t$this->metaTags = array();\n\n\t\t$this->recordCachingAction('clientScript', 'reset', array());\n\t}", "public function flushAll($which = null)\n {\n $this->view->getSmarty()->clearAllCache();\n }", "private function initializeTemplateMessages()\n {\n if (is_null($this->templateErrors)) {\n $this->templateErrors = array();\n }\n\n if (is_null($this->templateWarnings)) {\n $this->templateWarnings = array();\n }\n\n if (is_null($this->templateConfirms)) {\n $this->templateConfirms = array();\n }\n\n if (is_null($this->templateErrors)) {\n $this->templateInfos = array();\n }\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "function tearDownOnce() {\n\t\tparent::tearDownOnce();\n\n\t\t$this->delete_directory(Director::baseFolder() . \"/assets/dynamic_templates/tmp__TemplateNoManifest\");\n\t\t$this->delete_directory(Director::baseFolder() . \"/assets/dynamic_templates/tmp__TemplateWithManifest\");\n\t}", "public function cleanContrexxCaching()\n {\n $this->_deleteAllFiles();\n }", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "public static function _uninstallAllOfModuleTemplates(&$module, $tplset, &$log)\n {\n //\n // The following processing depends on the structure of Legacy_RenderSystem.\n //\n $tplHandler =& xoops_gethandler('tplfile');\n $delTemplates = null;\n\n $delTemplates =& $tplHandler->find($tplset, 'module', $module->get('mid'));\n\n if (is_array($delTemplates) && count($delTemplates) > 0) {\n //\n // clear cache\n //\n $xoopsTpl = new XoopsTpl();\n $xoopsTpl->clear_cache(null, 'mod_' . $module->get('dirname'));\n\n foreach ($delTemplates as $tpl) {\n if (!$tplHandler->delete($tpl)) {\n $log->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_TEMPLATE_UNINSTALLED, $tpl->get('tpl_file')));\n }\n }\n }\n }" ]
[ "0.82534856", "0.7129658", "0.69437295", "0.6841781", "0.6561434", "0.6556717", "0.6516829", "0.6433131", "0.63522834", "0.6308994", "0.6300324", "0.6245947", "0.6244525", "0.62025714", "0.62013847", "0.61953324", "0.61668104", "0.6163034", "0.6147954", "0.6133729", "0.61288947", "0.611813", "0.6106571", "0.6098946", "0.60600096", "0.6040641", "0.6035281", "0.60341686", "0.6030962", "0.6025692" ]
0.77750427
1
output all enqued footer scripts. used as custom template function
public function footer_scripts() { global $context, $settings; if(!empty($context['theme_scripts'])) { foreach($context['theme_scripts'] as $type => $script) { echo ' <script type="text/javascript" src="',($script['default'] ? $settings['default_theme_url'] : $settings['theme_url']) . '/' . $script['name'] . $context['jsver'], '"></script>'; } } if(!empty($context['inline_footer_script'])) echo ' <script type="text/javascript"> <!-- // --><![CDATA[ ',$context['inline_footer_script'],' '; echo ' // ]]> </script> '; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function print_footer_scripts()\n {\n }", "public function print_footer_scripts()\n {\n }", "public function footer_scripts() {\n\n\t\tif ( ! empty( $this->element_footer_scripts ) ) {\n\t\t\techo \"<script type=\\\"text/javascript\\\">\\r\\n\";\n\t\t\tforeach ( $this->element_footer_scripts as $script ) {\n\t\t\t\techo $script . \"\\r\\n\";\n\t\t\t}\n\t\t\techo \"</script>\\r\\n\";\n\t\t}\n\t}", "protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }", "public static function footer_scripts()\n\t{\n\t\tself::$_configInstance->footer_scripts();\n\t}", "function print_footer_scripts()\n {\n }", "public static function _wp_footer()\n\t{\n\t\tforeach (static::$footer_scripts as $params) {\n\t\t\tif (!isset($params['url'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isset($params['localize']) && isset($params['localize']['name']) && isset($params['localize']['data'])) {\n\t\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\tvar <?php $params['localize']['name'] ?> = <?php echo json_encode($params['localize']['data']); ?>;\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\tif (isset($params['version']) && $params['version']) {\n\t\t\t\t$join_char = (stripos($params['url'], '?') !== false) ? '&' : '?';\n\t\t\t\t$params['url'] .= $join_char.'ver='.$params['version'];\n\t\t\t}\n\n\t\t\t$attrs_str = 'type=\"text/javascript\" src=\"'.$params['url'].'\"';\n\n\t\t\tif (isset($params['async']) && $params['async']) {\n\t\t\t\t$attrs_str .= ' async';\n\t\t\t}\n\n\t\t\tif (isset($params['defer']) && $params['defer']) {\n\t\t\t\t$attrs_str .= ' defer';\n\t\t\t}\n\n\t\t\techo \"<script {$attrs_str}></script>\\n\";\n\t\t}\n\t}", "public static function output_footer_assets()\n {\n }", "public static function addScripts() {\n\t\t$embeddedMode\t = get_option( 'cmtt_enableEmbeddedMode', false );\n\t\t$inFooter\t\t = get_option( 'cmtt_script_in_footer', false );\n\t\t/*\n\t\t * If the embeddedMode is enabled we ignore the inFooter setting\n\t\t */\n\t\tif ( $inFooter && !$embeddedMode ) {\n\t\t\tadd_action( 'wp_footer', array( __CLASS__, 'outputScripts' ), 9 );\n\t\t} else {\n\t\t\tself::outputScripts();\n\t\t}\n\t}", "public function kapee_wp_print_footer_scripts() {\n\t\tif(!kapee_get_option('cookie-notice', 0)){ return false;}\n\t\t$scripts = html_entity_decode( trim( wp_kses_post( kapee_get_option('cookie-refuse-code','') ) ) );\n\t\t\n\t\tif ( $this->kapee_cookie_setted() && ! empty( $scripts ) ) {\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\t<?php echo esc_js( $scripts ); ?>\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}", "public function buildFooter() {\n $arrOfJsFiles = $this->getJsFiles();\n \n //alle js bestanden in een script tag steken\n $stringOfJsTags = $this->createJsTags($arrOfJsFiles);\n \n include $this->footerFile;\n \n }", "function asc_print_footer_scripts() {\n\t/**\n\t * Fires when footer scripts are printed.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'asc_print_footer_scripts' );\n}", "function _asc_footer_scripts() {\n\tprint_late_styles();\n\tprint_footer_scripts();\n}", "function print_footer_scripts() {\n\tglobal $asc_scripts, $concatenate_scripts;\n\n\tif ( !is_a($asc_scripts, 'ASC_Scripts') )\n\t\treturn array(); // No need to run if not instantiated.\n\n\tscript_concat_settings();\n\t$asc_scripts->do_concat = $concatenate_scripts;\n\t$asc_scripts->do_footer_items();\n\n\t/**\n\t * Filter whether to print the footer scripts.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the footer scripts. Default true.\n\t */\n\tif ( apply_filters( 'print_footer_scripts', true ) ) {\n\t\t_print_scripts();\n\t}\n\n\t$asc_scripts->reset();\n\treturn $asc_scripts->done;\n}", "function ihs_add_script_footer() {\n\t\t$output = '';\n\t\t$id = ihs_get_current_page_id();\n\t\tif ( $id ) {\n\t\t\t$output = stripslashes( get_post_meta( $id, 'ihs_add_script_footer_meta', true ) );\n\t\t}\n\t\techo $output;\n\t}", "function _wp_footer_scripts()\n {\n }", "function wp_print_footer_scripts()\n {\n }", "protected function footer()\n {\n require SCRIPT_BASE . \"build/rox/templates/footer.php\";\n }", "function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function add_late_scripts()\n\t{\n\t\t// only procceed if we have finished printing footer scripts\n\t\tif (did_action('bwp_minify_after_footer_scripts'))\n\t\t\t$this->todo_late_scripts = 'footer' . $this->late_script_order;\n\t}", "function cosmetics_footer_scripts() {\n global $cosmetics_options;\n $cosmetics_footer_scripts = $cosmetics_options['cosmetics_footer_scripts_editor'];\n\n if ( !empty( $cosmetics_footer_scripts ) ) :\n echo $cosmetics_footer_scripts;\n endif;\n}", "function footer() {\n\t\tob_start();\n\t\tinclude('templates/footer.php');\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "protected function add_footer_scripts() {\n\t\t\tdo_action( 'admin_print_footer_scripts' );\n\t\t}", "function exit_script()\n{\n\t//Each time we want the script to stop executing further, we will call this function so that the basic html code is output at the end\n\t\n\t?>\n\t</article>\n\t<!-- ----------------------------Including the footer ------------------------------------------- -->\n <?php require_once($_SERVER['DOCUMENT_ROOT'].'/../cms_server_files/footer.php'); //This file contains code of footer \n\t?>\n\t</section>\n\t\n\t<div class=\"clear\"></div>\n\t</section>\n </body>\n\t</html>\n\n<?php\n\texit;\n}", "function exit_script()\n{\n\t//Each time we want the script to stop executing further, we will call this function so that the basic html code is output at the end\n\t\n\t?>\n\t</article>\n\t<!-- ----------------------------Including the footer ------------------------------------------- -->\n <?php require_once($_SERVER['DOCUMENT_ROOT'].'/../cms_server_files/footer.php'); //This file contains code of footer \n\t?>\n\t</section>\n\t\n\t<div class=\"clear\"></div>\n\t</section>\n </body>\n\t</html>\n\n<?php\n\texit;\n}", "public function admin_index_print_footer_scripts() {\n\t\tif (time() < UpdraftPlus_Options::get_updraft_option('dismissed_clone_php_notices_until', 0)) return;\n\t\t?>\n\t\t<script>\n\t\t\tjQuery(function($) {\n\t\t\t\tif ($('#dashboard-widgets #dashboard_php_nag').length < 1) return;\n\t\t\t\t$('#dashboard-widgets #dashboard_php_nag .button-container').before('<div class=\"updraft-ad-container\"><a href=\"<?php echo UpdraftPlus_Options::admin_page_url(); ?>?page=updraftplus&amp;tab=migrate#updraft-navtab-migrate-content\"><?php echo esc_js(__('You can test running your site on a different PHP (or WordPress) version using UpdraftClone credits.', 'updraftplus')); ?></a> (<a href=\"#\" onclick=\"jQuery(\\'.updraft-ad-container\\').slideUp(); jQuery.post(ajaxurl, {action: \\'updraft_ajax\\', subaction: \\'dismiss_clone_php_notice\\', nonce: \\'<?php echo wp_create_nonce('updraftplus-credentialtest-nonce'); ?>\\' });return false;\"><?php echo esc_js(__('Dismiss notice', 'updraftplus')); ?></a>)</div>');\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "function print_html_footer() {\n\techo '\n\t\t\t</div> <!-- /content -->\t\t\t \n\t\t</div> <!-- /container -->\t\t\t \n\t\t<script src=\"https://code.jquery.com/jquery-3.1.1.slim.min.js\"></script>\n\t\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js\"></script>\n\t\t<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js\"></script>\n\t\t<script src=\"js/script.js\"></script>\n\t</body>\n</html>\n\t';\n}", "protected function generatePageFooter() \n {\n\t\t\n\t\techo \"</body>\\n\";\n\t\techo \"</html>\\n\";\n // to do: output common end of HTML code\n }", "function build_footer()\n{\n include 'footer.php';\n}", "public function footer()\n\t\t{\t\t\t\n\t\t\treturn $this->render('incs/footer');\n\t\t}" ]
[ "0.80130845", "0.80017006", "0.78766024", "0.77855605", "0.77101386", "0.7704807", "0.76320046", "0.7628733", "0.76174486", "0.758224", "0.75224185", "0.7378726", "0.73747134", "0.73118436", "0.72951657", "0.7290863", "0.72804374", "0.72477", "0.72056544", "0.7205259", "0.7198808", "0.7132558", "0.7124057", "0.70879287", "0.70879287", "0.7072986", "0.704893", "0.70235604", "0.6987738", "0.6949501" ]
0.80600184
0
Returns a new MenuPersonaQuery object.
public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof MenuPersonaQuery) { return $criteria; } $query = new MenuPersonaQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useMenuPersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinMenuPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'MenuPersona', 'MenuPersonaQuery');\n\t}", "public function createQuery()\n {\n $query = &atknew(\"atk.db.atk{$this->m_current_clusternode->m_type}query\");\n $query->m_db = $this;\n return $query;\n }", "public function newQuery()\n {\n return new self($this->connection, $this->grammar, $this->getProcessor());\n }", "public function newQuery()\n {\n $builder = $this->newAlfrescoBuilder($this->getConnection());\n $builder->setModel($this);\n return $builder;\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }", "public function prune($menuPersona = null)\n\t{\n\t\tif ($menuPersona) {\n\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_MENU_PERSONA, $menuPersona->getIdMenuPersona(), Criteria::NOT_EQUAL);\n\t }\n\t \n\t\treturn $this;\n\t}", "public function newQuery();", "public function query()\n {\n return MenuGroup::query();\n }", "public function getQueryMenus();", "public function createQuery() {\n\t\treturn $this->luceneQueryFactory->create($this);\n\t}", "public static function NewQuery()\r\n\t{\r\n\t\treturn new QSqlQuery();\r\n\t}", "public function createQuery() {\n\t\treturn $this->queryFactory->create($this->objectType);\n\t}", "public static function createQuery()\n\t{\n\t\treturn new ActiveQuery(['modelClass' => get_called_class()]);\n\t}", "public static function query()\n {\n // Create a new model instance for the query to ensure\n // that the model's initialize() method gets called.\n // Otherwise, the property definitions will be incomplete.\n $model = new static();\n\n return new Query($model);\n }", "public function query()\n {\n $users = Menu::query()\n ->with('extension')\n ->where('navigation_id', $this->navigation->id)\n ->select('menus.*');\n\n return $this->applyScopes($users);\n }", "public function createQuery(): QueryInterface\n {\n /** @var QueryInterface $query */\n $query = $this->objectManager->get(QueryInterface::class);\n $query->setConfiguration($this->getConfiguration());\n\n return $query;\n }", "public function getQueryAR()\n {\n // require_once('dbActiveRecord.php');\n // return DbActiveRecord::getSingleton();\n return $this;\n }", "protected function createQuery()\n {\n return \\PropelQuery::from($this->class);\n }", "protected function query() {\n\t\treturn new Query($this);\n\t}", "public function filterByMenuPersona($menuPersona, $comparison = null)\n\t{\n\t\tif ($menuPersona instanceof MenuPersona) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(PersonaPeer::ID_PERSONA, $menuPersona->getIdPersona(), $comparison);\n\t\t} elseif ($menuPersona instanceof PropelCollection) {\n\t\t\treturn $this\n\t\t\t\t->useMenuPersonaQuery()\n\t\t\t\t\t->filterByPrimaryKeys($menuPersona->getPrimaryKeys())\n\t\t\t\t->endUse();\n\t\t} else {\n\t\t\tthrow new PropelException('filterByMenuPersona() only accepts arguments of type MenuPersona or PropelCollection');\n\t\t}\n\t}", "public function newQuery()\n {\n $datasource = $this->getDatasource();\n\n $query = new Builder($datasource, $datasource->getPostProcessor());\n\n return $query->setModel($this);\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\n }", "public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }", "public function createQuery()\n {\n $query = $this->persistenceManager->createQueryForType($this->objectType);\n if ($this->defaultOrderings !== []) {\n $query->setOrderings($this->defaultOrderings);\n }\n if ($this->defaultQuerySettings !== null) {\n $query->setQuerySettings(clone $this->defaultQuerySettings);\n }\n return $query;\n }", "public function createQuery(): QueryInterface;", "public static function listaQuery()\n {\n $query = self::find();\n\n if (!Yii::$app->user->isGuest) {\n $query->andWhere(['propietario_id' => Yii::$app->user->id]);\n }\n\n return $query;\n }", "function GetMenu()\n {\n $sql = \"SELECT\n title,\n slug,\n id\n FROM\n pages\";\n $this->setSql($sql);\n return $this->getAll();\n }", "public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }" ]
[ "0.59764767", "0.56885344", "0.5652246", "0.56272733", "0.55539286", "0.55539286", "0.5526462", "0.5496832", "0.547868", "0.54757535", "0.53950965", "0.53695965", "0.53662235", "0.53384423", "0.5298388", "0.5297754", "0.52785933", "0.5257302", "0.52553225", "0.5222451", "0.5212786", "0.52029437", "0.5174622", "0.5167256", "0.51645297", "0.51641834", "0.515945", "0.5157561", "0.5126747", "0.51260287" ]
0.61196274
0
Filter the query on the id_menu column Example usage: $query>filterByIdMenu(1234); // WHERE id_menu = 1234 $query>filterByIdMenu(array(12, 34)); // WHERE id_menu IN (12, 34) $query>filterByIdMenu(array('min' => 12)); // WHERE id_menu > 12
public function filterByIdMenu($idMenu = null, $comparison = null) { if (is_array($idMenu)) { $useMinMax = false; if (isset($idMenu['min'])) { $this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($idMenu['max'])) { $this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MenuTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MenuTableMap::COL_ID, $id['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(MenuTableMap::COL_ID, $id, $comparison);\n }", "public function filterByMenuid($menuid = null, $comparison = null)\n {\n if (is_array($menuid)) {\n $useMinMax = false;\n if (isset($menuid['min'])) {\n $this->addUsingAlias(TblmenuTableMap::COL_MENUID, $menuid['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($menuid['max'])) {\n $this->addUsingAlias(TblmenuTableMap::COL_MENUID, $menuid['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(TblmenuTableMap::COL_MENUID, $menuid, $comparison);\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(MenuTableMap::COL_ID, $key, Criteria::EQUAL);\n }", "public function filterId(int $id): self;", "public function filter_wp_get_nav_menu_object($menu_obj, $menu_id)\n {\n }", "public function filterUser(int $id): self;", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(TblmenuTableMap::COL_MENUID, $key, Criteria::EQUAL);\n }", "function automap_filter_by_ids(&$obj, $params = null) {\n if(isset($params['filter_by_ids']) && $params['filter_by_ids'] != '') {\n $allowed_ids = array_flip(explode(',', $params['filter_by_ids']));\n automap_filter_tree($allowed_ids, $obj);\n }\n}", "function menu_get_idmenu($id)\n{\n $sql = 'SELECT idMenu\n\t FROM menu\n\t WHERE id = '.$id.';';\n $data = sql_query($sql)->fetch();\n return $data['idMenu'];\n}", "public function byId($menuId)\n {\n return Menu::with('permission')->find($menuId);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['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(SchoolPeer::ID, $id, $comparison);\n }", "public function itemsFilterIds($params){\n\t\tif(empty($params['orderby'])){\n\t\t\t$params['orderby']=$this->leftKeyName;\n\t\t\t}\n\t\treturn parent::itemsFilterIds($params);\n\t\t}", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "public function filterIds(int ...$ids): self;", "public function filterByMenu($menu = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($menu)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblmenuTableMap::COL_MENU, $menu, $comparison);\n }", "public function getQueryMenus();", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(MenuTableMap::COL_ID, $keys, Criteria::IN);\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public function filterByMenu($menu, $comparison = null)\n\t{\n\t\tif ($menu instanceof Menu) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_MENU, $menu->getIdMenu(), $comparison);\n\t\t} elseif ($menu instanceof PropelCollection) {\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_MENU, $menu->toKeyValue('PrimaryKey', 'IdMenu'), $comparison);\n\t\t} else {\n\t\t\tthrow new PropelException('filterByMenu() only accepts arguments of type Menu or PropelCollection');\n\t\t}\n\t}", "public function specific_menu($id)\r\n\t{\r\n\t\t$this->db->where('id',$id); \r\n\t\t$result = $this->db->get('menu'); \r\n\t\treturn $result->row();\r\n\t}", "public function whereId($id);", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CandleRolePermissionTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CandleRolePermissionTableMap::COL_ID, $id['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(CandleRolePermissionTableMap::COL_ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['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(SocioTableMap::COL_ID, $id, $comparison);\n }", "public function edit($id)\n {\n $user=Auth::user();\n if($user->admin == 1 || $user->admin == 2){\n $menu = Menu::findOrfail($id);\n $product= Product::orderBy('category_id', 'desc')->get();\n $menu_det_m0= Menu_det::where('menu_id', $id)->where('day', 0)->where('numero', 0)->first();\n $menu_det_m1= Menu_det::where('menu_id', $id)->where('day', 0)->where('numero', 1)->first();\n $menu_det_m2= Menu_det::where('menu_id', $id)->where('day', 0)->where('numero', 2)->first();\n\n $menu_det_t0= Menu_det::where('menu_id', $id)->where('day', 1)->where('numero', 0)->first();\n $menu_det_t1= Menu_det::where('menu_id', $id)->where('day', 1)->where('numero', 1)->first();\n $menu_det_t2= Menu_det::where('menu_id', $id)->where('day', 1)->where('numero', 2)->first();\n\n\n $menu_det_w0= Menu_det::where('menu_id', $id)->where('day', 2)->where('numero', 0)->first();\n $menu_det_w1= Menu_det::where('menu_id', $id)->where('day', 2)->where('numero', 1)->first();\n $menu_det_w2= Menu_det::where('menu_id', $id)->where('day', 2)->where('numero', 2)->first();\n\n\n $menu_det_th0= Menu_det::where('menu_id', $id)->where('day', 3)->where('numero', 0)->first();\n $menu_det_th1= Menu_det::where('menu_id', $id)->where('day', 3)->where('numero', 1)->first();\n $menu_det_th2= Menu_det::where('menu_id', $id)->where('day', 3)->where('numero', 2)->first();\n\n\n $menu_det_f0= Menu_det::where('menu_id', $id)->where('day', 4)->where('numero', 0)->first();\n $menu_det_f1= Menu_det::where('menu_id', $id)->where('day', 4)->where('numero', 1)->first();\n $menu_det_f2= Menu_det::where('menu_id', $id)->where('day', 4)->where('numero', 2)->first();\n\n $menu_det_s0= Menu_det::where('menu_id', $id)->where('day', 5)->where('numero', 0)->first();\n $menu_det_s1= Menu_det::where('menu_id', $id)->where('day', 5)->where('numero', 1)->first();\n $menu_det_s2= Menu_det::where('menu_id', $id)->where('day', 5)->where('numero', 2)->first();\n\n $menu_det_su0= Menu_det::where('menu_id', $id)->where('day', 6)->where('numero', 0)->first();\n $menu_det_su1= Menu_det::where('menu_id', $id)->where('day', 6)->where('numero', 1)->first();\n $menu_det_su2= Menu_det::where('menu_id', $id)->where('day', 6)->where('numero', 2)->first();\n\n\n //return $menu_det_t0;\n return view('menu.edit', array('menu'=>$menu, 'product'=>$product,\n 'menu_det_m0'=>$menu_det_m0,\n 'menu_det_m1'=>$menu_det_m1,\n 'menu_det_m2'=>$menu_det_m2,\n 'menu_det_t0'=>$menu_det_t0,\n 'menu_det_t1'=>$menu_det_t1,\n 'menu_det_t2'=>$menu_det_t2,\n 'menu_det_w0'=>$menu_det_w0,\n 'menu_det_w1'=>$menu_det_w1,\n 'menu_det_w2'=>$menu_det_w2,\n 'menu_det_th0'=>$menu_det_th0,\n 'menu_det_th1'=>$menu_det_th1,\n 'menu_det_th2'=>$menu_det_th2,\n 'menu_det_f0'=>$menu_det_f0,\n 'menu_det_f1'=>$menu_det_f1,\n 'menu_det_f2'=>$menu_det_f2,\n 'menu_det_s0'=>$menu_det_s0,\n 'menu_det_s1'=>$menu_det_s1,\n 'menu_det_s2'=>$menu_det_s2,\n 'menu_det_su0'=>$menu_det_su0,\n 'menu_det_su1'=>$menu_det_su1,\n 'menu_det_su2'=>$menu_det_su2,\n ));\n }\n else{\n return abort(404);\n }\n\n }", "public function filterUser(int|UniqueId $id): self;", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['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(TrabajosTableMap::COL_ID, $id, $comparison);\n }", "public function selectById($id){\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_menu_funcionario_web where id_funcionario_web=?;\";\n $stm = $conn->prepare($sql);\n $stm->bindValue(1, $id); \n $success = $stm->execute();\n if ($success) {\n $listMenu = [];\n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $Menu = new MenuFuncionario();\n $Menu->setId($result['id_menu_funcionario_web']);\n $Menu->setData($result['data']);\n $Menu->setIdMenu($result['id_menu']);\n $Menu->setIdFuncionario($result['id_funcionario_web']);\n array_push($listMenu, $Menu);\n }\n $this->conex -> closeDataBase();\n return $listMenu;\n } else {\n return \"Erro\";\n }\n \n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(AlumnoTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(AlumnoTableMap::COL_ID, $id['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(AlumnoTableMap::COL_ID, $id, $comparison);\n }", "private function filterByPermission(){\n\n }" ]
[ "0.59541965", "0.5866768", "0.53965074", "0.53861904", "0.53622794", "0.52085775", "0.51823467", "0.51408", "0.51081616", "0.510691", "0.5100512", "0.49946535", "0.49896416", "0.4987702", "0.49547362", "0.49516904", "0.4937862", "0.49278483", "0.4920688", "0.49131975", "0.48860806", "0.484593", "0.48380676", "0.48251575", "0.48172164", "0.47953418", "0.47912404", "0.47882864", "0.47782332", "0.47734088" ]
0.677803
0
Filter the query on the id_persona column Example usage: $query>filterByIdPersona(1234); // WHERE id_persona = 1234 $query>filterByIdPersona(array(12, 34)); // WHERE id_persona IN (12, 34) $query>filterByIdPersona(array('min' => 12)); // WHERE id_persona > 12
public function filterByIdPersona($idPersona = null, $comparison = null) { if (is_array($idPersona)) { $useMinMax = false; if (isset($idPersona['min'])) { $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($idPersona['max'])) { $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona, $comparison); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByIdPersona($idPersona = null, $comparison = null)\n\t{\n\t\tif (is_array($idPersona) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $idPersona, $comparison);\n\t}", "public function filterByPersonaId($personaId = null, $comparison = null)\r\n\t{\r\n\t\tif (is_array($personaId)) {\r\n\t\t\t$useMinMax = false;\r\n\t\t\tif (isset($personaId['min'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId['min'], Criteria::GREATER_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif (isset($personaId['max'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId['max'], Criteria::LESS_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif ($useMinMax) {\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\tif (null === $comparison) {\r\n\t\t\t\t$comparison = Criteria::IN;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId, $comparison);\r\n\t}", "public function filterByPersonId($personId = null, $comparison = null)\n {\n if (is_array($personId)) {\n $useMinMax = false;\n if (isset($personId['min'])) {\n $this->addUsingAlias(MigrationPeer::PERSON_ID, $personId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($personId['max'])) {\n $this->addUsingAlias(MigrationPeer::PERSON_ID, $personId['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(MigrationPeer::PERSON_ID, $personId, $comparison);\n }", "public function filterId(int $id): self;", "public function filterByIdPessoa($idPessoa = null, $comparison = null)\n {\n if (is_array($idPessoa)) {\n $useMinMax = false;\n if (isset($idPessoa['min'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::ID_PESSOA, $idPessoa['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idPessoa['max'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::ID_PESSOA, $idPessoa['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(TbalunomatriculaPeer::ID_PESSOA, $idPessoa, $comparison);\n }", "function createObjectFilter($opt) {\n\textract($opt);\n\n\t//make an array if we only have a singular column value\n\tif (is_array($object_filter)) $str = implode(\",\",$object_filter);\n\telse $str = $object_filter;\n\n\t$sql = \"SELECT id FROM docmgr.dm_object WHERE id IN (\".$str.\")\";\n\n\treturn $sql;\n\n}", "public function filterByIdFeria($idFeria = null, $comparison = null)\n\t{\n\t\tif (is_array($idFeria)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idFeria['min'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idFeria['max'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria, $comparison);\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['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(UsuarioPerfilPeer::ID, $id, $comparison);\n }", "public function filterByIdRaca($idRaca = null, $comparison = null)\n {\n if (is_array($idRaca)) {\n $useMinMax = false;\n if (isset($idRaca['min'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::ID_RACA, $idRaca['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idRaca['max'])) {\n $this->addUsingAlias(TbalunomatriculaPeer::ID_RACA, $idRaca['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(TbalunomatriculaPeer::ID_RACA, $idRaca, $comparison);\n }", "public function filterByPersona($persona, $comparison = null)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $persona->getId(), $comparison);\r\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['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(SchoolPeer::ID, $id, $comparison);\n }", "public function filterUser(int $id): self;", "public function filterByIdFeria($idFeria = null, $comparison = null)\n\t{\n\t\tif (is_array($idFeria)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idFeria['min'])) {\n\t\t\t\t$this->addUsingAlias(ExpositorFeriaPeer::ID_FERIA, $idFeria['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idFeria['max'])) {\n\t\t\t\t$this->addUsingAlias(ExpositorFeriaPeer::ID_FERIA, $idFeria['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ExpositorFeriaPeer::ID_FERIA, $idFeria, $comparison);\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPersona($persona, $comparison = null)\n\t{\n\t\tif ($persona instanceof Persona) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->getIdPersona(), $comparison);\n\t\t} elseif ($persona instanceof PropelCollection) {\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->toKeyValue('PrimaryKey', 'IdPersona'), $comparison);\n\t\t} else {\n\t\t\tthrow new PropelException('filterByPersona() only accepts arguments of type Persona or PropelCollection');\n\t\t}\n\t}", "public function filterByIdCargo($idCargo = null, $comparison = null)\n\t{\n\t\tif (is_array($idCargo)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idCargo['min'])) {\n\t\t\t\t$this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idCargo['max'])) {\n\t\t\t\t$this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_CARGO, $idCargo, $comparison);\n\t}", "public function filterUser(int|UniqueId $id): self;", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['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(UserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['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(UserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['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(sfGuardUserPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['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(RemoteAppPeer::ID, $id, $comparison);\n }", "public function filterByIdManufacturer($idManufacturer = null, $comparison = null)\n\t{\n\t\tif (is_array($idManufacturer)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idManufacturer['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idManufacturer['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_AddressPeer::ID_MANUFACTURER, $idManufacturer, $comparison);\n\t}", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['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(SearchIndexPeer::ID, $id, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(TrabajosTableMap::COL_ID, $id['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(TrabajosTableMap::COL_ID, $id, $comparison);\n }", "public function filterByIdUsuario($idUsuario = null, $comparison = null)\n\t{\n\t\tif (is_array($idUsuario)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idUsuario['min'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_USUARIO, $idUsuario['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idUsuario['max'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_USUARIO, $idUsuario['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ActividadPeer::ID_USUARIO, $idUsuario, $comparison);\n\t}", "function automap_filter_by_ids(&$obj, $params = null) {\n if(isset($params['filter_by_ids']) && $params['filter_by_ids'] != '') {\n $allowed_ids = array_flip(explode(',', $params['filter_by_ids']));\n automap_filter_tree($allowed_ids, $obj);\n }\n}", "abstract protected function foreignIDFilter($id = null);", "public function whereId($id);", "public function filterByAid($aid = null, $comparison = null)\n {\n if (is_array($aid)) {\n $useMinMax = false;\n if (isset($aid['min'])) {\n $this->addUsingAlias(AliFmbonusTableMap::COL_AID, $aid['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($aid['max'])) {\n $this->addUsingAlias(AliFmbonusTableMap::COL_AID, $aid['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(AliFmbonusTableMap::COL_AID, $aid, $comparison);\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CardPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CardPeer::ID, $id['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(CardPeer::ID, $id, $comparison);\n }" ]
[ "0.63588125", "0.60873246", "0.5787159", "0.5572213", "0.55235964", "0.5507588", "0.546259", "0.54596984", "0.54020816", "0.5363765", "0.53244185", "0.53203696", "0.52625203", "0.52618206", "0.5252117", "0.52432156", "0.52330625", "0.52324086", "0.52324086", "0.518515", "0.5105208", "0.5105008", "0.5090115", "0.5082718", "0.50688", "0.5058918", "0.5049611", "0.5041485", "0.5038982", "0.5032967" ]
0.70465845
0
Filter the query by a related Persona object
public function filterByPersona($persona, $comparison = null) { if ($persona instanceof Persona) { return $this ->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->getIdPersona(), $comparison); } elseif ($persona instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $persona->toKeyValue('PrimaryKey', 'IdPersona'), $comparison); } else { throw new PropelException('filterByPersona() only accepts arguments of type Persona or PropelCollection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filterByPersona($persona, $comparison = null)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $persona->getId(), $comparison);\r\n\t}", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPagoEfectivoRelatedByIdPersona($pagoEfectivo, $comparison = null)\n\t{\n\t\tif ($pagoEfectivo instanceof PagoEfectivo) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(PersonaPeer::ID_PERSONA, $pagoEfectivo->getIdPersona(), $comparison);\n\t\t} elseif ($pagoEfectivo instanceof PropelCollection) {\n\t\t\treturn $this\n\t\t\t\t->usePagoEfectivoRelatedByIdPersonaQuery()\n\t\t\t\t\t->filterByPrimaryKeys($pagoEfectivo->getPrimaryKeys())\n\t\t\t\t->endUse();\n\t\t} else {\n\t\t\tthrow new PropelException('filterByPagoEfectivoRelatedByIdPersona() only accepts arguments of type PagoEfectivo or PropelCollection');\n\t\t}\n\t}", "public function filterByIdPersona($idPersona = null, $comparison = null)\n\t{\n\t\tif (is_array($idPersona) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $idPersona, $comparison);\n\t}", "public function personas()\n {\n $parametros = Input::only('term');\n\n $acompaniantes = Acompaniantes::select('personas_id')->get();\n\n $data = Personas::with('municipios','localidades','derechohabientes', 'estados_embarazos')->whereNotIn('id', $acompaniantes)\n ->where(function($query) use ($parametros) {\n $query->where('id','LIKE',\"%\".$parametros['term'].\"%\");\n });\n\n $data = $data->get();\n return $this->respuestaVerTodo($data);\n }", "public function filterByIdPersona($idPersona = null, $comparison = null)\n\t{\n\t\tif (is_array($idPersona)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idPersona['min'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idPersona['max'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_PERSONA, $idPersona, $comparison);\n\t}", "public function prune($persona = null)\n\t{\n\t\tif ($persona) {\n\t\t\t$this->addUsingAlias(PersonaPeer::ID_PERSONA, $persona->getIdPersona(), Criteria::NOT_EQUAL);\n\t }\n\t \n\t\treturn $this;\n\t}", "public function getPersona()\n {\n return $this->hasOne(Personas::className(), ['id' => 'persona_id']);\n }", "public function personas(): Personas\n {\n return Personas::findById($this->persona_id);\n }", "public function filterByMenuPersona($menuPersona, $comparison = null)\n\t{\n\t\tif ($menuPersona instanceof MenuPersona) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(PersonaPeer::ID_PERSONA, $menuPersona->getIdPersona(), $comparison);\n\t\t} elseif ($menuPersona instanceof PropelCollection) {\n\t\t\treturn $this\n\t\t\t\t->useMenuPersonaQuery()\n\t\t\t\t\t->filterByPrimaryKeys($menuPersona->getPrimaryKeys())\n\t\t\t\t->endUse();\n\t\t} else {\n\t\t\tthrow new PropelException('filterByMenuPersona() only accepts arguments of type MenuPersona or PropelCollection');\n\t\t}\n\t}", "public function relationshipFilter()\n\t{\n\t\tee()->load->add_package_path(PATH_ADDONS.'relationship');\n\t\tee()->load->library('EntryList');\n\t\tee()->output->send_ajax_response(ee()->entrylist->ajaxFilter());\n\t}", "public function getFilteredDetails();", "public function persona()\n {\n\t\treturn $this -> belongsTo(Persona::class,'id_persona','id_persona');\n }", "public function personas(){\n\n return $this->morphedByMany(Persona::class, 'cargoable'); //relacion muchos a muchos \"una persona tiene muchos cargos y un cargo tiene muchas personas\"\n }", "public function filterByPerson($person, $comparison = null)\n {\n if ($person instanceof Person) {\n return $this\n ->addUsingAlias(MigrationPeer::PERSON_ID, $person->getId(), $comparison);\n } elseif ($person instanceof PropelObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(MigrationPeer::PERSON_ID, $person->toKeyValue('PrimaryKey', 'Id'), $comparison);\n } else {\n throw new PropelException('filterByPerson() only accepts arguments of type Person or PropelCollection');\n }\n }", "abstract protected function foreignIDFilter($id = null);", "protected abstract function filter();", "private function filterByPermission(){\n\n }", "private function filtrarPersonas() {\n $aFil = array();\n $aPer = $this->aDatosPersonas;\n $fHom = $this->filtroHombre;\n $fMuj = $this->filtroMujer;\n $fOtr = $this->filtroOtro; \n $fCor = $this->filtroCorreo; \n $fEnv = $this->filtroEnvios;\n $fTel = $this->filtroTelefono;\n $fNot = $this->filtroNotas;\n $fPro = $this->filtroPropietario;\n \n // array('cod'=>array(0 apellidos, 1 nombre, 2 sexo, 3 codusu, 4 correo, 5 envios, 6 telefono, 7 notas)...)\n foreach ($aPer as $per => $aPersona) {\n $bOK = TRUE;\n if ($fHom == 'S' || $fMuj == 'S' || $fOtr == 'S') {\n $bOK = (($fHom == 'S' && $aPersona[2] == 'H') || ($fMuj == 'S' && $aPersona[2] == 'M') || ($fOtr == 'S' && $aPersona[2] == '')) ? TRUE : FALSE;\n }\n if ($fCor == 'S') {\n $bOK = ($fCor == 'S' && !$aPersona[4]) ? FALSE : $bOK;\n }\n if ($fEnv == 'S') {\n $bOK = ($fEnv == 'S' && !$aPersona[5]) ? FALSE : $bOK;\n }\n if ($fTel == 'S') {\n $bOK = ($fTel == 'S' && !$aPersona[6]) ? FALSE : $bOK;\n }\n if ($fNot == 'S') {\n $bOK = ($fNot == 'S' && !$aPersona[7]) ? FALSE : $bOK;\n }\n if ($fPro == 'S') {\n $bOK = (!$this->esPropietario($per)) ? FALSE : $bOK;\n }\n if ($bOK) {\n $aFil[$per] = $aPersona;\n }\n }\n $this->aFiltradas = $aFil;\n }", "public function all($id){\n return $this->model->query()->where('persona_id',$id)->get();\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_MENU_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function filterByPrimaryKeys($keys)\n\t{\n\t\treturn $this->addUsingAlias(PersonaPeer::ID_PERSONA, $keys, Criteria::IN);\n\t}", "public function filtering();", "public function getRepr($id_personnemoral){\n $repr = afa::with('personnephysique')\n ->join('personnephysique','personnephysique.idpersonnephysique','=','afa.idpersonnephysique')\n ->where('afa.idpersonnemorale',$id_personnemoral)->get();\n\n foreach ($repr as $res){\n return $res;\n\n }\n }", "abstract public function filterFields();", "public function usePagoEfectivoRelatedByIdPersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinPagoEfectivoRelatedByIdPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'PagoEfectivoRelatedByIdPersona', 'PagoEfectivoQuery');\n\t}", "public function filterByAgencia($agencia, $comparison = null)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->addUsingAlias(PersonaCastingPeer::AGENCIA_ID, $agencia->getId(), $comparison);\r\n\t}", "public function filterByPersonaLocalizacion($personaLocalizacion, $comparison = null)\n\t{\n\t\tif ($personaLocalizacion instanceof PersonaLocalizacion) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(PersonaPeer::ID_PERSONA, $personaLocalizacion->getIdPersona(), $comparison);\n\t\t} elseif ($personaLocalizacion instanceof PropelCollection) {\n\t\t\treturn $this\n\t\t\t\t->usePersonaLocalizacionQuery()\n\t\t\t\t\t->filterByPrimaryKeys($personaLocalizacion->getPrimaryKeys())\n\t\t\t\t->endUse();\n\t\t} else {\n\t\t\tthrow new PropelException('filterByPersonaLocalizacion() only accepts arguments of type PersonaLocalizacion or PropelCollection');\n\t\t}\n\t}", "public function buscar() \n {\n \n if($buscar = \\Request::get('q')){\n $personas= Persona:: where(function($query) use ($buscar){\n $query->where('nombre','LIKE', \"%$buscar%\")->orWhere('cedula','LIKE',\"%$buscar%\")\n ->orWhere('tipo','LIKE',\"%$buscar%\")->orWhere('apellido','LIKE',\"%$buscar%\");\n\n })->paginate(20);\n }\n\n return $personas; //retorna toda la consulta\n }", "public function filterByPersonaId($personaId = null, $comparison = null)\r\n\t{\r\n\t\tif (is_array($personaId)) {\r\n\t\t\t$useMinMax = false;\r\n\t\t\tif (isset($personaId['min'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId['min'], Criteria::GREATER_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif (isset($personaId['max'])) {\r\n\t\t\t\t$this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId['max'], Criteria::LESS_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif ($useMinMax) {\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\tif (null === $comparison) {\r\n\t\t\t\t$comparison = Criteria::IN;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->addUsingAlias(PersonaCastingPeer::PERSONA_ID, $personaId, $comparison);\r\n\t}" ]
[ "0.6348065", "0.60208315", "0.59823203", "0.5949341", "0.59345204", "0.5896664", "0.581859", "0.5805348", "0.57148933", "0.56413376", "0.5539253", "0.5453332", "0.545109", "0.54509676", "0.5421689", "0.538004", "0.5377162", "0.53466785", "0.53254664", "0.53208584", "0.5305891", "0.5287879", "0.52841806", "0.52708596", "0.5260575", "0.52511615", "0.5243746", "0.52284825", "0.52162814", "0.52081245" ]
0.60780114
1
Adds a JOIN clause to the query using the Persona relation
public function joinPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Persona'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Persona'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinQuery()\n {\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "abstract public function join($alias_from, $rel_name, $alias_to);", "public function usePersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Persona', 'PersonaQuery');\n\t}", "public function joinPersona($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\r\n\t{\r\n\t\t$tableMap = $this->getTableMap();\r\n\t\t$relationMap = $tableMap->getRelation('Persona');\r\n\t\t\r\n\t\t// create a ModelJoin object for this join\r\n\t\t$join = new ModelJoin();\r\n\t\t$join->setJoinType($joinType);\r\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\r\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\r\n\t\t\t$join->setPreviousJoin($previousJoin);\r\n\t\t}\r\n\t\t\r\n\t\t// add the ModelJoin to the current object\r\n\t\tif($relationAlias) {\r\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\r\n\t\t\t$this->addJoinObject($join, $relationAlias);\r\n\t\t} else {\r\n\t\t\t$this->addJoinObject($join, 'Persona');\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function joinPagoEfectivoRelatedByIdPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('PagoEfectivoRelatedByIdPersona');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'PagoEfectivoRelatedByIdPersona');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function joinMenuPersona($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('MenuPersona');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'MenuPersona');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function usePersonaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->joinPersona($relationAlias, $joinType)\r\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'Persona', 'PersonaQuery');\r\n\t}", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function useMenuPersonaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\treturn $this\n\t\t\t->joinMenuPersona($relationAlias, $joinType)\n\t\t\t->useQuery($relationAlias ? $relationAlias : 'MenuPersona', 'MenuPersonaQuery');\n\t}", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "function getJoinOnPersonID()\n { \n return $this->getJoinOnFieldX('person_id');\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function joinPersonaLocalizacion($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('PersonaLocalizacion');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'PersonaLocalizacion');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "public function getJoinExpression();" ]
[ "0.67215556", "0.6406976", "0.6372515", "0.63512254", "0.63392663", "0.6259774", "0.6205174", "0.6079694", "0.60710216", "0.6033944", "0.6030065", "0.6005922", "0.59923756", "0.5958837", "0.5929727", "0.59141105", "0.58743614", "0.5836996", "0.58062667", "0.5801637", "0.5801637", "0.5801637", "0.57967454", "0.57690907", "0.5760669", "0.5723021", "0.57007194", "0.5686068", "0.5669569", "0.5660703" ]
0.6544707
1
Filter the query by a related Menu object
public function filterByMenu($menu, $comparison = null) { if ($menu instanceof Menu) { return $this ->addUsingAlias(MenuPersonaPeer::ID_MENU, $menu->getIdMenu(), $comparison); } elseif ($menu instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(MenuPersonaPeer::ID_MENU, $menu->toKeyValue('PrimaryKey', 'IdMenu'), $comparison); } else { throw new PropelException('filterByMenu() only accepts arguments of type Menu or PropelCollection'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function menus(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\MainMenu', 'permisos_menu', 'user_id', 'permisos_id')->where('menu.estado','=','1')->orderBy('menu.id');\n }", "public function filterByIdMenu($idMenu = null, $comparison = null)\n\t{\n\t\tif (is_array($idMenu)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idMenu['min'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idMenu['max'])) {\n\t\t\t\t$this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_MENU, $idMenu, $comparison);\n\t}", "public function filter_wp_get_nav_menu_object($menu_obj, $menu_id)\n {\n }", "public function getQueryMenus();", "private function filterByPermission(){\n\n }", "public function activateQueryableSubmenus()\n {\n add_filter('wp_nav_menu_objects', array($this, 'filterSubNavObjects'), 10, 2);\n }", "public function byId($menuId)\n {\n return Menu::with('permission')->find($menuId);\n }", "public\tfunction menu() {\n\t\treturn\t$this->belongsTo('App\\Menu');\n\t}", "private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }", "public function search() {\n\t\t\tif (!empty($this->params['form']['query'])) {\n\t\t\t\t/* Get query */\n\t\t\t\t$query = Sanitize::escape($this->params['form']['query']);\n\t\t\t\n\t\t\t\t/* Get list of menu items filtered by query */\n\t\t\t\t$this->menuList = $this->getThreadedList($query);\n\t\t\t} else {\n\t\t\t\t/* Get list of menu items */\n\t\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t}\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function getSubmenu()\n {\n return $this->hasOne(Menu::className(), ['id'=>'menu_id']);\n }", "public function getMenu()\n {\n return $this->hasOne(\\wdmg\\menu\\models\\Menu::class, ['id' => 'menu_id']);\n }", "public function find(){\n $this->resultado = Load::model('menu')->find();\n }", "public function findAllByMenu(MenuInterface $menu);", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n $menu_id = $_GET['menu_id'];\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('menu_id',$menu_id);\n\t\t$criteria->compare('image_path',$this->image_path,true);\n\t\t$criteria->compare('caption',$this->caption,true);\n\t\t$criteria->compare('caption_eng',$this->caption_eng,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('create_user',$this->create_user);\n\t\t$criteria->compare('update_date',$this->update_date,true);\n\t\t$criteria->compare('del_flg',$this->del_flg);\n\t\t$criteria->compare('public_flg',$this->public_flg);\n\t\t$criteria->compare('feature_flg',$this->feature_flg);\n\t\t$criteria->addCondition(\"del_flg = 0\");\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function relatedIdItems()\n {\n $query = Menu::find();\n if ($this->menuRelatedType != self::ALL_MENU_TYPES) {\n $query->andWhere(['type' => $this->menuRelatedType]);\n }\n if ($this->menuRelatedLevel != self::ALL_MENU_LEVELS) {\n $query->andWhere(['level' => $this->menuRelatedLevel]);\n }\n\n $relatedIdnotin = [];\n\n if ($this->relatedType == ArticleType::RELATE_MENU_UNIQUE) {\n $relatedIdnotin = ArticleRelate::find()->select('related_id')->where(['type_id' => ArticleType::RELATE_MENU_UNIQUE])->column();\n }\n\n // exclude related id for edit themself\n if ($this->scenario == self::SCENARIO_EDIT && $this->relatedId) {\n unset($relatedIdnotin[array_search($this->relatedId, $relatedIdnotin)]);\n }\n\n if ($relatedIdnotin) {\n $query->andWhere(['not in', 'id', $relatedIdnotin]);\n }\n\n $items = ArrayHelper::map($query->asArray()->all(), 'id', 'title');\n return $items;\n }", "public function menu(){\n return $this->belongsTo('App\\Front\\Menu','menu_id','id');\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function query()\n {\n return MenuGroup::query();\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(MenuPersonaPeer::ID_MENU_PERSONA, $key, Criteria::EQUAL);\n\t}", "public function menu()\n {\n return $this->belongsTo(Menu::class, 'menuID', 'id');\n }", "public function menu()\n {\n return $this->hasMany(\"App\\Menu\");\n }", "public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }", "public function filterByMenu($menu = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($menu)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TblmenuTableMap::COL_MENU, $menu, $comparison);\n }", "protected function filter(&$query)\n {\n if (!empty($this->filterModel)) {\n if (isset($this->filterModel->status_id)) {\n $query->andWhere(['status' => $this->filterModel->status_id]);\n }\n }\n }", "public function query()\n {\n $users = Menu::query()\n ->with('extension')\n ->where('navigation_id', $this->navigation->id)\n ->select('menus.*');\n\n return $this->applyScopes($users);\n }", "public function menu() {\n return $this->belongsTo('App\\Menu');//belongsToは$reservekから$menuに入れることができる便利なやつ\n }", "public function getMenuItems(){\n $items = ItemMenu::getBy(array('_id' => array('$in' => $this->_menuItems)));\n return $items;\n }", "public function menuItems(){\n return $this->hasMany('App\\Models\\MasterRecords\\MenuItem');\n }", "public function filterByMenuPersona($menuPersona, $comparison = null)\n\t{\n\t\tif ($menuPersona instanceof MenuPersona) {\n\t\t\treturn $this\n\t\t\t\t->addUsingAlias(PersonaPeer::ID_PERSONA, $menuPersona->getIdPersona(), $comparison);\n\t\t} elseif ($menuPersona instanceof PropelCollection) {\n\t\t\treturn $this\n\t\t\t\t->useMenuPersonaQuery()\n\t\t\t\t\t->filterByPrimaryKeys($menuPersona->getPrimaryKeys())\n\t\t\t\t->endUse();\n\t\t} else {\n\t\t\tthrow new PropelException('filterByMenuPersona() only accepts arguments of type MenuPersona or PropelCollection');\n\t\t}\n\t}" ]
[ "0.61885047", "0.59666693", "0.5953614", "0.58441424", "0.5696303", "0.5647056", "0.5632563", "0.55811566", "0.55473846", "0.55340654", "0.550739", "0.5481936", "0.5468523", "0.5446603", "0.5409647", "0.5390296", "0.53678095", "0.53588355", "0.5317836", "0.5312922", "0.52688247", "0.52317685", "0.52312785", "0.52269036", "0.52022237", "0.51971644", "0.51901984", "0.51754737", "0.51590323", "0.5156451" ]
0.608012
1
Consumer::getAuthorizationBasic Gets Consumer HTTP_AUTHORIZATION Bearer code.
public function getAuthorizationBasic() { if ( ! empty($this->key) && ! empty($this->secret)) { $key = rawurlencode($this->key); $secret = rawurlencode($this->secret); return 'Basic ' . base64_encode($key . ':' . $secret); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_authorization(){\n\t\t$bvars = $this->get_bvars();\n\t\tif ( array_key_exists( 'Authorization', $bvars ) ) {\n\t\t\treturn $bvars[ 'Authorization' ];\t\n\t\t}\n\t\t\n\t\treturn 'Basic Kjo=';\n\t}", "function wp_populate_basic_auth_from_authorization_header()\n {\n }", "public static function getBearer()\n {\n $token = explode(\" \", $_SERVER['HTTP_AUTHORIZATION']);\n if(isset($token[1])){\n return $token[1];\n }\n throw new GlobalException(\"Authorization bearer token not found in HTTP_AUTHORIZATION header\");\n }", "private static function getAuthoriza()\n\t{\n\t\t$data = ['Authorization' => 'Basic '.base64_encode(self::api_key)];\n\t\treturn $data;\n\t}", "public function getAuthorizationMethod()\n {\n return 'bearer';\n }", "private function getAuthorization()\n {\n // Post id_token\n if (new DateTime() > $this->tokenExpire) {\n $this->refreshToken();\n }\n $data = [\n 'authenticationToken' => $this->idToken,\n ];\n $url = \"https://api2.ov-chipkaart.nl/femobilegateway/v1/api/authorize\";\n $authorizationResponse = (self::Execute($url, $data));\n\n // Returns string\n $this->authorizationToken = $authorizationResponse['o'];\n }", "protected function getBearer(){\n\t\t$a = $this->param->getServer('REDIRECT_HTTP_AUTHORIZATION');\n\t\tif(!$a){\n\t\t\t$a = $this->param->getServer('HTTP_AUTHORIZATION');\n\t\t}\n\n\t\tif($a){\n\t\t\t$authorization = $a;\n\t\t} else {\n\t\t\t$authorization = 'Bearer ' . $this->param->getParam('token');\n\t\t}\n\n\t\tif($authorization){\n\t\t\t$authorization = explode(' ', $authorization);\n\t\t\tif(isset($authorization[1])){\n\t\t\t\t$token = explode('.', $authorization[1]);\n\t\t\t\tif(count($token) == 3){\n\t\t\t\t\treturn $token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function action_basic() {\n\tif (Input::server(\"PHP_AUTH_USER\", null) == null) {\n\t $response = new Response();\n\t $response->set_header('WWW-Authenticate', 'Basic realm=\"Authenticate for eventual.org\"');\n\t return $response;\n\t} else {\n\t $response = Response::forge(\"You are authenticated as \" . Input::server(\"PHP_AUTH_USER\"));\n\t return $response;\n\t}\n }", "function rest_authorization_required_code()\n {\n }", "public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }", "protected function getBasicAuthHeader()\n {\n return \"Basic \" . base64_encode($this->clientId . \":\" . $this->clientSecret);\n }", "public function getBearerToken() \n {\n $headers = $this->getAuthorizationHeader(); \n \n if (!empty($headers)) {\n $token = explode(\" \", $headers, 2);\n if (!empty($token[1])) {\n //echo (\"Token: \" . $token[1] .\"\\n\"); //debug\n return $token[1];\n } \n $this->throwException(COULD_NOT_GET_AUTHORIZATION_FROM_HEADER, 'Could not parse access token from authorization header'); \n }\n }", "public function getAuthorization(): string\n {\n return self::PREFIX . base64_encode($this->username . ':' . $this->password);\n }", "public function getBasicAuth()\n {\n return $this->basicAuth;\n }", "public function get_test_authorization_header()\n {\n }", "public function getAuthorizationHeader() \n {\n $headers = null;\n \n if (isset($_SERVER['Authorization'])) {\n $headers = trim($_SERVER['Authorization']);\n }\n else if (isset($_SERVER['HTTP_AUTHORIZATION'])) {\n $headers = trim($_SERVER['HTTP_AUTHORIZATION']);\n } elseif (function_exists('apache_request_headers')) {\n $apacheHeaders = apache_request_headers();\n \n $apacheHeaders = array_combine(array_map('ucwords', array_keys($apacheHeaders)), array_values($apacheHeaders));\n if (isset($apacheHeaders['Authorization'])) {\n $headers = trim($apacheHeaders['Authorization']);\n }\n }\n \n //echo (\"Headers: \" . $headers .\"\\n\"); //debug\n return $headers;\n }", "protected function getBearerAuthHeader()\n {\n return \"Bearer \" . $this->retrieveToken();\n }", "public function getAuthorizationBearer()\n {\n if ( ! empty($this->key) && ! empty($this->secret)) {\n $key = rawurlencode($this->key);\n $secret = rawurlencode($this->secret);\n\n return 'Bearer ' . base64_encode($key . ':' . $secret . ':' . md5($key . $secret));\n }\n\n return false;\n }", "public function getBasicAuthMethod() {\n\t\treturn $this->selectedEndpoint['basic_auth_method'];\n\t}", "private function getAuthHeader()\n\t\t{\n\t\t\tif (isset($_SERVER['Authorization'])) {\n\t\t\t\treturn $_SERVER['Authorization'];\n\t\t\t} elseif (function_exists('apache_request_headers')) {\n\t\t\t\t$headers = apache_request_headers();\n\t\t\t\tif (isset($headers['Authorization'])) {\n\t\t\t\t\treturn $headers['Authorization'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new Exception(\"No authorization data!\");\n\t\t}", "public function getAuthorizationString();", "protected static function getBearerToken() \n {\n $headers = self::getAuthorizationHeader();\n // HEADER: Get the access token from the header\n \n if ((! empty($headers)) && (! is_null($headers))) {\n // if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n // return $matches[1];\n // }\n return $headers;\n }\n Utils::json_respond(ATHORIZATION_HEADER_NOT_FOUND, 'Access Token Not found');\n }", "protected function getAuthorizationCode()\n {\n $code = null;\n if ($this->responseMode === 'query' && isset($_GET['code'])) {\n $code = $_GET['code'];\n } else if ($this->responseMode === 'form_post' && isset($_POST['code'])) {\n $code = $_POST['code'];\n }\n\n return $code;\n }", "public static function getAuthorizationBearer()\n {\n $bearerToken = null;\n\n if (self::hasHeader('Authorization')) { \n if (preg_match('/Bearer\\s(\\S+)/', self::getHeader('Authorization'), $matches)) {\n $bearerToken = $matches[1];\n }\n }\n\n return $bearerToken;\n }", "protected function __authorization(){\n\t\t $this->cURL->headers['Authorization'] = 'Bearer '.$this->access_token;\n }", "public function get_authorization_code() {\n\n\t\treturn $this->authorization_num;\n\t}", "protected function getAuthorizationHeaders()\n {\n $apiUsername = $this->configModel->get('github_frontend_api_username');\n $apiToken = $this->configModel->get('github_frontend_api_access_token');\n\n if (! empty($apiUsername) && ! empty($apiToken)) {\n return array(\n 'Authorization: Basic '.base64_encode($apiUsername.':'.$apiToken)\n );\n }\n\n return array();\n }", "protected function getAuthorizationHeader(){\n return base64_encode(\n Controller\\Controller::getEnvironmentData('CCP_SSO_CLIENT_ID') . ':'\n . Controller\\Controller::getEnvironmentData('CCP_SSO_SECRET_KEY')\n );\n }", "public function getBearerToken()\n {\n $headers = $this->getAuthorizationHeader();\n // HEADER: Get the access token from the header\n if (!empty($headers)) {\n if (preg_match('/Bearer\\s(\\S+)/', $headers, $matches)) {\n return $matches[1];\n }\n }\n $this->returnResponse(ATHORIZATION_HEADER_NOT_FOUND, null, 'Access Token Not found');\n }", "static function BearerToken()\n {\n return trim(str_replace('Bearer', '', self::GetHeader()));\n }" ]
[ "0.7432054", "0.7076157", "0.69052726", "0.68913436", "0.6722596", "0.6626426", "0.6559026", "0.64736736", "0.6408718", "0.6385755", "0.63671374", "0.6355683", "0.6350947", "0.6346494", "0.6308254", "0.6258218", "0.6257869", "0.62441695", "0.6237988", "0.6214038", "0.62018996", "0.6176546", "0.61747855", "0.6173534", "0.6172299", "0.6164493", "0.6163329", "0.61324805", "0.6122206", "0.60981745" ]
0.7312144
1
Create a new S3BrowserBasedUploads instance.
public function make(array $config): S3BrowserBasedUploads { $adapter = $this->getS3Adapter($config); return new S3BrowserBasedUploads( $adapter->getClient(), $adapter->getBucket(), $this->getInputs($config), $this->getConditions($config), $this->getExpirationTime($config) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdapter()\n {\n $client = new S3Client([\n 'credentials' => [\n 'key' => $this->accessKey,\n 'secret' => $this->secret,\n ],\n 'region' => $this->region,\n 'version' => $this->version, // or \"latest\"\n //'profile' => 'default', #if enabled - the library searches for credentials in {webserver_root}/.aws/credentials\n ]);\n\n $bucket = 'mbt-public-media';\n return new AwsS3Adapter($client, $bucket);\n }", "public function it_should_be_able_to_create_an_s3_storeage_instance()\n {\n $attachment = $this->buildMockAttachment('s3');\n\n $storage = Storage::create($attachment);\n\n $this->assertInstanceOf('Codesleeve\\Stapler\\Storage\\S3', $storage);\n }", "function __construct() {\n\t\tConfigure::load(\"EnbakeAttach.s3\");\n\n\t\t$this->s3 = new S3(Configure::read(\"S3.access_key\"),\n\t\t\t\tConfigure::read(\"S3.secret_key\"));\n\t}", "private function connectServer() : S3Client\n {\n return new S3Client($this->storageConfig['s3']);\n }", "function __construct() {\n\t\tif (!isset(self::$uploads)) {\n\t\t\tself::uploadFactory($_FILES);\n\t\t}\n\t}", "protected function getS3Client()\n {\n // If we haven't call this function already\n if (!$this->s3) {\n // Generate a brand new instance and keep a reference to it.\n $this->s3 = new Aws\\S3\\S3Client(array(\n 'credentials' => new Aws\\Credentials\\Credentials(\n self::config()->AccessId,\n self::config()->Secret\n ),\n 'region' => $this->Region,\n 'version' => 'latest',\n ));\n }\n return $this->s3;\n }", "protected function getS3Client()\n {\n $config = $this->getAwsConfig();\n // Create an instance of the AWS SDK and S3Client.\n $awsSdk = new Sdk($config);\n return $awsSdk->createS3();\n }", "public function createS3Driver(array $config)\n {\n $s3Config = $this->formatS3Config($config);\n\n $root = $s3Config['root'] ?? null;\n\n $options = $config['options'] ?? [];\n\n return new FilesystemS3Adapter(new Flysystem(new S3Adapter(\n new S3Client($s3Config), $s3Config['bucket'], $root, $options), $config\n ));\n }", "public static function createFromUrlToS3( $url, $options=array() )\r\n {\r\n $app = \\Base::instance();\r\n \r\n $s3_options = array(\r\n 'clientPrivateKey' => $app->get('aws.clientPrivateKey'),\r\n 'serverPublicKey' => $app->get('aws.serverPublicKey'),\r\n 'serverPrivateKey' => $app->get('aws.serverPrivateKey'),\r\n 'expectedBucketName' => $app->get('aws.bucketname'),\r\n 'expectedMaxSize' => $app->get('aws.maxsize'),\r\n 'cors_origin' => $app->get('SCHEME') . \"://\" . $app->get('HOST') . $app->get('BASE')\r\n );\r\n \r\n if (!class_exists('\\Aws\\S3\\S3Client')\r\n || empty($s3_options['clientPrivateKey'])\r\n || empty($s3_options['serverPublicKey'])\r\n || empty($s3_options['serverPrivateKey'])\r\n || empty($s3_options['expectedBucketName'])\r\n || empty($s3_options['expectedMaxSize'])\r\n )\r\n {\r\n throw new \\Exception('Invalid configuration settings');\r\n }\r\n \r\n $options = $options + array('width'=>460, 'height'=>308);\r\n \r\n $request = \\Web::instance()->request( $url );\r\n if (empty($request['body'])) {\r\n throw new \\Exception('Could not download asset from provided URL');\r\n }\r\n \r\n $model = new static;\r\n \r\n $url_path = parse_url( $url , PHP_URL_PATH );\r\n $pathinfo = pathinfo( $url_path );\r\n $filename = $model->inputfilter()->clean( $url_path );\r\n $buffer = $request['body'];\r\n $originalname = str_replace( \"/\", \"-\", $filename );\r\n \r\n $thumb = null;\r\n if ( $thumb_binary_data = $model->getThumb( $buffer, null, $options )) {\r\n $thumb = new \\MongoBinData( $thumb_binary_data, 2 );\r\n }\r\n \r\n $title = \\Dsc\\String::toSpaceSeparated( $model->inputFilter()->clean( $originalname ) );\r\n \r\n $values = array(\r\n 'storage' => 's3',\r\n 'contentType' => $model->getMimeType( $buffer ),\r\n 'md5' => md5( $filename ),\r\n 'thumb' => $thumb,\r\n 'url' => null,\r\n \"source_url\" => $url,\r\n \"filename\" => $filename,\r\n 'title' => $title,\r\n );\r\n \r\n $model->bind($values);\r\n \r\n // these need to happen after the bind\r\n $model->slug = $model->generateSlug();\r\n $model->_id = new \\MongoId;\r\n \r\n /**\r\n * Push to S3\r\n */\r\n $bucket = $app->get( 'aws.bucketname' );\r\n $s3 = \\Aws\\S3\\S3Client::factory(array(\r\n 'key' => $app->get('aws.serverPublicKey'),\r\n 'secret' => $app->get('aws.serverPrivateKey')\r\n ));\r\n \r\n $key = (string) $model->_id;\r\n \r\n $res = $s3->putObject(array(\r\n 'Bucket' => $bucket,\r\n 'Key' => $key,\r\n 'Body' => $buffer,\r\n 'ContentType' => $model->contentType,\r\n ));\r\n \r\n $s3->waitUntil('ObjectExists', array(\r\n 'Bucket' => $bucket,\r\n 'Key' => $key\r\n ));\r\n \r\n if( !$s3->doesObjectExist( $bucket, $key ) ){\r\n throw new \\Exception( \"Upload to Amazon S3 failed\" );\r\n }\r\n \r\n $objectInfoValues = $s3->headObject(array(\r\n 'Bucket' => $bucket,\r\n 'Key' => $key\r\n ))->getAll();\r\n \r\n /**\r\n * END Push to S3\r\n */\r\n \r\n $model->url = $s3->getObjectUrl($bucket, $key);\r\n \r\n $model->s3 = array_merge( array(), (array) $model->s3, array(\r\n 'bucket' => $bucket,\r\n 'key' => $key,\r\n 'uuid' => (string) $model->_id\r\n ) ) + $objectInfoValues;\r\n \r\n return $model->save();\r\n }", "public function getS3Object(){\t\n\t\ttry {\t\n\t\t\t$this->autoRender = false;\n\t\t\t$s3Credentials = Configure::read('S3_CREDENTIALS');\n\t\n\t\t\t$s3 = S3Client::factory([\n\t\t\t\t\t'credentials' => [\n\t\t\t\t\t\t\t'key' => $s3Credentials['KEY'],\n\t\t\t\t\t\t\t'secret' => $s3Credentials['SECRET']\n\t\t\t\t\t],\n\t\t\t\t\t'region' => $s3Credentials['REGION'],\n\t\t\t\t\t'version' => $s3Credentials['VERSION'],\n\t\t\t\t\t\t\n\t\t\t]);\n\t\t\t\t\n\t\t\treturn $s3;\n\t\n\t\t}catch (S3Exception $e) {\n\t\t\techo $e->getMessage() . \"\\n\";\n\t\t}\n\t\n\t}", "private function __construct() {\n try {\n $this->_s3_client_instance = new S3Client([\n \"version\" => AWS_ACCESS_VERSION,\n \"region\" => AWS_ACCESS_REGION\n ]);\n\n } catch (S3Exception $exception) {\n $this->_error = $exception->getMessage();\n }\n }", "private function createAWSS3Mock()\n {\n /** @var $awsMock S3Client */\n $awsMock = $this->createMock(S3Client::class);\n return $awsMock;\n }", "public function moveToS3()\r\n {\r\n \t$app = \\Base::instance();\r\n \t\r\n \t$options = array(\r\n \t 'clientPrivateKey' => $app->get('aws.clientPrivateKey'),\r\n \t 'serverPublicKey' => $app->get('aws.serverPublicKey'),\r\n \t 'serverPrivateKey' => $app->get('aws.serverPrivateKey'),\r\n \t 'expectedBucketName' => $app->get('aws.bucketname'),\r\n \t 'expectedMaxSize' => $app->get('aws.maxsize'),\r\n \t 'cors_origin' => $app->get('SCHEME') . \"://\" . $app->get('HOST') . $app->get('BASE')\r\n \t);\r\n \t\r\n \tif (!class_exists('\\Aws\\S3\\S3Client')\r\n \t|| empty($options['clientPrivateKey'])\r\n \t|| empty($options['serverPublicKey'])\r\n \t|| empty($options['serverPrivateKey'])\r\n \t|| empty($options['expectedBucketName'])\r\n \t|| empty($options['expectedMaxSize'])\r\n \t)\r\n \t{\r\n \t throw new \\Exception('Invalid configuration settings');\r\n \t}\r\n \t\r\n \t$bucket = $app->get( 'aws.bucketname' );\r\n \t$s3 = \\Aws\\S3\\S3Client::factory(array(\r\n 'key' => $app->get('aws.serverPublicKey'),\r\n 'secret' => $app->get('aws.serverPrivateKey')\r\n ));\r\n\r\n \t$pathinfo = pathinfo($this->{'filename'});\r\n \t$key = (string) $this->id;\r\n \tif (!empty($pathinfo['extension'])) {\r\n \t $key .= '.' . $pathinfo['extension'];\r\n \t}\r\n \t\r\n \t$idx = 1;\r\n \twhile ($s3->doesObjectExist( $bucket, $key ) )\r\n \t{\r\n \t\t$key = (string) $this->id . '-' . $idx;\r\n \t\tif (!empty($pathinfo['extension'])) {\r\n \t\t $key .= '.' . $pathinfo['extension'];\r\n \t\t}\r\n \t\t$idx++;\r\n \t}\r\n \t\r\n \t$chunks = ceil( $this->length / $this->chunkSize );\r\n \t\r\n \t$collChunkName = $this->collectionNameGridFS() . \".chunks\";\r\n \t$collChunks = $this->getDb()->{$collChunkName};\r\n \t$data = '';\r\n \tfor( $i=0; $i<$chunks; $i++ )\r\n \t{\r\n \t\t$chunk = $collChunks->findOne( array( \"files_id\" => $this->id, \"n\" => $i ) );\r\n \t\t$data .= (string) $chunk[\"data\"]->bin;\r\n \t}\r\n \t \r\n \t$res = $s3->putObject(array(\r\n \t\t'Bucket' => $bucket,\r\n \t\t'Key' => $key,\r\n \t\t'Body' => $data,\r\n \t\t\t'ContentType' => $this->contentType,\r\n \t));\r\n \t\r\n \t$s3->waitUntil('ObjectExists', array(\r\n\t\t\t'Bucket' => $bucket,\r\n\t\t\t'Key' => $key\r\n \t));\r\n \t\r\n \tif( !$s3->doesObjectExist( $bucket, $key ) ){\r\n \t\tthrow new \\Exception( \"Upload to Amazon S3 failed! - Asset #\".(string)$this->id );\r\n \t}\r\n \t\r\n \t$objectInfoValues = $s3->headObject(array(\r\n 'Bucket' => $bucket,\r\n 'Key' => $key\r\n \t))->getAll();\r\n \t\r\n \t$this->storage = 's3';\r\n \t$this->url = $s3->getObjectUrl($bucket, $key);\r\n \t\r\n \t$this->s3 = array_merge( array(), (array) $this->s3, array(\r\n \t\t'bucket' => $bucket,\r\n \t\t'key' => $key,\r\n \t\t'filename' => $pathinfo['basename'],\r\n \t\t'uuid' => (string)$this->id\r\n \t) ) + $objectInfoValues;\r\n \t\r\n \t$this->clear( 'chunkSize' );\r\n \t$this->save();\r\n \t\r\n \t// delete all chunks\r\n \t$collChunks->remove( array( \"files_id\" => $this->id ) );\r\n \t \t\r\n \treturn $this;\r\n }", "public function getFactory ()\n {\n return S3Client::factory($this->getAwsAuthArray()); // returns the AWS S3 Client Factory, will fail if no key &/or secret\n }", "public static function factory(array $params=array())\r\n {\r\n $bucket = SquirtUtil::validateParamClass('bucket', 'Riak\\Bucket', $params);\r\n\r\n $instance = new static($bucket);\r\n\r\n $namespace =\r\n SquirtUtil::validateStringParamWithDefault('namespace', $params, 'squirt');\r\n if (strlen($namespace) > 0) {\r\n $instance->setNamespace($namespace);\r\n }\r\n\r\n return $instance;\r\n }", "function S3Object($name) {\n\t\t\treturn new S3Object($this->__name, $name, $this->GetAWSKeyId(), $this->GetSecretKey());\n\t\t}", "public function store(Request $request)\n {\n $response = $this->s3->createMultipartUpload([\n 'Bucket' => config('filesystems.disks.s3.bucket'),\n 'Key' => $request->input('filename'),\n 'ContentType' => $request->input('metadata.type'),\n 'ContentDisposition' => 'inline',\n ]);\n\n return response()->json([\n 'uploadId' => $response->get('UploadId'),\n 'key' => $response->get('Key'),\n ]);\n }", "private function load_s3()\n\t{\n\t\t// S3 credentials\n\t\t$this->client = S3Client::factory(array(\n\t\t\t'key'\t\t=> $this->config['aws_access_key'],\n\t\t\t'secret'\t=> $this->config['aws_secret_key'],\n\t\t));\n\n\t\t// Register Stream Wrapper\n\t\ttry {\n\t\t\t$this->client->registerStreamWrapper();\n\t\t} catch ( Exception $e ) {\n\t\t\t$errors = array(\n\t\t\t\t'error' => $e->getMessage(),\n\t\t\t);\n\n\t\t\t// Set the template here\n\t\t\t$template = File::get( __DIR__ . '/views/error-no-render.html');\n\n\t\t\t// Parse the template\n\t\t\t$html = Parse::template($template, $errors);\n\n\t\t\theader('Content-Type', 'application/json');\n\t\t\techo self::build_response_json(false, true, FILECLERK_S3_ERROR, $e->getMessage(), 'error', $errors, null, $html);\n\t\t\texit;\n\t\t}\n\t}", "public function connect(array $config)\n {\n $sqs = SqsClient::factory($config);\n\n return new S3SqsQueue($sqs, $config['queue']);\n }", "public function getS3() {\r\n if (empty($this->s3)) {\r\n try {\r\n $this->s3 = new AmazonS3();\r\n } catch (Exception $e) {\r\n $this->modx->log(modX::LOG_LEVEL_ERROR,'[modAws] Could not load AmazonS3 class: '.$e->getMessage());\r\n }\r\n }\r\n return $this->s3;\r\n }", "function wps3backup_upload_handler() {\n check_ajax_referer('wps3backup_controls');\n\n if (empty($_POST['backup_dir'])) {\n wp_send_json_error('Empty backup directory');\n }\n\n if (!realpath($_POST['backup_dir'])) {\n wp_send_json_error('Backup directory does not exist');\n }\n\n $backupFile = realpath(\n realpath($_POST['backup_dir'])\n . DIRECTORY_SEPARATOR\n . WPS3BACKUP_LATEST_BACKUP_NAME\n );\n\n if (!$backupFile) {\n wp_send_json_error(\n sprintf(\n 'Can\\'t find \"%s\" in backup directory, please run backup first',\n WPS3BACKUP_LATEST_BACKUP_NAME\n )\n );\n }\n\n if (empty($_POST['aws_region'])) {\n wp_send_json_error('Empty AWS region');\n } elseif (empty($_POST['s3_bucket'])) {\n wp_send_json_error('Empty S3 bucket');\n } elseif (empty($_POST['aws_key'])) {\n wp_send_json_error('Empty AWS key');\n } elseif (empty($_POST['aws_secret'])) {\n wp_send_json_error('Empty AWS secret');\n }\n\n require 'vendor/autoload.php';\n\n $s3 = new \\Aws\\S3\\S3Client([\n 'version' => 'latest',\n 'region' => $_POST['aws_region'],\n 'credentials' => [\n 'key' => $_POST['aws_key'],\n 'secret' => $_POST['aws_secret']\n ]\n ]);\n\n $bucket = $_POST['s3_bucket'];\n $key = str_replace(' ', '_', strtolower(get_bloginfo())) . '_' . date('Y_m_d');\n\n try {\n $s3->putObject([\n 'Bucket' => $bucket,\n 'Key' => $key,\n 'SourceFile' => $backupFile\n ]);\n } catch (Exception $e) {\n wp_send_json_error($e->getMessage());\n }\n\n wp_send_json_success(sprintf('Successfully uploaded object with key: \"%s\"', $key));\n}", "public function create($input) {\n return Upload::create($input);\n }", "function send_to_bucket($attachment, $filename) {\n $aws_key = get_option('aws_key');\n $aws_secret = get_option('secret_key');\n $aws_can_id = get_option('can_id');\n $aws_can_name = get_option('can_name');\n $host = get_option('bucket_host');\n // require the amazon sdk for php library\n require_once 'aws-sdk-for-php-master/sdk.class.php';\n // Instantiate the S3 class and point it at the desired host\n $Connection = new AmazonS3(array(\n 'key' => $aws_key,\n 'secret' => $aws_secret,\n 'canonical_id' => $aws_can_id,\n 'canonical_name' => $aws_can_name,\n ));\n $Connection->set_hostname($host);\n $Connection->allow_hostname_override(false);\n $Connection->enable_path_style(true);\n $bucketname = get_option('bucket_name');\n\n $Connection->create_object($bucketname, $filename, array('fileUpload' => \"$attachment\", 'contentType' => 'text/plain', 'https' => true, ));\n $Connection->set_object_acl($bucketname, $filename , AmazonS3::ACL_PUBLIC);\n $opt['https'] = true; \n\n /*\n This is the return URL if needed\n $plans_url = $Connection->get_object_url($bucketname , $filename, 0, $opt);\n */\n}", "public function getS3Bucket();", "public function getS3Client(): S3Client\n {\n return new S3Client([\n 'version' => 'latest',\n 'region' => $this->getAwsRegion(),\n ]);\n }", "public function createS3Filesystem($config)\n {\n $config = $this->parseEnv($config);\n\n $config['root'] = array_get($config, 'path');\n\n return $this->filesystem->createS3Driver($config);\n }", "function call_Multi_Image_Uploader()\r\n{\r\n new Multi_Image_Uploader();\r\n}", "function s3($command=null,$args=null)\n{\n\tstatic $s3=null;\n\tif ($s3===null)\n\t$s3 = new Aws\\S3\\S3Client([\n\t 'version' => 'latest',\n\t 'region' => 'us-east-1',\n\t 'signature_version' => 'v4',\n\t 'credentials' => [\n\t 'key' => aws_key(),\n\t 'secret' => aws_secret(),\n\t ]\n ]);\n \n\tif ($command===null)\n return $s3;\n\t$args=func_get_args();\n\tarray_shift($args);\n\ttry {\n\t\t$res=call_user_func_array([$s3,$command],$args);\n\t\treturn $res;\n\t}\n\tcatch (AwsException $e)\n\t{\n\t\techo $e->getMessage(),PHP_EOL;\n\t}\t\n\treturn null;\n}", "public function testAWSS3_post()\n\t{\n\t\t // $b = $this->aws_s3->createNewBucket('lender1');\n\t\t // print_r($b);\n\t\t/* CREATE NEW BUCKETS*/\n\t\t\n\t\t/* LIST OF BUCKETS*/\n\t\t\n\t\t\n\t\t// $res = $this->aws_s3->listAllBuckets();\n\t\t\n\t\t// echo \"All Buckets from Business Controller\\n\\n\";\n\t\t// foreach ($res['Buckets'] as $bucket) {\n\t\t\t// echo $bucket['Name'];\n\t\t\t// echo \"\\n\\n\\n\\n\";\n\t\t// }\n\t\t\n\t\t/* LIST OF BUCKETS*/\n\t\t\n\t\t\n\t\t/* STORE FILE TO S3*/\n\t\t\n\t\t// $file = $_FILES['myfile']['tmp_name'];\n\t\t// $file2 = $_FILES['myfile']['name'];\n\t\t// print_r($file);\n\t\t// print_r($file2);\n\t\t\n\t\t// $s3pathname = 'pd2/'.$file2;\n\t\t// $data = array('bucket_name'=>'lender1','key'=>$s3pathname,'sourcefile'=>$file);\n\t\t// $res = $this->aws_s3->uploadFileToS3Bucket($data);\n\t\t// print_r($res);\n\t\t// echo is_object($res);\n\t\t// echo is_array($res);\n\t\t// echo \"*********\\n\\n\";\n\t\t// echo $res['ObjectURL'];\n\t\t// echo $res['@metadata']['statusCode'];\n\t\t// foreach($res as $key => $value)\n\t\t// {\n\t\t\t// echo $key.\"\\n\\n\";\n\t\t// }\n\t\t\n\t\t/* STORE FILE TO S3*/\n\t\t\n\t\t// /* GET FILE FROM S3*/\n\t\t// $bucket_name = 'lender1';\n\t\t// $folder_name = 'pd2';\n\t\t// $file_name = '';\n\t\t// $res = $this->aws_s3->getSingleObjectInaBucket($bucket_name,$folder_name);\n\t\t// print_r($res);\n\t\t//echo \"\\n\\n\\n\\n\\n<br>\";\n\t\t //header(\"Content-Type:{$res['ContentType']}\");\n\t\t//header(\"Content-Disposition:attachment; filename='woodgrass1.jpg'\");\n\n\t\t// print_r($res);\n\t\t\n\t\t/* GET FILES FROM S3*/\n\t\t\n\t\t$bucket_name = 'lender1';\n\t\t$folder_name = 'pd2';\n\t\t$r = $this->aws_s3->getAllObjectsInaBucket($bucket_name,$folder_name);\n\t\t$s3_signed_urls = array();\n\t\tforeach($r as $k)\n\t\t{\n\t\t\tif($k['Key'] != $folder_name.'/') array_push($s3_signed_urls,$this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$k['Key']));\n\t\t\t\n\t\t}\n\t\tprint_r($s3_signed_urls);\n\t\t\n\t\t/* GET FILES FROM S3*/\n\t\t/* GET ALL FILES FROM IN A FOLDER WITHIN A BUCKET*/\n\t\t/*\n\t\t$id = MYDB::saveRecords(array('city_name'=>'salem'),'t_city_master');\n\t\tprint_r($id);\n\t\t*/\n\t\t\n\t\t/*\n\t\t$where_condition_array = array();\n\t\t$id = MYDB::selectRecords($where_condition_array,'t_city_master',$print_query = '');\n\t\tprint_r($id);\n\t\t*/\n\t\t\n\t\t\n\t\t//$data = MYDB::updateRecords($record_data = array(),$table_name,$where_condition_array = array(),$print_query = '')\n\t\t\n\t\t/*\n\t\t$where= array('city_name'=>'chennai','fk_state_id'=>'1');\n\t\t\n\t\t$or_where = array('city_name'=>'salem','fk_state_id'=>'4');\n\t\t$or_where_total[] = $or_where;\n\t\t$or_where = array('city_name'=>'erode');\n\t\t$or_where_total[] = $or_where;\n\t\t\n\t\t$fields = array('city_name','fk_state_id');\n\t\t$id = MYDB::selectCustomRecords($fields , $where,$or_where_total,$table = 't_city_master', $limit = '', $order_by_colum_name = 'fk_state_id', $order_by = '',$group_by = 'fk_state_id',$print_query = '');\n\t\tprint_r($id);\n\t\t*/\n\t\t\n\t\t\n\t\t// $columns = array('m_states.name as sname','BRANCH.name as bname','m_city.*');\n\t\t// $table = BRANCH.' as BRANCH';\n\t\t// $joins = array(\n\t\t\t// array(\n\t\t\t\t// 'table' => 'm_city',\n\t\t\t\t// 'condition' => 'BRANCH.fk_city_id = m_city.city_id ',\n\t\t\t\t// 'jointype' => 'INNER'\n\t\t\t// ),\n\t\t\t// array(\n\t\t\t\t// 'table' => 'm_states',\n\t\t\t\t// 'condition' => 'm_city.fk_state_id = m_states.state_id',\n\t\t\t\t// 'jointype' => 'INNER'\n\t\t\t// )\n\t\t// );\n\t\t// $id = MYDB::getJoinRecords($columns,$table,$joins,$print_query = '');\n\t\t// print_r($id);\n\t\t\n\t}", "public function s3Streamewrapper()\n {\n $this->s3->registerStreamWrapper();\n }" ]
[ "0.5934584", "0.5713374", "0.5684964", "0.5647068", "0.54735273", "0.5470488", "0.5457707", "0.54536027", "0.5448086", "0.5417879", "0.54163283", "0.5407867", "0.5391453", "0.53402406", "0.5296888", "0.5269851", "0.52486247", "0.52382123", "0.5234674", "0.5213807", "0.5110522", "0.50852114", "0.5060064", "0.5048075", "0.5045684", "0.50358427", "0.49628457", "0.49563563", "0.4914897", "0.49066228" ]
0.7931766
0
get the s3 adapter.
protected function getS3Adapter(array $config): AwsS3Adapter { return app('filesystem')->disk(Arr::get($config, 'disk', 's3'))->getAdapter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdapter()\n {\n $client = new S3Client([\n 'credentials' => [\n 'key' => $this->accessKey,\n 'secret' => $this->secret,\n ],\n 'region' => $this->region,\n 'version' => $this->version, // or \"latest\"\n //'profile' => 'default', #if enabled - the library searches for credentials in {webserver_root}/.aws/credentials\n ]);\n\n $bucket = 'mbt-public-media';\n return new AwsS3Adapter($client, $bucket);\n }", "public function getS3() {\r\n if (empty($this->s3)) {\r\n try {\r\n $this->s3 = new AmazonS3();\r\n } catch (Exception $e) {\r\n $this->modx->log(modX::LOG_LEVEL_ERROR,'[modAws] Could not load AmazonS3 class: '.$e->getMessage());\r\n }\r\n }\r\n return $this->s3;\r\n }", "function getConnection()\n\t{\n\t\treturn S3Client::factory(array(\"key\"=>$this->iamkey, \"secret\"=>$this->iamsecret));\n\t}", "protected function getS3Client()\n {\n // If we haven't call this function already\n if (!$this->s3) {\n // Generate a brand new instance and keep a reference to it.\n $this->s3 = new Aws\\S3\\S3Client(array(\n 'credentials' => new Aws\\Credentials\\Credentials(\n self::config()->AccessId,\n self::config()->Secret\n ),\n 'region' => $this->Region,\n 'version' => 'latest',\n ));\n }\n return $this->s3;\n }", "public function getS3Object(){\t\n\t\ttry {\t\n\t\t\t$this->autoRender = false;\n\t\t\t$s3Credentials = Configure::read('S3_CREDENTIALS');\n\t\n\t\t\t$s3 = S3Client::factory([\n\t\t\t\t\t'credentials' => [\n\t\t\t\t\t\t\t'key' => $s3Credentials['KEY'],\n\t\t\t\t\t\t\t'secret' => $s3Credentials['SECRET']\n\t\t\t\t\t],\n\t\t\t\t\t'region' => $s3Credentials['REGION'],\n\t\t\t\t\t'version' => $s3Credentials['VERSION'],\n\t\t\t\t\t\t\n\t\t\t]);\n\t\t\t\t\n\t\t\treturn $s3;\n\t\n\t\t}catch (S3Exception $e) {\n\t\t\techo $e->getMessage() . \"\\n\";\n\t\t}\n\t\n\t}", "private function connectServer() : S3Client\n {\n return new S3Client($this->storageConfig['s3']);\n }", "public function getAmazonS3()\n {\n return $this->amazonS3;\n }", "protected function getS3Client()\n {\n $config = $this->getAwsConfig();\n // Create an instance of the AWS SDK and S3Client.\n $awsSdk = new Sdk($config);\n return $awsSdk->createS3();\n }", "public static function getDisk()\n {\n return Storage::disk('s3');\n }", "public function getFactory ()\n {\n return S3Client::factory($this->getAwsAuthArray()); // returns the AWS S3 Client Factory, will fail if no key &/or secret\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function get_adapter()\n {\n return $this->_adapter;\n }", "public function getS3Bucket();", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter() : Adapter\n {\n return $this->adapter;\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->req->getAdapter();\n\t}", "public static function adapter()\n {\n return self::connectionManager()->getAdapter(static::connectionName());\n }", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "protected function &getS3Client()\n\t{\n\t\t// Retrieve engine configuration data\n\t\t$config = $this->getEngineConfiguration();\n\n\t\t// Get the configuration parameters\n\t\t$accessKey = $config['accessKey'];\n\t\t$secretKey = $config['secretKey'];\n\t\t$useSSL = $config['useSSL'];\n\t\t$customEndpoint = $config['customEndpoint'];\n\t\t$signatureMethod = $config['signatureMethod'];\n\t\t$region = $config['region'];\n\t\t$disableMultipart = $config['disableMultipart'];\n\t\t$bucket = $config['bucket'];\n\n\t\t// Required since we're returning by reference\n\t\t$null = null;\n\n\t\tif ($signatureMethod == 's3')\n\t\t{\n\t\t\t$signatureMethod = 'v2';\n\t\t}\n\n\t\tFactory::getLog()\n\t\t\t->log(LogLevel::DEBUG, \"{$this->engineLogName} -- Using signature method $signatureMethod, \" . ($disableMultipart ? 'single-part' : 'multipart') . ' uploads');\n\n\t\t// Makes sure the custom endpoint has no protocol and no trailing slash\n\t\t$customEndpoint = trim($customEndpoint);\n\n\t\tif ( !empty($customEndpoint))\n\t\t{\n\t\t\t$protoPos = strpos($customEndpoint, ':\\\\');\n\n\t\t\tif ($protoPos !== false)\n\t\t\t{\n\t\t\t\t$customEndpoint = substr($customEndpoint, $protoPos + 3);\n\t\t\t}\n\n\t\t\t$customEndpoint = rtrim($customEndpoint, '/');\n\n\t\t\tFactory::getLog()\n\t\t\t\t->log(LogLevel::DEBUG, \"{$this->engineLogName} -- Using custom endpoint $customEndpoint\");\n\t\t}\n\n\t\t// Remove any slashes from the bucket\n\t\t$bucket = str_replace('/', '', $bucket);\n\n\t\t// Sanity checks\n\t\tif (empty($accessKey))\n\t\t{\n\t\t\t$this->setError('You have not set up your ' . $this->engineLogName . ' Access Key');\n\n\t\t\treturn $null;\n\t\t}\n\n\t\tif (empty($secretKey))\n\t\t{\n\t\t\t$this->setError('You have not set up your ' . $this->engineLogName . ' Secret Key');\n\n\t\t\treturn $null;\n\t\t}\n\n\t\tif ( !function_exists('curl_init'))\n\t\t{\n\t\t\t$this->setWarning('cURL is not enabled, please enable it in order to post-process your archives');\n\n\t\t\treturn null;\n\t\t}\n\n\t\tif (empty($bucket))\n\t\t{\n\t\t\t$this->setError('You have not set up your ' . $this->engineLogName . ' Bucket');\n\n\t\t\treturn $null;\n\t\t}\n\n\n\t\t// Prepare the configuration\n\t\t$configuration = new Configuration($accessKey, $secretKey, $signatureMethod, $region);\n\t\t$configuration->setSSL($useSSL);\n\n\t\tif (!empty($config['token']))\n\t\t{\n\t\t\t$configuration->setToken($config['token']);\n\t\t}\n\n\t\tif ($customEndpoint)\n\t\t{\n\t\t\t$configuration->setEndpoint($customEndpoint);\n\t\t}\n\n\t\t// If we're dealing with China AWS, we have to use the Legacy Paths\n\t\tif ($region == 'cn-north-1')\n\t\t{\n\t\t\t$configuration->setUseLegacyPathStyle(true);\n\t\t}\n\n\t\t// Create the S3 client instance\n\t\t$s3Client = new Connector($configuration);\n\n\t\treturn $s3Client;\n\t}", "public function getS3Client(): S3Client\n {\n return new S3Client([\n 'version' => 'latest',\n 'region' => $this->getAwsRegion(),\n ]);\n }" ]
[ "0.85968053", "0.7119198", "0.68366945", "0.67225814", "0.66513973", "0.66286635", "0.64920807", "0.6468124", "0.6407579", "0.6379342", "0.63625413", "0.63625413", "0.63625413", "0.63625413", "0.63625413", "0.63625413", "0.63625413", "0.63625413", "0.635483", "0.6185719", "0.6150055", "0.6150055", "0.61402434", "0.60916245", "0.60916245", "0.60669047", "0.60615534", "0.6058797", "0.6039921", "0.5889864" ]
0.7449229
1
/ function name recordlike() author kontem date 20130503 return json data record user like log
function recordlike($data){ $mid=null; $mid=$_SESSION['mid']; if(!$mid){echo json_encode(2);exit();} $videoid=null; $videoid=intval($_POST['vid']); $checkLikeSql=null; $checkLikeSql="select * from ai_video_vote where uid=$mid and vid=$videoid"; $checkLikeInfo=array(); $checkLikeInfo=C_mysqlQuery($checkLikeSql); $checkLikeInfo = mysql_fetch_assoc($checkLikeInfo); if($checkLikeInfo['uid']>0){ echo json_encode(2); exit(); } else{ $usql="update ai_video set `like`=`like`+1 where id=$videoid"; C_mysqlQuery($usql); $insql='insert into ai_video_vote (`uid`,`vid`) values ("'.$mid.'","'.$videoid.'")'; C_mysqlQuery($insql); echo json_encode(1); exit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postlike(){\n if($_SERVER['REQUEST_METHOD'] === 'POST'){\n $user_id = $_POST['user_id'];\n $post_id = $_POST['post_id'];\n if(intval($user_id) == 0 || intval($post_id) == 0){\n $arr[0]['Result'] = 0;\n\t $arr[0]['MSG'] = 'please send all required data';\n echo json_encode($arr);\n die;\n }\n if($this->post->checkLike($user_id,$post_id)){\n \t $json[0]['result']=0;\n\t $json[0]['msg']='Already liked';\n\t echo json_encode($json);\n\t die; \n }\n $liked=$this->post->LikePost($user_id,$post_id);\n if($liked){\n \t$json[0]['result']=1;\n\t$json[0]['msg']='liked';\n\techo json_encode($json);\n\tdie; \n }else{\n \t$json[0]['result']=0;\n\t$json[0]['msg']='error';\n\techo json_encode($json);\n\tdie; \n }\n }else{\n $arr[0]['Result'] = 0;\n\t$arr[0]['MSG'] = 'please call required method';\n echo json_encode($arr);\n }\n }", "public function verificarLike()\n\t{\n\t\t$this->que_bda = \"SELECT * FROM like_comentario WHERE \n\t\t\t\t\t\t\t\t\t\t\t\tfky_usu_onl = '$this->fky_usu_onl' AND \n\t\t\t\t\t\t\t\t\t\t\t\tfky_com_vid = '$this->fky_com_vid' AND \n\t\t\t\t\t\t\t\t\t\t\t\ttip_lik_vid = 'L';\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}", "function scrivilistathread($mese, $anno, $mese1, $anno1) {\n\tconnetti($db);\n\t$query = \"SELECT postusername, count(*) thread FROM `vb_thread` WHERE dateline >= unix_timestamp(DATE('\".$anno.\"-\".$mese.\"-01')) and dateline < unix_timestamp(DATE('\" . $anno1 . \"-\" . ($mese1) . \"-01')) and postusername<>'' and postuserid<>770 group by postusername order by thread desc limit 10\";\n\t$result = seleziona($db, $query);\n\t$n_righe = get_num_rows($result);\n\t$arr=array();\n\tif ($n_righe > 0) {\n\t\tfor ($i = 0; $i < $n_righe; $i++) {\n\t\t\t$riga = scorri_record($result);\n\t\t\t$arr[]=array('username' => $riga['postusername'], 'thread' => $riga['thread']);\n\t\t}\n\t\techo json_encode($arr);\n\t}\n}", "public function checklikes(){\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$postid = $this->input->post(\"postid\");\n\t\t\t$userid = $this->input->post(\"userid\");\n\n\t\t\t$con = array('post_id'=>$postid,'user_id'=>$userid);\n\t\t\tif($this->get->read('post_likes',$con)){\n\t\t\t\techo json_encode(array('stat'=>'like'));\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo json_encode(array('stat'=>'notlike'));\n\t\t\t}\n\t\t}\t\n\t\telse{\n\t\t\tredirect('error');\n\t\t}\n\t}", "function scrivimipiace($mese, $anno, $mese1, $anno1) {\n\tconnetti($db);\n\t$query=\"SELECT username, count(*) n FROM vb_vbseo_likes left join vb_user on l_dest_userid=userid where l_dateline >= unix_timestamp(DATE('\".$anno.\"-\".$mese.\"-01')) and l_dateline < unix_timestamp(DATE('\" . $anno1 . \"-\" . ($mese1) . \"-01')) and username<>'' and userid<>770 group by username order by n desc limit 10\";\n\t$result = seleziona($db, $query);\n\t$n_righe = get_num_rows($result);\n\t$arr=array();\n\tif ($n_righe > 0) {\n\t\tfor ($i = 0; $i < $n_righe; $i++) {\n\t\t\t$riga = scorri_record($result);\n\t\t\t$arr[]=array('username' => $riga['username'], 'mipiace' => $riga['n']);\n\t\t}\n\t\techo json_encode($arr);\n\t}\n\t//else\n\t//\techo '<b>Statistiche \"mi piace\"<br />disponibili solo da maggio 2013</b>';\n}", "private function userlikelist($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'], FILTER_SANITIZE_STRING) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n // return $valid;\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n $likes_listing = $this->Api_model->likesListing($user_id,$valid['VALUE']['user_id']);\n $message_listing = $this->Api_model->message_likes($user_id);\n $media_likes = $this->Api_model->media_likes($user_id);\n $final_response = [];\n $arr = [];\n //MAKR IF THE LOGGED USER FOLLOWS THE USER\n if(!empty($likes_listing)){\n $likes_listing = $this->markFollowing($valid['VALUE']['user_id'],$likes_listing);\n }\n // return $likes_listing;\n if(!empty($message_listing)){\n $message_listing = $this->markFollowing($valid['VALUE']['user_id'],$message_listing);\n }\n // return $message_listing;\n\n if(!empty($media_likes)){\n $media_likes = $this->markFollowing($valid['VALUE']['user_id'],$media_likes);\n }\n foreach ($likes_listing as $key => $value) {\n if( !in_array($value['user_id'], $arr) ){\n array_push($final_response, $value);\n array_push($arr,$value['user_id']);\n }\n }\n\n foreach ($message_listing as $key => $value) {\n if( !in_array($value['user_id'], $arr) ){\n array_push($final_response, $value);\n array_push($arr,$value['user_id']);\n }\n }\n\n foreach ($media_likes as $key => $value) {\n if( !in_array($value['user_id'], $arr) ){\n array_push($final_response, $value);\n array_push($arr,$value['user_id']);\n }\n }\n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $final_response;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "protected function like($data) { \n\t\t$user_id \t\t= $data->user_id;\n\t\t$pid \t\t\t= $data->pid;\n\t\t$reddit_id \t\t= $data->name;\n\t\tif($reddit_id!=''){\n\t\t\t$where_AND = \"AND reddit_id = '\".$reddit_id.\"'\";\n\t\t\t$where \t= \"reddit_id = '\".$reddit_id.\"'\";\n\t\t} else {\n\t\t\t$where_AND = \"AND post_id = \".$pid;\n\t\t\t$where \t= \"post_id = \".$pid;\n\t\t}\n\t\t\n\t\t$sql\t\t= \"Select * from userpostlike where user_id = \".$user_id.\" \".$where_AND;\t\t\n\t\t$query \t\t= $this->db->query($sql);\n\t\tif($query->num_rows() > 0) { \n\t\t\t// user already liked the post\n\t\t\t$this->falseResponse('You already liked the post.');\n\t\t} else {\n\t\t\n\t\t\t$sql\t \t\t= \"Select likecount from appstats where \".$where;\n\t\t\t$query \t\t\t= $this->db->query($sql);\n\t\t\tif($query->num_rows() > 0) { \n\t\t\t\t$likedata = $query->row_array();\n\t\t\t\t$likedata['likecount'] \t= $likedata['likecount']+1;\n\t\t\t\t$update_like \t\t\t= \"UPDATE appstats SET likecount= \".$likedata['likecount'].\" where \".$where;\n\t\t\t\t\n\t\t\t\tif($this->db->query($update_like)){\n\t\t\t\t\t$like_entry = array(\n\t\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t\t\t'post_id'\t\t=> $pid\n\t\t\t\t\t); \n\t\t\t\t\t$result\t\t\t\t= $this->db->insert('userpostlike', $like_entry);\n\t\t\t\t\t$activity_data= array(\n\t\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t\t'post_id'\t\t=> $pid,\n\t\t\t\t\t\t'mode'\t\t\t=> '1', \n\t\t\t\t\t\t'user_id'\t\t=> $user_id\n\t\t\t\t\t);\n\t\t\t\t\t$activity\t\t\t\t= $this->db->insert('activity', $activity_data);\n\t\t\t\t\t$this->trueResponse($likedata,'success', $encode = true);\n\t\t\t\t}\n\t\t\t} else { //insert if there is first time any user like this post\n\t\t\t\t$like_entry = array(\n\t\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t\t\t'post_id'\t\t=> $pid\n\t\t\t\t\t); \n\t\t\t\t$result\t\t\t\t= $this->db->insert('userpostlike', $like_entry);\n\t\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t'likecount'\t\t=> 1,\n\t\t\t\t\t'viewcount'\t\t=> '', \n\t\t\t\t\t'commentcount'\t=> '', \n\t\t\t\t\t//'user_id'\t\t=> '',\n\t\t\t\t\t'post_id'\t\t=> $pid\n\t\t\t\t);\n\t\t\t\t$result\t\t\t\t= $this->db->insert('appstats', $data);\n\t\t\t\t$last_inserted_id \t= $this->db->insert_id();\n\t\t\t\tif (!empty($last_inserted_id)) {\n\t\t\t\t\t$activity_data= array(\n\t\t\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t\t\t'post_id'\t\t=> $pid,\n\t\t\t\t\t\t'mode'\t\t\t=> '1', \n\t\t\t\t\t\t'user_id'\t\t=> $user_id//$user_id\n\t\t\t\t\t);\n\t\t\t\t\t$activity\t\t\t= $this->db->insert('activity', $activity_data);\t\t\t\n\t\t\t\t\t$sql = \"select likecount from appstats where id='$last_inserted_id'\";\n\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t\t\t$likedata \t\t= $query->_fetch_object();\n\t\t\t\t\t\t$this->trueResponse($likedata,'success', $encode = true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function get_liked_notifications($uid) {\n\ttry {\n $db = \\Db::dbc();\n $sql=\"SELECT IDTWEET, A.IDUSER, DATEAIME, LUAIME FROM TWEET T INNER JOIN AIMER A USING(IDTWEET) WHERE T.IDUSER = :uid\";\n $stmt=$db->prepare($sql);\n $stmt->execute(array(':uid'=>$uid));\n\n $results = $stmt->fetchAll();\n if($results==false) {\n $aimeNoti=(array) NULL;\n } else {\n foreach($results as $result) {\n $aimeNoti[]=(object) array(\n \t\t\t\"type\"=>\"liked\",\n \"post\"=>\\Model\\Post\\get($result[\"IDTWEET\"]),\n \"liked_by\"=>\\Model\\User\\get($result[\"IDUSER\"]),\n \"date\"=>new \\DateTime($result[\"DATEAIME\"]),\n \"reading_date\"=>$result[\"LUAIME\"] == NULL ? NULL : new \\DateTime($result[\"LUAIME\"])\n );\n }\n }\n\n\t\t$db = NULL;\n\t\treturn $aimeNoti;\n } catch (\\PDOException $e) {\n $db = NULL;\n\t\techo $e->getMessage();\n\t}\n}", "function userLiked($post_id)\r\n {\r\n $db = connect(); //Datenbank verbindung\r\n\r\n $userid = $_SESSION['userdata']['ID_User']; //ID des aktuellen User\r\n \r\n $sql = \"SELECT count(*) FROM liken WHERE User_ID = ? AND Post_ID = ?;\";\r\n $statement = $db->prepare($sql);\r\n $statement->bind_param('ii',$userid,$post_id);\r\n $statement->execute();\r\n $statement->bind_result($userLikeCheck);\r\n\r\n while($statement->fetch()){\r\n $check = array('userLike' => $userLikeCheck);\r\n }\r\n //Wen er den Beitrag schon geliket hat, wird true zurück gegeben\r\n if ($check['userLike'] == 1) {\r\n return true;\r\n }\r\n else{ //Wen er den BEitrag noch nich geliket hat, wird false zurück gegeben \r\n return false;\r\n }\r\n }", "function get_like($like_id)\n {\n return $this->db->get_where('likes',array('like_id'=>$like_id))->row_array();\n }", "public function getWhoLikePhotoAction()\n {\n// \t$photo_id = $this->getRequest()->getParam( 'photo_id' ) ;\n// \t$photo_posted_by_user_id = $this->getRequest()->getParam( 'photo_posted_by_user_id' ) ;\n// \t$is_wallpost_exist = \\Extended\\wall_post::checkWallpostByPhotoNUser($photo_id , $photo_posted_by_user_id);\n// \tif($is_wallpost_exist){\n// \t\techo Zend_Json::encode( \\Extended\\likes::getUsersForWallpost($is_wallpost_exist ) );\n// \t}\n// \telse\n// \t{\n// \t\treturn ;\n// \t}\n// \tdie;\n \t$user_info = array();\n \tif($this->getRequest()->getParam( 'photo_id' ))\n \t{\n \t\tif( \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam( 'photo_id' ) ))\n \t\t{\n \t\t\t$ppl_who_liked = \\Extended\\likes::getUserslikedWallpostOrAlbumOrPhoto(\tnull, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tnull, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t$this->getRequest()->getParam('photo_id'),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam('limit'),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam('offset'));\n \t\t\tif($ppl_who_liked)\n \t\t\t{\n \t\t\t\tforeach( $ppl_who_liked['data'] as $key=>$user_who_liked )\n \t\t\t\t{\n \t\t\t\t\t$mutual_arr=\\Extended\\ilook_user::getMutualLinks(\\Auth_UserAdapter::getIdentity()->getId(), $user_who_liked->getLikesLiked_by()->getId());\n \t\t\t\t\t$mutualFrdsCount = count($mutual_arr);\n \t\t\t\t\tif(\\Auth_UserAdapter::getIdentity()->getId() == $user_who_liked->getLikesLiked_by()->getId()){\n \t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = \"Me\";\n \t\t\t\t\t}\n \t\t\t\t\telse{\n \t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = $mutualFrdsCount;\n \t\t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t$user_info[$key][\"user_id\"] = $user_who_liked->getLikesLiked_by()->getId();\n \t\t\t\t\t$user_info[$key][\"user_image\"] = \\Helper_common::getUserProfessionalPhoto($user_who_liked->getLikesLiked_by()->getId(), 3);\n \t\t\t\t\t$user_info[$key][\"user_full_names\"] = $user_who_liked->getLikesLiked_by()->getFirstname().\" \".$user_who_liked->getLikesLiked_by()->getLastname();\n \t\t\t\t\t$user_info[$key][\"link_info\"] = \\Extended\\link_requests::getFriendRequestState( $user_who_liked->getLikesLiked_by()->getId() );\n \t\t\t\t}\n \t\t\t\t//For pagination which is not yet implemented.\n \t\t\t\t//$user_info['more_records'] = $ppl_who_liked['is_more_records'];\n \t\t\t\techo Zend_Json::encode( $user_info );\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\techo Zend_Json::encode( 0 );\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\techo Zend_Json::encode( 0 );\n \t\t}\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode( 0 );\n \t}\n \t \n \t \n \tdie;\n }", "function addLike()\n {\n // query to insert record\n $query = \"INSERT INTO `LikeList`(`user_email`, `pushpin_ID`) VALUES ('$this->email','$this->pushpin_id');\";\n\n // prepare query\n $stmt = $this->conn->prepare($query);\n\n // execute query\n if ($stmt->execute()) {\n return true;\n }\n\n return false;\n }", "function scrividiscussioni($mese, $anno, $mese1, $anno1) {\n\tconnetti($db);\n\t$query=\"select title, postusername, replycount from vb_thread where dateline >= unix_timestamp(DATE('\".$anno.\"-\".$mese.\"-01')) and dateline < unix_timestamp(DATE('\" . $anno1 . \"-\" . ($mese1) . \"-01')) and postusername<>'' and postuserid<>770 order by replycount desc limit 10\";\n\t$result = seleziona($db, $query);\n\t$n_righe = get_num_rows($result);\n\t$arr=array();\n\tif ($n_righe > 0) {\n\t\tfor ($i = 0; $i < $n_righe; $i++) {\n\t\t\t$riga = scorri_record($result);\n\t\t\t$arr[]=array('username' => $riga['postusername'], 'title' => trunc($riga['title'],50), 'reply' => $riga['replycount']);\n\t\t}\n\t\techo json_encode($arr);\n\t}\n}", "function action_like () {\n\t\t\t$this->module->indexLike($_POST['id']);\n\t\n\t\t}", "public function getWhoLikeWishPostAction()\n {\n $user_info = array();\n if($this->getRequest()->getParam( 'wish_id' ))\n {\n \t//Check if wish object exist.\n \t$wish_obj = \\Extended\\wishes::getRowObject($this->getRequest()->getParam('wish_id'));\n \tif( $wish_obj->getWallPost() )\n \t{\n \t\t//Getting wallpost_id for wish\n \t\t$wall_post_id = $wish_obj->getWallPost()->getId();\n \t\t$ppl_who_liked = \\Extended\\likes::getUserslikedWallpostOrAlbumOrPhoto( $wall_post_id);\n \t\tif($ppl_who_liked)\n \t\t{\n \t\t\tforeach( $ppl_who_liked['data'] as $key=>$user_who_liked )\n \t\t\t{\n \t\t\t\t$mutual_arr=\\Extended\\ilook_user::getMutualLinks(\\Auth_UserAdapter::getIdentity()->getId(), $user_who_liked->getLikesLiked_by()->getId());\n \t\t\t\t$mutualFrdsCount = count($mutual_arr);\n \t\t\t\tif(\\Auth_UserAdapter::getIdentity()->getId() == $user_who_liked->getLikesLiked_by()->getId()){\n \t\t\t\t\t$user_info[$key][\"mutual_count\"] = \"Me\";\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\t$user_info[$key][\"mutual_count\"] = $mutualFrdsCount;\n \t\t\t\t\t\t\n \t\t\t\t}\n $blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(\\Auth_UserAdapter::getIdentity()->getId());\n\n $user_info[$key][\"user_id\"] = $user_who_liked->getLikesLiked_by()->getId();\n \t\t\t\t$user_info[$key][\"user_image\"] = \\Helper_common::getUserProfessionalPhoto($user_who_liked->getLikesLiked_by()->getId(), 3,false,$blocked_user);\n \t\t\t\t$user_info[$key][\"user_full_names\"] = $user_who_liked->getLikesLiked_by()->getFirstname().\" \".$user_who_liked->getLikesLiked_by()->getLastname();\n \t\t\t\t$user_info[$key][\"link_info\"] = \\Extended\\link_requests::getFriendRequestState( $user_who_liked->getLikesLiked_by()->getId() );\n \t\t\t}\n \t\t\t//For pagination which is not yet implemented.\n \t\t\t// \t\t\t \t$user_info['more_records'] = $ppl_who_liked['is_more_records'];\n \t\t\techo Zend_Json::encode( $user_info );\n \t\t}\n \t\telse\n \t\t{\n \t\t\techo Zend_Json::encode( 0 );\n \t\t}\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode( 0 );\n \t}\n }\n else\n {\n \techo Zend_Json::encode( 0 );\n }\n \n \n die;\n \n }", "public function add_like() {\n $id_photo = $this->input->post('id_photo');\n $id_user = $this->session->userdata('uid');\n echo $this->photo_model->insert_like($id_photo, $id_user);\n }", "public function get_tiv_like_name_and_id($keyword){\n $this->db->select('tiv_id, tiv_name, CONCAT(tiv_id,(\"/\"),tiv_name) as tiv_data');\n $this->db->like('tiv_id', $keyword);\n $this->db->or_like('tiv_name', $keyword);\n $query = $this->db->get('tbl_tiv');\n if($query->num_rows() > 0){\n foreach ($query->result_array() as $row){\n $row_set[] = htmlentities(stripslashes($row['tiv_data'])); //build an array\n }\n echo json_encode($row_set); //format the array into json data\n }\n }", "public function add_likes($info)\n {\n\t\t$s_where\t= \" AND i_user_id='\".intval(decrypt($this->session->userdata('user_id'))).\"' AND i_magazine_id='\".$info['i_magazine_id'].\"'\";\n\t\t$count\t= $this->get_count_gospel_likes($s_where);\n\t\tif($count>0)\n\t\t\treturn false;\n\t\telse\n {\n\t\t\t$this->db->insert($this->db->GOSPEL_MAGAZINE_LIKE,$info);\n \t\t$res = $this->db->insert_id();\n \treturn $res;\n\t\t}\n }", "public function testCreateLike(){\n $parameters = [\n 'liking_username' => 'ridho',\n 'id_post' => 1,\n 'like' => 1\n ];\n\n $this->post(\"/api/v1/like\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_post',\n 'liking_username',\n 'like'\n ]\n ]\n );\n }", "public function like_list()\n {\n $this->pushpin_id = $_GET['pushpinId'];\n\n $query = \"SELECT u.user_name, u.email\nFROM LikeList l\nLEFT JOIN User u ON u.email = l.user_email\nWHERE pushpin_ID= '$this->pushpin_id'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function paint_likes($db, $nickname)\n {\n $sql = \" SELECT * from likes where user_ID = '$nickname' \";\n $stmt = $db->ejecutar($sql);\n return $db->listar($stmt);\n }", "public function likes(){\n }", "function my_action_callback() {\n check_ajax_referer( 'my-special-string', 'security' );\n $postid = intval( $_POST['postid'] );\n $user = get_current_user_id();\n $like=0;\n $dislike=0;\n $like_count=0;\n //check if post id and userid present\n global $wpdb;\n $row = $wpdb->get_results( \"SELECT id FROM $wpdb->post_like_table WHERE postid = '$postid' AND userid = '$user' AND userid != 0\");\n if ( is_user_logged_in() ) {\n if(empty($row)){\n //insert row\n $wpdb->insert( $wpdb->post_like_table, array( 'postid' => $postid, 'userid' => $user ), array( '%d', '%d' ) );\n //echo $wpdb->insert_id;\n $like=1;\n } else {\n //delete row\n $wpdb->delete( $wpdb->post_like_table, array( 'postid' => $postid, 'userid'=> $user ), array( '%d','%s' ) );\n $dislike=1;\n }\n }\n\n //calculate like count from db.\n $totalrow = $wpdb->get_results( \"SELECT id FROM $wpdb->post_like_table WHERE postid = '$postid'\");\n $total_like=$wpdb->num_rows;\n $data=array( 'postid'=>$postid,'likecount'=>$total_like,'userid'=>$user,'like'=>$like,'dislike'=>$dislike);\n echo json_encode($data);\n die(); // this is required to return a proper result\n}", "public function add_like() {\n $id_photo = $this->input->post('id_photo');\n $id_user = $this->session->userdata('uid');\n echo $this->photos->insert_like($id_photo, $id_user);\n }", "public function agregarDislike()\n\t{\n\t\t$this->que_bda = \"INSERT INTO like_comentario \n\t\t(tip_lik_vid, fky_usu_onl, fky_com_vid)\n\t\tVALUES \n\t\t('D', '$this->fky_usu_onl','$this->fky_com_vid');\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}", "function scrivilistapost($mese, $anno, $mese1, $anno1) { //top 10 per numero post\n\tconnetti($db);\n\t$query = \"SELECT username, count(*) post FROM vb_post WHERE dateline >= unix_timestamp(DATE('\" . $anno . \"-\" . $mese . \"-01')) and dateline < unix_timestamp(DATE('\" . $anno1 . \"-\" . ($mese1) . \"-01')) and username<>'' and userid<>770 group by username order by post desc limit 10\";\n\t$result = seleziona($db, $query);\n\t$n_righe = get_num_rows($result);\n\t$arr=array();\n\tif ($n_righe > 0) {\n\t\tfor ($i = 0; $i < $n_righe; $i++) {\n\t\t\t$riga = scorri_record($result);\n\t\t\t$arr[]=array('username' => $riga['username'], 'post' => $riga['post']);\n\t\t}\n\t\techo json_encode($arr);\n\t}\n}", "function like($idevent) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/like\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}", "public static function getUserLike(String $picture_id){\n\t\t//$users = Like::select(\"user_id\")->where(\"picture_id\", $picture_id)->get();\n\t\treturn Like::join(\"users\", \"likes.user_id\", \"=\", \"users.id\")\n\t\t\t\t->select(\"users.id\", \"users.name\")\n\t\t\t\t->where(\"likes.picture_id\", \"=\", $picture_id)\n\t\t\t\t->orderBy(\"likes.created_at\", \"desc\")\n\t\t\t\t->get();\n\t}", "public function likes(){\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$postid = $this->input->post(\"postid\");\n\t\t\t$likerid = $this->login->isLoggedIn();\n\t\t\t$selector = 'likes';\n\t\t\t$condition = array('id'=>$postid);\n\t\t\t$numlikes = $this->get->read('posts',$condition,$selector)[0]['likes'];\n\t\t\t$condition = array('post_id'=>$postid,'user_id'=>$likerid);\n\t\t\tif(!$this->get->read('post_likes',$condition)){\n\t\t\t\t$data = array('likes'=>$numlikes+1);\n\t\t\t\t$condition = array('id'=>$postid);\n\t\t\t\t$this->get->update('posts',$data,$condition);\n\t\t\t\t$data = array('id'=>null,'post_id'=>$postid,'user_id'=>$likerid);\n\t\t\t\t$this->get->create('post_likes',$data);\n\t\t\t\t$this->notify->createNotify('',$postid,'2');\n\n\t\t\t\t$selector = 'likes';\n\t\t\t\t$condition = array('id'=>$postid);\n\t\t\t\t$likes = $this->get->read('posts',$condition,$selector)[0]['likes'];\n\t\t\t\techo json_encode(array('likes'=>$likes,'stats'=>'like'));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data = array('likes'=>$numlikes-1);\n\t\t\t\t$condition = array('id'=>$postid);\n\t\t\t\t$this->get->update('posts',$data,$condition);\n\t\t\t\t$data = array('post_id'=>$postid,'user_id'=>$likerid);\n\t\t\t\t$this->get->del('post_likes',$data);\n\n\t\t\t\t$selector = 'likes';\n\t\t\t\t$condition = array('id'=>$postid);\n\t\t\t\t$likes = $this->get->read('posts',$condition,$selector)[0]['likes'];\n\t\t\t\techo json_encode(array('likes'=>$likes,'stats'=>'unlike'));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tredirect('error');\n\t\t}\n\t}", "public function getWhoLikePostAction()\n {\n \t$user_info = array();\n \tif($this->getRequest()->getParam( 'wallpost_id' ))\n \t{\n \t\tif( \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam( 'wallpost_id' ) ))\n \t\t{\n\t\t \t$ppl_who_liked = \\Extended\\likes::getUserslikedWallpostOrAlbumOrPhoto( $this->getRequest()->getParam( 'wallpost_id' ), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tnull, \n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam( 'limit'), \n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam( 'offset') \n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t \t\n\n\t\t \tif($ppl_who_liked)\n\t\t \t{\n\t\t\t \tforeach( $ppl_who_liked['data'] as $key=>$user_who_liked )\n\t\t\t \t{\n\t\t\t \t\t$mutual_arr=\\Extended\\ilook_user::getMutualLinks(\\Auth_UserAdapter::getIdentity()->getId(), $user_who_liked->getLikesLiked_by()->getId());\n\t\t\t\t\t\t$mutualFrdsCount = count($mutual_arr);\n\t\t\t\t\t\tif(\\Auth_UserAdapter::getIdentity()->getId() == $user_who_liked->getLikesLiked_by()->getId()){\n\t\t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = \"Me\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = $mutualFrdsCount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n $blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(\\Auth_UserAdapter::getIdentity()->getId());\n\n $user_info[$key][\"user_id\"] = $user_who_liked->getLikesLiked_by()->getId();\n\t\t\t\t\t\t$user_info[$key][\"user_image\"] = \\Helper_common::getUserProfessionalPhoto($user_who_liked->getLikesLiked_by()->getId(), 3,false,$blocked_user);\n\t\t\t\t\t\t$user_info[$key][\"user_full_names\"] = $user_who_liked->getLikesLiked_by()->getFirstname().\" \".$user_who_liked->getLikesLiked_by()->getLastname();\n\t\t\t\t\t\t$user_info[$key][\"link_info\"] = \\Extended\\link_requests::getFriendRequestState( $user_who_liked->getLikesLiked_by()->getId() );\n\t\t\t \t}\n\t\t\t \t//For view more records option \n\t\t\t\t\t$result = array('user_info'=>$user_info, 'is_more_records'=>$ppl_who_liked['is_more_records']);\n\t\t\t \techo Zend_Json::encode( $result );\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\techo Zend_Json::encode( 0 );\n\t\t \t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\techo Zend_Json::encode( 0 );\n \t\t}\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode( 0 );\n \t}\n \t\n \t\n \tdie;\n }" ]
[ "0.6202798", "0.61039394", "0.60848176", "0.5954333", "0.59345376", "0.59107965", "0.5674129", "0.5593179", "0.54925114", "0.5471545", "0.5464126", "0.54597896", "0.54466337", "0.5436773", "0.54351366", "0.5421725", "0.5410829", "0.5398734", "0.538518", "0.5378094", "0.53591645", "0.5357728", "0.53515977", "0.535124", "0.53386116", "0.53373873", "0.5336266", "0.5320102", "0.5318865", "0.530204" ]
0.6709131
0
Task:retrieve a single product
public function getSingleProduct_post() { $product_id = ($this->post('product_id')) ? $this->post('product_id') : ''; if($product_id == '' ){ $empty_msg = "Product Id is required"; $this->response([ 'status' => false, 'message' => $empty_msg, ], Restserver\Libraries\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code exit; } if($product_id != ''){ $product_details = $this->Product_model->getProductById($product_id); } $this->response([ 'status' => true, 'message' => "Get data successfully", "data"=> $product_details, ], Restserver\Libraries\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function product_get()\n {\n $product_id = $this->uri->segment(3);\n\n $product = $this->api_model->get_product($product_id);\n\n if(!empty($product))\n {\n $this->response(array('status' => 'success', 'message' => $product));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function getProductById(int $id);", "public function getProduct();", "public function getProduct($id)\n {\n }", "function get_product_by_id($product_id) {\r\n try {\r\n $params[0] = array(\"name\" => \":prod_id\", \"value\" => &$product_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_product_by_id(:prod_id)\", $params);\r\n } catch (Exception $ex) {\r\n echo \">>\" . ex;\r\n }\r\n }", "public function getProductById($product_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"products/$product_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $product_data=json_decode($string);\n \n return $product_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"Get product error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function read_single() {\n \n //create query and prepare\n $query = \"SELECT * FROM $this->table WHERE id = ?\";\n $stmt = $this->conn->prepare($query);\n\n //bind params\n $stmt->bind_param('i', $id);\n\n //set parameter and execute\n $id = $this->id;\n $stmt->execute();\n\n //get result\n $result = $stmt->get_result();\n\n //fetch resulting as array\n $product = mysqli_fetch_assoc($result);\n\n //set product properties\n $this->id = $product['id'];\n $this->name = $product['name'];\n $this->price = $product['price'];\n $this->created_at = $product['created_at'];\n\n }", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "public function regretProduct_get() {\n extract($_GET);\n $result = $this->feeds_model->regretProduct($prod_no, $order_id);\n return $this->response($result);\n }", "function getProduct($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/id/'.(int)$params['id'].'.json'),true);\n\t}", "public function GetProduct($product_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM products\n WHERE productID = :product_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':product_id' => $product_id,\n ]);\n }", "public function read($id) {\n return $this->product->find($id);\n\t}", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function findById($product_id)\n {\n return Product::find($product_id);\n }", "public function readProduct($id) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $product = Product::find_by_id($id);\r\n if ($product) {\r\n return $product;\r\n } else {\r\n throw new RestException(400, 'productct not found');\r\n }\r\n }", "public function show($id_product)\n {\n return Product::findOrFail($id_product);\n }", "public function product() {\n $slug = $this->param('slug');\n\n return Products::where('slug', '=', $slug)->first();\n }", "public function getProductById(ProductReadRequest $request)\n {\n $product = Product::find($request->id)->with('trans')->first();\n\n return response()->json([\n \"title\" => $product->trans->title,\n \"price\" => $product->price,\n \"description\" => $product->trans->description,\n \"discount\" => $product->discount,\n \"category_id\" => $product->category_id\n ], 200);\n }", "function fetch_product ($product_id) {\n $db = getDb();\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n WHERE\n product_id = :product_id\n \");\n\n $statement->execute([\"product_id\"=>$product_id]);\n $result = $statement->fetchObject();\n if (!$result) {\n throw new RowNotFoundException(\"Product not found\");\n }\n return $result;\n}", "public function get($id){\n $product=Product::find($id);\n return $product;\n }", "public function fetchProductFromShopware()\n {\n $config = Config::first();\n\n // Setting offset and limit\n $offset = 0;\n $limit = 5;\n $productLog = ProductLog::first();\n if ($productLog) {\n $offset = $productLog->total_product_api_call;\n }\n\n // Get Products from Shopware API\n $response = Http::withDigestAuth($config->user_name, $config->api_key)->get($config->shop_url . '/api/articles', [\n 'limit' => $limit,\n 'start' => $offset\n ]);\n\n // Get json from API response\n $products = $response->json()['data'];\n if (count($products) > 0) {\n\n // Count number of entries\n $productCounter = 0;\n // Count number of loop\n $counter = 0;\n foreach ($products as $product) {\n // Get Product Detail from Shopware API\n $response = Http::withDigestAuth($config->user_name, $config->api_key)->get($config->shop_url . '/api/articles/' . $product['id']);\n if ($response->status() === 200) {\n\n // Select data index from API response\n $product_detail = $response->json()['data'];\n\n $categoryOne = $this->categoryURLToArray(strtolower($config->category_url_1));\n $categoryTwo = $this->categoryURLToArray(strtolower($config->category_url_2));\n\n if (in_array(strtolower($product_detail['propertyGroup']['name']), $categoryOne) ||\n $this->checkCategories($product_detail['categories'], $categoryTwo)) {\n\n $productModle = new Product;\n $productModle->product_id = $product_detail['id'];\n $productModle->detail_id = $product_detail['mainDetailId'];\n $productModle->name = $product_detail['name'];\n $productModle->description_long = $product_detail['descriptionLong'];\n $productModle->active = $product_detail['active'];\n $productModle->order_number = $product_detail['mainDetail']['number'];\n $productModle->in_Stock = $product_detail['mainDetail']['inStock'];\n $productModle->stock_min = $product_detail['mainDetail']['stockMin'];\n $productModle->shipping_free = $product_detail['mainDetail']['shippingFree'];\n $productModle->customer_group_key = $product_detail['mainDetail']['prices'][0]['customerGroupKey'];\n $productModle->tax_percent = $product_detail['tax']['tax'];\n $productModle->price = $this->calculatePrice($product_detail['mainDetail']['prices'][0]['price'], $product_detail['tax']['tax']);\n $productModle->property_group = strtolower($product_detail['propertyGroup']['name']);\n $productModle->category = $this->getCategory($product_detail['categories']);\n $productModle->media = $this->getMedia($product_detail['images'], $config);\n $saved = $productModle->save();\n if ($saved) {\n $productCounter++;\n }\n\n }\n $counter++;\n }\n }\n\n // Check and save numbers of api calls in database\n $productLog = $productLog ? $productLog : new ProductLog;\n $productLog->total_product_api_call = ($offset + $counter);\n $productLog->save();\n\n return [\n 'message' => [\n \"totalProductAddedInDatabase\" => $productCounter\n ],\n \"Status\" => 200\n ];\n }\n // This will run when no response come from API\n return [\n 'message' => [\n \"noNewProductFound\" => '0 Product add in database',\n ],\n \"Status\" => 204\n ];\n }", "public function getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "public function actionProductdetail()\n {\n $route = 'merchant.getProduct';\n $request = new getProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(33);\n $request->appendProductIds(4678);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getProductResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "public function getProduct(){\n // where('barcode', '=', $request['barcode'])\n // ->get();\n\n // return response()->json($products);\n return 'worked';\n }", "function getProduct()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`products`\";\n //echo $sql;exit();\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $products = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $product = new ProductEntity();\n $product->setIdProduct($data->id);\n $product->setName($data->name);\n $product->setDomaine_realise($data->domaine_realise);\n $product->setTache_realisee($data->tache_realisee);\n $product->setImage($data->image);\n $product->setCreatedAt($data->createdat);\n\n $products[] = $product;\n }\n\n if ($products) {\n return $products;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function test_show_single_product()\n {\n Product::factory()->create();\n $response = $this->getJson('/api/products/1');\n\n $response\n ->assertStatus(200);\n }", "public function findById($id)\n {\n \t$product = $this->model->whereId($id)->first();\n \n \treturn $product;\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "public function show($product)\n {\n return response()->json(app(GetProductRequest::class)->product($product));\n }" ]
[ "0.6954669", "0.6898934", "0.6827219", "0.66973746", "0.66858476", "0.66033506", "0.6567939", "0.64397776", "0.6378699", "0.6363057", "0.6340975", "0.63383734", "0.6337217", "0.6334835", "0.63311875", "0.63245887", "0.6321705", "0.6305184", "0.62937033", "0.6293012", "0.62765676", "0.6275752", "0.6270787", "0.6263697", "0.62468016", "0.6222932", "0.62057626", "0.62008226", "0.6199064", "0.61981046" ]
0.698201
0
Constructor Decodes json source in php array and sets id and method members of json request
public function __construct() { parent::__construct(); $data = SkrillPsp_Json::getQIWIJson(); $this->json = $this->decode($data, true); $this->json['id'] = $this->setId(); $this->json['method'] = $this->method; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "public function __construct()\n\t {\n\t \t $data = SkrillPsp_Json::getPaySafeCardPAJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t $this->json['id'] = $this->setId();\n\t }", "public function __construct()\n\t{\n\t\t$this->data = \\json_decode(\\file_get_contents('php://input'), true);\n\t}", "public function __construct( $json = null )\n {\n if( $json )\n {\n $this->decodeJSONableArray($json);\n }\n else\n {\n $this->setTimestamp();\n //$this->setID();\n }\n }", "public function __construct($json) {\n $this->json = $json;\n }", "public function __construct( $raw_response_json ) {\n\n\t\t$this->raw_response_json = $raw_response_json;\n\n\t\t$this->response_data = json_decode( $raw_response_json );\n\t}", "function __construct($obj){\n parent::__construct($obj);\n $this->parseJSON($obj);\n }", "function __construct($data) {\n\t\t$this->data = json_decode($data, true);\n\t}", "function __construct($json)\n {\n // Remove problematic characters for JSON parsing\r\n $json = str_replace(array(\"\\\\'\", '\\\\\"'), array(\"'\", \"''\"), $json);\r\n $this->jsonList = json_decode($json);\r\n pm_logDebug(3, $this->jsonList);\n }", "public function __construct() {\r\n\t\t$this->request_method = $_SERVER ['REQUEST_METHOD'];\r\n\t\t$this->url_elements = explode ( '/', $_SERVER ['PATH_INFO'] );\r\n\t\t$this->parseIncomingParams ();\r\n\t\t// Initialise json as default format\r\n\t\t$this->format = 'json';\r\n\t\tif (isset ( $this->parameters ['format'] )) {\r\n\t\t\t$this->format = $this->parameters ['format'];\r\n\t\t}\r\n\t}", "public function __construct()\n\t {\n\t \t parent::__construct();\n\t \t $data = SkrillPsp_Json::getPaySafeCardCreateDispositionJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t $this->json['id'] = $this->setId();\n\t }", "public function __construct($json)\n\t{\n\t\t$this->json = $json;\n\t\t$values = json_decode($json, true);\n\n\t\t$this->count = count($values);\n\n\t\tforeach ($values as $key => $value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function __construct()\n {\n $this->array = explode(\"/\", $_SERVER['REQUEST_URI']);\n\n /* Get the body of the HTTP request. In our case, the body will only be sent in POST and PUT requests,\n in which we will send the JSON object to register or modify */\n $this->bodyRequest = file_get_contents(\"php://input\");\n\n /* The next cycle goes through the previously created array and if there is any blank value, it eliminates\n it from the array. This in order to control when the URL is sent in style http://localhost/api/user/\n Although, it is using the \"/\" at the end, no id parameter is being sent, however, the array is created\n in the following way\n\n Array\n (\n    [0] =>\n    [1] => api\n    [2] => user\n    [3] =>\n )\n\n Since the last position is empty, if we allow it that way, it will throw us an error because it does not make\n the request correctly with a data that is empty, so if the URL is sent by this way, it is assumed that it is\n being done a general request like http://localhost/api/user */\n foreach ($this->array as $key => $value) {\n if (empty($value)) {\n unset($this->array[$key]);\n }\n }\n\n /* Analyze the last position of the previously created array, if the value analyzed is greater than 0 it means\n that the sent character is a number (an identifier), therefore, we recognize that the request is being made to a\n specific id of type http://localhost/api/user/1, but if not greater than 0, we recognize that the last element of\n the array is just the name of the entity, then we recognize that is being made a general request of type\n http://localhost/api/user */\n if (end($this->array) > 0) {\n /* If it is a numeric value, create two variables that contain the requested id and the requested entity\n respectively */\n $this->id = $this->array[count($this->array)];\n $entity = $this->array[count($this->array) - 1];\n } else {\n /* If it is a value of type string, it only creates the variable of the requested entity */\n $entity = $this->array[count($this->array)];\n }\n\n /* Contain the Api Rest class 's instance */\n $this->api = $this->get_obj();\n\n /* It establishes in the API object the entity with which it is intended work\n (matches with the table of the same name of the entity in the database) */\n $this->api->entity = $entity;\n\n /* Analyze the method used in the http request of the four available methods: GET, POST, PUT, DELETE\n and process accordingly */\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'GET':\n $this->actionsForGetMethod();\n break;\n\n case 'POST':\n $this->actionsForPostMethod();\n break;\n\n case 'PUT':\n $this->actionsForPutMethod();\n break;\n\n case 'DELETE':\n $this->actionsForDeleteMethod();\n break;\n\n default:\n /* In case the requested method is not one of the four available, send the following response */\n $this->print_json(405, \"Method Not Allowed\", null);\n break;\n }\n }", "public function __construct($json) {\n if (is_null($json)) {\n $json = new \\stdClass();\n }\n\n $this->json = $json;\n }", "public function __construct()\n {\n $request = $this->isJson() ? $this->getJsonRequestParams() : $this->getRequestParams(); \n $this->makeRequest($request);\n\n //Helper function\n sanitizeArray($this);\n }", "public function __construct(){\r\n\t\t\t$this->request_vars = array();\r\n\t\t\t$this->data = '';\r\n\t\t\t$this->http_accept = (strpos($_SERVER['HTTP_ACCEPT'], 'json')) ? 'json' : 'xml';\r\n\t\t\t$this->method = 'GET';\r\n\t\t}", "public function fromJson(string $json){\n $this->content = json_decode($json);\n if(array_key_exists($this->idField, $this->content)){//verifica se possui id se sim seta o id; mesmo comportamento de formArray;\n $this->{$this->idField} = $this->content[$this->idField];\n }\n }", "public function __construct($raw) {\n\n // Map all response data into this object\n $this->transactionId = $raw['@attributes']['id'];\n if (!empty($raw['merchant_reference']))\n $this->merchantRef = $raw['merchant_reference'];\n $this->confirmationStatus = $raw['confirmation_status'];\n $this->statusCode = $raw['status_code'];\n $this->statusTitle = $raw['status_title'];\n $this->statusDescription = $raw['status_description'];\n $this->serviceId = $raw['service_id'];\n $this->pricePoint = $raw['price_point'];\n $this->commodityAmount = $raw['commodity_amount'];\n }", "public function __construct($referenceId = null)\n\t {\n\t \t $data = SkrillPsp_Json::getReversalJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t \n\t \t $this->json['id'] = $this->setId();\n\t \t $this->referenceId = $referenceId;\n\t \t \n\t \t if(!empty($this->referenceId)) {\n\t \t \t$this->json['params']['identification']['referenceid'] = $this->referenceId;\n\t \t }\n\t }", "public function __construct( JSONRequest $req, $mixed = null );", "public function __construct() {\r\n header(\"Access-Control-Allow-Orgin: *\");\r\n header(\"Access-Control-Allow-Methods: *\");\r\n header(\"Content-Type: application/json\");\r\n\r\n $this->args = [0,1];\r\n $this->endpoint = array_shift($this->args);\r\n if (array_key_exists(0, $this->args) && !is_numeric($this->args[0])) {\r\n $this->verb = array_shift($this->args);\r\n }\r\n }", "public function __construct($json)\n {\n if (array_key_exists('hash', $json)) {\n $this->hash = $json['hash'];\n }\n if (array_key_exists('ver', $json)) {\n $this->version = $json['ver'];\n }\n if (array_key_exists('prev_block', $json)) {\n $this->previous_block = $json['prev_block'];\n }\n if (array_key_exists('mrkl_root', $json)) {\n $this->merkle_root = $json['mrkl_root'];\n }\n if (array_key_exists('time', $json)) {\n $this->time = $json['time'];\n }\n if (array_key_exists('bits', $json)) {\n $this->bits = $json['bits'];\n }\n if (array_key_exists('fee', $json)) {\n $this->fee = Conversion::btcInt2Str($json['fee']);\n }\n if (array_key_exists('nonce', $json)) {\n $this->nonce = $json['nonce'];\n }\n if (array_key_exists('n_tx', $json)) {\n $this->n_tx = $json['n_tx'];\n }\n if (array_key_exists('size', $json)) {\n $this->size = $json['size'];\n }\n if (array_key_exists('block_index', $json)) {\n $this->block_index = $json['block_index'];\n }\n if (array_key_exists('main_chain', $json)) {\n $this->main_chain = $json['main_chain'];\n }\n if (array_key_exists('height', $json)) {\n $this->height = $json['height'];\n }\n if (array_key_exists('received_time', $json)) {\n $this->received_time = $json['received_time'];\n }\n if (array_key_exists('relayed_by', $json)) {\n $this->relayed_by = $json['relayed_by'];\n }\n if (array_key_exists('tx', $json)) {\n foreach ($json['tx'] as $tx) {\n $this->transactions[] = new Transaction($tx);\n }\n }\n }", "public function initialise($json, $smsObject)\n {\n// $this->smsObject = $smsObject;\n// $person = json_decode($json);\n// $this->consciousness = $person->consciousness;\n// $this->alive = $person->alive;\n// $this->id = $person->_id;\n }", "private function __construct() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $this->data = $_GET;\n } else {\n if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {\n $contentType = $_SERVER['HTTP_CONTENT_TYPE'];\n if (strpos($contentType, ';') !== false) {\n $split = explode(';', $contentType);\n $contentType = trim($split[0]);\n $enc = trim($split[1]);\n }\n if ($contentType == 'application/x-www-form-urlencoded') {\n $this->data = $_POST;\n } else if ($contentType == 'application/json') {\n $json = file_get_contents('php://input');\n $this->data = json_decode($json, true);\n }\n }\n }\n if (strpos($_SERVER['REQUEST_URI'], '/api/') === 0) {\n $this->route = explode('/', $_SERVER['REQUEST_URI']);\n }\n }", "public function __construct($jsonData) {\n return parent::assignValues($this, $jsonData);\n }", "public function __construct() {\n $this->parseRequest();\n }", "public function __construct($response)\n {\n $this->address = $response['address'];\n $this->url = $response['url'];\n $this->id = $response['id'];\n }", "public function init_from_json($json, $from = Bean::SOURCE_STRING)\n {\n if($from == Bean::SOURCE_STRING)\n {\n $array = @json_decode($json,true);\n }\n\n if($from == Bean::SOURCE_FILE || Bean::SOURCE_URL)\n {\n $js_array = @file_get_contents($json);\n $array = @json_decode($js_array,true);\n }\n\n if(isset($value[0]) && count($value[0])) \n {\n foreach($value[0] as $key => $val)\n {\n $this->set($key,$val); \n }\n } \n }", "public function __construct($requestMethod){\r\n switch($requestMethod){\r\n case 'get':\r\n $response = [];\r\n if(isset($_GET['id'])){\r\n $device = Factory::getDevice(device());\r\n $response = $device::get($_GET['id']);\r\n }else{\r\n $device = Factory::getDevice(device());\r\n $response = $device::getAll();\r\n }\r\n // Output JSON\r\n echo json_encode($response);\r\n break;\r\n case'post':\r\n // Read body content \r\n $body = file_get_contents('php://input');\r\n // Decode body content from JSON\r\n $body = json_decode($body);\r\n $device = Factory::getDevice(device());\r\n // Get values\r\n $device_name = $body->device_name;\r\n $OS = $body->OS;\r\n $processor = $body->processor;\r\n $ram_memory = $body->ram_memory;\r\n $screen_size = isset($body->screen_size) ? $body->screen_size : null;\r\n $touch_screen = isset($body->touch_screen) ? $body->touch_screen : null;\r\n // Setting properties\r\n $device->set($device_name,$OS,$processor,$ram_memory,$screen_size,$touch_screen);\r\n $res = $device->insert();\r\n // HTTP response\r\n if($res){\r\n header(\"HTTP/1.1 200 OK\");\r\n }else{\r\n header(\"HTTP/1.1 400 Bad Request\");\r\n }\r\n break;\r\n case'put':\r\n $body = file_get_contents('php://input');\r\n $body = json_decode($body);\r\n $device = Factory::getDevice(device());\r\n // Get values\r\n $id = $body->id;\r\n $device_name = $body->device_name;\r\n $OS = $body->OS;\r\n $processor = $body->processor;\r\n $ram_memory = $body->ram_memory;\r\n $screen_size = isset($body->screen_size) ? $body->screen_size : null;\r\n $touch_screen = isset($body->touch_screen) ? $body->touch_screen : null;\r\n // Setting properties\r\n $device->set($device_name,$OS,$processor,$ram_memory,$screen_size,$touch_screen);\r\n $res = $device->update($id);\r\n // HTTP response\r\n if($res){\r\n header(\"HTTP/1.1 200 OK\");\r\n }else{\r\n header(\"HTTP/1.1 400 Bad Request\");\r\n }\r\n break;\r\n case'delete':\r\n if(isset($_GET['id'])){\r\n $device = Factory::getDevice(device());\r\n if($device->delete($_GET['id'])){\r\n header(\"HTTP/1.1 200 OK\");\r\n }else{\r\n header(\"HTTP/1.1 400 Bad Request\");\r\n }\r\n }\r\n break;\r\n }\r\n }", "public function __construct( JSONRequest $req )\n {\n $this->setWrapperName( 'JSONResponse' );\n parent::__construct();\n $this->req = $req;\n //$this->set('serverLocalTime',time(),false);\n $this->setID( JSONMessage::generateID() );\n if( $req )\n {\n $this->setType( $req->getType() );\n $this->set('responseTo', $req->getID() );\n $this->setResult(0);\n }\n else\n {\n $this->setType( 'unknown' );\n $this->set('responseTo', null );\n }\n if(false && !$this->getCredentials() && @$_SESSION )\n {\n $ar = $_SESSION[\"credentials\"];\n if( $ar ) $this->setCredentials($ar);\n }\n //??? $this->setCredentials( $req->getCredentials() );\n }" ]
[ "0.69015884", "0.6681834", "0.6509452", "0.6496121", "0.6363527", "0.63603467", "0.63393945", "0.6303781", "0.6216822", "0.61967003", "0.6161716", "0.61408144", "0.60917604", "0.6079412", "0.6078284", "0.6054838", "0.5933308", "0.58855057", "0.58729655", "0.58266646", "0.57692003", "0.5717644", "0.5712428", "0.5671853", "0.5666157", "0.5605001", "0.5584", "0.55504966", "0.554957", "0.5548414" ]
0.73037106
0
Sets the Varnish IP to localhost if Cloudflare is active.
public function set_varnish_localhost( $varnish_ip ) { if ( ! $this->should_filter_varnish() ) { return $varnish_ip; } if ( is_string( $varnish_ip ) ) { $varnish_ip = (array) $varnish_ip; } $varnish_ip[] = 'localhost'; return $varnish_ip; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "private function set_real_ip() {\n\n\t\t$is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false;\n\t\tif ( ! $is_cf ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\n\t\tif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\n\t\t\t// Grab the Current Cloudflare Address Range\n\t\t\t$cf_ips_values = $this->get_ips();\n\t\t\tif ( false == $cf_ips_values || empty($cf_ips_values) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the we getting a IPv4 or IPv6 Address\n\t\t\tif ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) {\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv4'] ?? '';\n\n\t\t\t\t// IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv6'];\n\t\t\t\t$ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv6_in_range( $ipv6, $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}", "public function setIpAddress($ip_address);", "public function maybe_set_real_ip() {\n\t\t$run =true;\n\t\tif (!function_exists('is_plugin_active')) {\n\t\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t}\n\t\tforeach ($this->plugins as $plugin) {\n\t\t\tif (\\is_plugin_active($plugin) ) {\n\t\t\t\t$run = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->wp_rocket_cloudflare_enabled()) {\n\t\t\t$run = false;\n\t\t}\n\n\t\tif ($run) {\n\t\t\t$this->set_real_ip();\n\t\t}\n\t}", "public function setIps()\n {\n if ($this->module->sandbox) {\n $this->ips = $this->sandboxIps;\n } else {\n $this->ips = $this->productionIps;\n }\n }", "public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}", "private function checkIfOnLocalhost() {\n $whitelist = array(\n '127.0.0.1',\n '::1'\n );\n if(in_array($_SERVER['REMOTE_ADDR'], $whitelist)){\n return;\n } else {\n $this->databaseServerName = getenv('DATABASE_SERVER_NAME');\n $this->databaseUserName = getenv('DATABASE_USERNAME');\n $this->databasePassword = getenv('DATABASE_PASSWORD');\n $this->databaseName = getenv('DATABASE_NAME');\n }\n }", "public function testSetRemoteIp()\n {\n $this->_req->setRemoteIp('999.99.998.9');\n $this->assertEquals('999.99.998.9', $this->_req->getRemoteIp());\n }", "public function setRemoteIp($remoteIp);", "static function IP(){\r\n\t\tif(\\Core\\Server::isCLI()){\r\n\t\t\treturn new IP(static::DEFAULT_IP);\r\n\t\t}\r\n\t\tif(isset($_SERVER['HTTP_X_REAL_IP'])){\r\n\t\t\treturn new IP($_SERVER['HTTP_X_REAL_IP']);\r\n\t\t}\r\n\t\tif(isset($_SERVER['REMOTE_ADDR'])){\r\n\t\t\treturn new IP($_SERVER['REMOTE_ADDR']);\r\n\t\t}\r\n\t\treturn new IP(static::DEFAULT_IP);\r\n\t}", "public function setIp($value)\n {\n return $this->set(self::ip, $value);\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setVip($vip)\n {\n $this->_vip = $vip;\n }", "function ip_visiteur() {\n\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif(isset($_SERVER['HTTP_CLIENT_IP']))\n\t{\n\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telse\n\t{\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}", "public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}", "private function sniff_ip() {\n\n\t\tif ( $this->ip_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t$this->ip_data = [ '127.0.0.1', 'CLI' ];\n\n\t\t\treturn;\n\t\t}\n\n\t\t$ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ];\n\t\t$ips = array_intersect_key( $_SERVER, $ip_server_keys );\n\t\t$this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ];\n\t}", "function getIP() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n //ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n //ip pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }else{\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip === '::1' ? '127.0.0.1' : $ip;\n}", "public function setHost(string $host): void\n {\n }", "function vProxy()\r\n\t\t{\r\n\t\t\tif( $_SERVER['HTTP_X_FORWARDED_FOR']\r\n\t\t\t || $_SERVER['HTTP_X_FORWARDED']\r\n\t\t\t || $_SERVER['HTTP_FORWARDED_FOR']\r\n\t\t\t || $_SERVER['HTTP_VIA']\r\n\t\t\t || in_array( $_SERVER['REMOTE_PORT'], array( 8080,80,6588,8000,3128,553,554) )\r\n\t\t\t || @fsockopen( $_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30) )\r\n\t\t\t{\r\n\t\t\t\texit('Proxy detected');\r\n\t\t\t\t\r\n\t\t\t} // end if( $_SERVER['HTTP_X_FORWARDED_FOR']\r\n\t\t\t\r\n\t\t}", "protected function set_host($ihost)\n {\n }", "public function set_host($ihost)\n {\n }", "public static function getIp(){\n if (isset($_SERVER['HTTP_CDN_SRC_IP']) && $_SERVER['HTTP_CDN_SRC_IP'] && strcasecmp($_SERVER['HTTP_CDN_SRC_IP'], \"unknown\")){\n $ip = $_SERVER['HTTP_CDN_SRC_IP'];\n }elseif(getenv(\"HTTP_CLIENT_IP\") && strcasecmp(getenv(\"HTTP_CLIENT_IP\"), \"unknown\")){\n $ip = getenv(\"HTTP_CLIENT_IP\");\n }else if (getenv(\"HTTP_X_FORWARDED_FOR\") && strcasecmp(getenv(\"HTTP_X_FORWARDED_FOR\"), \"unknown\")){\n $ip = getenv(\"HTTP_X_FORWARDED_FOR\");\n }else if (getenv(\"REMOTE_ADDR\") && strcasecmp(getenv(\"REMOTE_ADDR\"), \"unknown\")){\n $ip = getenv(\"REMOTE_ADDR\");\n }else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], \"unknown\")){\n $ip = $_SERVER['REMOTE_ADDR'];\n }else{\n $ip = \"unknown\";\n }\n return($ip);\n }", "static function IP ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn '127.0.0.1';\n\t\t\treturn isset ($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : NULL;\n\t\t}", "public function getIpAddress();", "public function setIpAddress($val)\n {\n $this->_propDict[\"ipAddress\"] = $val;\n return $this;\n }", "public static function getLocalIp() {\n $localip = '127.0.0.1';\n $the_ip = '';\n if($_SERVER['REMOTE_ADDR']!='::1'){\n if ( function_exists( 'apache_request_headers' ) ) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n $check = 0;\n //Get the forwarded IP if it exists \n if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) { \n $the_ip = $headers['X-Forwarded-For'];\n } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 )\n ) { \n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n } else { \n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );\n } \n } \n if($the_ip!='' OR strlen($the_ip)==0){ \n $the_ip = $localip;\n }\n return $the_ip; \n }", "public function getRemoteIp();" ]
[ "0.703615", "0.6464836", "0.64441645", "0.6381589", "0.614889", "0.6108838", "0.6037302", "0.60194564", "0.5978361", "0.585526", "0.57842094", "0.57539666", "0.5663702", "0.56424767", "0.56424767", "0.5630467", "0.5621584", "0.56099325", "0.558107", "0.5568539", "0.55604434", "0.55592144", "0.555159", "0.5541788", "0.5529598", "0.54799896", "0.5477625", "0.5477095", "0.54698944", "0.5461835" ]
0.6821282
1
Checks if we should filter the value for the Varnish purge.
private function should_filter_varnish() { // This filter is documented in inc/classes/subscriber/Addons/Varnish/VarnishSubscriber.php. if ( ! apply_filters( 'do_rocket_varnish_http_purge', false ) && ! $this->options->get( 'varnish_auto_purge', 0 ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function shouldPurge()\n {\n // we only need to send a purge request if varnish is enabled\n if ($this->scopeConfig->getValue(\n 'system/full_page_cache/caching_application',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n ) == 2) {\n return false; // disabled for now as need to either purge by tag or update vcl @todo add config\n return true;\n }\n return false;\n }", "protected function filterValue($value)\n\t{\n\t\treturn !in_array($value, $this->forbiddenValues(), true);\n\t}", "private function purge_allowed() {\n\t\tif ( ! $this->as3cf->is_plugin_setup( true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->as3cf->count_files() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function filter($value) {\n return strpos('vendors', $value) === false ? true : false;\n }", "protected function filterValue($value)\n\t{\n\t\treturn (int) $value > 0;\n\t}", "function is_filtered() {\n\t\tglobal $_chosen_attributes;\n\n\t\treturn ( sizeof( $_chosen_attributes ) > 0 || ( isset( $_GET['max_price'] ) && isset( $_GET['min_price'] ) ) ) ? true : false;\n\t}", "public function isPurged() {}", "protected function prefilterValue($value)\n\t{\n\t\treturn !in_array($value, ['', null], true);\n\t}", "protected function _purgeValue($value) {}", "function is_purchasable() {\n\t\t$purchasable = WCS_Limiter::is_purchasable( parent::is_purchasable(), $this );\n\n\t\treturn apply_filters( 'woocommerce_subscription_is_purchasable', $purchasable, $this );\n\t}", "private function filterParam(){\n $this->verses = $this->extractVerses(explode(',', $this->verses));\n\n // Limit to max_verses variable\n $this->sliceVerses();\n \n // Check verse existing\n if( !$this->checkVerseExist() ) return false;\n\n // Filter out non available translation\n $this->filterTranslation();\n\n return true;\n }", "public function is_set()\n {\n return parent::is_set() || $this->has_filter_property(self::FILTER_FREQUENCY) ||\n $this->has_date(self::FILTER_START_DATE) || $this->has_date(self::FILTER_END_DATE);\n }", "protected function hasFilter()\n {\n return ! empty($this->filter);\n }", "public function prune(): bool\n {\n // Prepare query\n // Note: $wpdb->delete cannot be used as it does not support \"<=\" comparison)\n $query = $this->wpdb->prepare(\n \"DELETE FROM {$this->blacklist_table} WHERE release_time <= %s\",\n \\date(self::MYSQL_DATETIME_FORMAT, current_time('timestamp'))\n );\n // Execute query\n $result = $this->wpdb->query($query);\n // Return result\n return $result !== false;\n }", "function es_filtro($vfiltro){\n $res = false;\n if ($vfiltro != SIN_FILTRO)\n $res = true;\n return $res;\n}", "public function shouldOnlyVaultOnVault()\n {\n return $this->getSingleUse() == 'false' &&\n Mage::getStoreConfigFlag('payment/gene_braintree_paypal/use_vault_only_on_vault');\n }", "function purge()\n {\n return true;\n }", "public function varnish()\n {\n /* @var $helper Magneto_Varnish_Helper_Cacheable */\n $helper = Mage::helper('varnish/cacheable');\n\n // Cache disabled in Admin / System / Cache Management\n if (!Mage::app()->useCache('varnish')) {\n $helper->turnOffVarnishCache();\n return false;\n }\n\n if ($helper->isNoCacheStable()) {\n return false;\n }\n\n if ($helper->pollVerification()) {\n $helper->setNoCacheStable();\n return false;\n }\n\n\n if ($helper->quoteHasItems() || $helper->isCustomerLoggedIn() || $helper->hasCompareItems()) {\n $helper->turnOffVarnishCache();\n\n return false;\n }\n\n $helper->turnOnVarnishCache();\n\n return true;\n }", "private function allowsFilter()\n {\n return config('dingoquerymapper.allowFilters');\n }", "public function purge(): bool\n {\n // Get limit (in months) from option\n $limit = $this->plugin()->option('deleteAfter', false);\n\n if ($limit !== false) {\n // Get cutoff date by subtracting limit from today\n $time = strtotime('-' . $limit . ' month');\n $cutoff = date('Y-m-d 00:00:00', $time);\n\n /** @var \\Kirby\\Database\\Query $table */\n $table = $this->table()->bindings(['cutoff' => $cutoff]);\n\n return $table->delete('strftime(\"%s\", date) < strftime(\"%s\", :cutoff)');\n }\n\n return true;\n }", "public function hasFilter(): bool;", "public function hasFilter(){\n return $this->_has(5);\n }", "abstract protected function filterFieldvalue();", "private function hasFiltroReputacao()\n {\n return !empty($this->filtros['reputacao']);\n }", "public function hasPurify(){\n return $this->_has(18);\n }", "function CheckFilter() {\n\t\tglobal $deals_details;\n\n\t\t// Check dealer extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->dealer))\n\t\t\treturn TRUE;\n\n\t\t// Check date_start extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->date_start))\n\t\t\treturn TRUE;\n\n\t\t// Check status extended filter\n\t\tif ($this->NonTextFilterApplied($deals_details->status))\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "protected function handlePurge() : void { }", "public function isReadyForPurge()\n\t{\n\t\tif($this->getStatus() != CategoryStatus::DELETED)\n\t\t\treturn false;\n\t\t\t\n\t\tif($this->getMembersCount())\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getMembersCount() . \"] users\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getEntriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getEntriesCount() . \"] entries\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getDirectSubCategoriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getDirectSubCategoriesCount() . \"] sub categories\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function filter($value)\n {\n return $this->getPurifier()->purify($value);\n }", "public function filterable()\n {\n return true;\n }" ]
[ "0.7011172", "0.6329347", "0.6038297", "0.5988666", "0.5726487", "0.5704695", "0.564973", "0.55836964", "0.55330914", "0.5495705", "0.54898906", "0.5385073", "0.533488", "0.5324994", "0.53233194", "0.53184587", "0.5286606", "0.5286443", "0.5248415", "0.5242693", "0.52102566", "0.5193199", "0.5190538", "0.51865226", "0.51788825", "0.5169626", "0.5163831", "0.5115375", "0.51108676", "0.51063925" ]
0.74980533
0
Automatically set Cloudflare development mode value to off after 3 hours to reflect Cloudflare behaviour.
public function deactivate_devmode() { $this->options->set( 'cloudflare_devmode', 'off' ); $this->options_api->set( 'settings', $this->options->get_options() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useDevelopmentMode();", "function turnOffDebugMode()\n {\n $this->debugmode = false;\n }", "function confdev()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => true,\n 'cookies.lifetime' => '5 minutes',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n\n ]);\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::DEBUG);\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in development mode.');\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n}", "public function developmentMode()\n {\n $this->API_URL = self::DEVELOPMENT_API_URL;\n $this->username = self::DEVELOPMENT_API_USERNAME;\n $this->password = self::DEVELOPMENT_API_PASSWORD;\n }", "function turnOnDebugMode()\n {\n $this->debugmode = true;\n }", "function confprod()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => false,\n 'cookies.lifetime' => '1 day',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n\n ]);\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::WARN);\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in production mode.');\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n error_reporting(E_ALL ^ (E_DEPRECATED | E_USER_DEPRECATED));\n}", "static public function deactive()\n {\n do_action( \"sc_wpfmp_disable_wp_cron\" ); // Go disable cron\n }", "function isNotLive(){ return $_ENV['CURRENT_ENVIRONMENT'] != ENVIRONMENT_LIVE; }", "public function enableDebugMode() {}", "function switchToLive(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_LIVE; }", "public static function disable_wp_fastest_cache() {\n\t\t$GLOBALS['wp_fastest_cache_options']['wpFastestCacheCombineCss'] = false;\n\t\t$GLOBALS['wp_fastest_cache_options']['wpFastestCacheMinifyCss'] = false;\n\t\t$GLOBALS['wp_fastest_cache_options']['wpFastestCacheStatus'] = false;\n\t}", "public static function setCleanCacheFlag() {\n\t\tconfig::set('cleanCacheFlag', 1);\n\t}", "public function isProductionMode(): bool;", "function acf_settings_init() {\n\tacf_update_setting('show_updates', false);\n}", "public static function smush_deactivated() {\n\t\tif ( ! class_exists( '\\\\Smush\\\\Core\\\\Modules\\\\CDN' ) ) {\n\t\t\trequire_once __DIR__ . '/modules/class-cdn.php';\n\t\t}\n\n\t\tModules\\CDN::unschedule_cron();\n\n\t\tif ( is_multisite() && is_network_admin() ) {\n\t\t\t/**\n\t\t\t * Updating the option instead of removing it.\n\t\t\t *\n\t\t\t * @see https://incsub.atlassian.net/browse/SMUSH-350\n\t\t\t */\n\t\t\tupdate_site_option( WP_SMUSH_PREFIX . 'networkwide', 1 );\n\t\t}\n\t}", "public function disableDebug() {}", "function isLive(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_LIVE; }", "public function enableNoExpiryMode()\n\t{\n\t\t$this->_no_expire = true;\n\t}", "static public function setDebug($on=false){\n \tif (self::$_is_debug != (bool) $on){\n \t\tself::$_is_debug = (bool) $on;\n \t\tself::regenerate();\n \t}\n }", "function wp_is_development_mode($mode)\n {\n }", "private function wp_rocket_cloudflare_enabled() {\n\t\tif (function_exists('rocket_set_real_ip_cloudflare')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn;\n\t}", "public function disableDebug();", "function confdebug()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => true,\n 'cookies.lifetime' => '1 day',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n ]);\n require 'vendor/DateTimeFileWriter.php';\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::DEBUG);\n $app->getLog()->setWriter(new \\Slim\\Extras\\Log\\DateTimeFileWriter(['path' => './data', 'name_format' => 'Y-m-d']));\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in debug mode.');\n error_reporting(E_ALL | E_STRICT);\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n}", "function robots_access(){\r\n if(is_production() && get_option('blog_public') == '0') update_option('blog_public', '1');\r\n if(!is_production() && get_option('blog_public') == '1') update_option('blog_public', '0');\r\n}", "function disableDebug($value = true) {\n\t\t$GLOBALS['amfphp']['disableDebug'] = $value;\n\t}", "public static function enterMaintenanceMode() {\n $settings = self::getSettings();\n $settings->maintenance = true;\n $settings->save();\n }", "public function auto_purge() {\r\n\t\tif ( ! current_user_can( 'rocket_purge_cloudflare_cache' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_cache_everything = $this->cloudflare->has_page_rule( 'cache_everything' );\r\n\r\n\t\tif ( is_wp_error( $cf_cache_everything ) || ! $cf_cache_everything ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Purge CloudFlare.\r\n\t\t$this->cloudflare->purge_cloudflare();\r\n\t}", "function wp_get_development_mode()\n {\n }", "function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }", "function debugOff()\n\t{\n\t\t$this->bDebug = false;\n\t}" ]
[ "0.6113033", "0.5886946", "0.568852", "0.5648188", "0.558613", "0.5538556", "0.55360055", "0.55128473", "0.5496666", "0.5496582", "0.54236853", "0.54122275", "0.5405852", "0.5374354", "0.53697616", "0.5351875", "0.53324854", "0.5327558", "0.5308217", "0.52788377", "0.52745324", "0.5266185", "0.5251404", "0.52285576", "0.5212921", "0.51845443", "0.5181452", "0.5174886", "0.5169107", "0.5154491" ]
0.71097624
0
Purge Cloudflare cache automatically if Cache Everything is set as a Page Rule.
public function auto_purge() { if ( ! current_user_can( 'rocket_purge_cloudflare_cache' ) ) { return; } $cf_cache_everything = $this->cloudflare->has_page_rule( 'cache_everything' ); if ( is_wp_error( $cf_cache_everything ) || ! $cf_cache_everything ) { return; } // Purge CloudFlare. $this->cloudflare->purge_cloudflare(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function purge_cloudflare_full() {\n\t\tcheck_ajax_referer( 'np_cf_ei_secure_me', 'np_cf_ei_nonce' );\n\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\techo 'Current user cannot clear the Cloudflare cache';\n\t\t\tdie();\n\t\t}\n\n\t\techo self::purge_cloudflare_cache();\n\t\tdie();\n\t}", "public function purgePageCache()\n\t{\n\t\t// Purge the folder\n\t\t$objFolder = new \\Folder('system/cache/html');\n\t\t$objFolder->purge();\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the page cache', __METHOD__, TL_CRON);\n\t}", "public function purge_cloudflare_url() {\n\t\tcheck_ajax_referer( 'np_cf_ei_secure_me', 'np_cf_ei_nonce' );\n\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\techo 'Current user cannot clear the Cloudflare cache';\n\t\t\tdie();\n\t\t}\n\n\t\t$url_clear = esc_url( $_POST['url'] );\n\t\tself::$cache_trigger_url = $url_clear;\n\t\techo self::purge_cloudflare_cache( array( $url_clear ) );\n\t\tdie();\n\t}", "public function purgeEverything () {\n\t\t\t$modelPath = \"cloudflare/api_overview_configuration\";\n\t\t\t$zoneId = Mage::getSingleton (\"$modelPath\")->getZoneId ();\n\t\t\t$endpoint = sprintf ( \"zones/%s/purge_cache\", $zoneId );\n\t\t\t$api = Mage::getModel (\"cloudflare/api_request\");\n\t\t\t$api->setType ( $api::REQUEST_DELETE );\n\t\t\t$api->setPostData ( array ( \"purge_everything\" => true ) );\n\t\t\treturn $api->resolve ( $endpoint );\n\t\t}", "public static function purgeCaches() {}", "public static function purge_cache(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->purge_cache();\n }", "function clearCacheIfSet()\t{\n\t\tif ($this->conf['clearCacheOfPages'])\t{\n\t\t\t$cc_pidList = $GLOBALS['TYPO3_DB']->cleanIntList($this->conf['clearCacheOfPages']);\n\t\t\t$GLOBALS['TSFE']->clearPageCacheContent_pidList($cc_pidList);\n\t\t}\n\t}", "public function delete_crawl_cache() : void {\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'wp2static_crawl_cache';\n\n $wpdb->query( \"TRUNCATE TABLE $table_name\" );\n\n $sql =\n \"SELECT count(*) FROM $table_name\";\n\n $count = $wpdb->get_var( $sql );\n\n if ( $count === '0' ) {\n http_response_code( 200 );\n\n echo 'SUCCESS';\n } else {\n http_response_code( 500 );\n }\n }", "public static function clear() \n\t\t{\n\t\t\tSite_CacheManager::flush('page');\n\t\t}", "private static function purgeCache() {\n $cacheFolder = self::$cache_folder ? self::$cache_folder : self::relative_client_helper_path() . 'cache/';\n self::purgeFiles($cacheFolder, self::$cache_timeout * 5, self::$cache_allowed_file_count);\n }", "public function clearPageCacheContent() {}", "function wp_clean_update_cache()\n {\n }", "public function clearCache() {}", "public function clearCache() {}", "public function purgeCache()\n\t{\n\t\t$objFolder = new Folder(self::CACHE_DIR);\n\t\t$objFolder->purge();\n\t\t\n\t\tstatic::$arrIsCached = array();\t\t\n\t}", "protected function purgeCache() {\n\t\tConfigboxCacheHelper::purgeCache();\n\t}", "public function clearCache(): void;", "public function flushCache() {\n\t\t// is deleted. If it cleared our static cache variables\n\t\t// here, they would in effect be useless.\n\t}", "function _garbage_collection()\n\t{\n\t\tif (class_exists('Stats'))\n\t\t{\n\t\t\tif (ee()->stats->statdata('last_cache_clear')\n\t\t\t\t&& ee()->stats->statdata('last_cache_clear') > 1)\n\t\t\t{\n\t\t\t\t$last_clear = ee()->stats->statdata('last_cache_clear');\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset($last_clear))\n\t\t{\n\t\t\tee()->db->select('last_cache_clear');\n\t\t\tee()->db->where('site_id', ee()->config->item('site_id'));\n\t\t\t$query = ee()->db->get('stats');\n\n\t\t\t$last_clear = $query->row('last_cache_clear') ;\n\t\t}\n\n\t\tif (isset($last_clear) && ee()->localize->now > $last_clear)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'last_cache_clear'\t=> ee()->localize->now + (60*60*24*7)\n\t\t\t);\n\n\t\t\tee()->db->where('site_id', ee()->config->item('site_id'));\n\t\t\tee()->db->update('stats', $data);\n\n\t\t\tif (ee()->config->item('enable_throttling') == 'y')\n\t\t\t{\n\t\t\t\t$expire = time() - 180;\n\n\t\t\t\tee()->db->where('last_activity <', $expire);\n\t\t\t\tee()->db->delete('throttle');\n\t\t\t}\n\n\t\t\tee()->functions->clear_caching('all');\n\t\t}\n\t}", "private function clear_cache_wpsupercache() {\n\t\t$all = true;\n\n\t\tglobal $updraftplus, $cache_path, $wp_cache_object_cache;\n\n\t\tif ($wp_cache_object_cache && function_exists('reset_oc_version')) reset_oc_version();\n\n\t\t// Removed check: && wpsupercache_site_admin()\n\t\tif (true == $all && function_exists('prune_super_cache')) {\n\t\t\tif (!empty($cache_path)) {\n\t\t\t\t$updraftplus->log_e(\"Clearing cached pages (%s)...\", 'WP Super Cache');\n\t\t\t\tprune_super_cache($cache_path, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "private function _cacheCleanup()\n\t {\n\t\t$this->_db->exec(\n\t\t \"DELETE FROM `HTTPcache` WHERE \" .\n\t\t \"`datetime` < DATE_SUB(NOW(), INTERVAL \" . $this->_expiry . \" SECOND) OR `expiry` < NOW()\"\n\t\t);\n\t }", "function wp_cache_flush_runtime()\n {\n }", "function the_champ_clear_shorturl_cache(){\r\n\tglobal $wpdb;\r\n\t$wpdb->query(\"DELETE FROM $wpdb->postmeta WHERE meta_key = '_the_champ_ss_bitly_url'\");\r\n\tdie;\r\n}", "public function clearCache()\n {\n }", "function wp_cache_flush()\n {\n }", "public function purgeUrl($url);", "public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}", "public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}", "public function clearCache()\n {\n if ($this->clear_cache && !empty($this->pageinfo)) {\n $dataHandler = GeneralUtility::makeInstance(DataHandler::class);\n $dataHandler->start([], []);\n $dataHandler->clear_cacheCmd($this->id);\n }\n }", "public function purge($url)\n {\n }" ]
[ "0.7171041", "0.68811893", "0.6835959", "0.68086535", "0.6559303", "0.6549579", "0.6494307", "0.6483772", "0.6372288", "0.6363682", "0.631605", "0.62746394", "0.6254291", "0.6254291", "0.6233105", "0.6218409", "0.614058", "0.6115821", "0.6110934", "0.61102194", "0.61072326", "0.60986584", "0.6082498", "0.60669816", "0.60615337", "0.6049037", "0.60474265", "0.60474265", "0.6035395", "0.6023691" ]
0.8303174
0
Set Real IP from CloudFlare.
public function set_real_ip() { // only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode. if ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) { return; } $cf_ips_values = $this->cloudflare->get_cloudflare_ips(); $cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs; $ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); $ipv6 = get_rocket_ipv6_full( $ip ); if ( false === strpos( $ip, ':' ) ) { // IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range. $cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs; } foreach ( $cf_ip_ranges as $range ) { if ( ( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) ) || ( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) ) ) { $_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_real_ip() {\n\n\t\t$is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false;\n\t\tif ( ! $is_cf ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\n\t\tif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\n\t\t\t// Grab the Current Cloudflare Address Range\n\t\t\t$cf_ips_values = $this->get_ips();\n\t\t\tif ( false == $cf_ips_values || empty($cf_ips_values) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the we getting a IPv4 or IPv6 Address\n\t\t\tif ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) {\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv4'] ?? '';\n\n\t\t\t\t// IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv6'];\n\t\t\t\t$ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv6_in_range( $ipv6, $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function maybe_set_real_ip() {\n\t\t$run =true;\n\t\tif (!function_exists('is_plugin_active')) {\n\t\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t}\n\t\tforeach ($this->plugins as $plugin) {\n\t\t\tif (\\is_plugin_active($plugin) ) {\n\t\t\t\t$run = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->wp_rocket_cloudflare_enabled()) {\n\t\t\t$run = false;\n\t\t}\n\n\t\tif ($run) {\n\t\t\t$this->set_real_ip();\n\t\t}\n\t}", "function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}", "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}", "public function setIpAddress($val)\n {\n $this->_propDict[\"ipAddress\"] = $val;\n return $this;\n }", "public function setIp($value)\n {\n return $this->set(self::ip, $value);\n }", "public function setRemoteIp($remoteIp);", "public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "public function setIpAddress($ip_address);", "function pre_system ( $data ) \n\t{\n\n\t\t// Is the HTTP_CF_CONNECTING_IP header set? If not, then this isn't CloudFlare\n\t\t$this->is_cf = ( ! empty( $_SERVER[\"HTTP_CF_CONNECTING_IP\"] )) ? TRUE : FALSE;\n\n\t\t// Set Origin IP\n\t\t$this->origin_ip = ( ! empty( $_SERVER[\"HTTP_CF_CONNECTING_IP\"] ))\n\t\t\t\t? $_SERVER[\"HTTP_CF_CONNECTING_IP\"]\n\t\t\t\t: UNKNOWN_COUNTRY;\n\n\t\t// Set country code\n\t\t$this->ip_country = ( ! empty( $_SERVER[\"HTTP_CF_IPCOUNTRY\"] ))\n\t\t\t\t? $_SERVER[\"HTTP_CF_IPCOUNTRY\"]\n\t\t\t\t: UNKNOWN_COUNTRY;\n\t\t\n\t\t// Set the CloudFlare service IP\n\t\t$this->cloudflare_ip = $_SERVER['REMOTE_ADDR'];\n\t\t\n\t\t// Overwrite the REMOTE_ADDR data if enabled\n\t\tif ( $this->settings['overwrite_addr'] == 'y' )\n\t\t{\n\t\t\t$this->_overwrite_remoteaddr();\n\t\t}\n\t\t\n\t}", "public function Persona (){ \n\n $this->ip=$this->getIP();\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public static function get_unsafe_client_ip()\n {\n }", "private function auto_reverse_proxy_remote_ip(){\n $remote_addr = $_SERVER['REMOTE_ADDR'];\n if (!empty($_SERVER['X_FORWARDED_FOR'])) {\n $X_FORWARDED_FOR = explode(',', $_SERVER['X_FORWARDED_FOR']);\n if (!empty($X_FORWARDED_FOR)) {\n $remote_addr = trim($X_FORWARDED_FOR[0]);\n }\n }\n /*\n * Some php environments will use the $_SERVER['HTTP_X_FORWARDED_FOR'] \n * variable to capture visitor address information.\n */\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $HTTP_X_FORWARDED_FOR= explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n if (!empty($HTTP_X_FORWARDED_FOR)) {\n $remote_addr = trim($HTTP_X_FORWARDED_FOR[0]);\n }\n }\n return preg_replace('/[^0-9a-f:\\., ]/si', '', $remote_addr);\n }", "public function testSetRemoteIp()\n {\n $this->_req->setRemoteIp('999.99.998.9');\n $this->assertEquals('999.99.998.9', $this->_req->getRemoteIp());\n }", "function getRealIpAddr()\n{\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif ($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) {\n\t\t$ip = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\telse\n\t{\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}", "function getRealIpAddr()\n{\nif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\n//CHECK IP FROM SHARE INTERNET\n\n{\n$ip=$_SERVER['HTTP_CLIENT_IP'];\n\n}\n\nelse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\n// to check if ip is pass from proxy\n\n{\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n}\nelse\n{\n$ip=$_SERVER['REMOTE_ADDR'];\n}\nreturn $ip;\n}", "function getRealUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default : return $_SERVER['REMOTE_ADDR'];\n }\n }", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}", "public static function getIP() {\n\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $rawheaders = apache_request_headers();\n } else {\n $rawheaders = $_SERVER;\n }\n\n // Lower case headers\n $headers = array();\n foreach($rawheaders as $key => $value) {\n $key = trim(strtolower($key));\n if ( !is_string($key) || empty($key) ) continue;\n $headers[$key] = $value;\n }\n\n // $filter_option = FILTER_FLAG_IPV4;\n // $filter_option = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n $filter_option = 0;\n\n $the_ip = false;\n\n // Check Cloudflare headers\n if ( $the_ip === false && array_key_exists( 'http_cf_connecting_ip', $headers ) ) {\n $pieces = explode(',',$headers['http_cf_connecting_ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'cf-connecting-ip', $headers ) ) {\n $pieces = explode(',',$headers['cf-connecting-ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Get the forwarded IP from more traditional places\n if ( $the_ip == false && array_key_exists( 'x-forwarded-for', $headers ) ) {\n $pieces = explode(',',$headers['x-forwarded-for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'http_x_forwarded_for', $headers ) ) {\n $pieces = explode(',',$headers['http_x_forwarded_for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'remote_addr', $headers ) ) {\n $the_ip = filter_var( $headers['remote_addr'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Fall through and get *something*\n if ( $the_ip === false && array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false ) $the_ip = NULL;\n return $the_ip;\n }", "static function IP(){\r\n\t\tif(\\Core\\Server::isCLI()){\r\n\t\t\treturn new IP(static::DEFAULT_IP);\r\n\t\t}\r\n\t\tif(isset($_SERVER['HTTP_X_REAL_IP'])){\r\n\t\t\treturn new IP($_SERVER['HTTP_X_REAL_IP']);\r\n\t\t}\r\n\t\tif(isset($_SERVER['REMOTE_ADDR'])){\r\n\t\t\treturn new IP($_SERVER['REMOTE_ADDR']);\r\n\t\t}\r\n\t\treturn new IP(static::DEFAULT_IP);\r\n\t}", "public static function isCloudFlare (string $ip): bool {\n $cf_ips = ['173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', '141.101.64.0/18', '108.162.192.0/18', '190.93.240.0/20', '188.114.96.0/20', '197.234.240.0/22', '198.41.128.0/17', '162.158.0.0/15', '104.16.0.0/12', '104.24.0.0/14', '172.64.0.0/13', '131.0.72.0/22'];\n foreach ($cf_ips as $cf_ip) {\n if (self::ipInRange($ip,$cf_ip)) {\n return true;\n }\n }\n return false;\n }", "function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "function getRealIpAddr()\n{\nif(!empty($_SERVER['HTTP_CLIENT_IP']))\n//check if from share internet\n{\n\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n}\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "function getRealIP() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n}", "public function getRealIpAddr(){\n\t\t//check ip from share internet\n\t if (!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t } else {\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}" ]
[ "0.7655002", "0.6699963", "0.6580829", "0.634213", "0.63274556", "0.59078723", "0.58831203", "0.5875683", "0.5864624", "0.58630025", "0.5789596", "0.5786246", "0.5781765", "0.5781765", "0.5780637", "0.57787335", "0.5777172", "0.5761268", "0.5729141", "0.5710153", "0.5706482", "0.5706482", "0.56973886", "0.56921476", "0.5690045", "0.567914", "0.5672065", "0.56616294", "0.5658176", "0.5657229" ]
0.7737613
0
This notice is displayed after purging the CloudFlare cache.
public function maybe_display_purge_notice() { if ( ! current_user_can( 'rocket_purge_cloudflare_cache' ) ) { return; } $user_id = get_current_user_id(); $notice = get_transient( $user_id . '_cloudflare_purge_result' ); if ( ! $notice ) { return; } delete_transient( $user_id . '_cloudflare_purge_result' ); rocket_notice_html( [ 'status' => $notice['result'], 'message' => $notice['message'], ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function purge_cloudflare_full() {\n\t\tcheck_ajax_referer( 'np_cf_ei_secure_me', 'np_cf_ei_nonce' );\n\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\techo 'Current user cannot clear the Cloudflare cache';\n\t\t\tdie();\n\t\t}\n\n\t\techo self::purge_cloudflare_cache();\n\t\tdie();\n\t}", "public function purge_cloudflare_url() {\n\t\tcheck_ajax_referer( 'np_cf_ei_secure_me', 'np_cf_ei_nonce' );\n\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\techo 'Current user cannot clear the Cloudflare cache';\n\t\t\tdie();\n\t\t}\n\n\t\t$url_clear = esc_url( $_POST['url'] );\n\t\tself::$cache_trigger_url = $url_clear;\n\t\techo self::purge_cloudflare_cache( array( $url_clear ) );\n\t\tdie();\n\t}", "public function auto_purge() {\r\n\t\tif ( ! current_user_can( 'rocket_purge_cloudflare_cache' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_cache_everything = $this->cloudflare->has_page_rule( 'cache_everything' );\r\n\r\n\t\tif ( is_wp_error( $cf_cache_everything ) || ! $cf_cache_everything ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Purge CloudFlare.\r\n\t\t$this->cloudflare->purge_cloudflare();\r\n\t}", "public static function purge_cache(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->purge_cache();\n }", "function _sp_clear_testimonial_pending_notice_cache() {\n\tdelete_transient( 'sp-testimonial-pending-notice' );\n\n\treturn true;\n}", "function wp_clean_update_cache()\n {\n }", "public function flushCache() {\n\t\t// is deleted. If it cleared our static cache variables\n\t\t// here, they would in effect be useless.\n\t}", "function logoCacheExpire() {\n\tmem2_force_delete('site_logo');\n}", "function purge()\n {\n return true;\n }", "public function cache_gc() {\n // TO DO!!!!!\n }", "protected function clearCacheOnError() {}", "public function cache_delete()\n {\n }", "public static function clean_cached_data()\n {\n }", "public static function purgeCaches() {}", "protected function adminNotices()\n {\n if (! empty($_GET[self::NOTICE]) &&\n \\filter_var($_GET[self::NOTICE], FILTER_VALIDATE_INT) === 1\n ) {\n $message = \\esc_html__('The cache has been successfully cleared.', 'wp-rest-api-cache');\n echo \"<div class='notice updated is-dismissible'><p>{$message}</p></div>\"; // PHPCS: XSS OK.\n }\n }", "protected function purgeCache() {\n\t\tConfigboxCacheHelper::purgeCache();\n\t}", "public static function removeCache() {\n\t}", "public function purge() {}", "function wp_cache_reset()\n {\n }", "public function afterDelete() {\n\t\tparent::afterDelete();\n\t\tCache::clear(false, CACHE_KEY_DEPARTMENTS_LOCAL_INFO);\n\t}", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public function reset_notices() {\n\t\tdelete_transient( sprintf( '%s_hero_notice', get_template() ) );\n\t}", "function wp_cache_flush()\n {\n }", "public function cloudflare_notices() {\n\t\tforeach ( $this->cloudflare_notices as $notice ) {\n\t\t\t$this->cloudflare_admin_notice( $notice );\n\t\t}\n\t}", "function _garbage_collection()\n\t{\n\t\tif (class_exists('Stats'))\n\t\t{\n\t\t\tif (ee()->stats->statdata('last_cache_clear')\n\t\t\t\t&& ee()->stats->statdata('last_cache_clear') > 1)\n\t\t\t{\n\t\t\t\t$last_clear = ee()->stats->statdata('last_cache_clear');\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset($last_clear))\n\t\t{\n\t\t\tee()->db->select('last_cache_clear');\n\t\t\tee()->db->where('site_id', ee()->config->item('site_id'));\n\t\t\t$query = ee()->db->get('stats');\n\n\t\t\t$last_clear = $query->row('last_cache_clear') ;\n\t\t}\n\n\t\tif (isset($last_clear) && ee()->localize->now > $last_clear)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'last_cache_clear'\t=> ee()->localize->now + (60*60*24*7)\n\t\t\t);\n\n\t\t\tee()->db->where('site_id', ee()->config->item('site_id'));\n\t\t\tee()->db->update('stats', $data);\n\n\t\t\tif (ee()->config->item('enable_throttling') == 'y')\n\t\t\t{\n\t\t\t\t$expire = time() - 180;\n\n\t\t\t\tee()->db->where('last_activity <', $expire);\n\t\t\t\tee()->db->delete('throttle');\n\t\t\t}\n\n\t\t\tee()->functions->clear_caching('all');\n\t\t}\n\t}", "public function removeCache() {\r\n $this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:i:s') . 'GMT');\r\n $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');\r\n $this->output->set_header('Cache-Control: post-check=0, pre-check=0', false);\r\n $this->output->set_header('Pragma: no-cache');\r\n }", "private function _cleanCache()\n {\n if ($this->cache instanceof \\Zend_Cache_Core) {\n $this->cache->clean();\n $this->addMessage($this->_('Cache cleaned'));\n }\n }", "private function _cacheCleanup()\n\t {\n\t\t$this->_db->exec(\n\t\t \"DELETE FROM `HTTPcache` WHERE \" .\n\t\t \"`datetime` < DATE_SUB(NOW(), INTERVAL \" . $this->_expiry . \" SECOND) OR `expiry` < NOW()\"\n\t\t);\n\t }", "public function plugin_deactive_hook(){\r\n delete_transient( 'woolentor_template_info' );\r\n delete_metadata( 'user', null, 'woolentor_dismissed_lic_notice', null, true );\r\n }", "function clear_cache() {\n $this->output->set_header(\"cache-control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0\");\n $this->output->set_header(\"Pragma:no-cache\");\n }" ]
[ "0.7152211", "0.68079865", "0.67483526", "0.65016586", "0.63651377", "0.6276794", "0.6248941", "0.6194012", "0.6146116", "0.61334276", "0.612225", "0.6107855", "0.60924447", "0.6014962", "0.60141146", "0.60056436", "0.59971464", "0.5996657", "0.5977005", "0.59755546", "0.59535027", "0.59460056", "0.59343714", "0.5930895", "0.5925194", "0.5917911", "0.59165883", "0.5916489", "0.5905587", "0.58973354" ]
0.71415937
1
Gets relevant system path (path for installing the package) based on the infos in the deployservice
protected function getSystemPath(EasyDeploy_DeployService $deployService) { return $deployService->getSystemPath(). '/' . $deployService->getEnvironmentName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPackagePath() ;", "public function getSystemPath() {\n return $this->system_path;\n }", "public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "function package_dir()\n {\n $reflector = new ReflectionClass(Service::class);\n\n return dirname($reflector->getFileName());\n }", "public function getPackageLocation(): string;", "private function getSystemPath() {\n if (strpos(PHP_OS, 'Win') !== FALSE) {\n return getenv('SystemRoot') . '\\\\System32\\\\drivers\\\\etc\\\\hosts';\n }\n \n return '/etc/hosts';\n }", "function getDistributorSitePath() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_SITE_PATH);\n\t}", "protected function getServicePath() {\r\n $api_path = PATH . '/' . $this->config['custom_path'];\r\n $params = $this->request->getParams();\r\n return $api_path . \"/Service/version_\" . str_replace(\".\", \"_\", $params['version']);\r\n }", "public function getPackagePath() {}", "protected static function getInstallToolEnableFilePath() {}", "public function getPackagePath()\n {\n if (!is_null($this->path)) {\n return $this->path;\n }\n\n switch ($this->getPackageType()) {\n case self::TYPE_ROOT:\n $this->path = static::getPackageCwd() . $this->name;\n break;\n case self::TYPE_VENDOR:\n $this->path = sprintf('%s/vendor/%s', static::getPackageCwd(), $this->name);\n break;\n case self::TYPE_PSEUDO:\n default:\n $this->path = false;\n break;\n }\n\n return $this->path;\n }", "function getApplicationSystemPath(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ];\n}", "protected function getBaseInstallationPath()\n {\n\n if ( !$this->composer || !$this->composer->getPackage() ) {\n return self::DEFAULT_ROOT;\n }\n\n $extra = $this->composer->getPackage()->getExtra();\n\n if ( !$extra || empty( $extra['module-dir'] ) ) {\n return self::DEFAULT_ROOT;\n }\n\n return $extra['module-dir'];\n }", "public static function getSystemInfo()\n {\n $file = tempnam(sys_get_temp_dir(), 'packlink_system_info');\n\n $zip = new ZipArchive();\n $zip->open($file, ZipArchive::CREATE);\n $phpInfo = static::getPhpInfo();\n\n if (false !== $phpInfo) {\n $zip->addFromString(static::PHP_INFO_FILE_NAME, $phpInfo);\n }\n\n $zip->addFromString(static::SYSTEM_INFO_FILE_NAME, static::getShopwareSystemInfo());\n $zip->addFromString(static::LOG_FILE_NAME, static::getLogs(static::PLUGIN_LOG_FILE_NAME));\n $zip->addFromString(static::PACKLINK_SPECIFIC_LOGS, static::getLogs(static::PACKLINK_SPECIFIC_LOG_FILE_NAME));\n $zip->addFromString(static::SHOPWARE_LOG_FILE, static::getLogs('core'));\n $zip->addFromString(static::USER_INFO_FILE_NAME, static::getUserInfo());\n $zip->addFromString(static::QUEUE_INFO_FILE_NAME, static::getQueueStatus());\n $zip->addFromString(static::PARCEL_WAREHOUSE_FILE_NAME, static::getParcelAndWarehouseInfo());\n $zip->addFromString(static::SERVICE_INFO_FILE_NAME, static::getServicesInfo());\n\n $zip->close();\n\n return $file;\n }", "protected static function packagePath(): string\n {\n return dirname(dirname(__DIR__));\n }", "protected function _setSystem()\n { $dirs = array(\n // symlink solar\n \"/source/solar/script/solar\",\n // symlink vendor\n \"/source/{$this->_vendor}/script/{$this->_vendor}\",\n // copy solar\n \"/script/solar\",\n // copy vendor\n \"/script/{$this->_vendor}\",\n );\n\n $this->_system = false;\n $file = __FILE__;\n foreach ($dirs as $dir) {\n // make comparison windows-friendly\n $dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);\n $len = -1 * strlen($dir);\n if (substr($file, $len) == $dir) {\n $this->_system = substr($file, 0, $len);\n break;\n }\n }\n }", "public function getDeploymentPackageDirectory()\n {\n return __DIR__;\n }", "public function getInstallationPath()\n {\n return get_storage_path($this->getSubdir().DIRECTORY_SEPARATOR.$this->getId());\n }", "function getPackageFilePath() {\n\t\treturn $this->_outPath .'/'. $this->_fileDir .'/'. $this->_packageFileName;\t\t \n\t}", "public function guessPackagePath()\n\t{\n\t\t$path = with(new \\ReflectionClass($this))->getFileName();\n\n\t\treturn realpath(dirname($path).'/../');\n\t}", "public function getPackagesPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_PACKAGES);\r\n\t}", "protected static function getFirstInstallFilePaths() {}", "protected function get_fixed_syspath($sPathSystem=\"\")\n {\n $sPathSystem = trim($sPathSystem);\n //http://websvn.eduardoaf.com/filedetails.php?repname=proy_tasks&path=%2Ftrunk%2Fproy_tasks%2Fthe_framework%2Fmvc%2Fmain%2Ftheframework_view.php&rev=293\n if($sPathSystem)\n {\n //todas las rutas se llevan a un tipo de separador de directorio\n $sPathSystem = str_replace(\"\\\\/\",\"/\",$sPathSystem);\n $sPathSystem = str_replace(\"/\\\\\",\"/\",$sPathSystem);\n $sPathSystem = str_replace(\"\\\\\",\"/\",$sPathSystem);\n $sPathSystem = str_replace(\"//\",\"/\",$sPathSystem);\n $sPathSystem = str_replace(\"\\\\\\\\\",\"/\",$sPathSystem);\n //se repmplaza el tipo de separador por el del sistema\n $sPathSystem = str_replace(\"/\",DIRECTORY_SEPARATOR,$sPathSystem);\n $sPathSystem = str_replace(\"\\\\\",DIRECTORY_SEPARATOR,$sPathSystem);\n }\n return $sPathSystem;\n }", "public function symfonyInstallerPath()\n {\n return __DIR__ . '/../../symfony.phar';\n }", "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }", "protected function resolvePackagePath()\n\t{\n\t\tif($this->scriptUrl===null || $this->themeUrl===null)\n\t\t{\n\t\t\t$cs=Yii::app()->getClientScript();\n\t\t\tif($this->scriptUrl===null)\n\t\t\t\t$this->scriptUrl=$cs->getCoreScriptUrl().'/jui/js';\n\t\t\tif($this->themeUrl===null)\n\t\t\t\t$this->themeUrl=$cs->getCoreScriptUrl().'/jui/css';\n\t\t}\n\t}", "function package_path($package = '')\n { \n return extension_path(\"packages\").($package ? DS.$package : $package);\n }", "public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }", "public function getAppPath()\n\t{\n\t\t$appName = $this->getAppName();\n\t\tif (empty($this->_appBasePath) || empty($appName)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception('applications base path and application name must assign before use');\n\t\t}\n\t\treturn $this->_appBasePath . '/' . $appName;\n\t}" ]
[ "0.65225834", "0.6412996", "0.629095", "0.62394136", "0.6202898", "0.61109823", "0.61014014", "0.6097387", "0.608544", "0.60625154", "0.6012535", "0.6006655", "0.595853", "0.5892877", "0.5885332", "0.5799127", "0.5794184", "0.5723053", "0.57100993", "0.5700102", "0.5692184", "0.5683591", "0.5682391", "0.5676525", "0.5664637", "0.5627714", "0.56067556", "0.5594755", "0.557483", "0.55742407" ]
0.6928345
0
Get the value of studentId
public function getStudentId() { return $this->studentId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_student_id() {\n\t\t\treturn $this->student_id;\n\t\t}", "public function getIdStudent(){\n\t\treturn $this->idStudent;\n\t}", "public function getStudentId(): int\n {\n return $this->studentId;\n }", "public function getIdStudent()\n {\n return $this->id_student;\n }", "public function getCurrentStudentId()\n {\n return $this->getAttribute('student_id');\n }", "public function getStudent($idStudent){\n $student=student::where('numberAccount',$idStudent)->first();\n return $idStudent;\n }", "function student_id()\n\t\t{\n\t\t$custom = $this->custom_parsed();\n\t\tif(isset($custom['student_id']))\n\t\t\t{\n\t\t\treturn $custom['student_id'];\n\t\t\t}\n\t\telseif(isset($custom['person_id']))\n\t\t\t{\n\t\t\t$p = new Person($custom['person_id']);\n\t\t\treturn Student::addperson($p);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$info = $this->infoarray();\n\t\t\tif(isset($info['payer_email']))\n\t\t\t\t{\n\t\t\t\t$p = Person::get_by_email($info['payer_email']);\n\t\t\t\tif($p === false)\n\t\t\t\t\t{\n\t\t\t\t\t$name = $info['first_name'] . ' ' . $info['last_name'];\n\t\t\t\t\t$person_id = Person::add2($info['payer_email'], $name);\n\t\t\t\t\treturn Student::addperson(new Person($person_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn false;\n\t\t}", "public function getStudentId() {\n\t\tpreg_match ( '/\\d{9}/', $this->transcript, $ID ); // this will get the SID of the student\n\n\t\tif (count ( $ID ) > 0) {\n\t\t\t\t\n\t\t\t// $key= mt_rand ( MIN_KEY, MAX_KEY ); // will append a random key to the SI\n\t\t\treturn $ID [0]; // . strval($key);\n\t\t} else\n\t\t\treturn null;\n\t}", "private function get_student_id($param = '')\r\n\t{\r\n\t\treturn $this->db->get_where('students', array('npm' => $param))->row('student_id');\r\n\t}", "public function getStNo(){\n return $this->student_no;\n }", "public function getId()\n {\n if($this->context->getRequest()->getParam('example_id')){\n $studentModel =$this->studentFactory->create();\n $studentModel->load($this->context->getRequest()->getParam('example_id'));\n \n return $studentModel->getId();\n }\n return false;\n }", "protected /*array<string,mixed>*/ function getStudent(/*int*/ $studentid)\n\t{\n\t\t$query = $this->db->prepare(\"SELECT * FROM `students` WHERE `id` = ? LIMIT 1;\")->execute($studentid);\n\n\t\tif(len($query) > 0)\n\t\t\treturn $query->row;\n\t\treturn null;\n\t}", "function get_student_info_by_id($student_id) {\n return $this->db->get_where('student', array('student_id' => $student_id))->row_array();\n }", "function getId() {\n\t\treturn $this->getData('studyId');\n\t}", "public function getReviewStudentProfileId() : int {\n\t\treturn ($this->reviewStudentProfileId);\n\t}", "public function _getStudentNumber()\n {\n $user = \"\";\n if ($this->has('user'))\n $user = $this->user;\n else\n $user = TableRegistry::get('Users')->get($this->user_id);\n\n return substr($user->login, 2);\n }", "public function studentNumberSelect($student_id){\n\t \ttry {\n\n\t \t\t$stmt = $this->con->prepare(\"select * from sixtoeightmarksheet where student_id = :student_id and status = 1 \");\n\t \t\t$stmt->bindValue(':student_id', $student_id, PDO::PARAM_STR);\n\t \t\t$stmt->execute();\n\n\t \t\tif($stmt->rowCount() > 0){\n\t \t\t\treturn $stmt->fetch(PDO::FETCH_ASSOC);\n\t \t\t}\n\t \t\telse{\n\t \t\t\t$_SESSION['delete'] = \"Student ID does not match !!! Please try another ID to see Marksheet \";\n\t \t\t\t//header('location=meritmarksheet.php');\n\t \t\t\techo \"<script>window.location='view/admin/marksheet/meritmarksheet.php'</script>\";\n\t \t\t}\n\t \t\t\n\t \t} catch (PDOException $e) {\n\t \t\techo \"Error: \".$e->getMessage().\"<br />\";\n\t \t\tdie();\n\n\t \t}\n\t }", "public function getStudent($id){\n\t\t$this->db->where('id',$id);\n\t\t$query = $this->db->get('students');\n\t\treturn $query->row();\n\t}", "public function getT_StudentID($rno)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql=\"select student_id from student where student_rollNo=:sno\";\n\t\t\t\t\t\t\t$this->openDB();\n\t\t\t\t\t\t\t$this->prepareQuery($sql);\n\t\t\t\t\t\t\t$this->bindQueryParam(':sno',$rno);\t\t\t\t\t\t \n\t\t\t\t\t\t\t$result=$this->executeQuery();\n\t\t\t\t\t\t $this->closeDB();\n\t\t\t\t\t\t return $result;\n\t\t\t\t\t}", "protected function getLastId(){\n $student_current_id = \"SELECT students.id FROM `students` ORDER BY id DESC LIMIT 1\";\n $sql = $this->conn->prepare($student_current_id);\n $sql->execute();\n\n $result = $sql->setFetchMode(PDO::FETCH_ASSOC);\n $student_id = $sql->fetchAll();\n echo \"<br><br><br><br>\";\n foreach ($student_id as $id){\n $my_id = $id['id'];\n }\n return $my_id;\n }", "public function getStudentGroupId()\n {\n return $this->studentGroupId;\n }", "function getSId() {\n return $this->sId;\n }", "public function get_student($id)\n\t\t{\n\t\t\treturn $this->conn->get($id);\n\t\t}", "public function getid($id = null) {\n\t\tif(strlen($id) == 11) {\n\t\t\tif($id != null) {\n\t\t\t\t$user = DB::table('student_info')->where('student_id', $id)->first();\n\t\t\t\tif($user == null) return \"NO\"; \n\t\t\t\treturn Response::json($user);\n\t\t\t}\n\t\t\treturn \"NO\";\n\t\t}\n\t\treturn \"ER\";\n\t}", "function show_student_id($data){\n\t$this->db->select('*');\n\t$this->db->from('students');\n\t$this->db->where('student_id', $data);\n\t$query = $this->db->get();\n\t$result = $query->result();\n\treturn $result;\n\t}", "private function getSampleIndividualId()\n {\n return $this->sampleIndividualId;\n }", "public function getValueId()\n {\n return $this->valueId;\n }", "function get_student($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function getStaffID()\n {\n return $this->getValueByFieldName('staff_id');\n }", "public function getId() \r\n\t{\r\n\t\treturn $this->sId;\r\n\t}" ]
[ "0.78031254", "0.7801303", "0.77913064", "0.77817005", "0.77364075", "0.74751586", "0.73274857", "0.72067964", "0.69598776", "0.6800084", "0.6678113", "0.6601985", "0.6532665", "0.6482011", "0.6476485", "0.6428621", "0.64249164", "0.6404434", "0.63950074", "0.63936037", "0.63568753", "0.6346652", "0.6323983", "0.63126487", "0.62824756", "0.62767094", "0.6242064", "0.62101865", "0.62039685", "0.6199565" ]
0.7918013
0
Get the value of careerId
public function getCareerId() { return $this->careerId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCedarId() { \n\t $this->load();\n\t return $this->mCedarId; \n }", "public function getCarId()\n {\n return $this->attributes['car_id'];\n }", "function getERCId() {\n\t\treturn $this->getData('ercId');\n\t}", "public function getId()\n {\n return $this->c_id;\n }", "public function getId() {\n\t\treturn $this -> data['id'];\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function getID() {\n return array_key_exists($this->_key_field, $this->_data) ? $this->_data[$this->_key_field] : null;\n }", "public function getId()\n {\n return $this->getValue('id');\n }", "public function getMaconomyId(): string\n {\n return (string)$this->data['instancekeyField'];\n }", "public function getCarid()\n {\n return $this->carid;\n }", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "protected function _getIdentifier()\n\t{\n\t\treturn $this->_getCookieValue(Df_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');\n\t}", "public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}", "function getID() {\n\t\treturn $this->data_array['id'];\n\t}", "public function id() : ?string\n {\n return (isset($this->data['id'])) ? $this->data['id'] : null;\n }", "public function getID()\n { return $this->get('id'); }", "public static function id(){\n return self::info('id');\n }", "public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}", "public function get_id();", "public function get_id();", "public function getIdCook()\n {\n return $this->id_cook;\n }", "public function getId() {\n return $this->datosprop->getId_prop_carac();\n }", "public function getId(){\n return $this->_data['id'];\n }", "public function getWholesalerId()\n {\n $value = $this->get(self::wholesaler_id);\n return $value === null ? (integer)$value : $value;\n }", "public function identifier()\n {\n return $this->id;\n }", "public function getId()\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "function getId() {\n\t\treturn $this->getData('sectionDecisionId');\r\n\t}", "public function getUserBreweryId () {\n\t\treturn ($this->userBreweryId);\n\t}", "function get_id() {\n return $this->get_mapped_property('id');\n }" ]
[ "0.6604089", "0.64933234", "0.64733315", "0.63972855", "0.6338489", "0.6337994", "0.6296576", "0.628451", "0.6258674", "0.62416553", "0.6236524", "0.6236524", "0.62289506", "0.62189454", "0.6173707", "0.6149272", "0.61487067", "0.61405206", "0.61396736", "0.6133577", "0.6133577", "0.6131441", "0.6127647", "0.612085", "0.6086579", "0.6085591", "0.6058718", "0.6055603", "0.6046834", "0.6038549" ]
0.80861133
1
Get the value of fileNumber
public function getFileNumber() { return $this->fileNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFile_id() {\n return (int) $this->_file_id;\n }", "public function getFileID()\n {\n return $this->get('FileID');\n }", "public function getFileId(): string\n {\n return $this->file_id;\n }", "public function fileCode() { return $this->_m_fileCode; }", "function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}", "public function getFileId()\n {\n return $this->fileId;\n }", "public function getDataWithTypeFileReturnsUidOfFileObject() {}", "function get_max_number_file(){\n\t\t$myFile = \"/home/hvn0220437/supercleaner.info/public_html/number.txt\";\n\t\t$fh = fopen($myFile, 'r') or die(\"Cannot open file\");\n\t\t$myFileContents = fread($fh, filesize($myFile));\n\t\t$myFile_array = explode(\"+\",$myFileContents);\n\t\tfclose($fh);\n\t\treturn $myFileContents[2];\n\t}", "public function getFileId()\n\t{\n\t\treturn $this->fileId; \n\n\t}", "public function get(): int\n {\n return (int) $this->filesystem->get($this->filename);\n }", "public function getFileNumber(Career $career)\n {\n if (SchoolBehaviourFactory::getInstance()->getFileNumberIsGlobal())\n {\n $file_number = $this->getGlobalFileNumber();\n }\n else\n {\n $c = new Criteria();\n $c->add(CareerStudentPeer::CAREER_ID, $career->getId());\n $c->add(CareerStudentPeer::STUDENT_ID, $this->getId());\n\n $file_number = CareerStudentPeer::doSelectOne($c)->getFileNumber();\n }\n return sprintf(\"%05s\", $file_number);\n\n }", "public function getSpecFileRevision()\n {\n $value = $this->get(self::SPEC_FILE_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function getSpecFileRevision()\n {\n $value = $this->get(self::SPEC_FILE_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function getRawValue ()\n {\n return $this->files->getFile( $this->getName() );\n }", "public function getAllowedMaxFileNumber() {\n return $this->allowedMaxFileNumber;\n }", "public function get_New_FTS_No(){\n\n\t\t$this->db->select_max('FM_FILE_ID');\n\t\t$query = $this->db->get('FILE_MST');\n\t\t$row = $query->row();\n\n\t\tif (isset($row))\n\t\t return $row->FM_FILE_ID + 1;\n\t}", "public function get_number()\n\t{\n\t\treturn $this->number;\n\t}", "function readFileVersion()\n\t{\n\t\treset($this->lastfilecontent);\n\t\t$regs = array();\n\t\tforeach ($this->lastfilecontent as $row)\n\t\t{\n\t\t\tif (ereg(\"^<#([0-9]+)>\", $row, $regs))\n\t\t\t{\n\t\t\t\t$version = $regs[1];\n\t\t\t}\n\t\t}\n\n\t\t$this->fileVersion = (integer) $version;\n\t\treturn $this->fileVersion; \n\t}", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "function getImgNumber ($userDir) {\r\n $arrayFile = getFilesFromDir($userDir);\r\n if (!empty($arrayFile)) {\r\n // the lagest number is first\r\n rsort($arrayFile);\r\n // get first filename from array\r\n $fileName = current($arrayFile);\r\n // get the filename without extension\r\n $fileName = substr($fileName, 0, -4);\r\n }\r\n // if directory is empty - first filename must be 0.jpg\r\n else {\r\n $fileName = 0;\r\n }\r\n return $fileName;\r\n}", "public function getNumber() {\n return $this->number;\n }", "public function getFileCount(){\n\t\treturn $this->intFileCount;\n\t}", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }" ]
[ "0.69876075", "0.68775", "0.6643478", "0.6621315", "0.6591665", "0.6464993", "0.6446901", "0.64357716", "0.64146477", "0.63549995", "0.6342966", "0.63021284", "0.63021284", "0.6235594", "0.62163264", "0.61746603", "0.6136774", "0.6129149", "0.6120593", "0.60369956", "0.6032284", "0.5996886", "0.59939045", "0.59939045", "0.59939045", "0.59939045", "0.59939045", "0.59939045", "0.59939045", "0.59939045" ]
0.8545292
0
Add our resources to the theme as soon as it is available, otherwise return
private function addToTheme() { static $addedResource = false; if ($this->activated && !$addedResource) { if (isset($GLOBALS['xoTheme'])) { /* $xoops = Xoops::getInstance(); $head = '</style>' . $this->renderer->renderHead() . '<style>.icon-tags:before { content: ""; width: 16px; background-position: -25px -48px;}'; $xoops->theme()->addStylesheet(null, null, $head); */ $addedResource = true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mightyResources() {\n $css_file = get_stylesheet_directory() . '/dist/assets/css/style.min.css';\n wp_enqueue_style('theme', get_stylesheet_directory_uri() . '/dist/assets/css/style.min.css', '', date('m.d.Y.H.i.s', filemtime($css_file)));\n\t\twp_dequeue_style('wp-block-library');\n\n wp_deregister_script('jquery');\n wp_register_script('jquery', ('//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'), '', '2.2.4', false);\n wp_enqueue_script('jquery');\n\n // wp_enqueue_script('fontawesome-kit', '//kit.fontawesome.com/72e34829c8.js', '', '1.0', false);\n\t\twp_enqueue_script('google-maps', '//maps.googleapis.com/maps/api/js?key=AIzaSyClqC80DXd3luWXcJZ-a0odx1q6ddTDVr0', '', '1.0', false);\n\n\t\twp_enqueue_script('aos', '//unpkg.com/[email protected]/dist/aos.js', '', '2.3.1', true);\n wp_enqueue_script('theme', get_stylesheet_directory_uri() . '/dist/assets/js/scripts.min.js', ['jquery'], '1.0.6', true);\n\n\t\twp_localize_script('theme', 'globalVar', array(\n\t\t 'themePath' => get_template_directory_uri(),\n\t\t));\n }", "function Define_Resources() : void\n {\n for($i = 0;$i < count($this->Scripts);$i++)\n {\n if($this->Scripts[$i] instanceof stdClass)\n {\n wp_enqueue_script($this->Scripts[$i]->Handle,$this->Scripts[$i]->Src,$this->Scripts[$i]->Deps,$this->Scripts[$i]->Ver,$this->Scripts[$i]->InFooter);\n }\n }\n for($i = 0;$i < count($this->Styles);$i++)\n {\n if($this->Styles[$i] instanceof stdClass)\n {\n wp_enqueue_style($this->Styles[$i]->Handle,$this->Styles[$i]->Src,$this->Styles[$i]->Deps,$this->Styles[$i]->Ver,$this->Styles[$i]->Media);\n }\n }\n }", "function load()\n {\n self::loadScriptsAndStyles($this->m_themeLoad ? $this->m_themeName : false);\n }", "public static function get_resources() {\n if (self::$resource_list === NULL) {\n $base = self::$base_url;\n if (!self::$js_path) {\n self::$js_path = $base . 'media/js/';\n }\n elseif (substr(self::$js_path, -1) != \"/\") {\n // Ensure a trailing slash.\n self::$js_path .= \"/\";\n }\n if (!self::$css_path) {\n self::$css_path = $base . 'media/css/';\n }\n elseif (substr(self::$css_path, -1) != '/') {\n // Ensure a trailing slash.\n self::$css_path .= \"/\";\n }\n global $indicia_theme, $indicia_theme_path;\n if (!isset($indicia_theme)) {\n // Use default theme if page does not specify it's own.\n $indicia_theme = 'default';\n }\n if (!isset($indicia_theme_path)) {\n // Use default theme path if page does not specify it's own.\n $indicia_theme_path = preg_replace('/css\\/$/', 'themes/', self::$css_path);\n }\n // Ensure a trailing slash.\n if (substr($indicia_theme_path, -1) !== '/') {\n $indicia_theme_path .= '/';\n }\n self::$resource_list = [\n 'indiciaFns' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"indicia.functions.js\"],\n ],\n 'jquery' => [\n 'javascript' => [\n self::$js_path . 'jquery.js',\n self::$js_path . 'ie_vml_sizzlepatch_2.js',\n ],\n ],\n 'datepicker' => [\n 'deps' => ['jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'indicia.datepicker.js',\n self::$js_path . 'date.polyfill/better-dom/dist/better-dom.min.js',\n self::$js_path . 'date.polyfill/better-dateinput-polyfill/dist/better-dateinput-polyfill.min.js',\n ]\n ],\n 'sortable' => [\n 'javascript' => ['https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.js'],\n ],\n 'openlayers' => [\n 'javascript' => [\n self::$js_path . (function_exists('iform_openlayers_get_file') ? iform_openlayers_get_file() : 'OpenLayers.js'),\n self::$js_path . 'proj4js.js',\n self::$js_path . 'proj4defs.js',\n self::$js_path . 'lang/en.js',\n ],\n ],\n 'graticule' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'indiciaGraticule.js'],\n ],\n 'clearLayer' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'clearLayer.js'],\n ],\n 'hoverControl' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'hoverControl.js'],\n ],\n 'addrowtogrid' => [\n 'deps' => ['validation'],\n 'javascript' => [self::$js_path . \"addRowToGrid.js\"],\n ],\n 'speciesFilterPopup' => [\n 'deps' => ['addrowtogrid'],\n 'javascript' => [self::$js_path . \"speciesFilterPopup.js\"],\n ],\n 'indiciaMapPanel' => [\n 'deps' => ['jquery', 'openlayers', 'jquery_ui', 'jquery_cookie', 'hoverControl'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMapPanel.js\"],\n ],\n 'indiciaMapEdit' => [\n 'deps' => ['indiciaMap'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.js\"],\n ],\n 'postcode_search' => [\n 'javascript' => [self::$js_path . \"postcode_search.js\"],\n ],\n 'locationFinder' => [\n 'deps' => ['indiciaMapEdit'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.locationFinder.js\"],\n ],\n 'createPersonalSites' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"createPersonalSites.js\"],\n ],\n 'autocomplete' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$css_path . \"jquery.autocomplete.css\"],\n 'javascript' => [self::$js_path . \"jquery.autocomplete.js\"],\n ],\n 'addNewTaxon' => [\n 'javascript' => [self::$js_path . \"addNewTaxon.js\"],\n ],\n 'import' => [\n 'javascript' => [self::$js_path . \"import.js\"],\n ],\n 'indicia_locks' => [\n 'deps' => ['jquery_cookie', 'json'],\n 'javascript' => [self::$js_path . \"indicia.locks.js\"],\n ],\n 'jquery_cookie' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.cookie.js\"],\n ],\n 'jquery_ui' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [\n self::$css_path . 'jquery-ui.min.css',\n \"$indicia_theme_path$indicia_theme/jquery-ui.theme.min.css\",\n ],\n 'javascript' => [\n self::$js_path . 'jquery-ui.min.js',\n self::$js_path . 'jquery-ui.effects.js',\n ]\n ],\n 'jquery_ui_fr' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . \"jquery.ui.datepicker-fr.js\"]\n ],\n 'jquery_form' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.form.min.js\"],\n ],\n 'reportPicker' => [\n 'deps' => ['treeview', 'fancybox'],\n 'javascript' => [self::$js_path . \"reportPicker.js\"],\n ],\n 'treeview' => ['deps' => ['jquery'], 'stylesheets' => [self::$css_path.\"jquery.treeview.css\"], 'javascript' => [self::$js_path.\"jquery.treeview.js\"]],\n 'treeview_async' => ['deps' => ['treeview'], 'javascript' => [self::$js_path.\"jquery.treeview.async.js\", self::$js_path.\"jquery.treeview.edit.js\"]],\n 'googlemaps' => [\n 'javascript' => [\"https://maps.google.com/maps/api/js?v=3\" . (empty(self::$google_maps_api_key) ? '' : '&key=' . self::$google_maps_api_key)],\n ],\n 'fancybox' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.css'],\n 'javascript' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.js'],\n ],\n 'treeBrowser' => [\n 'deps' => ['jquery', 'jquery_ui'],\n 'javascript' => [self::$js_path . 'jquery.treebrowser.js']\n ],\n 'defaultStylesheet' => [\n 'deps' => [''],\n 'stylesheets' => [\n self::$css_path . 'default_site.css',\n self::$css_path . 'theme-generic.css'\n ],\n 'javascript' => []\n ],\n 'validation' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jquery.metadata.js',\n self::$js_path . 'jquery.validate.js',\n self::$js_path . 'additional-methods.js',\n ],\n ],\n 'plupload' => [\n 'deps' => ['jquery_ui', 'fancybox'],\n 'javascript' => [\n self::$js_path . 'jquery.uploader.js',\n self::$js_path . 'plupload/js/plupload.full.min.js',\n ]\n ],\n 'uploader' => [\n 'deps' => ['jquery', 'dmUploader'],\n 'javascript' => [\n self::$js_path . 'uploader.js',\n ],\n ],\n 'dmUploader' => [\n 'stylesheets' => [\n self::$js_path . 'uploader/dist/css/jquery.dm-uploader.min.css',\n ],\n 'javascript' => [\n self::$js_path . 'uploader/dist/js/jquery.dm-uploader.min.js',\n ]\n ],\n 'jqplot' => [\n 'stylesheets' => [self::$js_path . 'jqplot/jquery.jqplot.min.css'],\n 'javascript' => [\n self::$js_path . 'jqplot/jquery.jqplot.min.js',\n '[IE]' . self::$js_path . 'jqplot/excanvas.js'\n ],\n ],\n 'jqplot_bar' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.barRenderer.js',\n ],\n ],\n 'jqplot_pie' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.pieRenderer.js',\n ],\n ],\n 'jqplot_category_axis_renderer' => [\n 'javascript' => [self::$js_path . 'jqplot/plugins/jqplot.categoryAxisRenderer.js'],\n ],\n 'jqplot_canvas_axis_label_renderer' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.canvasTextRenderer.js',\n self::$js_path . 'jqplot/plugins/jqplot.canvasAxisLabelRenderer.js',\n ],\n ],\n 'jqplot_trendline' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.trendline.js',\n ],\n ],\n 'reportgrid' => [\n 'deps' => ['jquery_ui', 'jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'jquery.reportgrid.js',\n ]\n ],\n 'reportfilters' => [\n 'deps' => ['reportgrid'],\n 'stylesheets' => [self::$css_path . 'report-filters.css'],\n 'javascript' => [self::$js_path . 'reportFilters.js'],\n ],\n 'tabs' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . 'tabs.js'],\n ],\n 'wizardprogress' => [\n 'deps' => ['tabs'],\n 'stylesheets' => [self::$css_path . 'wizard_progress.css']\n ],\n 'spatialReports' => [\n 'javascript' => [self::$js_path . 'spatialReports.js'],\n ],\n 'jsonwidget' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jsonwidget/jsonedit.js',\n self::$js_path . 'jquery.jsonwidget.js',\n ],\n 'stylesheets' => [self::$css_path . 'jsonwidget.css'],\n ],\n 'timeentry' => [\n 'javascript' => [self::$js_path . 'jquery.timeentry.min.js'],\n ],\n 'verification' => [\n 'javascript' => [self::$js_path . 'verification.js'],\n ],\n 'control_speciesmap_controls' => [\n 'deps' => [\n 'jquery',\n 'openlayers',\n 'addrowtogrid',\n 'validation',\n ],\n 'javascript' => [\n self::$js_path . 'controls/speciesmap_controls.js',\n ],\n ],\n 'complexAttrGrid' => [\n 'javascript' => [self::$js_path . 'complexAttrGrid.js'],\n ],\n 'footable' => [\n 'stylesheets' => [self::$js_path . 'footable/css/footable.core.min.css'],\n // Note, the minified version not used as it does not contain bugfixes.\n // 'javascript' => [self::$js_path.'footable/dist/footable.min.js']\n 'javascript' => [self::$js_path . 'footable/js/footable.js'],\n 'deps' => ['jquery'],\n ],\n 'footableSort' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.sort.min.js'],\n 'deps' => ['footable'],\n ],\n 'footableFilter' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.filter.min.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableReport' => [\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableReport.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableChecklist' => [\n 'stylesheets' => [self::$css_path . 'jquery.indiciaFootableChecklist.css'],\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableChecklist.js'],\n 'deps' => ['footable']\n ],\n 'html2pdf' => [\n 'javascript' => [\n self::$js_path . 'html2pdf/dist/html2pdf.bundle.min.js',\n ],\n ],\n 'review_input' => [\n 'javascript' => [self::$js_path . 'jquery.reviewInput.js'],\n ],\n 'sub_list' => [\n 'javascript' => [self::$js_path . 'sub_list.js'],\n ],\n 'georeference_default_geoportal_lu' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/geoportal_lu.js'],\n ],\n 'georeference_default_nominatim' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/nominatim.js'],\n ],\n 'georeference_default_google_places' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/google_places.js'],\n ],\n 'georeference_default_indicia_locations' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/indicia_locations.js'],\n ],\n 'sref_handlers_2169' => [\n 'javascript' => [self::$js_path . 'drivers/sref/2169.js'],\n ],\n 'sref_handlers_4326' => [\n 'javascript' => [self::$js_path . 'drivers/sref/4326.js'],\n ],\n 'sref_handlers_osgb' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osgb.js'],\n ],\n 'sref_handlers_osie' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osie.js'],\n ],\n 'font_awesome' => [\n 'stylesheets' => ['https://use.fontawesome.com/releases/v5.15.4/css/all.css']\n ],\n 'leaflet' => [\n 'stylesheets' => ['https://unpkg.com/[email protected]/dist/leaflet.css'],\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/leaflet.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket.min.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket-leaflet.min.js',\n self::$js_path . 'leaflet.heat/dist/leaflet-heat.js',\n ],\n ],\n 'leaflet_google' => [\n 'deps' => [\n 'googlemaps'\n ],\n 'javascript' => [\n 'https://unpkg.com/leaflet.gridlayer.googlemutant@latest/dist/Leaflet.GoogleMutant.js',\n ],\n ],\n 'datacomponents' => [\n 'deps' => [\n 'font_awesome',\n 'indiciaFootableReport',\n 'jquery_cookie',\n ],\n 'javascript' => [\n self::$js_path . 'indicia.datacomponents/idc.core.js',\n self::$js_path . 'indicia.datacomponents/idc.controlLayout.js',\n self::$js_path . 'indicia.datacomponents/idc.esDataSource.js',\n self::$js_path . 'indicia.datacomponents/idc.pager.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.customScript.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.runCustomVerificationRulesets.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.cardGallery.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.dataGrid.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.esDownload.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.leafletMap.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordsMover.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordDetailsPane.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.templatedOutput.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.verificationButtons.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.filterSummary.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.permissionFilters.js',\n 'https://unpkg.com/@ungap/url-search-params',\n ],\n ],\n 'file_classifier' => [\n 'deps' => [\n 'plupload',\n 'jquery_ui',\n ],\n 'javascript' => [\n self::$js_path . 'jquery.fileClassifier.js',\n ],\n ],\n 'brc_atlas' => [\n 'deps' => [\n 'd3',\n 'bigr',\n 'leaflet',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.min.js',\n ],\n ],\n 'brc_charts' => [\n 'deps' => [\n 'd3',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.min.js',\n ],\n ],\n 'd3' => [\n 'javascript' => [\n 'https://d3js.org/d3.v5.min.js',\n ],\n ],\n 'bigr' => [\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/bigr.min.umd.js',\n ],\n ],\n ];\n }\n return self::$resource_list;\n }", "function massively_theme_assets() {\n\n\t\t$var = '1.0.0';\n\n\t\t/* CSS */\n\t\twp_enqueue_style( 'main-css', get_theme_file_uri('/assets/css/main.css'), '', $var );\n\t\twp_enqueue_style( 'noscript-css', get_theme_file_uri('/assets/css/noscript.css'), '', $var );\n\t\twp_enqueue_style( 'theme-css', get_stylesheet_uri(), '', $var );\n\n\t\t/* JavaScripts */\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'scrollex-js', get_theme_file_uri('/assets/js/jquery.scrollex.min.js'), '', $var );\n\t\twp_enqueue_script( 'scrolly-js', get_theme_file_uri('/assets/js/jquery.scrolly.min.js'), '', $var );\n\t\twp_enqueue_script( 'browser-js', get_theme_file_uri('/assets/js/browser.min.js'), '', $var );\n\t\twp_enqueue_script( 'breakpoints-js', get_theme_file_uri('/assets/js/breakpoints.min.js'), '', $var );\n\t\twp_enqueue_script( 'util-js', get_theme_file_uri('/assets/js/util.js'), '', $var );\n\t\twp_enqueue_script( 'main-js', get_theme_file_uri('/assets/js/main.js'), array('jquery'), $var, true );\n\t}", "function theme_assets() {\n\t// load css\n\twp_enqueue_style( 'font-awesome-css', get_template_directory_uri() . '/css/fontawesome.css' );\n\twp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css', false, time() );\n\n\t// load javascript\n\twp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '', true );\n wp_enqueue_script( 'waterfall-js', get_template_directory_uri() . '/js/waterfall.js', array(), '', true );\n\twp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array(), '', true);\n}", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "public function theme_assets_handler() {\n\t\t\n\t\t$version = wp_get_theme()->get('Version');\n\n\t\t//Enqueue stylesheets\n\t\tforeach ($this->styles as $style) {\n\t\t\twp_register_style($this->prefix . $style['slug'], get_template_directory_uri() . $style['path'], $style['deps'], $version);\n\t\t\twp_enqueue_style($this->prefix . $style['slug']);\n\n\n\n\t\t}\n\t\t\n\t\t//Enqueue Scripts\n\t\tforeach ($this->scripts as $script) {\n\t\t\twp_register_script($this->prefix . $script['slug'], get_template_directory_uri() . $script['path'], $script['deps'], $version);\n\t\t\twp_enqueue_script($this->prefix . $script['slug']);\n\t\t}\n\t\t\n\t\t//Enqueue WP Scripts\n\t\tif(is_array($this->wp_scripts)){\n\t\t\t\n\t\t\tforeach ($this->wp_scripts as $script) {\n\t\t\t\twp_enqueue_script($script);\n\t\t\t}\n\t\t}\n\t}", "public function loadResources() {}", "private function setup_assets() {\n\t\t$this->prefix = sanitize_title($this->theme_name) . '-';\n\t\t$public_lib = '/lib/pub/';\n\t\t$source_lib = '/lib/src/';\n\n\t\t//IF WP DEBUG Is ON, load source maps and assets\n\t\tif (constant(\"WP_DEBUG\") === true) {\n\t\t\t//Style Resources\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles',\n\t\t\t\t'path' => $source_lib . 'css/master.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\t\t\t\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'scss',\n\t\t\t\t'path' => $source_lib . 'scss/master.scss',\n\t\t\t\t'deps' => array( $this->prefix . 'styles')\n\t\t\t);\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'css-map',\n\t\t\t\t'path' => $source_lib . 'maps/master.css.map',\n\t\t\t\t'deps' => array( $this->prefix . 'styles', $this->prefix . 'scss')\n\t\t\t);\n\t\t\n\t\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'plugins',\n\t\t\t\t'path' => $source_lib . 'js/plugins.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'the-script',\n\t\t\t\t'path' => $source_lib . 'js/script.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\n\n\t\t\t// $this->scripts[] = array(\n\t\t\t// \t'slug' => $this->prefix . 'script-map',\n\t\t\t// \t'path' => $source_lib . 'maps/scripts.js.map',\n\t\t\t// \t'deps' => array(\n\t\t\t// \t\t'jquery',\n\t\t\t// \t\t$this->prefix . 'script'\n\t\t\t// \t)\n\t\t\t// );\n\t\n\t\t// Otherwise load only minified assets\n\t\t} else {\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles-min',\n\t\t\t\t'path' => $public_lib . 'css/master.min.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t\t'slug' => $this->prefix . 'scripts-min',\n\t\t\t\t\t'path' => $public_lib . 'js/master.min.js',\n\t\t\t\t\t'deps' => array(\n\t\t\t\t\t\t'jquery'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->add_wp_script('jquery');\n\t\t\n\t\tadd_action('wp_enqueue_scripts', array( $this, 'theme_assets_handler' ));\n\t}", "public function loadAppAssets() {\n\t\tadd_action( 'wp_loaded', function () {\n\t\t\t/** EnqueueScritps instance. Don't remove it. Used in included file. */\n\t\t\t$assets = Container::make( EnqueueScripts::class );\n\t\t\tinclude_once( MWW_PATH . '/app/Support/assets.php' );\n\t\t} );\n\t}", "public function add_resources()\n\t{\n\t\t\n\t}", "protected function addEmbeddedResources()\n {\n }", "public function load_assets() {\n\t\t\t//only load styles and js when needed\n\t\t\tif ( $this->is_edit_page() ) {\n\t\t\t\t//styles\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_style( 'wm-options-panel-white-label' );\n\t\t\t\tif ( ! wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )\n\t\t\t\t\twp_enqueue_style( 'wm-options-panel-branded' );\n\t\t\t\twp_enqueue_style( 'color-picker' );\n\n\t\t\t\t//scripts\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-tabs' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'wm-options-panel' );\n\t\t\t\twp_enqueue_script( 'color-picker' );\n\t\t\t}\n\t\t}", "function get_themes()\n {\n }", "public function handle_load_themes_request()\n {\n }", "function init__themes()\n{\n global $THEME_IMAGES_CACHE, $CDN_CONSISTENCY_CHECK, $RECORD_THEME_IMAGES_CACHE, $RECORDED_THEME_IMAGES, $THEME_IMAGES_SMART_CACHE_LOAD;\n $THEME_IMAGES_CACHE = array();\n $CDN_CONSISTENCY_CHECK = array();\n $RECORD_THEME_IMAGES_CACHE = false;\n $RECORDED_THEME_IMAGES = array();\n $THEME_IMAGES_SMART_CACHE_LOAD = 0;\n}", "public function useful_resources(){\r\n\t\t\r\n\t\t/* Get model */\r\n\t\t$itemsModel = $this->getModel('items');\r\n\t\t$itemsModel->set('category', $this->get('category'));\r\n\t\t\r\n\t\t/* Get data */\r\n\t\t$resources = $itemsModel->getResources();\r\n\t\t\r\n\t\t/* No data? */\r\n\t\tif (!DEBUG && !Utility::iterable($resources)){\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\t/* Load template */\r\n\t\tinclude(BLUPATH_TEMPLATES.'/site/modules/useful_resources.php');\r\n\t\t\r\n\t}", "function WPThemeDevPrac_resources(){\n\n\twp_enqueue_style('style', get_stylesheet_uri());\n\n}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "public function addRequiredResources() {\n // None\n }", "public function add_theme_support() {\n\t}", "function init() {\n\n\t\twp_register_style( THEME_PREFIX . '/copy', get_theme_file_url( 'assets/critical/copy.min.css' ), null, 'init' );\n\n\t\tCalyx()->_register_vendor_assets();\n\n\t\twp_register_script( THEME_PREFIX . '/script_object', get_theme_file_url( 'assets/js/calyx.min.js' ), null, 'init' );\n\n\t\t\t$localize_args = array(\n\t\t\t\t'_site' => home_url(),\n\t\t\t\t'_rest' => home_url( 'wp-json' ),\n\t\t\t\t'_ajax' => admin_url( 'admin-ajax.php' ),\n\n\t\t\t\t '_server_high_load' => json_encode( Calyx()->server()->is_high_load() ),\n\t\t\t\t'_server_extreme_load' => json_encode( Calyx()->server()->is_extreme_load() ),\n\t\t\t\t '_webfontloader' => json_encode( Calyx()->get_webfontloader_settings() ),\n\t\t\t);\n\n\t\t\tis_admin() && $localize_args['_admin'] = json_encode( true );\n\n\t\t\twp_localize_script( THEME_PREFIX . '/script_object', '_' . THEME_PREFIX . '_data', $localize_args );\n\n\t}", "public function setup_theme()\n {\n }", "function mu_themes_in_use(){$this->__construct();}", "function _maybe_update_themes()\n {\n }", "function purpleBlog_resources() {\n\n\t/*-- stylesheets ---*/\n\twp_enqueue_style( 'style', get_stylesheet_uri() );\n\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'bootstrap_theme', get_template_directory_uri() . '/css/bootstrap-theme.css' );\n}", "public static function loadTheme()\n\t{\n\t\tglobal $context;\n\n\t\tloadLanguage('QuickSpoiler/');\n\n\t\tif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'showoperations')\n\t\t\treturn;\n\n\t\tloadCSSFile('quick_spoiler.css');\n\n\t\tif (!in_array($context['current_action'], array('helpadmin', 'printpage')))\n\t\t\tloadJavaScriptFile('quick_spoiler.js', array('minimize' => true));\n\t}", "function load_stylesheets(){\n /**/ \n\t\twp_register_style('mobiriseicon', get_template_directory_uri(). '/assets/web/assets/mobirise-icons2/mobirise2.css', '',2.0,'all');\n\t\twp_register_style('tether', get_template_directory_uri(). '/assets/tether/tether.min.css', '',1.0,'all');\n\t\twp_register_style('bootstrap', get_template_directory_uri(). '/assets/bootstrap/css/bootstrap.min.css', '',4.0,'all');\n\t\twp_register_style('bootstrapgrid', get_template_directory_uri(). '/assets/bootstrap/css/bootstrap-grid.min.css', '',4.0,'all');\n\t\twp_register_style('bootstrapreboot', get_template_directory_uri(). '/assets/bootstrap/css/bootstrap-reboot.min.css', '',4.0,'all');\n\t\twp_register_style('dropdown', get_template_directory_uri(). '/assets/dropdown/css/style.css', '',5.1,'all');\n\t\twp_register_style('socicon', get_template_directory_uri(). '/assets/socicon/css/styles.css', '',3.0,'all');\n\t\twp_register_style('themestyle', get_template_directory_uri(). '/assets/theme/css/style.css', '',3.0,'all');\n\t\twp_register_style('addstyle', get_template_directory_uri(). '/assets/mobirise/css/mbr-additional.css', '',3.0,'all');\n\t\twp_register_style('appcss', get_template_directory_uri(). '/assets/css/app.css', '',0.1,'all');\n \n wp_enqueue_style('mobiriseicon');\n wp_enqueue_style('tether');\n wp_enqueue_style('bootstrap');\n wp_enqueue_style('bootstrapgrid');\n wp_enqueue_style('bootstrapreboot');\n wp_enqueue_style('dropdown');\n wp_enqueue_style('socicon');\n wp_enqueue_style('themestyle');\n wp_enqueue_style('addstyle');\n wp_enqueue_style('appcss');\n}", "function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }" ]
[ "0.7130416", "0.6751047", "0.66358095", "0.6613623", "0.65931255", "0.6534532", "0.6500077", "0.6492729", "0.6436466", "0.6411904", "0.63371253", "0.63212943", "0.6321055", "0.6300137", "0.624496", "0.6241471", "0.61941403", "0.6185063", "0.6184126", "0.6179152", "0.6178277", "0.617487", "0.61723703", "0.6167405", "0.61609566", "0.6160005", "0.61531746", "0.6149273", "0.61152774", "0.6091038" ]
0.7221214
0
Create a new voucher
public function create($data) { // Create the voucher $id = $this->voucher->create($data); if (!$id) { return false; } return $id; // Do post processing for voucher creation }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n \t$input = $request->all();\n $model = Voucher::create($input);\n return response($model);\n }", "public function transactionCreate(Request $request)\n {\n $invoice_request = $request->all();\n\n $response = BilldeskHmac::transactionCreate($invoice_request);\n }", "public function store(Request $request)\n {\n $rules = $this->Officevoucher->getRules('adds');\n $request->validate($rules);\n $data = [\n 'category_id' => $request->input('category_id'),\n 'price' => $request->input('price'),\n 'description' => $request->input('description'),\n 'narrative' => $request->input('narrative'),\n 'created_at' => date('Y-m-d')\n ];\n $status = Officevoucher::create($data);\n\n //taking last inserted ID after inserting data\n $lastinsertedID = $status->id;\n $updatedata = Officevoucher::find($lastinsertedID);\n //creating the voucher ID with string pad function and keeping last inserted ID as main core count\n $updatedata->voucherid = \"JOJ\". date('Y') .'-' . str_pad($lastinsertedID, '5', '0', STR_PAD_LEFT);\n //updating the created voucher ID to the same last inserted data.\n $updatestat = $updatedata->update();\n\n if($updatestat){\n $notification = array(\n 'alert-type' => 'success',\n 'message' => 'Voucher created successfully.'\n );\n } else {\n $notification = array(\n 'alert-type' => 'error',\n 'message' => 'Problem while creating Voucher.'\n );\n }\n return redirect()->route('office_voucher.index')->with($notification);\n }", "public function create()\n\t{\n /*if(!in_array('viewProduct', $this->permission)) {\n redirect('dashboard', 'refresh');\n }*/\n\n $this->data['vendor'] = $this->model_products->getVendorData();\n $this->data['products'] = $this->model_products->getProductData();\n\n\t\t$this->render_template('invoice/create', $this->data);\t\n\t}", "static public function ctrCrearVenta(){\n\n $tabla = \"ventas\";\n\n $datos = array(\n \"Ven_Cli_Id\" => $_POST[\"Ven_Cli_Id\"],\n \"Ven_Vnrs_Id\" => $_POST[\"Ven_Vnrs_Id\"],\n \"Ven_Factura\" => $_POST[\"Ven_Factura\"],\n \"Ven_Total\" => $_POST[\"Ven_Total\"],\n \"listaProductos\" => $_POST[\"listaProductos\"],\n \"metodos_pago\" => $_POST[\"listaMetodosPago\"]\n );\n\n $respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\n if($respuesta == \"ok\"){\n\n echo'VENTA GUARDADA CON EXITO';\n\n }\n\n \n\n }", "public function store(Request $request)\n {\n $validator = Validator::make(request()->all(),[\n 'name' => 'required|unique:vouchers,name',\n 'amount' => 'required|regex:/^[0-9]+$/',\n 'amount_type' => 'required',\n // 'expiry_date' => 'required|after:today',\n ]);\n if($validator->passes())\n {\n $date = Carbon::createFromFormat('d-m-Y', $request->expiry_date)->format('Y-m-d');\n $voucher = new Voucher();\n $voucher->name = $request->name;\n $voucher->amount = $request->amount;\n $voucher->amount_type = $request->amount_type;\n $voucher->expiry_date = $date;\n if($request->has('status'))\n {\n $voucher->status = '1';\n }\n else\n {\n $voucher->status = '0';\n }\n $voucher->save();\n return Redirect::back()->with('success','Voucher created successfully');\n }\n return Redirect::back()->withErrors($validator);\n \n }", "function add_voucher($data) \n\t{\n\t\t$this->db->insert('vouchers', $data);\n\t\treturn $this->db->insert_id();\n\t}", "public function cashVoucherRegistrationAction(CashVoucherRegistrationRequest $request)\n {\n $date = $request->get('cash_voucher_date');\n $time = $request->get('cash_voucher_time');\n $accountId = $request->get('cash_voucher_account_id');\n $voucherTransactionType = $request->get('cash_voucher_type');\n $voucherAmount = $request->get('cash_voucher_amount');\n $description = $request->get('cash_voucher_description');\n\n $cashAccount = Account::where('account_name','Cash')->first();\n if($cashAccount) {\n $cashAccountId = $cashAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/01</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $account = Account::where('id',$accountId)->first();\n if($account) {\n $name = $account->accountDetail->name;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/02</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n if($voucherTransactionType == 1) {\n $debitAccountId = $cashAccountId;\n $creditAccountId = $accountId;\n $particulars = $description.\" :(Cash recieved from \".$name.\")\";\n } else {\n $debitAccountId = $accountId;\n $creditAccountId = $cashAccountId;\n $particulars = $description.\" :(Cash paid to \".$name.\")\";\n }\n\n //converting date and time to sql datetime format\n $dateTime = date('Y-m-d H:i:s', strtotime($date.' '.$time.':00'));\n\n $transaction = new Transaction;\n $transaction->debit_account_id = $debitAccountId;\n $transaction->credit_account_id = $creditAccountId;\n $transaction->amount = !empty($voucherAmount) ? $voucherAmount : '0';\n $transaction->date_time = $dateTime;\n $transaction->particulars = $particulars;\n $transaction->status = 1;\n $transaction->created_user_id = Auth::user()->id;\n if($transaction->save()) {\n $voucher = new Voucher;\n $voucher->date_time = $dateTime;\n $voucher->voucher_type = 'Cash';\n $voucher->transaction_type = $voucherTransactionType;\n $voucher->amount = $voucherAmount;\n $voucher->description = $description;\n $voucher->transaction_id = $transaction->id;\n $voucher->status = 1;\n \n if($voucher->save()) {\n return redirect()->back()->with(\"message\",\"Successfully saved.\")->with(\"alert-class\",\"alert-success\");\n } else {\n //delete transaction if associated voucher record saving failed.\n $transaction->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/03</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/04</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n }", "public function store(CreateTransPurchaseRequest $request)\n\t{\n\t\t$r = $request->all();\n\t\t$t = new TransPurchase;\n\t\t$t->fill($r);\n\t\t$t->id_user = \\Auth::id(); //harusnya user yg login\n\t\t$t->date = Carbon::now();\n\t\t$t->save();\t\t\n\n\t\treturn redirect()->route('transpurchase.index');\n\t}", "public function actionCreate()\n {\n $model = new Purchase();\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', AppConstants::MESSAGE_SAVE_SUCCESS);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view('users.accounting.transaction.create');\n }", "public function actionCreate()\n {\n $model = new Voucher();\n\n if ($model->load(Yii::$app->request->post())) {\n $started_at = 0;\n $finished_at = 0;\n if ($model->date_start) {\n $started_at = strtotime(DateTime::createFromFormat(\"d-m-Y H:i:s\", $model->date_start)->format('Y-m-d H:i:s'));;\n }\n\n if ($model->date_end) {\n $finished_at = strtotime(DateTime::createFromFormat(\"d-m-Y H:i:s\", $model->date_end)->format('Y-m-d H:i:s'));;\n }\n\n if ($finished_at < $started_at) {\n Yii::$app->getSession()->setFlash('error',Yii::t('app', 'Ngày kết thúc không được nhỏ hơn ngày bắt đầu'));\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n $thumbnail = UploadedFile::getInstance($model, 'image');\n if ($thumbnail) {\n $file_name = uniqid() . time() . '.' . $thumbnail->extension;\n if ($thumbnail->saveAs(Yii::getAlias('@webroot') . \"/\" . Yii::getAlias('@voucher_image') . \"/\" . $file_name)) {\n $model->image = $file_name;\n } else {\n Yii::$app->getSession()->setFlash('error',Yii::t('app','Không thành công, vui lòng thử lại'));\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n $model->start_date = $started_at;\n $model->end_date = $finished_at;\n if ($model->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('app',' Thêm mới voucher thành công'));\n $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n Yii::error($model->getErrors());\n Yii::$app->getSession()->setFlash('error',Yii::t('app', 'Không thành công, vui lòng thử lại'));\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store($poheadId, Request $request)\n {\n $this->validate($request, ['voucher_no' => 'required|unique:vouchers'], ['voucher_no.unique' => '凭证号需唯一']);\n\n $v = new Voucher();\n $v->ref_id = $poheadId;\n $v->ref_type = 'PO';\n $v->voucher_no = $request->get('voucher_no');\n $v->amount = $request->get('amount');\n $v->post_date = $request->get('post_date');\n $v->remark = $request->get('remark');\n $v->creator = Auth::user()->id;\n $v->save();\n\n return redirect(\"/purchase/purchaseorders/$poheadId/vouchers\");\n }", "public function create(Request $request)\n {\n $this->isValid($request);\n $voucher = VoucherPool::create($request->all());\n\n return response()->json($voucher, 201);\n }", "public function creditVoucherRegistrationAction(CreditVoucherRegistrationRequest $request)\n {\n $date = $request->get('credit_voucher_date');\n $time = $request->get('credit_voucher_time');\n $debitAccountId = $request->get('credit_voucher_debit_account_id');\n $creditAccountId = $request->get('credit_voucher_credit_account_id');\n $voucherAmount = $request->get('credit_voucher_amount');\n $description = $request->get('credit_voucher_description');\n $excavatorId = $request->get('machine_voucher_excavator_id');\n $jackhammerId = $request->get('machine_voucher_jackhammer_id');\n\n $debitAccount = Account::where('id', $debitAccountId)->first();\n if($debitAccount) {\n $debitAccountName = $debitAccount->accountDetail->name;\n } else{\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/05</small>\")->with(\"alert-class\",\"alert-danger\");\n\n }\n\n $creditAccount = Account::where('id', $creditAccountId)->first();\n if($creditAccount) {\n $creditAccountName = $creditAccount->accountDetail->name;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/06</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n //converting date and time to sql datetime format\n $dateTime = date('Y-m-d H:i:s', strtotime($date.' '.$time.':00'));\n\n $transaction = new Transaction;\n $transaction->debit_account_id = $creditAccountId; //the crediter gives to company\n $transaction->credit_account_id = $debitAccountId; //the company gives to debiter\n $transaction->amount = !empty($voucherAmount) ? $voucherAmount : '0';\n $transaction->date_time = $dateTime;\n $transaction->particulars = $description.\"[\".$debitAccountName.\"->\".$creditAccountName.\"]\";\n $transaction->status = 1;\n $transaction->created_user_id = Auth::user()->id;\n if($transaction->save()) {\n $voucher = new Voucher;\n $voucher->date_time = $dateTime;\n if(!empty($excavatorId) || !empty($jackhammerId)) {\n $voucher->voucher_type = 'Credit_through';\n } else {\n $voucher->voucher_type = 'Credit';\n }\n $voucher->transaction_type = '3';\n $voucher->amount = $voucherAmount;\n $voucher->description = $description.\"[\".$debitAccountName.\"->\".$creditAccountName.\"]\";\n $voucher->transaction_id = $transaction->id;\n $voucher->excavator_id = $excavatorId;\n $voucher->jackhammer_id = $jackhammerId;\n $voucher->status = 1;\n \n if($voucher->save()) {\n return redirect()->back()->with(\"message\",\"Successfully saved.\")->with(\"alert-class\",\"alert-success\");\n } else {\n //delete transaction if associated voucher record saving failed.\n $transaction->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/07</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the voucher details. Try again after reloading the page!<small class='pull-right'> #06/08</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n }", "public function insert_voucher_details(){\r\n\t\t\r\n\t\t$tblVoucherHead_data = array(\r\n\t\t\t\t//'intVoucherReferenceID' => 'Primary key Auto generate',\r\n\t\t\t\t'strVoucherReferenceNo' => '',\r\n\t\t\t\t'strVoucherHeadPrefix' => '',\r\n\t\t\t\t'dtVoucerHeadDate' => '',\r\n\t\t\t\t'strVoucherHeadAccountID' => '',\r\n\t\t\t\t'strVoucherHeadAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherHeadBankName' => '',\r\n\t\t\t\t'strVoucherHeadBankDrawnBranch' => '',\r\n\t\t\t\t'tintVoucherHeadBankChequeType' => '',\r\n\t\t\t\t'strVoucherHeadBankChequeNumber' => '',\r\n\t\t\t\t'dtVoucherHeadBankChequeDate' => '',\r\n\t\t\t\t'strVoucherHeadNarration' => '',\r\n\t\t\t\t'intObjectID' => '',\r\n\t\t\t\t'strDatabaseName' => '',\r\n\t\t\t\t'intBranchID' => '',\r\n\t\t\t\t'strAction' => '',\r\n\t\t\t\t'strImportStatus' => '',\r\n\t\t\t\t'strMerchantID' => '',\r\n\r\n\t\t\t);\r\n\r\n\t\t$tblVoucherDetail_data = array(\r\n\t\t\t\t'intVoucherReferenceID' => '',\r\n\t\t\t\t'intVoucherReferenceDetailID' => '',\r\n\t\t\t\t'tintVoucherDetailEntryfor' => '',\r\n\t\t\t\t'intVoucherNewReferenceID' => '',\r\n\t\t\t\t'strVoucherDetailAccountID' => '',\r\n\t\t\t\t'strVoucherDetailAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherDetailNarration' => '',\r\n\t\t\t\t'decVoucherDetailTotalAmt' => '',\r\n\t\t\t\t'strVoucherDetailTotalAmtType' => '',\r\n\t\t\t\t'decVoucherDetailTDSon' => '',\r\n\t\t\t);\r\n\t}", "public function create(Request $request)\n {\n $pay = new Payment;\n\n $val = Crypt::decryptString($request->key);\n $str_arr = explode (\"-\", $val);\n $pay->event = $str_arr[0];\n $pay->team_id = $str_arr[1];\n $pay->trxid = $request->trxid;\n $pay->save();\n alert()->success('Your payment information has been submitted successfully. Please visit our selected participants section to get the confirmation. It might take upto 6 hours for us to update.')->autoclose(120000);\n return redirect()->route('front');\n \n }", "public function create()\n {\n $data['proceso'] = 'crea';\n $data['var'] = $this->var;\n $data['documentosCompra'] = PurchaseDocument::crsdocumentocom2($this->ventana);\n $data['sucursal'] = Subsidiaries::findOrFail(1);\n $data['transaccion'] = TransactionType::findOrFail(1);\n $data['currency'] = Currency::findOrFail(1);\n $data['condicion'] = PaymentCondition::findOrFail(1);\n $data['paymentmethods'] = PaymentMethod::all();\n $data['mediopagos'] = PaymentType::all();\n $data['period'] = Period::where('descripcion', Session::get('period'))->first();\n $data['terceros'] = Customer::all();\n $data['view'] = link_view('Tesoreria', 'Transacción', 'Generación de Documentos por Pagar', '');\n $data['header'] = headeroptions($this->var, 'crea', '', '');\n\n return view('otherprovisions.create', $data);\n }", "public function __construct(Voucher $voucher)\n {\n $this->voucher = $voucher;\n }", "public function store(Request $request)\n {\n // print_r($request->all());\n\n $request->validate([\n 'party_name' => 'required',\n 'bill_date' => 'required',\n 'order_number' => 'required',\n 'quantity' => 'required',\n 'rate' => 'required',\n 'to_account' => 'required',\n 'due_date' => 'required',\n 'item_name' => 'required',\n ]);\n\n ReceiveVoucher::insert([\n 'party_name' => $request->party_name,\n 'bill_date' => $request->bill_date,\n 'order_number' => $request->order_number,\n 'quantity' => $request->quantity,\n 'rate' => $request->rate,\n 'to_account' => $request->to_account,\n 'due_date' => $request->due_date,\n 'item_name' => $request->item_name,\n 'desc' => $request->desc,\n 'created_by' => Auth::id(),\n 'created_at' => Carbon::now(),\n ]);\n\n return redirect('receive')->with('success','Receive Voucher Add Successfully !!');\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 create()\n {\n return view(\"inventory.transaction.create\");\n }", "public function create()\n {\n $data['purchase_type'] = Config(\"constanta.purchase_type\");\n $data['currency'] = Config(\"constanta.currency\");\n $data['solicitation_type'] = Config(\"constanta.solicitation_type\");\n $data['product'] = KodamiProduct::select('name', 'id', 'name_alias')->where('status', 1)->get();\n return view('request_for_quotation.add', $data);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'gift_voucher_name' => 'required',\n 'gift_voucher_code' => 'required',\n 'amount' => 'required',\n ]);\n\n $cominfo = new GiftVoucher;\n $cominfo->gift_voucher_name = $request->gift_voucher_name;\n $cominfo->gift_voucher_code = $request->gift_voucher_code;\n $cominfo->amount = $request->amount;\n $cominfo->store_id=$this->sdc->storeID();\n $cominfo->branch_id=$this->sdc->branchID();\n $cominfo->created_by=$this->sdc->UserID();\n $cominfo->save();\n\n \n\n $this->sdc->log(\"Gift Voucher Info\",$this->moduleName.\" Added Successfully.\");\n return redirect('gift_voucher')->with('status', 'Gift Voucher Added Successfully!');\n }", "public function create()\n {\n JavaScript::put('invoice_id',(int)$this->service->getLastInsertId()+1);\n return view('admin.invoice.add',[\n 'invoice_id'=>((int)$this->service->getLastInsertId()+1),\n 'taxes' => Tax::all(),\n ]);\n }", "protected function create(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $data = (array) $request->all();\n\n if($data['voucher'] == 'kessingtech')\n {\n $user = User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => Hash::make($data['password']),\n 'type'=>'admin',\n 'voucher'=>Str::random(5),\n 'account_type'=>3\n ]);\n\n HostingPlan::create([\n 'host_period'=>10,\n 'user_id'=>$user->id\n ]);\n\n DriveCapacity::create([\n 'capacity'=>1000000000,\n 'd_usage'=>0,\n 'user_id'=>$user->id\n ]);\n\n User::where('id',$user->id)->update(['account_type'=>3]);\n\n $this->guard()->login($user);\n\n return response()->json([\n 'redirect'=>'admin/dashboard'\n ]);\n }\n else\n { \n $voucher = Voucher::where(['voucher'=>$data['voucher'],'active'=>0])->get();\n\n if(sizeof($voucher))\n {\n $user = User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => Hash::make($data['password']),\n 'voucher' => $data['voucher'],\n 'type'=>'customer'\n ]);\n\n if($voucher[0]->type == 'host'){\n HostingPlan::create([\n 'host_period'=>$voucher[0]->host_size,\n 'user_id'=>$user->id\n ]);\n\n User::where('id',$user->id)->update(['account_type'=>1]);\n }\n\n if($voucher[0]->type == 'drive'){\n DriveCapacity::create([\n 'capacity'=>$voucher[0]->drive_size,\n 'd_usage'=>0,\n 'user_id'=>$user->id\n ]);\n\n User::where('id',$user->id)->update(['account_type'=>2]);\n }\n\n if($voucher[0]->type == 'both'){\n HostingPlan::create([\n 'host_period'=>$voucher[0]->host_size,\n 'user_id'=>$user->id\n ]);\n\n DriveCapacity::create([\n 'capacity'=>$voucher[0]->drive_size,\n 'd_usage'=>0,\n 'user_id'=>$user->id\n ]);\n\n User::where('id',$user->id)->update(['account_type'=>3]);\n }\n\n Voucher::where('voucher',$data['voucher'])->update(['active' => 1,'user_id'=>$user->id]);\n\n $this->guard()->login($user);\n\n return response()->json([\n 'redirect'=>'dashboard'\n ]);\n }\n else\n {\n return response()->json([\n 'errors'=>['voucher'=>(array)['Voucher Code doest not exist.']]\n ]);\n }\n }\n }", "public function create()\n {\n return view('dashboard.invoices.create-purchase-inv');\n }", "public function create()\n {\n return view(\"purchases.create\");\n }", "public function commit()\n {\n $this->voucherService->addVoucher($this->voucher);\n \n }", "public function create()\n {\n //\n return view('finance.invoice.create');\n }" ]
[ "0.676546", "0.6760029", "0.67219675", "0.67093444", "0.67074317", "0.667385", "0.6536358", "0.6532747", "0.65234315", "0.64978087", "0.6461423", "0.64549977", "0.6446954", "0.6405477", "0.63837945", "0.636421", "0.6360954", "0.63520646", "0.63516676", "0.6346688", "0.634253", "0.6336493", "0.63310987", "0.6330731", "0.63000584", "0.6298835", "0.6292975", "0.62918824", "0.62765104", "0.6265885" ]
0.6888902
0
Convert the collection to a Symfony RouteCollection instance.
public function toSymfonyRouteCollection() { $symfonyRoutes = new SymfonyRouteCollection; /* This function is used to generate cached route file with Symfony, and the Symfony will also be used while finding route in the cache file. Therefore we have to sort routes here, so that versioning could work well in Symfony. */ /** @var array $routes */ $routes = Version::sortRoutes($this->getRoutes())->all(); foreach ($routes as $route) { if (!$route->isFallback) { $symfonyRoutes = $this->addToSymfonyRoutesCollection($symfonyRoutes, $route); } } foreach ($routes as $route) { if ($route->isFallback) { $symfonyRoutes = $this->addToSymfonyRoutesCollection($symfonyRoutes, $route); } } /* This line is from parent RouteCollection (not from AbstractRouteCollection) */ $this->refreshNameLookups(); return $symfonyRoutes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCollection() : RouteCollectionInterface\n {\n return $this->collection;\n }", "public static function getRouteCollection()\n {\n return static::$_collection;\n }", "public function getRoutes()\n {\n return $this->collection;\n }", "public function routeCollection(): Collection\n {\n collect(explode(',', Arr::get($this->config, 'source', [])))->each(function ($url) {\n if (filter_var($url, FILTER_VALIDATE_URL)) {\n $source = $url . '/routee.json';\n \n if (($fileSource = file_get_contents($source)) !== false) {\n $json = \\json_decode($fileSource, true);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n $this->routeList = $this->routeList->merge($json);\n }\n }\n }\n });\n \n return $this->routeList;\n }", "public function addRoutes(RouteCollectionInterface $collection) : RouterInterface;", "public function getRouteCollection()\n {\n\n // retrieve the registered handlers\n $handlers = $this->handlerManager->getHandler();\n\n // prepare the collection with the available routes and initialize the route counter\n $routes = new RouteCollection();\n $counter = 0;\n\n // iterate over the available handlers and prepare the routes\n foreach ($handlers as $urlPattern => $handler) {\n $pattern = str_replace('/*', \"/{placeholder_$counter}\", $urlPattern);\n $route = new Route($pattern, array(\n $handler\n ), array(\n \"{placeholder_$counter}\" => '.*'\n ));\n $routes->add($counter ++, $route);\n }\n\n // return the collection with the routes\n return $routes;\n }", "public function add( Route $route ): Collection;", "protected function getRouting_Loader_CollectionService()\n {\n $this->services['routing.loader.collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('routing.loader.yaml');\n\n return $instance;\n }", "protected function getRouting_ResourcesLocator_CollectionService()\n {\n $this->services['routing.resources_locator.collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('routing.resources_locator.default');\n\n return $instance;\n }", "public function __construct(RouteCollection $routeCollection){\n\t\t$this->routeCollection = $routeCollection;\n\t}", "public function mapVia(string $routePattern, $handler, $method, string $name = null): CollectionInterface\n {\n }", "public function configureRoutes(RouteCollection $collection) {\n parent::configureRoutes($collection);\n $collection\n ->remove('create')\n ->add('take','{objectId}/take');\n }", "public function __construct(Collection $routes)\n {\n $this->routes = $routes;\n }", "public static function getRoutes()\n {\n $routes = new \\FreeFW\\Router\\RouteCollection();\n $paths = [];\n $paths[] = __DIR__ . '/../resource/routes/restful/routes.php';\n foreach ($paths as $onePath) {\n $apiRoutes = @include($onePath);\n if (is_array($apiRoutes)) {\n foreach ($apiRoutes as $routeId => $apiRoute) {\n $myRoute = new \\FreeFW\\Router\\Route();\n $myRoute\n ->setId($routeId)\n ->setMethod($apiRoute[\\FreeFW\\Router\\Route::ROUTE_METHOD])\n ->setUrl($apiRoute[\\FreeFW\\Router\\Route::ROUTE_URL])\n ->setController($apiRoute[\\FreeFW\\Router\\Route::ROUTE_CONTROLLER])\n ->setFunction($apiRoute[\\FreeFW\\Router\\Route::ROUTE_FUNCTION])\n ;\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_ROLE, $apiRoute)) {\n $myRoute->setRole($apiRoute[\\FreeFW\\Router\\Route::ROUTE_ROLE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_AUTH, $apiRoute)) {\n $myRoute->setAuth($apiRoute[\\FreeFW\\Router\\Route::ROUTE_AUTH]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_INCLUDE, $apiRoute)) {\n $myRoute->setInclude($apiRoute[\\FreeFW\\Router\\Route::ROUTE_INCLUDE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_MODEL, $apiRoute)) {\n $myRoute->setDefaultModel($apiRoute[\\FreeFW\\Router\\Route::ROUTE_MODEL]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COLLECTION, $apiRoute)) {\n $myRoute->setCollection($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COLLECTION]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COMMENT, $apiRoute)) {\n $myRoute->setComment($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COMMENT]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_PARAMETERS, $apiRoute)) {\n $myRoute->setParameters($apiRoute[\\FreeFW\\Router\\Route::ROUTE_PARAMETERS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_RESULTS, $apiRoute)) {\n $myRoute->setResponses($apiRoute[\\FreeFW\\Router\\Route::ROUTE_RESULTS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_SCOPE, $apiRoute)) {\n $myRoute->setScope($apiRoute[\\FreeFW\\Router\\Route::ROUTE_SCOPE]);\n }\n $routes->addRoute($myRoute);\n }\n }\n }\n return $routes;\n }", "public function register_routes( Collection $routes );", "protected function routeMap()\n {\n $this->routCollection = new RouteCollection();\n\n foreach ($this->routers as $rout) {\n $this->routCollection->add(\n $rout['name'],\n new Route(\n $rout['route'],\n ['controller' => $rout['controller']]\n )\n );\n }\n\n return $this;\n }", "public function testAddRouteAsObject()\n {\n $this->collection->add(new Route('name', '/', 'action'));\n $this->collection->compile();\n\n $this->assertCount(1, $this->collection->all());\n }", "protected function configureRoutes(RouteCollectionInterface $collection): void\n {\n parent::configureRoutes($collection);\n $collection\n ->remove('delete')\n ->add('download', $this->getRouterIdParameter().'/download')\n ;\n }", "protected function configureRoutes(RouteCollection $collection)\n {\n $collection->clearExcept(array('list'));\n \n }", "protected function parseRoute($collection, $name, $config, $path)\n {\n $method = $config['method'] ?? 'add';\n $options = $config['options'] ?? [];\n\n if (isset($config['as']) || isset($config['options']['as'])) {\n $name = $config['as'] ?? $config['options']['as'];\n }\n\n if ($collection instanceof RouteFactory) {\n $collection->create($method, $name, $config['controller'], $options);\n }\n\n return $collection;\n }", "public function getRoutes()\n {\n return collect($this->attributes)\n ->map(function (array $attributes) {\n return $this->newRoute($attributes);\n })\n ->merge($this->routes->getRoutes())\n ->values()\n ->all();\n }", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function getRoutes()\n {\n $results = array();\n\n foreach ($this->routes as $route) {\n if ($route->getActionName() != 'Closure') {\n $results[] = $this->getRouteInformation($route);\n }\n }\n\n return Collection::make(array_filter($results));\n }", "public function map(string $routePattern, $handler, string $name = null): CollectionInterface\n {\n }", "public function testGetRouteCollection(): void\n {\n $collection = Router::getRouteCollection();\n $this->assertInstanceOf(RouteCollection::class, $collection);\n $this->assertCount(0, $collection->routes());\n }", "public function urlList(): Collection\n {\n return $this->range()->mapWithKeys(function (int $page) {\n return [$page => $this->url($page)];\n });\n }", "public static function routes()\n {\n if (!static::$initialized) {\n static::_loadRoutes();\n }\n\n return static::$_collection->routes();\n }", "protected function configureRoutes(RouteCollection $collection)\n {\n // ALL route\n // batch\n // create\n // delete\n // export\n // edit\n // list\n // show\n $collection->remove('show');\n// $collection->clearExcept(['create', 'delete','list', 'edit']);\n }", "protected function _prepareCollection()\n {\n /* @var $collection Belvg_Storelocator_Model_Resource_Location_Collection */\n $collection = Mage::getModel('storelocator/location')->getResourceCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function configureRoutes(RouteCollection $collection)\n {\n //$collection->remove('create');\n }" ]
[ "0.7232727", "0.66590035", "0.6614905", "0.65837216", "0.62136716", "0.620019", "0.6115779", "0.60557485", "0.60401225", "0.5887849", "0.57750297", "0.5768578", "0.5749698", "0.5745349", "0.56759274", "0.56293905", "0.55566627", "0.55505633", "0.5484076", "0.5465092", "0.54599935", "0.54586834", "0.5449974", "0.54415935", "0.544142", "0.5424064", "0.5420708", "0.5401302", "0.53731275", "0.53666496" ]
0.7533356
0
Compile the routes for caching.
public function compile() { $compiled = $this->dumper()->getCompiledRoutes(); /* This line is added in order to compile `conditions` into cache file. */ $compiled[4] = $this->dumper()->getCompiledRoutes(true)[4]; $attributes = []; foreach ($this->getRoutes() as $route) { $attributes[$route->getName()] = [ 'methods' => $route->methods(), 'uri' => $route->uri(), 'action' => $route->getAction(), 'fallback' => $route->isFallback, 'defaults' => $route->defaults, 'wheres' => $route->wheres, 'bindingFields' => $route->bindingFields(), 'lockSeconds' => $route->locksFor(), 'waitSeconds' => $route->waitsFor(), 'withTrashed' => $route->allowsTrashedBindings(), ]; } return compact('compiled', 'attributes'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "public function cacheFile()\n\t{\n\t\t$data[] = \"<?php\";\n\t\t$data[] = \"defined('LUNA_SYSTEM') or die('Hacking attempt!');\\n\";\n\n\t\t$routes = Route::orderBy('type')->orderBy('controller')->get()->toArray();\n\n\t\tif (!empty($routes)) {\n\t\t\tforeach ($routes as $route) {\n\t\t\t\t$call_back = isset($route['action']) ? $route['controller'] . \":\" . $route['action'] : $route['controller'];\n\t\t\t\tif (!isset($route['method'])) {\n\t\t\t\t\t$data[] = '$app->get(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t} else {\n\t\t\t\t\t$methods = explode(',', preg_replace('/\\s+/', '', $route['method']));\n\t\t\t\t\tforeach ($methods as $method) {\n\t\t\t\t\t\t$data[] = '$app->' . strtolower($method) . '(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$output = implode(\"\\n\", $data);\n\n\t\twrite_file(LUNA_CACHEPATH . \"/data/routes.php\", $output);\n\t}", "public static function compiledRoutes()\n {\n return self::$compiled_routes;\n }", "protected function routes()\n {\n if($this->app->routesAreCached()){\n return;\n }\n\n Route::middleware(['web' , 'can:Zoroaster-cache-card' , 'can:Zoroaster'])\n ->prefix('ZoroasterCacheCard')\n ->group(__DIR__ . '/../routes/web.php');\n }", "public function generateRoutes()\n {\n $routes = property_exists(app(), 'router')? app()->router->getRoutes() : app()->getRoutes();\n foreach ($routes as $route) {\n array_push($this->routes, [\n 'method' => $route['method'],\n 'uri' => $route['uri'],\n 'name' => $this->getRouteName($route),\n 'action' => $this->getRouteAction($route),\n 'middleware' => $this->getRouteMiddleware($route),\n 'map' => $this->getRouteMapTo($route)\n ]);\n }\n }", "public function rebuild()\n {\n // Don't bother if there's no cache file in config\n if (empty($this->cacheFile)) {\n throw new \\Exception(\n 'Cannot rebuild route cache because no file is provided in config.'\n );\n }\n // Get all published routes\n $routes = $this->pageModel->getPublishedRoutes();\n\n // Smash them into a pipe-separated string\n $pipedRoutes = implode('|', $routes);\n\n // Write to the cache file\n file_put_contents($this->cacheFile, $pipedRoutes);\n }", "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function compile() {\n\t\t\n\t\t$path = $this -> _front ->getApp() ->getConfig() ->controller ->module ->path;\n\t\t$path .= $this -> _front ->getApp() ->getConfig() ->subdomain ? $this -> _front ->getApp() ->getConfig() ->subdomain . DIRECTORY_SEPARATOR : '';\n\t\t$path .= \\FMW\\Utilities\\File\\Util::rslash( $this -> _front ->getRouter() ->getModule() ) . 'cache';\n\t\t\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'js'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$js = '';\n\t\t\t\n\t\t\tforeach ($this->_javascriptCache as $value) {\n\t\t\t\t$js .= file_get_contents( $value );\n\t\t\t}\n\t\t\t\n\t\t\t$js = \\FMW\\Utilities\\Minify\\JSMin::minify($js);\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $js, $this->_cachetime );\n\t\t\t\n\t\t}\n\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'css'\n\t\t\t)\n\t\t);\n\t\t\n\t\tunset($js);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$css = \\FMW\\Utilities\\Minify\\CSSMin::minify( $this->_cssCache, $this->_front->getApp()->getConfig() );\n\t\t\t\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $css, $this->_cachetime );\n\t\t\t\t\n\t\t}\n\t\t\n\t\tunset($css);\n\t}", "public function build_route_map($routes) {}", "protected function loadCachedRoutes()\n {\n $this->app->booted(function()\n {\n require $this->app->getCachedRoutesPath();\n });\n }", "function preflightCache() {\n\t\t$moduleDir = (isset($this->bean->module_dir) && !empty($this->bean->module_dir)) ? $this->bean->module_dir : \"General\";\n\t\t$this->rulesCache = sugar_cached(\"routing/{$moduleDir}\");\n\n\t\tif(!file_exists($this->rulesCache)) {\n\t\t\tmkdir_recursive($this->rulesCache);\n\t\t}\n\t}", "protected function cacheRoutesPerLocale()\n {\n // Store the default routes cache,\n // this way the Application will detect that routes are cached.\n $allLocales = $this->getSupportedLocales();\n\n array_push($allLocales, null);\n\n foreach ($allLocales as $locale) {\n\n $routes = $this->getFreshApplicationRoutesForLocale($locale);\n\n if (count($routes) == 0) {\n $this->error(\"Your application doesn't have any routes.\");\n return;\n }\n\n foreach ($routes as $route) {\n $route->prepareForSerialization();\n }\n\n $this->files->put(\n $this->makeLocaleRoutesPath($locale), $this->buildRouteCacheFile($routes)\n );\n }\n }", "protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\n }", "private function buildRoutes($route) {\n\t\t$slash_toggle = false;\n\t\n\t\tif($route->getName() == \"route\") {\n\t\t\t\n\t\t\t//Route validation\n\t\t\tif(empty($route['id']))\n\t\t\t\treturn $this->failRoute(\"The ID attribute is missing\",$route);\n\t\t\n\t\t\tif(empty($route['pattern']) && empty($this->current_pattern))\n\t\t\t\treturn $this->failRoute(\"The PATTERN attribute is missing\",$route);\n\t\t\t\n\t\t\tif(empty($route['controller']) && empty($this->parent_class))\n\t\t\t\treturn $this->failRoute(\"The CONTROLLER attribute is missing\",$route);\n\t\t\t\t\n\t\t\tif(empty($route['method']) && empty($this->parent_method))\n\t\t\t\treturn $this->failRoute(\"The METHOD attribute is missing\",$route);\n\t\t\t\t\t\t\n\t\t\tif(!empty($route['pattern'])){\n\t\t\t\t\n\t\t\t\tif(preg_match('{^/.+}', $route['pattern']))\n\t\t\t\t\treturn $this->failRoute(\"The PATTERN attribute must not start with a / \", $route);\n\n\t\t\t\tif(!preg_match(\"%/$%\",$route['pattern'])) {\n\t\t\t\t\t$slash_toggle = true;\n\t\t\t\t\t$route['pattern'] = $route['pattern'] . '/';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->current_pattern[] = (string) $route['pattern'];\n\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tif(isset($route['method']))\n\t\t\t\t$this->parent_method = (string) $route['method'];\n\t\t\t\t\n\t\t\tif(isset($route['controller']))\n\t\t\t\t$this->parent_class = (string) $route['controller'];\n\t\n\t\t\t//Compile a route if validation passed\n\t\t\t$this->compiled_routes[(string)$route['id']] = array( \"pattern\" => implode(null,$this->current_pattern),\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t \"controller\" => $this->parent_class,\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t \"method\" => $this->parent_method,\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t \"matches\" => $this->matches,\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t \"regex\" => implode(null,$this->current_pattern));\n\t\t\t\n\t\t\t//Now remove the slash again if needs be\t\t\t\t\t\t\t\t \t\t\t \t\t \n\t\t\tif($slash_toggle == true) {\n\t\t\t\t$this->compiled_routes[(string)$route['id']]['pattern'] = rtrim($this->compiled_routes[(string)$route['id']]['pattern'],'/');\n\t\t\t}\n\t\t\t\n\t\t\t//Tag section - works out tags from the pattern to determine how many matches there should be\n\t\t\t$current_tags = $this->tags;\n\t\t\t$tag_count = count($current_tags);\n\t\t\t$temp_tags = array();\n\t\t\tpreg_match_all('%\\{{1}([^{}]+)\\}{1}%', (string) $route['pattern'], $tags);\n\t\t\tif(isset($tags[1])) {\n\t\t\t\tforeach($tags[1] as $key => &$value) {\n\t\t\t\t\t$temp_tags[$key+$tag_count] = $value;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$this->tags = array_merge($this->tags,array_flip($temp_tags));\n\t\t\t}\n\t\t\t\n\t\t\t//Recurse through the matches\n\t\t\tforeach($route->match as $match) {\n\t\t\t\tif($match->getName() == \"match\") {\n\t\t\t\t\tif(empty($match['name'])) {\n\t\t\t\t\t\t$this->failMatch(\"The NAME attribute must be set\",$match);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(empty($match[0])) {\n\t\t\t\t\t\t$this->failMatch(\"The TEXT value must be set\",$match);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(@preg_match(\"%\".$match[0].\"%\", \"\") === false) {\n\t\t\t\t\t\t$this->failMatch(\"The REGEX is invalid\",$match);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t//If the tag exists add it in to the matches\n\t\t\t\t\tif(isset($this->tags[(string)$match['name']])) {\n\t\t\t\t\t\t$position = $this->tags[(string) $match['name']];\n\t\t\t\t\t\t$this->compiled_routes[(string)$route['id']]['matches'][$position] = \n\t\t\t\t\t\t$this->matches[$position] = array( \"tag\" => (string)$match['name'], \"regex\" => (string)$match[0]);\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Re-order the keys to fill in any blanks in the matches so that they start at 0\n\t\t\t$this->compiled_routes[(string)$route['id']]['matches'] = array_values($this->compiled_routes[(string)$route['id']]['matches']);\n\t\t\t$this->matches = array_values($this->matches);\n\t\t\t\n\t\t\t\n\t\t\t//Save current patterns/matches here so after child recursion it has a copy before it was modified by the child\n\t\t\t$current_pattern = $this->current_pattern;\n\t\t\t$current_match = $this->matches;\t\t\t\n\t\t\t$this->compiled_routes[(string)$route['id']]['regex'] = $this->createRegularExpression($this->compiled_routes[(string)$route['id']]['pattern'],$this->matches);\n\t\n\t\t\t//Recurse children\n\t\t\tforeach($route->route as $childRoute) {\n\t\t\t\t\n\t\t\t\tif($childRoute->getName() == \"route\") {\n\t\t\t\t\t$this->buildRoutes($childRoute);\n\t\t\t\t}\n\n\t\t\t\t//Reset tags/patterns/matches back to saved values so that inheritance doesnt break peers on the same level\n\t\t\t\t$this->tags = $current_tags;\n\t\t\t\t$this->matches = $current_match; \n\t\t\t\t$this->current_pattern = $current_pattern;\n\t\t\t\t\t\n\t\t\t\tif(!empty($route['method']))\n\t\t\t\t\t$this->parent_method = (string) $route['method'];\n\t\t\t\n\t\t\t\tif(!empty($route['controller']))\n\t\t\t\t\t$this->parent_class = (string) $route['controller'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\n\t}", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "protected function loadRoutes()\n {\n if (!$this->app->routesAreCached()) {\n $this->routes($this->app->make(Router::class));\n }\n }", "protected function buildRoutes()\n {\n $routes = array();\n \n foreach (glob($this->dir.'*.xml') as $file) {\n $xml = simplexml_load_file($file);\n \n $attr = $xml -> attributes();\n $actionsNS = isset($attr['namespace']) ? $attr['namespace'].'\\\\' : '';\n $module = isset($attr['module']) ? $attr['module'].'/' : '';\n \n foreach ($xml->children() as $tag) {\n $id = (string) $tag['id'];\n $method = (string) $tag['method'];\n $pattern = (string) $tag -> url;\n $action = (string) $tag -> action;\n \n $params = [];\n \n if (isset($tag -> params)) {\n foreach ($tag -> params -> children() as $param) {\n $arr = (array) $param -> attributes();\n $arr = $arr['@attributes'];\n \n if (isset($arr['required'])) {\n $arr['required'] = $arr['required'] == 'true' ? true : false;\n }\n \n $params[$arr['name']] = $arr;\n }\n }\n \n if (isset($routes[$module.$id])) {\n throw new \\RuntimeException('Duplicated Route ID: '.$module.$id.' in '.$file.'!');\n }\n \n $routes[$module.$id] = new PatternRoute(\n $this->getActionClass($action, $actionsNS, $id),\n strtoupper($method),\n $pattern,\n $params\n );\n }\n }\n \n return $routes;\n }", "private static function createModuleRoute()\n {\n self::$Router->map('GET|POST', '/[a:version]/[**:path]', function(string $version, string $path){\n $version = strtolower($version);\n $path = strtolower($path);\n\n if(isset(self::$PathRoutes[$version][$path]))\n {\n /** @var VersionConfiguration $VersionConfiguration */\n $VersionConfiguration = self::$MainConfiguration->VersionConfigurations[$version];\n\n /** @var ModuleConfiguration $ModuleConfiguration */\n $ModuleConfiguration = $VersionConfiguration->Modules[self::$PathRoutes[$version][$path]];\n\n if($VersionConfiguration->Available == false)\n {\n ResourceNotAvailable::executeResponse($VersionConfiguration->UnavailableMessage);\n exit();\n }\n\n if($ModuleConfiguration->Available == false)\n {\n ResourceNotAvailable::executeResponse($ModuleConfiguration->UnavailableMessage);\n exit();\n }\n\n self::verifyRequest();\n\n $AccessRecord = new AccessRecord();\n $AccessRecord->ID = 0;\n $AccessRecord->ApplicationID = 0;\n\n if($ModuleConfiguration->AuthenticationRequired)\n {\n $AccessRecord = self::authenticateUser();\n }\n\n /** @var Module $ModuleObject */\n $ModuleObject = self::getModuleObject($version, $ModuleConfiguration);\n $ModuleObject->access_record = $AccessRecord;\n\n // Process the request\n self::startTimer();\n\n $ModuleException = null;\n\n try\n {\n $ModuleObject->processRequest();\n\n header('Content-Type: ' . $ModuleObject->getContentType());\n header('Content-Size: ' . $ModuleObject->getContentLength());\n http_response_code($ModuleObject->getResponseCode());\n\n // Create the response\n if($ModuleObject->isFile())\n {\n header(\"Content-disposition: attachment; filename=\\\"\" . basename($ModuleObject->getFileName()) . \"\\\"\");\n }\n }\n catch(Exception $exception)\n {\n $ModuleException = $exception;\n //InternalServerError::executeResponse($exception);\n //exit();\n }\n\n $ExecutionTime = self::stopTimer();\n self::logRequest($AccessRecord, $version, $ModuleObject, $ExecutionTime);\n self::setHeaders();;\n\n // Update the last used state\n $AccessRecord->LastActivity = (int)time();\n $IntellivoidAPI = self::getIntellivoidAPI();\n $IntellivoidAPI->getAccessKeyManager()->updateAccessRecord($AccessRecord);\n\n if($ModuleException == null)\n {\n print($ModuleObject->getBodyContent());\n }\n else\n {\n $RequestRecordObject = $IntellivoidAPI->getRequestRecordManager()->getRequestRecord(\n RequestRecordSearchMethod::byReferenceId, self::$ReferenceCode\n );\n\n $IntellivoidAPI->getExceptionRecordManager()->recordException(\n $RequestRecordObject->ID, $AccessRecord, $ModuleException\n );\n\n InternalServerError::executeResponse($ModuleException);\n }\n\n exit();\n }\n else\n {\n ResourceNotFound::executeResponse();\n exit();\n }\n\n });\n }", "public static function getRoutes()\n {\n $routes = new \\FreeFW\\Router\\RouteCollection();\n $paths = [];\n $paths[] = __DIR__ . '/../resource/routes/restful/routes.php';\n foreach ($paths as $onePath) {\n $apiRoutes = @include($onePath);\n if (is_array($apiRoutes)) {\n foreach ($apiRoutes as $routeId => $apiRoute) {\n $myRoute = new \\FreeFW\\Router\\Route();\n $myRoute\n ->setId($routeId)\n ->setMethod($apiRoute[\\FreeFW\\Router\\Route::ROUTE_METHOD])\n ->setUrl($apiRoute[\\FreeFW\\Router\\Route::ROUTE_URL])\n ->setController($apiRoute[\\FreeFW\\Router\\Route::ROUTE_CONTROLLER])\n ->setFunction($apiRoute[\\FreeFW\\Router\\Route::ROUTE_FUNCTION])\n ;\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_ROLE, $apiRoute)) {\n $myRoute->setRole($apiRoute[\\FreeFW\\Router\\Route::ROUTE_ROLE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_AUTH, $apiRoute)) {\n $myRoute->setAuth($apiRoute[\\FreeFW\\Router\\Route::ROUTE_AUTH]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_INCLUDE, $apiRoute)) {\n $myRoute->setInclude($apiRoute[\\FreeFW\\Router\\Route::ROUTE_INCLUDE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_MODEL, $apiRoute)) {\n $myRoute->setDefaultModel($apiRoute[\\FreeFW\\Router\\Route::ROUTE_MODEL]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COLLECTION, $apiRoute)) {\n $myRoute->setCollection($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COLLECTION]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COMMENT, $apiRoute)) {\n $myRoute->setComment($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COMMENT]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_PARAMETERS, $apiRoute)) {\n $myRoute->setParameters($apiRoute[\\FreeFW\\Router\\Route::ROUTE_PARAMETERS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_RESULTS, $apiRoute)) {\n $myRoute->setResponses($apiRoute[\\FreeFW\\Router\\Route::ROUTE_RESULTS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_SCOPE, $apiRoute)) {\n $myRoute->setScope($apiRoute[\\FreeFW\\Router\\Route::ROUTE_SCOPE]);\n }\n $routes->addRoute($myRoute);\n }\n }\n }\n return $routes;\n }", "function _generate_auto_routes()\n {\n $module_routes = array();\n $module_routes[0] = array();\n $module_routes[1] = array();\n $module_routes[2] = array();\n $module_routes[3] = array();\n\n $dir = APPPATH . 'controllers' . '/';\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle)))\n {\n if(is_file($dir . $file) && substr($file, -4) == '.php'){\n $file = str_replace('.php', '', $file);\n $file = strtolower($file);\n $module_routes[0][$file . '(/.*)?'] = $file . '/index$1';\n } elseif(is_dir($dir2 = $dir . $file . DS) && !preg_match('/[^a-z0-9\\/\\\\\\_\\-]/i', $dir2)) {\n if ($handle2 = opendir($dir2)) {\n while (false !== ($file2 = readdir($handle2))) {\n if(!preg_match('/[^a-z0-9]/i', $file2)){\n $module_routes[3][$file2 . '(/.*)?'] = strtolower($file) . '/' . strtolower($file2) . '/' . strtolower($file2) . '/index$1';\n }\n if(is_file($dir2 . $file2) && substr($file2, -4) == '.php'){\n $file2 = str_replace('.php', '', $file2);\n $file = strtolower($file);\n $file2 = strtolower($file2);\n $module_routes[1][$file . '/' . $file2 . '(/.*)?'] = $file . '/' . $file2 . '/index$1';\n } elseif(is_dir($dir3 = $dir2 . $file2 . DS) && !preg_match('/[^a-z0-9\\/\\\\\\_\\-]/i', $dir3)) {\n if ($handle3 = opendir($dir3)) {\n while (false !== ($file3 = readdir($handle3))) {\n if(is_file($dir3 . $file3) && substr($file3, -4) == '.php'){\n $file3 = str_replace('.php', '', $file3);\n $key = '';\n $val = $file . '/';\n if ($this->routes['front_controllers_folder'] != $file) {\n $key .= $file . '/';\n //$val = '';\n }\n\n if ($file2 == $file3) {\n $key .= $file3;\n }\n else\n {\n $key .= $file2 . '/' . $file3;\n }\n\n $val .= $file2 . '/' . $file3;\n\n $key = strtolower($key);\n $val = strtolower($val);\n\n $module_routes[2][$key . '(/.*)?'] = $val . '/index$1';\n }\n }\n closedir($handle3);\n }\n }\n }\n closedir($handle2);\n }\n }\n }\n }\n closedir($handle);\n\n $module_routes = array_merge($module_routes[3], $module_routes[2], $module_routes[1], $module_routes[0], $this->routes);\n krsort($module_routes);\n\n return $module_routes;\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "public function getListRoutes()\r\n {\r\n $result = array();\r\n \r\n if (count( $this->routes ))\r\n {\r\n foreach ( $this->routes as $act )\r\n {\r\n \r\n $route_str = '';\r\n if (isset( $this->default_params['url_prefix'] ) && ! empty( $this->default_params['url_prefix'] ))\r\n {\r\n $route_str = $this->default_params['url_prefix'];\r\n }\r\n \r\n if (is_array( $act['type'] ))\r\n {\r\n $route_str = implode( '|', $act['type'] ) . ' ' . $route_str;\r\n }\r\n else\r\n {\r\n $route_str = $act['type'] . ' ' . $route_str;\r\n }\r\n $route_str .= $act['route'];\r\n \r\n if (isset( $act['params']['ajax'] ) && (bool) ($act['params']['ajax']))\r\n {\r\n $route_str .= ' [ajax]';\r\n }\r\n \r\n $action_str = '';\r\n if (isset( $act['params']['namespace'] ) && ! empty( $act['params']['namespace'] ))\r\n {\r\n $action_str = (string) $act['params']['namespace'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['namespace'] ) && ! empty( $this->default_params['namespace'] ))\r\n {\r\n $action_str = $this->default_params['namespace'];\r\n }\r\n }\r\n $action_str .= '\\\\';\r\n \r\n if (isset( $act['params']['controller'] ))\r\n {\r\n $action_str .= (string) $act['params']['controller'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['controller'] ) && ! empty( $this->default_params['controller'] ))\r\n {\r\n $action_str .= $this->default_params['controller'];\r\n }\r\n }\r\n $action_str .= '->' . (string) $act['params']['action'];\r\n \r\n $kbps = $this->default_params['kbps'];\r\n if( isset( $act['params']['kbps'] ) ){\r\n \t$kbps = $act['params']['kbps'];\r\n }\r\n $ttl = $this->default_params['ttl'];\r\n if( isset( $act['params']['ttl'] ) ){\r\n \t$ttl = $act['params']['ttl'];\r\n }\r\n \r\n $route = new \\stdclass();\r\n $route->pattern = $route_str;\r\n $route->handler = $action_str;\r\n $route->ttl = $ttl;\r\n $route->kbps = $kbps;\r\n $result[] = $route;\r\n }\r\n }\r\n \r\n return $result;\r\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "private function buildCache(): array\n {\n $dispatchData = $this->routeCollector->getData();\n\n file_put_contents($this->cacheFile, '<?php return ' . var_export($dispatchData, true) . ';');\n\n return $dispatchData;\n }", "public function testCompile()\n {\n $this->collection->get('first', '/first', 'action');\n $this->collection->get('second', '/second', function() {});\n\n $this->collection->compile();\n\n $routes = $this->collection->all();\n\n $this->assertCount(2, $routes);\n\n $this->assertArrayHasKey('0', $routes);\n $this->assertArrayHasKey('1', $routes);\n\n $this->assertEquals('first', $routes[0]['name']);\n $this->assertEquals('/^\\/first$/', $routes[0]['route']);\n\n $this->assertEquals('second', $routes[1]['name']);\n $this->assertEquals('/^\\/second$/', $routes[1]['route']);\n }", "public static function routes(): void\n {\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public function cache()\n {\n\n $route = Route::requireRoueFiiles();\n if (file_put_contents($this->cacheFile, serialize($route))) {\n echo 'OK';\n } else {\n echo 'ERROR';\n }\n }" ]
[ "0.6758545", "0.6429916", "0.6393608", "0.639167", "0.63069946", "0.6262555", "0.6199453", "0.6194339", "0.61885655", "0.6153062", "0.6108085", "0.6040378", "0.5989562", "0.59721226", "0.59509224", "0.5858197", "0.5857092", "0.5855775", "0.5844396", "0.5814372", "0.5811414", "0.57990533", "0.57867545", "0.57781506", "0.5770573", "0.5762764", "0.57624066", "0.5754734", "0.57533234", "0.5750883" ]
0.7321813
0
Find a AdminHelp record by UniqueIdentifier
public static function by_uid($uid) { return AdminHelp::get()->filter('UniqueIdentifier', $uid)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($identifier);", "function find_admin_by_id($admin_id) {\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$safe_admin_id = mysqli_real_escape_string($db, $admin_id);\r\n\t\t$query = \"SELECT * FROM admins \";\r\n\t\t$query .= \"WHERE id = {$safe_admin_id} \";\r\n\t\t$query .= \"LIMIT 1\";\r\n\t\t\r\n\t\t$id_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($id_set);\r\n\t\t\r\n\t\tif($id = mysqli_fetch_assoc($id_set)) {\r\n\t\t\treturn $id;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "function findOneMatchUid($uid);", "function findkey()\n\t{\n\t\t// Initialize variables\n\t\t$db = & JFactory::getDBO();\n\t\t$keyref = JRequest::getVar( 'keyref', null, 'default', 'cmd' );\n\t\tJRequest::setVar( 'keyref', $keyref );\n\n\t\t// If no keyref left, throw 404\n\t\tif ( empty( $keyref ) === true )\n\t\t{\n\t\t\tJError::raiseError( 404, JText::_( \"Key Not Found\" ) );\n\t\t}\n\n\t\t$keyref = $db->Quote( '%keyref=' . $db->getEscaped( $keyref, true ) . '%', false );\n\t\t$query = 'SELECT id' .\n\t\t\t\t\t\t' FROM #__content' .\n\t\t\t\t\t\t' WHERE attribs LIKE ' . $keyref;\n\t\t$db->setQuery( $query );\n\t\t$id = (int) $db->loadResult();\n\n\t\tif ( $id > 0 )\n\t\t{\n\t\t\t// Create the view\n\t\t\t$view = & $this->getView( 'article', 'html' );\n\n\t\t\t// Get/Create the model\n\t\t\t$model = & $this->getModel( 'Article' );\n\n\t\t\t// Set the id of the article to display\n\t\t\t$model->setId( $id );\n\n\t\t\t// Push the model into the view (as default)\n\t\t\t$view->setModel( $model, true );\n\n\t\t\t// Display the view\n\t\t\t$view->display();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJError::raiseError( 404, JText::_( 'Key Not Found' ) );\n\t\t}\n\n\t}", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "function get_help_ticket_by_id(PDO $pdo, $help_ticket_id)\n{\n $stmt = $pdo->prepare(GET_HELP_TICKET_QUERY . \"\n WHERE help_ticket_id = :help_ticket_id\n \");\n\n $stmt->bindParam(\":help_ticket_id\", $help_ticket_id);\n\n $stmt->execute();\n\n return $stmt->fetchObject(\"HelpTicket\");\n}", "public function findById() {\n // TODO: Implement findById() method.\n }", "function findbyid(){\r\n $conn=$this->connect();\r\n $id = $conn -> real_escape_string($this->id);\r\n $sql=\"SELECT * FROM quanly WHERE id = '$id'\";\r\n $result=$conn -> query($sql);\r\n $conn->close();\r\n return $result;\r\n }", "public function getOGAdminID();", "function get_laser_admin($conn, $laser_report_id) {\n\t$query_admin = \"SELECT * FROM laser_admin WHERE laser_report_id = \" . $laser_report_id;\n\t$admin = exec_query($conn, $query_admin);\n\tif (count($admin) > 0) {\n\t\treturn $admin[0];\n\t} else {\n\t\treturn NULL;\n\t}\n}", "public function returnDetailFindByPK($id);", "function find($uid, $showHidden=false) {\n\t\t$table = 'tx_wecassessment_result';\n\t\t$row = tx_wecassessment_result::getRow($table, $uid, '', $showHidden);\n\n\t\t$result = tx_wecassessment_result::newFromArray($row);\n\t\treturn $result;\t\t\n\t}", "function find_admin_by_username($admin_username) {\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$safe_admin_username = mysqli_real_escape_string($db, $admin_username);\r\n\t\t$query = \"SELECT * FROM admins \";\r\n\t\t$query .= \"WHERE username = '{$safe_admin_username}' \";\r\n\t\t$query .= \"LIMIT 1\";\r\n\t\t\r\n\t\t$admin_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($admin_set);\r\n\t\t\r\n\t\tif($admin = mysqli_fetch_assoc($admin_set)) {\r\n\t\t\treturn $admin;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}", "public function adminInfo($id){\n $info = DB::table('admins')->where('uid', $id)->first();\n return $info;\n }", "public function findByIdentifier($identifier);", "public function findByIdentifier($identifier);", "function find_admin_by_username($username) {\n\tglobal $connection;\n\t\n\t$safe_username = mysqli_real_escape_string($connection, $username);\n\t\n\t$query = \"SELECT * \";\n\t$query .= \"FROM admins \";\n\t$query .= \"WHERE username = '{$safe_username}' \";\n\t$query .= \"LIMIT 1\";\n\t$admin_set = mysqli_query($connection, $query);\n\tconfirm_query($admin_set);\n\tif($admin = mysqli_fetch_assoc($admin_set)) {\n\t\treturn $admin;\n\t} else {\n\t\treturn null;\n\t}\n}", "public abstract function find($primary_key, $model);", "function searchtool($weSearchID = 0)\n\t{\n\t\t\n\t\tparent::weToolModel(SUCHE_TABLE);\n\n\t\tif ($weSearchID) {\n\t\t\t$this->ID = $weSearchID;\n\t\t\t$this->load($weSearchID);\n\t\t}\n\t\n\t}", "function getByGuid($id);", "public function getRecord()\n {\n return $this->options['peoplefinder']->getByNUID($this->nu_id);\n }", "function findById($id);", "function find($id);", "public function findId($mobile);", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "function get_ScreenName($find)\n{\n \n $pdo = Database::connect();\n $sql= \"SELECT * FROM userimagedetails\"; \n\n global $nameArray;\n\t\tforeach($pdo->query($sql) as $row)\n\t\t{\n\t\t\n\t\t $nameArray= array( $row['userName']=>$row['shortID']);\n\t\t\n\t\t}\n\t\t\n\t\tDatabase::disconnect();\n //get a return\n foreach($nameArray as $name =>$userID)\n {\n if($name==$find)\n\t {\n\t return $userID;\n\t\t break;\n\t \n\t }\n }\n}", "protected function queryInfoById() {\n\t\tglobal $query, $lang, $wtcDB;\n\t\t\n\t\t$getWord = new Query($query['lang_words']['get'], Array(1 => $this->wordid));\n\t\n\t\t$this->info = parent::queryInfoById($getWord);\n\t}", "function getById($id, Suggestor $suggestor, DataHolder $dataHolder = NULL);", "function lookupAdmin($judge_id){\n\t$data = M('user');\n\tif((int)$judge_id>=1){\n\t\t$condition['id'] = (int)$judge_id;\n\t\t$judge = $data->where($condition)->find();\n\t\treturn $judge['role_admin'];\n\t}\n\telse return false;\n}" ]
[ "0.5586526", "0.54899204", "0.54245967", "0.54220253", "0.5340959", "0.533758", "0.5297304", "0.5269039", "0.526725", "0.52670485", "0.52603376", "0.5242388", "0.51874536", "0.518344", "0.51804143", "0.5139269", "0.5139269", "0.5138735", "0.51184136", "0.5083079", "0.5073117", "0.50516826", "0.5043156", "0.50398785", "0.5031497", "0.5029582", "0.501884", "0.5009549", "0.49789086", "0.4973834" ]
0.73810214
0
Returns a link to view this AdminHelp item in the CMS
public function Link() { return Controller::join_links('admin/admin-help/show/help', $this->ID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOverviewUrl()\n {\n return Mage::helper(\"adminhtml\")->getUrl('adminhtml/mzeis_documentation_module/view', array('module' => $this->getName()));\n }", "public function viewLink()\n {\n return app('html')->link(\n 'admin/partials/view/' . $this->object->getId(),\n $this->object->getTitle(),\n ['target' => '_blank']\n );\n }", "public function getSearchAdminLinkForObject() {\n return getLinkAdminHref(\"pages\", \"list\", \"&systemid=\".$this->getSystemid());\n }", "public function getHelpUrl()\n {\n return $this->helpPage;\n }", "function helpLink() {\n\t\t// By default it's an (external) URL, hence not a valid Title.\n\t\t// But because MediaWiki is by nature very customizable, someone\n\t\t// might've changed it to point to a local page. Tricky!\n\t\t// @see https://phabricator.wikimedia.org/T155319\n\t\t$helpPage = $this->msg( 'helppage' )->inContentLanguage()->plain();\n\t\tif ( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $helpPage ) ) {\n\t\t\t$helpLink = Linker::makeExternalLink(\n\t\t\t\t$helpPage,\n\t\t\t\t$this->msg( 'help' )->plain()\n\t\t\t);\n\t\t} else {\n\t\t\t$helpLink = MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(\n\t\t\t\tTitle::newFromText( $helpPage ),\n\t\t\t\t$this->msg( 'help' )->text()\n\t\t\t);\n\t\t}\n\t\treturn $helpLink;\n\t\t// This doesn't work with the default value of 'helppage' which points to an external URL\n\t\t// return $this->footerLink( 'help', 'helppage' );\n\t}", "public function viewLink()\n {\n return \\Html::link($this->entity->path(), $this->entity->getTitle(), ['target' => '_blank']);\n }", "public function CMSEditLink() {\n\t\t$class = Session::get(\"ListedPageAdmin.currentAdminClass\");\n\t\tif ($class) {\n\t\t\treturn singleton($class)->LinkPageEdit($this->ID);\n\t\t}\n\t\treturn null;\n\t}", "public function getViewLink() {\n return getConfig(\"public_url\").\"?\".$this->shareID;\n }", "public function get_help_page()\n\t{\n\t\t$this->load_misc_methods();\n\t\treturn cms_module_GetHelpPage($this);\n\t}", "public function viewLink()\n {\n return $this->html->link($this->object->path(), $this->object->getTitle(), ['target' => '_blank']);\n }", "public function Link() {\n $Action = 'show/' . $this->ID . '/' . $this->CategoryID;\n return $Action; \n }", "function ShowLink()\n {\n $CompaniesPage = CompanyListPage::get()->first();\n if ($this->Description) {\n return $CompaniesPage->Link() . \"profile/\" . $this->URLSegment;\n } else {\n return $this->URL;\n }\n }", "protected function displayHelp()\n {\n return $this->context->smarty->fetch($this->module->getLocalPath().'views/templates/admin/rewards_info.tpl');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "public function getEditLink()\n {\n return $this->get('EditLink');\n }", "protected function getInfoLink()\n {\n return Injector::inst()->create(\n GridFieldHtmlFragment::class,\n 'buttons-before-right',\n DBField::create_field('HTMLFragment', ArrayData::create([\n 'Link' => 'https://userhelp.silverstripe.org/en/4/optional_features/modules_report',\n 'Label' => _t(__CLASS__ . '.MORE_INFORMATION', 'More information'),\n ])->renderWith(__CLASS__ . '/MoreInformationLink'))\n );\n }", "public function getDetailViewUrl()\n\t{\n\t\treturn 'index.php?module=TreesManager&parent=Settings&view=Edit&record=' . $this->getId();\n\t}", "public function edit_link() {\n\t\tif ( $this->can_edit() ) {\n\t\t\treturn get_edit_post_link($this->ID);\n\t\t}\n\t}", "public function link() { return site_url().'/'.$this->post->post_name; }", "public function getEditMetaDataLink()\n {\n return $this->get('EditMetaDataLink');\n }", "public function addMainMenuLink()\n {\n return '<a href=\"/Plugins/Products/Actions/Products.php\">Products</a> ';\n }", "function show_contact_admin() {\r\n\tglobal $adminroot;\r\n\techo '<a href=\"'.$adminroot.'help_request.php\" title=\"Send Support Request\">contact CMS Support</a>';\r\n}", "function getLink () {\n\t\t$baseLink = 'index.php';\n\t\tif ($this->getAction ()) {\n\t\t\treturn $baseLink .= '?action='.$this->getAction ();\n\t\t}\n\t\telseif ($this->isAdminPage ()) {\n\t\t\treturn $baseLink .= '?action=admin&pageID='.$this->getID ();\n\t\t} else {\n\t\t\treturn $baseLink .= '?action=viewPage&pageID='.$this->getID ();\n\t\t}\n\t}", "public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }", "function bf_admin_help_links() {\r\n\t$content = '<strong><a href=\"http://code.google.com/p/arras-buffet/\">' . __('Project Page', 'buffet') . '</a></strong> | ';\r\n\t$content .= '<strong><a href=\"http://www.zy.sg/\">' . __(\"Developer's Blog\", 'buffet') . '</a></strong>';\r\n\t\r\n\techo apply_filters('bf_admin_help_links', $content);\r\n}", "function ShowAdminHelp()\r\n{\r\n\tglobal $txt, $helptxt, $context, $scripturl;\r\n\r\n\tif (!isset($_GET['help']) || !is_string($_GET['help']))\r\n\t\tfatal_lang_error('no_access', false);\r\n\r\n\tif (!isset($helptxt))\r\n\t\t$helptxt = array();\r\n\r\n\t// Load the admin help language file and template.\r\n\tloadLanguage('Help');\r\n\r\n\t// Permission specific help?\r\n\tif (isset($_GET['help']) && substr($_GET['help'], 0, 14) == 'permissionhelp')\r\n\t\tloadLanguage('ManagePermissions');\r\n\r\n\tloadTemplate('Help');\r\n\r\n\t// Set the page title to something relevant.\r\n\t$context['page_title'] = $context['forum_name'] . ' - ' . $txt['help'];\r\n\r\n\t// Don't show any template layers, just the popup sub template.\r\n\t$context['template_layers'] = array();\r\n\t$context['sub_template'] = 'popup';\r\n\r\n\t// What help string should be used?\r\n\tif (isset($helptxt[$_GET['help']]))\r\n\t\t$context['help_text'] = $helptxt[$_GET['help']];\r\n\telseif (isset($txt[$_GET['help']]))\r\n\t\t$context['help_text'] = $txt[$_GET['help']];\r\n\telse\r\n\t\t$context['help_text'] = $_GET['help'];\r\n\r\n\t// Does this text contain a link that we should fill in?\r\n\tif (preg_match('~%([0-9]+\\$)?s\\?~', $context['help_text'], $match))\r\n\t\t$context['help_text'] = sprintf($context['help_text'], $scripturl, $context['session_id'], $context['session_var']);\r\n}", "public function getListViewUrl() {\n\t\treturn \"index.php?module=\".$this->getName().\"&parent=\".$this->getParentName().\"&view=List\";\n\t}", "public function getListViewUrl() {\n\t\treturn \"index.php?module=\".$this->getName().\"&parent=\".$this->getParentName().\"&view=List\";\n\t}", "public function getHelpUrl ()\n {\n $module = $this->context->getModuleName ();\n $action = $this->context->getActionName ();\n\n $requestUrl = $this->context->getRequest()->getPathInfo ();\n foreach (sfConfig::get ('app_help_external', array ()) as $pattern => $url)\n {\n if (preg_match ($pattern, $requestUrl) === 1)\n return $url;\n }\n\n // check if there is a doc file for this module/action\n $url = $this->resolve ($module.'/'.$action);\n\n return ($url !== null ? $this->generateUrl ($url) : null);\n }" ]
[ "0.69270456", "0.6909853", "0.68793976", "0.68175226", "0.6815216", "0.67353606", "0.67215747", "0.6688855", "0.66805506", "0.66160643", "0.65825444", "0.6510771", "0.64874727", "0.6463432", "0.64619", "0.64619", "0.64364135", "0.64347214", "0.64338917", "0.6427095", "0.64254844", "0.63799965", "0.6373246", "0.6358439", "0.6355168", "0.635068", "0.6330569", "0.63141966", "0.63141966", "0.6286928" ]
0.7583758
0
look for a line in /etc/network/interfaces to be uncommented
function isRunningDhcp() { $wlan0_dhcp = "iface wlan0 inet dhcp"; $interfacesFile = file("/etc/network/interfaces"); // loop through each line of the file foreach ($interfacesFile as $interfacesLine) { if ($interfacesLine == $wlan0_dhcp) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInterfaceList() {\n\t\t$i = 0;\n\t\t$interfaces = array();\n\n\t\t$temp = Functions::shellCommand('ifconfig');\n\t\t$temp = explode(\"\\n\",$temp);\n\n\t\twhile($i < count($temp)){\n\t\t\tif(stristr($temp[$i],'flags')){\n\t\t\t\t$position = strpos($temp[$i],\":\",0);\n\t\t\t\t$tmp = substr($temp[$i],0,$position);\n\n\t\t\t\tif($tmp != 'lo0'){\n\t\t\t\t\t$interfaces[] = $tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn $interfaces;\n\t}", "function get_interface_list() {\n\n\tglobal $g;\n\n\t/* build interface list with netstat */\n\texec(\"/usr/bin/netstat -in -f inet\", $linkinfo);\n\tarray_shift($linkinfo);\n\n\t$iflist = array();\n\n\tforeach ($linkinfo as $link) {\n\t\t$alink = preg_split(\"/\\s+/\", $link);\n\t\t$ifname = chop($alink[0]);\n\t\t$iftype = chop($alink[2]);\n\t\tif (preg_match(\"/Link/\", $iftype)) {\n\t\t\tif (substr($ifname, -1) == \"*\")\n\t\t\t$ifname = substr($ifname, 0, strlen($ifname) - 1);\n\n\t\t\tif (!preg_match(\"/^(pflog|carp|pfsync|ppp|enc|sl|gif|faith|lo|ng|vlan|tun)/\", $ifname)) {\n\t\t\t\t$iflist[$ifname] = array();\n\n\n\t\t\t\t$iflist[$ifname]['mac'] = chop($alink[3]);\n\t\t\t\t$iflist[$ifname]['up'] = false;\n\n\t\t\t\t/* find out if the link on this interface is up */\n\t\t\t\tunset($ifinfo);\n\t\t\t\texec(\"/sbin/ifconfig {$ifname}\", $ifinfo);\n\n\t\t\t\tforeach ($ifinfo as $ifil) {\n\t\t\t\t\tif (preg_match(\"/status: active/\", $ifil)) {\n\t\t\t\t\t\t$iflist[$ifname]['up'] = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $iflist;\n}", "public function testIfconfig1804()\n {\n $string = file_get_contents(__DIR__ . \"/ifconfig1804\");\n $sensor = new Ifconfig(new \\App\\Server());\n $interfaces = $sensor->parseIfconfig($string);\n $this->assertEquals(2, count($interfaces));\n $this->assertEquals(\"eno1\", $interfaces[0]->name);\n $this->assertEquals(\"172.20.0.8\", $interfaces[1]->address);\n $this->assertEquals(185252610, $interfaces[1]->rx);\n $this->assertEquals(266912412, $interfaces[1]->tx);\n }", "function where_is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\t$where_configured = array();\n\n\t$pos = strpos($ignore_if, '_virtualip');\n\tif ($pos !== false) {\n\t\t$ignore_vip_id = substr($ignore_if, $pos+10);\n\t\t$ignore_vip_if = substr($ignore_if, 0, $pos);\n\t} else {\n\t\t$ignore_vip_id = -1;\n\t\t$ignore_vip_if = $ignore_if;\n\t}\n\n\t$isipv6 = is_ipaddrv6($ipaddr);\n\n\tif ($isipv6) {\n\t\t$ipaddr = text_to_compressed_ip6($ipaddr);\n\t}\n\n\tif ($check_subnets) {\n\t\t$cidrprefix = intval($cidrprefix);\n\t\tif ($isipv6) {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 128)) {\n\t\t\t\t$cidrprefix = 128;\n\t\t\t}\n\t\t} else {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 32)) {\n\t\t\t\t$cidrprefix = 32;\n\t\t\t}\n\t\t}\n\t\t$iflist = get_configured_interface_list();\n\t\tforeach ($iflist as $if => $ifname) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($isipv6) {\n\t\t\t\t$if_ipv6 = get_interface_ipv6($if);\n\t\t\t\t$if_snbitsv6 = get_interface_subnetv6($if);\n\t\t\t\t/* do not check subnet overlapping on 6rd interfaces,\n\t\t\t\t * see https://redmine.pfsense.org/issues/12371 */ \n\t\t\t\tif ($if_ipv6 && $if_snbitsv6 &&\n\t\t\t\t ((config_get_path(\"interfaces/{$if}/ipaddrv6\") != '6rd') || ($cidrprefix > $if_snbitsv6)) &&\n\t\t\t\t check_subnetsv6_overlap($ipaddr, $cidrprefix, $if_ipv6, $if_snbitsv6)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ipv6($if) . \"/\" . get_interface_subnetv6($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$if_ipv4 = get_interface_ip($if);\n\t\t\t\t$if_snbitsv4 = get_interface_subnet($if);\n\t\t\t\tif ($if_ipv4 && $if_snbitsv4 && check_subnets_overlap($ipaddr, $cidrprefix, $if_ipv4, $if_snbitsv4)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ip($if) . \"/\" . get_interface_subnet($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($isipv6) {\n\t\t\t$interface_list_ips = get_configured_ipv6_addresses();\n\t\t} else {\n\t\t\t$interface_list_ips = get_configured_ip_addresses();\n\t\t}\n\n\t\tforeach ($interface_list_ips as $if => $ilips) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (strcasecmp($ipaddr, $ilips) == 0) {\n\t\t\t\t$where_entry = array();\n\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t$where_entry['ip_or_subnet'] = $ilips;\n\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($check_localip) {\n\t\tif (strcasecmp($ipaddr, text_to_compressed_ip6(config_get_path('l2tp/localip', \"\"))) == 0) {\n\t\t\t$where_entry = array();\n\t\t\t$where_entry['if'] = 'l2tp';\n\t\t\t$where_entry['ip_or_subnet'] = config_get_path('l2tp/localip');\n\t\t\t$where_configured[] = $where_entry;\n\t\t}\n\t}\n\n\treturn $where_configured;\n}", "function get_interface_addr($if) {\n\tglobal $config;\n\n\t$ifdescr = convert_friendly_interface_to_friendly_descr($if);\n\n\t/* find out interface name */\n\tif ($ifdescr == \"wan\")\n\t\t$if = get_real_wan_interface();\n\telse\n\t\t$if = $config['interfaces'][$ifdescr];\n\n\treturn $if;\n\n}", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "function common_get_network_config($net){\r\n\t$file = '/etc/network/interfaces';\r\n\t$curr = file_get_contents($file);\r\n\tif($net == 'ip'){\t\t\r\n\t\t$curr_ip = explode('#ip',$curr);\r\n\t\t$curr_ip = $curr_ip[1];\r\n\t\t$curr_ip = explode(' ', $curr_ip);\r\n\t\t$curr_ip = trim($curr_ip[1]);\r\n\t\t\r\n\t\treturn $curr_ip;\r\n\t}\r\n\telse if($net == 'subnet'){\r\n\t\t$curr_subnet = explode('#subnet',$curr);\r\n\t\t$curr_subnet = $curr_subnet[1];\r\n\t\t$curr_subnet= explode(' ', $curr_subnet);\r\n\t\t$curr_subnet = trim($curr_subnet[1]);\r\n\t\t\r\n\t\treturn $curr_subnet;\r\n\t}\r\n\telse if($net == 'gw'){\r\n\t\t$curr_gw = explode('#gw',$curr);\r\n\t\t$curr_gw = $curr_gw[1];\r\n\t\t$curr_gw= explode(' ', $curr_gw);\r\n\t\t$curr_gw = trim($curr_gw[1]);\r\n\t\t\r\n\t\treturn $curr_gw;\r\n\t}\r\n\telse if($net == 'dns'){\r\n\t\t$curr_dns = explode('#dns',$curr);\r\n\t\t$curr_dns = $curr_dns[1];\r\n\t\t$curr_dns= explode(' ', $curr_dns);\r\n\t\t$curr_dns = trim($curr_dns[1]);\r\n\t\t\r\n\t\treturn $curr_dns;\r\n\t}\t\r\n\t\r\n\treturn null;\r\n}", "private function _network()\n {\n if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {\n $lines = preg_split(\"/\\n/\", $netstat, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($lines as $line) {\n $ar_buf = preg_split(\"/\\s+/\", $line);\n if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) {\n $dev = new NetDevice();\n $dev->setName($ar_buf[0]);\n $dev->setRxBytes($ar_buf[4]);\n $dev->setTxBytes($ar_buf[6]);\n $dev->setErrors($ar_buf[5] + $ar_buf[7]);\n //$dev->setDrops($ar_buf[8]);\n $this->sys->setNetDevices($dev);\n }\n }\n }\n }", "public function searchableIPs() {\n\t\treturn false;\n\t}", "function disableclient()\n {\n\n exec('ifconfig ' . escapeshellarg($this->interface) . ' down');\n }", "function is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\tif (count(where_is_ipaddr_configured($ipaddr, $ignore_if, $check_localip, $check_subnets, $cidrprefix))) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function enableDHCP() {\r\n\t\t/* fire up dhclient */\r\n\t\tFunctions::shellCommand ( \"/sbin/dhclient -c /var/etc/dhclient_\" . ( string ) $this->data->if . \".conf \" . ( string ) $this->data->if . \" >/tmp/\" . ( string ) $this->data->if . \"_output >/tmp/\" . ( string ) $this->data->if . \"_error_output\" );\r\n\t}", "private function getDefinedInterfaces()\n {\n $result = array();\n if (!empty($this->configHandle->interfaces)) {\n foreach ($this->configHandle->interfaces->children() as $ifname => $iface) {\n if (!isset($iface->virtual) || $iface->virtual != \"1\") {\n $result[$ifname] = array();\n foreach ($iface as $key => $value) {\n $result[$ifname][(string)$key] = (string)$value;\n }\n }\n }\n }\n return $result;\n }", "public function disableDHCP() {\r\n\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . ( string ) $this->data->if . \" down\" );\r\n\t\tsleep ( 1 );\r\n\t\t$pid = Functions::shellCommand ( 'ps awux | grep dhclient | grep -v grep | grep ' . ( string ) $this->data->if . ' | awk \\'{ print $2 }\\'' );\r\n\t\tif (! empty ( $pid )) {\r\n\t\t\tFunctions::shellCommand ( \"kill {$pid}\" );\r\n\t\t}\r\n\t}", "function oinkmaster_conf($id, $if_real, $iface_uuid)\n{\n\tglobal $config, $g, $snort_md5_check_ok, $emerg_md5_check_ok, $pfsense_md5_check_ok;\n\n\t@unlink(\"/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/oinkmaster_{$iface_uuid}_{$if_real}.conf\");\n\n\t/* enable disable setting will carry over with updates */\n\t/* TODO carry signature changes with the updates */\n\tif ($snort_md5_check_ok != 'on' || $emerg_md5_check_ok != 'on' || $pfsense_md5_check_ok != 'on') {\n\n\t\t$selected_sid_on_section = \"\";\n\t\t$selected_sid_off_sections = \"\";\n\n\t\tif (!empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_on'])) {\n\t\t\t$enabled_sid_on = trim($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_on']);\n\t\t\t$enabled_sid_on_array = split('\\|\\|', $enabled_sid_on);\n\t\t\tforeach($enabled_sid_on_array as $enabled_item_on)\n\t\t\t\t$selected_sid_on_sections .= \"$enabled_item_on\\n\";\n\t\t}\n\n\t\tif (!empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_off'])) {\n\t\t\t$enabled_sid_off = trim($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_off']);\n\t\t\t$enabled_sid_off_array = split('\\|\\|', $enabled_sid_off);\n\t\t\tforeach($enabled_sid_off_array as $enabled_item_off)\n\t\t\t\t$selected_sid_off_sections .= \"$enabled_item_off\\n\";\n\t\t}\n\n\t\tif (!empty($selected_sid_off_sections) || !empty($selected_sid_on_section)) {\n\t\t\t$snort_sid_text = <<<EOD\n\n###########################################\n# #\n# this is auto generated on snort updates #\n# #\n###########################################\n\npath = /bin:/usr/bin:/usr/local/bin\n\nupdate_files = \\.rules$|\\.config$|\\.conf$|\\.txt$|\\.map$\n\nurl = dir:///usr/local/etc/snort/rules\n\n$selected_sid_on_sections\n\n$selected_sid_off_sections\n\nEOD;\n\n\t\t\t/* open snort's oinkmaster.conf for writing */\n\t\t\t@file_put_contents(\"/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/oinkmaster_{$iface_uuid}_{$if_real}.conf\", $snort_sid_text);\n\t\t}\n\t}\n}", "function writeIPs() {\n\n\t\t// get banned IPs file name\n\t\t$bannedips_file = $this->settings['bannedips_file'];\n\t\t$empty = true;\n\n\t\t// compile banned IPs file contents\n\t\t$list = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\" . CRLF\n\t\t . \"<ban_list>\" . CRLF;\n\t\tfor ($i = 0; $i < count($this->bannedips); $i++) {\n\t\t\tif ($this->bannedips[$i] != '') {\n\t\t\t\t$list .= \"\\t\\t<ipaddress>\" . $this->bannedips[$i] . \"</ipaddress>\" . CRLF;\n\t\t\t\t$empty = false;\n\t\t\t}\n\t\t}\n\t\tif ($empty) {\n\t\t\t$list .= \"<!-- format:\" . CRLF\n\t\t\t . \"\\t\\t<ipaddress>xx.xx.xx.xx</ipaddress>\" . CRLF\n\t\t\t . \"-->\" . CRLF;\n\t\t}\n\t\t$list .= \"</ban_list>\" . CRLF;\n\n\t\t// write out the list file\n\t\tif (!@file_put_contents($bannedips_file, $list)) {\n\t\t\ttrigger_error('Could not write banned IPs file ' . $bannedips_file . ' !', E_USER_WARNING);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function set_ipalias($ip, $netmask, $if, $action = '') {\n if($action == '-') {\n $_alias = \"-alias\";\n log_error(\"Removing IP $ip with netmask $netmask from interface $if\");\n } else {\n $_alias = \"alias\";\n log_error(\"Adding IP $ip with netmask $netmask to interface $if\");\n }\n\n $_cmd = \"ifconfig $if $_alias $ip netmask $netmask\";\n system($_cmd, $_exit_status);\n return $_exit_status; \n}", "public function getIP(){\n\t\ttry {\n\t\t\t$fileContents = parse_ini_file(\"editableFiles/configFile.ini\");\n\t\t\treturn $fileContents[\"ip\"];\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "function add_iptables($ip){\n\t$cmd_add_iptables = \"sudo iptables -t nat -I PREROUTING -s \".$ip.\" -p tcp -j ACCEPT\";\n\tshell_exec($cmd_add_iptables);\n}", "private function sniff_ip() {\n\n\t\tif ( $this->ip_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t$this->ip_data = [ '127.0.0.1', 'CLI' ];\n\n\t\t\treturn;\n\t\t}\n\n\t\t$ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ];\n\t\t$ips = array_intersect_key( $_SERVER, $ip_server_keys );\n\t\t$this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ];\n\t}", "public function checkLockToIP() {}", "function wg_interface_status() {\n\tglobal $wgg;\n\n\t$if_group = escapeshellarg($wgg['if_group']);\n\n\t$status = array();\n\texec(\"{$wgg['ifconfig']} -a -g {$if_group}\", $status);\n\n\t$output = implode(\"\\n\", $status);\n\treturn $output;\n\n}", "function ArrayIPTables(){\n$pattern=\"#INPUT\\s+-s\\s(.+?)\\/.+?--dport 25.+?ArticaInstantPostfix#\";\t\n$cmd=\"/sbin/iptables-save > /etc/artica-postfix/iptables.conf\"; \nsystem($cmd);\nevents(\"ArrayIPTables:: loading current ipTables list\");\n$datas=explode(\"\\n\",@file_get_contents(\"/etc/artica-postfix/iptables.conf\"));\nif(!is_array($datas)){return null;}\nwhile (list ($num, $ligne) = each ($datas) ){\n\tif(preg_match($pattern,$ligne,$re)){\n\t\t$array[$re[1]]=$re[1];\n\t}else{\n\t\t\n\t}\n}\nevents(\"ArrayIPTables:: loading current ipTables list \". count($array). \" rules\");\nreturn $array;\n\n\n}", "function is_dhcpv6_server_enabled() {\n\tforeach (config_get_path('interfaces', []) as $ifcfg) {\n\t\tif (isset($ifcfg['enable']) && !empty($ifcfg['track6-interface'])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tforeach (config_get_path('dhcpdv6', []) as $dhcpv6if => $dhcpv6ifconf) {\n\t\tif (empty($dhcpv6ifconf)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (isset($dhcpv6ifconf['enable']) &&\n\t\t\t!empty(config_get_path(\"interfaces/{$dhcpv6if}\"))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function list_addr() {\n $this->set_error('list_addr is not implemented');\n return false;\n }", "public function beLoginLinkIPList() {}", "function enable_hardware_offloading($interface) {\n\t$int = get_real_interface($interface);\n\tif (empty($int)) {\n\t\treturn;\n\t}\n\n\tif (!config_path_enabled('system','do_not_use_nic_microcode')) {\n\t\t/* translate wan, lan, opt -> real interface if needed */\n\t\t$int_family = preg_split(\"/[0-9]+/\", $int);\n\t\t$supported_ints = array('fxp');\n\t\tif (in_array($int_family, $supported_ints)) {\n\t\t\tif (does_interface_exist($int)) {\n\t\t\t\tpfSense_interface_flags($int, IFF_LINK0);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* This is mostly for vlans and ppp types */\n\t$realhwif = get_parent_interface($interface);\n\tif ($realhwif[0] == $int) {\n\t\thardware_offloading_applyflags($int);\n\t} else {\n\t\thardware_offloading_applyflags($realhwif[0]);\n\t\thardware_offloading_applyflags($int);\n\t}\n}", "function readIPs() {\n\n\t\t// get banned IPs file name\n\t\t$bannedips_file = $this->settings['bannedips_file'];\n\n\t\tif ($list = $this->xml_parser->parseXml($bannedips_file)) {\n\t\t\t// read the XML structure into variable\n\t\t\tif (isset($list['BAN_LIST']['IPADDRESS']))\n\t\t\t\t$this->bannedips = $list['BAN_LIST']['IPADDRESS'];\n\t\t\telse\n\t\t\t\t$this->bannedips = array();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// could not parse XML file\n\t\t\ttrigger_error('Could not read/parse banned IPs file ' . $bannedips_file . ' !', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "private function _locate_hw() {\n\t\t$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\t\t\n\t\tsocket_bind($socket, \"0.0.0.0\", 55555);\n\t\t\n\t\t$timeout = array('sec'=>20,'usec'=>0);\n\t\tsocket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO,$timeout);\n\t\tsocket_set_option($socket, SOL_SOCKET, SO_BROADCAST, 1);\n\t\tsocket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\t\tsocket_set_option($socket, SOL_SOCKET, SO_DEBUG, 0);\t\t\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tsocket_recvfrom($socket, $buf, 512, 0, $remote_ip, $remote_port);\t\t\t\n\t\t\tif (strpos($buf,'HomeWizard') !== false) {\n\t\t\t\t$this->ip_address = $remote_ip;\t\t\t\t\n\t\t\t\tsocket_close($socket);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tsocket_close($socket);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\t\t\n\t}", "function is_dhcp_server_enabled() {\n\tforeach (config_get_path('dhcpd', []) as $dhcpif => $dhcpifconf) {\n\t\tif (empty($dhcpifconf)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (isset($dhcpifconf['enable']) &&\n\t\t\t!empty(config_get_path(\"interfaces/{$dhcpif}\"))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}" ]
[ "0.5779439", "0.54975265", "0.5305615", "0.5204889", "0.5125404", "0.50824064", "0.50343305", "0.5006693", "0.49678248", "0.48681784", "0.48419186", "0.48123765", "0.47758344", "0.47314057", "0.4708282", "0.47080708", "0.46936038", "0.4691595", "0.46496284", "0.46253914", "0.46202043", "0.46032315", "0.45983103", "0.45942658", "0.45907897", "0.456035", "0.45577234", "0.45546257", "0.45449728", "0.4543023" ]
0.55333614
1
Return information about the loaded vendor.
public function GetVendor() { return $this->vendor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVendor()\n {\n return $this->_coreRegistry->registry('current_vendor');\n }", "public function getLoadedVendorCollection()\n {\n return $this->_getVendorCollection();\n }", "public function getVendorName(): string;", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "protected function _getConfig()\n {\n return $this->_vendor;\n }", "public function unknownVendor() {\r\n\t\t$data = array();\r\n\t\t\t$data['name'] = 'Unknown';\r\n\t\t\t$data['link'] = '';\r\n\t\t\t$data['tax_id'] = 'Unknown';\r\n\t\t\t$data['address'] = 'Unknown';\r\n\t\t\t$data['address2'] = 'Unknown';\r\n\t\t\t$data['city'] = 'Unknown';\r\n\t\t\t$data['state'] = 'Unknown';\r\n\t\t\t$data['zip'] = 'Unknown';\r\n\t\t\t$data['country'] = 'Unknown';\r\n\t\t\t$data['has_ship'] = 0;\r\n\t\t\t$data['ship_contact'] = 'Unknown';\r\n\t\t\t$data['ship_phone'] = 'Unknown';\r\n\t\t\t$data['ship_address'] = 'Unknown';\r\n\t\t\t$data['ship_address2'] = 'Unknown';\r\n\t\t\t$data['ship_city'] = 'Unknown';\r\n\t\t\t$data['ship_state'] = 'Unknown';\r\n\t\t\t$data['ship_zip'] = 'Unknown';\r\n\t\t\t$data['ship_country'] = 'Unknown';\r\n\t\t\t$data['first_name'] = 'Unknown';\r\n\t\t\t$data['last_name'] = 'Unknown';\r\n\t\t\t$data['phone'] = 'Unknown';\r\n\t\t\t$data['alt_phone'] = 'Unknown';\r\n\t\t\t$data['fax'] = 'Unknown';\r\n\t\t\t$data['email'] = 'Unknown';\r\n\t\t\t$data['notes'] = 'Unknown';\r\n\t\t\t$data['active'] = 0;\r\n\t\t\t$data['legacy_vendor_code'] = 'Unknown';\r\n\t\t\t$data['legacy_vendor_id'] = 0;\r\n\t\t\t$data['mailing_list'] = 0;\r\n\r\n\t\treturn $data; //array\r\n\t}", "public function getVendorData()\n {\n $ven = MasterVendor::latest()->get();\n return response([\n 'success' => true,\n 'message' => 'List All Vendor',\n 'data' => $ven\n ], 200);\n\n }", "public function getVendorCode()\n {\n return $this->vendorCode;\n }", "public function getVendorList() {\n $vendors = $this->couponServices_model->fetchVendors();\n\n $vendor_options = array();\n $vendor_options[\"\"] = \"-- Select vendor --\";\n foreach ($vendors as $company) {\n $vendor_options[$company['vendorId']] = $company['vendorName'];\n }\n return $vendor_options;\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getInfoMerchant()\n {\n\n $response = $this->client->request($this->methods['post'], 'payment_gateway_api/get_vendor', [\n 'json' => [\n 'VENDOR_ID' => $this->vendor_id,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->vendor_id. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }", "public function getActivatedVendors();", "public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }", "public function getVendorId() {}", "public function getVendorName(): string\n {\n return 'local';\n }", "public function details()\n {\n \n try{\n return response()->json(['status' => true, 'data' => new VendorResource(auth()->user()), 'error' => []]);\n }\n catch(\\Exception $e){\n return response()->json(['status' => true, 'data' => [], 'error' => ['message' => $e->getMessage()]]);\n }\n }", "public function vendor($vendor_id)\n\t{\n\t\t$this->_vendors_array('all');\n\t\t\n\t\tif (isset($this->vendors_cache[$vendor_id]))\n\t\t{\n\t\t\treturn $this->vendors_cache[$vendor_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->vendors_cache[1];\n\t\t}\n\t}", "private static function vendor() {\n $file = Storange::getPathFile('vendor/autoload.php');\n if (file_exists($file)) {\n include_once $file;\n } else {\n throw new exceptions\\LoadFiles('Error to load vendor autoload. Check the composer libs', 0);\n }\n }", "private function LoadVendorById($id)\n\t{\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tWHERE vendorid='\".(int)$id.\"'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\treturn $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t}", "public function getDeviceManufacturer() {}", "public function getVendor()\n {\n if ($this->_oVendor === null) {\n $this->_oVendor = $this->getProduct()->getVendor(false);\n }\n\n return $this->_oVendor;\n }", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "protected function getVendorFilePath()\n {\n $reflection = new \\ReflectionClass('Composer\\Autoload\\ClassLoader');\n return $reflection->getFileName();\n }", "public static function getvendorData()\n {\n\n $value=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get(); \n return $value;\n\t\n }", "protected function getVendorReplacement()\n {\n return $this->theme->config('composer.vendor');\n }", "public function getIosVendorId();", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "function get_vendors($debug = false) {\n\t\t$q = (new QueryBuilder())->table('vendors');\n\t\t$q->where('shipfrom', '');\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Vendor');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "public function getVendorThatExists()\n {\n // Given\n $this->_mockApi->expects($this->once())\n ->method('getResource')\n ->with($this->equalTo(\"vendors/v1\"))\n ->will($this->returnValue(self::$VENDOR_RESPONSE));\n\n // When\n $result = $this->_vendorProvider->getById(\"v1\");\n\n // Then\n $this->assertResult($result);\n }" ]
[ "0.6996057", "0.6563159", "0.652806", "0.6440363", "0.6395274", "0.63126254", "0.6277696", "0.62547034", "0.6168338", "0.61667174", "0.6134548", "0.6132914", "0.60982734", "0.6088694", "0.60774684", "0.60457283", "0.60436994", "0.60385275", "0.59770817", "0.59729344", "0.5956312", "0.5942357", "0.5942357", "0.59156483", "0.5914175", "0.59139955", "0.5912228", "0.5901699", "0.5879618", "0.5878163" ]
0.66353315
1
Show the page containing products belonging to the current vendor.
public function ShowVendorProducts() { $GLOBALS['BreadCrumbs'] = array( array( 'name' => GetLang('Vendors'), 'link' => VendorLink() ), array( 'name' => $this->vendor['vendorname'], 'link' => VendorLink($this->vendor) ), array( 'name' => GetLang('Products') ) ); $title = sprintf(GetLang('ProductsFromVendorX'), isc_html_escape($this->vendor['vendorname'])); $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.$title); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_products'); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ShowVendors()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors')\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function showProducts()\n {\n /** @var ProductFinder $productFinder */\n $productFinder = PersistenceFactory::createFinder(Product::class);\n /** @var array $products */\n\n $criteria = isset($this->request->getGet()['criteria']) ? $this->request->getGet()['criteria'] : 'title';\n $order = isset($this->request->getGet()['order']) ? $this->request->getGet()['order'] : '';\n $search = isset($this->request->getGet()['search']) ? $this->request->getGet()['search'] : null;\n $products = $productFinder->findBy($criteria, $order, $search);\n $renderer = new HomePageRenderer();\n $renderer->render($products);\n }", "public function show(Vendor $vendor)\n {\n //\n }", "public function showProduct($vendor_product_id)\n {\n //\n $Product = VendorProduct::where('vendor_product_id', $vendor_product_id)->first();\n // $Product = VendorProduct::where('vendor_product_id', 1)->first();\n $shop = Vendor::Where('vendor_id', $Product->vendor_id)->first();\n $product_size = VendorProductSize::where('vendor_product_id', $vendor_product_id)->get();\n $product_color = VendorProductColor::where('vendor_product_id', $vendor_product_id)->get();\n $product_image = VendorProductImage::where('vendor_product_id', $vendor_product_id)->first();\n $product_image_thumb = VendorProductImage::where('vendor_product_id', $vendor_product_id)->get();\n\n // dd($product_image);\n return view('Shop_Portal.product_page')->with([\n 'product'=>$Product,\n 'shop'=>$shop,\n 'product_size'=>$product_size,\n 'product_color'=>$product_color,\n 'product_image'=>$product_image,\n 'product_image_thumb'=>$product_image_thumb,\n ]);\n }", "public function show()\n {\n $products = \\App\\Product::get();\n return view('products.show')->with('products', $products);\n }", "public function showAdminproductsAction()\n {\n $productManager = new ProductManager();\n $products = $productManager->getAllProducts();\n return $this->twig->render('admin/adminproducts.html.twig', array(\n 'products' => $products\n ));\n }", "public function index()\n {\n $vendor_id=Auth::guard('vendor')->user()->id;\n //$data = Product::join('vendors','vendors.id','=','products.created_by')->paginate(2);\n $data = Product::where('created_by',$vendor_id)->paginate(20);\n $name='';\n return view('vendor/listproducts', compact('data','name'))->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function index()\n {\n return view('pharmacy.inventory.product.index', [\n 'products' => Product::with('manufacturer', 'category')\n ->orderByDesc('id')\n ->where('company_id', company_id())\n ->paginate(),\n 'categories' => Category::where('status',1)\n ->where('company_id', company_id())\n ->get(),\n ]);\n }", "public function index()\n {\n $user = Product::all();\n return view(\"backend.ProductsPage\",compact(\"user\"));\n }", "public function showSomeAction() \n\t{\n\t\t//récupération des produits à afficher sur la page\n\t\t$productsManager = new ProductsManager();\n\t\t$currentPage = array_key_exists('page', $_GET)? $_GET['page'] : 1;\n\t\t$numberByPage = PRODUCTS_BY_PAGE;\n\t\t$paginationStart = array_key_exists('page', $_GET)? ($_GET['page']-1)*$numberByPage : 0;\n\t\t$paginationStartShowed = array_key_exists('page', $_GET)? $paginationStart+1 : 1;\n\t\t$productsNumber = $productsManager -> count();\n\t\t$pagesNumber = ceil($productsNumber / $numberByPage);\n\t\t$paginationEnd = $paginationStart + $numberByPage > $productsNumber? $productsNumber : $paginationStart + $numberByPage;\n\t\t$products = $productsManager -> getAllOnPage($paginationStart, $numberByPage);\n\n\t\t$this->viewData['pagination'] = $pagination = \n\t\t[\n\t\t\t'currentPage' => $currentPage,\n\t\t\t'paginationStart' => $paginationStart,\n\t\t\t'paginationStartShowed' => $paginationStartShowed,\n\t\t\t'numberByPage' => $numberByPage,\n\t\t\t'productsNumber' => $productsNumber,\n\t\t\t'pagesNumber' => $pagesNumber,\n\t\t\t'paginationEnd' => $paginationEnd,\n\t\t\t'products' => $products\n\t\t];\n\n\t\t//vérification du numéro de page\n\t\tif ($pagination['currentPage'] < 1 OR $pagination['currentPage'] > $pagination['pagesNumber']) \n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT);\n\t\t\texit();\n\t\t}\n\t\t$this -> generateView('products/show-some.phtml');\n\t}", "public function index()\n {\n $products = Product::where('user_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(20);\n return view('admin.products.products', [\n 'products' => $products\n ]);\n }", "public function index()\n {\n $products = Product::latest()->simplePaginate(15);\n\n\n return view('backend.pages.products.index')->with([\n 'products' => $products\n ]);\n }", "public function page_vendors() {\n $action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';\n $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;\n\n switch ($action) {\n case 'view':\n $vendor = new \\WeDevs\\ERP\\People( $id );\n $template = dirname( __FILE__ ) . '/views/vendor/single.php';\n break;\n\n case 'edit':\n $template = dirname( __FILE__ ) . '/views/vendor/edit.php';\n break;\n\n case 'new':\n $template = dirname( __FILE__ ) . '/views/vendor/new.php';\n break;\n\n default:\n $template = dirname( __FILE__ ) . '/views/vendor/list.php';\n break;\n }\n\n if ( file_exists( $template ) ) {\n include $template;\n }\n }", "public function ShowVendorPage()\n\t{\n\t\tif(isset($_REQUEST['pageid'])) {\n\t\t\t$pageWhere = \" pageid='\".(int)$_REQUEST['pageid'].\"'\";\n\t\t}\n\t\telse {\n\t\t\t$page = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][2]);\n\t\t\t$page = MakeURLNormal($page);\n\t\t\t$pageWhere = \" LOWER(pagetitle)='\".$GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($page)).\"'\";\n\t\t}\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE \".$pageWhere.\" AND pagevendorid='\".(int)$this->vendor['vendorid'].\"' AND pagestatus='1'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$page = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\tif(!isset($page['pageid'])) {\n\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\texit;\n\t\t}\n\n\t\t// Otherwise show the page\n\t\t$GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($page['pageid'], false, $page);\n\t\t$GLOBALS['ISC_CLASS_PAGE']->HandlePage();\n\t\texit;\n\t}", "public function index()\n {\n\t $user = Auth::guard('admin')->user();\n\n\t $products = \\App\\Product::with( 'author' )\n\t ->with( 'category' )\n\t ->with( 'genre' )\n\t ->with( 'image' )\n\t ->orderBy( 'created_at', 'DESC' )\n\t ->get();\n\n\t return view('admin.pages.products', ['user' => $user, 'products' => $products]);\n }", "public function index()\n {\n return view('seller.product.index')->with([\n 'products' => Auth::user()->products\n ]);\n }", "public function index()\n {\n return view('content.product.product_show');\n }", "public function show()\n {\n //\n $productos = Productos::get();\n return view ('productos.show') -> with('productos', $productos);\n }", "public function index()\n {\n $products = $this->repository->latest()->paginate(15);\n\n return view('admin.pages.products.index', compact('products'));\n }", "public function show(Request $request)\n {\n return view('pages.products.show');\n\n }", "public function showProduct()\n {\n $products = DB::table('products')\n ->join('categories','categories.id','=','products.categoryId')\n ->join('manufacturers','manufacturers.id','=','products.manufacturerId')\n ->select('products.*','categories.categoryName','manufacturers.manufacturerName')\n ->get();\n return view('admin.product.manageProduct',compact('products'));\n }", "function show()\n\t{\n\t\t$this->layout->set(null);\n\t\t$id = getParameter('id');\n\t\t$data = [\n\t\t\t'product' => $this->model->product->find_by_id($id)\n\t\t];\n\t\t$this->view->load('product/show', $data);\n\t}", "public function index()\n {\n $products = Product::all();\n return view('merchant.products.index', compact('products'));\n }", "public function index()\n {\n $products = Product::all();\n return view(\"admin.displayProducts\", ['products' => $products]);\n }", "public function products()\n {\n if ($_SESSION['role'] == 1)\n { \n //get tickets info features from the database\n $ProductModel = $this->model('ProductModel');\n $this->products = $ProductModel->adminGetProducts(); \n $this->view('AdminDashboard/products', ['viewName' => 'Dashboard - Products']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n }", "public function getProducts(){\n\t\t$products = Product::all();\n\t\treturn view('admin-product-view')->with('products', $products);\n\t}", "public function indexAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $products = $em->getRepository('AppBundle:Product')->findBy(\n array('user' => $this->getUser())\n );\n\n return $this->render('seller/seller_space.html.twig', array(\n 'products' => $products,\n ));\n }", "public function index()\n {\n $active = 'products';\n return view('backend.products.index',compact('active'));\n }", "public function view()\n\t{\n\t\t$products = Products::where('is_visible', 1)->with('vouchers')->get();\n\n\t\treturn view('Products.list', ['products' => $products]);\n\t}", "public function index()\n {\n $products = Product::paginate(15);\n $countProduct = Product::all()->count();\n $countActiveProduct = $this->getActiveProducts();\n $countInactiveProduct = $this->getInactiveProducts();\n return view('admin.product.index')->with('products', $products)->with('countActiveProduct', $countActiveProduct)->with('countInactiveProduct', $countInactiveProduct)->with('countProduct', $countProduct);\n }" ]
[ "0.7312268", "0.7112363", "0.71049476", "0.6945475", "0.6920425", "0.6901654", "0.684036", "0.6830805", "0.68253374", "0.67833406", "0.678076", "0.6774265", "0.67449254", "0.67418396", "0.6720788", "0.67075396", "0.67061985", "0.6706029", "0.6685756", "0.666404", "0.6651464", "0.6624914", "0.6606177", "0.6597652", "0.6594611", "0.65943706", "0.6588581", "0.6587618", "0.6586431", "0.6584165" ]
0.84323925
0
Show the page containing a web page set up by a particular vendor.
public function ShowVendorPage() { if(isset($_REQUEST['pageid'])) { $pageWhere = " pageid='".(int)$_REQUEST['pageid']."'"; } else { $page = preg_replace('#\.html$#i', '', $GLOBALS['PathInfo'][2]); $page = MakeURLNormal($page); $pageWhere = " LOWER(pagetitle)='".$GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($page))."'"; } $query = " SELECT * FROM [|PREFIX|]pages WHERE ".$pageWhere." AND pagevendorid='".(int)$this->vendor['vendorid']."' AND pagestatus='1' "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $page = $GLOBALS['ISC_CLASS_DB']->Fetch($result); if(!isset($page['pageid'])) { $GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404'); $GLOBALS['ISC_CLASS_404']->HandlePage(); exit; } // Otherwise show the page $GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($page['pageid'], false, $page); $GLOBALS['ISC_CLASS_PAGE']->HandlePage(); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Vendor $vendor)\n {\n //\n }", "public function ShowVendors()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors')\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "public function HandlePage()\n\t{\n\t\tif(!gzte11(ISC_HUGEPRINT)) {\n\t\t\texit;\n\t\t}\n\n\t\t$this->SetVendorData();\n\n\t\tif($this->displaying == 'products') {\n\t\t\t$this->ShowVendorProducts();\n\t\t}\n\t\telse if($this->displaying == 'page') {\n\t\t\t$this->ShowVendorPage();\n\t\t}\n\t\telse if($this->displaying == 'profile') {\n\t\t\t$this->ShowVendorProfile();\n\t\t}\n\t\telse {\n\t\t\t$this->ShowVendors();\n\t\t}\n\t}", "public function page_vendors() {\n $action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';\n $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;\n\n switch ($action) {\n case 'view':\n $vendor = new \\WeDevs\\ERP\\People( $id );\n $template = dirname( __FILE__ ) . '/views/vendor/single.php';\n break;\n\n case 'edit':\n $template = dirname( __FILE__ ) . '/views/vendor/edit.php';\n break;\n\n case 'new':\n $template = dirname( __FILE__ ) . '/views/vendor/new.php';\n break;\n\n default:\n $template = dirname( __FILE__ ) . '/views/vendor/list.php';\n break;\n }\n\n if ( file_exists( $template ) ) {\n include $template;\n }\n }", "public function ShowVendorProfile()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors'),\n\t\t\t\t'link' => VendorLink()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => $this->vendor['vendorname'],\n\t\t\t)\n\t\t);\n\n\t\t$title = isc_html_escape($this->vendor['vendorname']);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.$title);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_profile');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public function show($id)\n {\n $data = Vendor::find($id);\n return view('apps.pages.setup.vendor.vendor',['data'=>$data]);\n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-customer-edit-page.php';\n }", "public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function display() {\n\t\techo '<iframe src=\"http://norulesweb.com/contact/\" width=\"800\" height=\"400\"></iframe>';\n\t}", "public static function show(){\r\n\t\techo \r\n\t\t\tIncludes::Head()\r\n\t\t \t. Includes::Header()\r\n\t\t\t. \"<div class='page-header'>\r\n\t\t\t \t<h1>Error 404 - ¡Uuups!</h1>\r\n\t\t\t </div>\"\r\n\t\t\t . \"<p>La pagina a la que intenta acceder parece no existir.</p>\r\n\t\t\t <div class='alert alert-danger'><strong>No se haga el hacker<strong>, vaya a estudiar.</div>\"\r\n\t\t\t . Includes::Footer();\r\n\t}", "public function view() {\n\t\t// Find page by url slug\n\t\t$slug = $this->app->getSlug();\n\t\t$page = Page::findBySlug($slug);\n\t\t\n\t\t// If page exists render it, otherwise 404\n\t\tif ($page) {\n\t\t\t$this->title = $page->name;\n\t\t\t$this->pageData['page'] = $page;\n\t\t\t$this->render('view');\n\t\t} else {\n\t\t\t$this->noRoute();\n\t\t}\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function show()\n {\n return view('website::show');\n }", "function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function showAction() {\n\t\t$contentObject = $this->configurationManager->getContentObject()->data;\n\t\t$config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n\n\t\t/** @var $dce Tx_Dce_Domain_Model_Dce */\n\t\t$dce = $this->dceRepository->findAndBuildOneByUid(\n\t\t\t$this->dceRepository->extractUidFromCType($config['pluginName']),\n\t\t\t$this->settings,\n\t\t\t$contentObject\n\t\t);\n\n\t\tif ($dce->getEnableDetailpage() && intval($contentObject['uid']) === intval(t3lib_div::_GP($dce->getDetailpageIdentifier()))) {\n\t\t\treturn $dce->renderDetailpage();\n\t\t} else {\n\t\t\treturn $dce->render();\n\t\t}\n\t}", "public function displayUpgradePage()\n {\n global $token;\n $upgraderVesion = $this->context['versionInfo'][0];\n $upgraderBuild = $this->context['versionInfo'][1];\n $this->log(\"WebUpgrader v.\" . $upgraderVesion . \" (build \" . $upgraderBuild . \") starting\");\n include dirname(__FILE__) . '/upgrade_screen.php';\n }", "public function show(Vendor $vendor)\n {\n return view('vendors.show', compact('vendor'));\n }", "function showPage($page_name, $data)\n\t{\n\t\t$instance_name = & get_instance();\n\t\t$instance_name->load->view(\"admin/header\", $data);\n\t\t$instance_name->load->view(\"admin/navbar\", $data);\n\t\t$instance_name->load->view(\"admin/{$page_name}\", $data);\n\t\t$instance_name->load->view(\"admin/footer\", $data);\n\t}", "public static function showHomePage()\n {\n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_home_azienda.php\");\n $vd->setContentFile(\"../view/in/azienda/home_page_azienda.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once \"../view/Master.php\";\n }", "public function show(Vendor $vendor)\n {\n return view('vendors.view')->with('vendor', $vendor);\n }", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "public function view($params)\n {\n if (isset($params[1])) // If the vendorId is sent in parameters\n {\n $vendorId = $params[1];\n }\n else pageBroken();\n\n // ================== Get the data\n\n $vendor = $this->vendorsModel->getVendorById($vendorId); // Get a specific vendor from it's ID\n\n // ================== Get the views and set their variables\n\n $vendorsAddViewModel = new Common_view_Model('/sales/vendors'); // Pass the view folder and name to the template\n $vendorsAddViewModel->assign('vendorId' , $vendorId); // Assign a variable\n $vendorsAddViewModel->assign('vendor' , $vendor); // Assign a variable\n\n // ================== Organise the views\n\n parent::displayHeader($vendor['firstName'] . \"'s sales\"); // Page header\n\n $vendorsAddViewModel->render(); // Display the vendor view\n\n parent::displayFooter(); // Page footer\n }", "public function ShowVendorProducts()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors'),\n\t\t\t\t'link' => VendorLink()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => $this->vendor['vendorname'],\n\t\t\t\t'link' => VendorLink($this->vendor)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Products')\n\t\t\t)\n\t\t);\n\t\t$title = sprintf(GetLang('ProductsFromVendorX'), isc_html_escape($this->vendor['vendorname']));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.$title);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_products');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function show(Page $page)\n {\n\n }", "public function show_admin_page() {\n\t\t$this->view->render();\n\t}" ]
[ "0.68381524", "0.68360615", "0.6627945", "0.6581867", "0.6380152", "0.6338733", "0.6234429", "0.6216846", "0.620616", "0.60589623", "0.6032917", "0.6027528", "0.5986388", "0.59737575", "0.5965106", "0.5950802", "0.59503335", "0.594697", "0.59249604", "0.58851725", "0.5837049", "0.58196163", "0.58059925", "0.5788777", "0.57757896", "0.57681787", "0.57530534", "0.57350856", "0.572439", "0.5722652" ]
0.8068273
0
Show the profile page belonging to the current vendor.
public function ShowVendorProfile() { $GLOBALS['BreadCrumbs'] = array( array( 'name' => GetLang('Vendors'), 'link' => VendorLink() ), array( 'name' => $this->vendor['vendorname'], ) ); $title = isc_html_escape($this->vendor['vendorname']); $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.$title); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_profile'); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function profile(){\n $title = array('pageTitle' => Lang::get(\"website.Profile\"));\n $result['commonContent'] = $this->index->commonContent();\n if(auth()->guard('customer')->user()->user_type==2){\n return view('web.vendor_profile', ['result' =>$result,'title' => $title]);\n }else{\n return view('web.profile', ['result' =>$result,'title' => $title]);\n }\n\t}", "public function showProfile()\n\t{\n\t\t$data = array(\n\t\t\t'profile' => $this->profile,\n\t\t\t'socialMediaAccounts' => $this->profileService->getSocialMediaAccountsForProfile($this->profile)->toArray(),\n\t\t\t'socialMediaMax' => Config::get('profile.social_media.max'),\n\t\t\t'socialMediaTypes' => $this->profileService->getSocialMediaTypes(),\n\t\t\t'maxQuote' => $this->profile->program->type->name == 'mbo' ? 75 : 175\n\t\t);\n\n\t\treturn new ProfileView($data);\n\t}", "public function show()\n {\n return view('customer.profile');\n }", "public function profile()\n {\n $supplier = Supplier::where('user_id', '=', Auth::user()->id)->first();\n return view('profile.show', compact('supplier'));\n }", "public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}", "public function showOwnProfile()\n {\n //Se obtiene el id del usuario con la sesion activa\n $user = DB::table('users')->where('id', '=', Auth::user()->id)->first();\n\n return view('profile.show', compact('user'));\n }", "public function profile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profile');\n\n return $this->loadPublicView('user.profile', $breadCrumb['data']);\n }", "public function show()\n {\n $user = User::where('id',auth()->id())->first();\n return view('super.profile.show', [\n 'index' => $user,\n ]);\n }", "public function ShowVendorPage()\n\t{\n\t\tif(isset($_REQUEST['pageid'])) {\n\t\t\t$pageWhere = \" pageid='\".(int)$_REQUEST['pageid'].\"'\";\n\t\t}\n\t\telse {\n\t\t\t$page = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][2]);\n\t\t\t$page = MakeURLNormal($page);\n\t\t\t$pageWhere = \" LOWER(pagetitle)='\".$GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($page)).\"'\";\n\t\t}\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE \".$pageWhere.\" AND pagevendorid='\".(int)$this->vendor['vendorid'].\"' AND pagestatus='1'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$page = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\tif(!isset($page['pageid'])) {\n\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\texit;\n\t\t}\n\n\t\t// Otherwise show the page\n\t\t$GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($page['pageid'], false, $page);\n\t\t$GLOBALS['ISC_CLASS_PAGE']->HandlePage();\n\t\texit;\n\t}", "public function show()\n {\n $user = User::findOrFail($this->auth->user()->id);\n return view('admin.admin-users.profile', compact('user'));\n }", "public function profile()\n { \n $customerInfo = Auth::guard('customer')->user();\n return view('website::customer.profile', ['customerInfo' => $customerInfo]);\n }", "public function show()\n {\n $user = Auth::user();\n\n // dd($user);\n return view('pages.user.profile')->withUser($user);\n }", "public function profileAction() {\n\t\t$this->view->assign('account', $this->accountManagementService->getProfile());\n\t}", "public function show()\n {\n $client = Auth::guard('client')->user();\n\n return view('client.profile')->with('client', $client);\n }", "public function show(Vendor $vendor)\n {\n //\n }", "public function show()\n {\n $user = Auth::user();\n\n return view('profile/show', compact('user'));\n }", "public function show()\r\n\t{\r\n\t\t\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\t\t\r\n\t}", "public function profile()\n\t{\n\t\treturn view('admin.profile');\n\t}", "public function show(Profile $profile)\n {\n //\n }", "public function show(Profile $profile)\n {\n //\n }", "public function show(Profile $profile)\n {\n //\n }", "public function show(Profile $profile)\n {\n //\n }", "public function show(Profile $profile)\n {\n //\n }", "public function index()\n {\n return view('settings.company.profile.show');\n }", "public function customerProfile()\n {\n return view('commerce-frontend::profile.details');\n }", "public function pageProfile()\r\n {\r\n if (!user()) {\r\n $this->redirect('/login?r=' . urlencode('/profile'));\r\n }\r\n\r\n return $this->view('profile');\r\n }", "public function my_profile()\n {\n $data = Admin::find(Auth::id());\n return view('admin.admins.profile.profile', compact('data'));\n }", "public function profile() {\n $data = ['title' => 'Profile'];\n return view('pages.admin.profile', $data)->with([\n 'users' => $this->users\n ]);\n }", "public function profile() {\n $user = Auth::user();\n return view('site.profile', compact('user'));\n }", "public function profileAction() {\r\n $user = $this->getCurUser();\r\n return $this->render('AlbatrossUserBundle:User:profile.html.twig', array(\r\n 'userInfo' => $user,\r\n )\r\n );\r\n }" ]
[ "0.7178437", "0.6924234", "0.69034344", "0.6903002", "0.68881154", "0.6886891", "0.68680245", "0.68493867", "0.6826859", "0.6795518", "0.6788308", "0.67859256", "0.6780031", "0.6750857", "0.67066604", "0.67029387", "0.670257", "0.66927683", "0.6681857", "0.6681857", "0.6681857", "0.6681857", "0.6681857", "0.6675839", "0.6668608", "0.66668695", "0.66532487", "0.6648365", "0.6647799", "0.66276675" ]
0.87367845
0
Show a listing of all of the vendors configured on the store.
public function ShowVendors() { $GLOBALS['BreadCrumbs'] = array( array( 'name' => GetLang('Vendors') ) ); $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors')); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors'); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $vendors = Vendor::all();\n\n return view('admin.vendors.index', [\n 'items' => $vendors\n ]);\n }", "public function index()\n {\n if (request()->status == 'deleted') {\n $vendors = Vendor::onlyTrashed()->get();\n } else {\n $vendors = Vendor::all();\n }\n return view('vendors.index')->with(compact('vendors'));\n }", "public function index()\n\t{\n\t\t$vendors = $this->vendor->all();\n\n\t\treturn View::make('vendors.index', compact('vendors'));\n\t}", "public function index()\n {\n return \\View::make('dhaaga-clothing.vendors.vendors-list');\n \n }", "public function actionIndex() {\n $searchModel = new VendorSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $editableVendor = null;\n $vendorQuery = Vendor::query();\n $vendorQuery->where('name', 'like', '%'.request('q').'%');\n $vendors = $vendorQuery->paginate(25);\n\n if (in_array(request('action'), ['edit', 'delete']) && request('id') != null) {\n $editableVendor = Vendor::find(request('id'));\n }\n\n return view('vendors.index', compact('vendors', 'editableVendor'));\n }", "public function getvendorsAction()\n {\n \t\n \t$vendorsmodel= new Default_Model_Vendors();\n \t$vendorsdataArr=$vendorsmodel->getVendorsList();\n \n \t$opt='<option value=\\'\\'>Select Vendor</option>';\n \n \tif(sizeof($vendorsdataArr)>0){\n \t\t\n \t\tforeach($vendorsdataArr as $vendors)\n \t\t{\n \t\t\t$opt.=\"<option value='\".$vendors['id'].\"'>\".$vendors['name'].\"</option>\";\n \t\t}\n \t}\n \t\n \t\n \t \t\n \t$this->_helper->json(array('options'=>utf8_encode($opt)));\n \t\n \t\n }", "public function index()\n {\n $this->authorize('show-contact');\n $vendors = \\App\\Contact::whereSubcontactType(config('polanco.contact_type.vendor'))->orderBy('sort_name', 'asc')->with('addresses.state', 'phones', 'emails', 'websites')->paginate(100);\n\n return view('vendors.index', compact('vendors')); //\n }", "public function getVendorData()\n {\n $ven = MasterVendor::latest()->get();\n return response([\n 'success' => true,\n 'message' => 'List All Vendor',\n 'data' => $ven\n ], 200);\n\n }", "public function ShowVendorProducts()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors'),\n\t\t\t\t'link' => VendorLink()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => $this->vendor['vendorname'],\n\t\t\t\t'link' => VendorLink($this->vendor)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Products')\n\t\t\t)\n\t\t);\n\t\t$title = sprintf(GetLang('ProductsFromVendorX'), isc_html_escape($this->vendor['vendorname']));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.$title);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_products');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function index(Request $request)\n {\n $this->vendorRepository->pushCriteria(new RequestCriteria($request));\n $vendors = $this->vendorRepository->all();\n\n return view('admin.vendors.index')\n ->with('vendors', $vendors);\n }", "public function index(Request $request)\n {\n\n $this->vendorRepository->pushCriteria(new RequestCriteria($request));\n $vendors = $this->vendorRepository->all();\n return view('admin.vendor.vendors.index')\n ->with('vendors', $vendors);\n }", "function admin_list(){\n\t\t\n\t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",VENDOR_LISTING);\n\t\t$conditions = array(\"Vendor.is_deleted\"=>\"0\");\n\t\t\n\t\t$name = isset($this->params['url']['name'])?$this->params['url']['name']:(isset($this->params['named']['name'])?$this->params['named']['name']:\"\");\n\t\tif(trim($name) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.name like\"=>\"%\".trim($name).\"%\"));\n\t\t}\t\t\n\t\t\n\t\t$is_active = isset($this->params['url']['is_active'])?trim($this->params['url']['is_active']):(isset($this->params['named']['is_active'])?$this->params['named']['is_active']:\"\");\n\t\tif(trim($is_active) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.is_active\"=>$is_active));\n\t\t}\n\t\t\n\t\t$from = isset($this->params['url']['from'])?$this->params['url']['from']:(isset($this->params['named']['from'])?$this->params['named']['from']:\"\");\n\t\t$to = isset($this->params['url']['to'])?$this->params['url']['to']:(isset($this->params['named']['to'])?$this->params['named']['to']:\"\");\n \n\t\tif(trim($from) != \"\"){\n\t\t\t$from = $this->covertToSystemDate($from);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.created,'%Y-%m-%d') >=\"=>trim($from)));\n\t\t}\n\t\tif(trim($to) != \"\"){\n\t\t\t$to = $this->covertToSystemDate($to);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.created,'%Y-%m-%d') <=\"=>trim($to)));\n\t\t}\n\t\t\n\t\t$this->paginate = array('limit' =>VENDOR_LIMIT,'conditions'=>$conditions,'order'=>array(\"Vendor.created\"=>\"desc\"));\n\t\t$vendor_data = $this->paginate('Vendor'); \n\t\t$this->set('vendor_data',$vendor_data);\n\t}", "public function index() {\n $vendors = Vendor::with('users')->paginate(20);\n return view('vendors.index', compact('vendors'))->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function index()\n {\n $data['vendor'] = \\DB::table('data_vendor')->get();\n return view('vendor.index',$data);\n }", "public function index()\n {\n $vendors = Vendor::all();\n $brands = Brand::all();\n return view('admin.pages.brand.index')->withVendors($vendors)->withBrands($brands);\n }", "public function getVendorList() {\n $vendors = $this->couponServices_model->fetchVendors();\n\n $vendor_options = array();\n $vendor_options[\"\"] = \"-- Select vendor --\";\n foreach ($vendors as $company) {\n $vendor_options[$company['vendorId']] = $company['vendorName'];\n }\n return $vendor_options;\n }", "public function index()\n {\n $vendors = Vendor::paginate(8);\n return view('LDXPS.vendors.page', compact('vendors'))->with('i', (request()->input('page', 1) - 1) * 8);\n }", "public function page_vendors() {\n $action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';\n $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;\n\n switch ($action) {\n case 'view':\n $vendor = new \\WeDevs\\ERP\\People( $id );\n $template = dirname( __FILE__ ) . '/views/vendor/single.php';\n break;\n\n case 'edit':\n $template = dirname( __FILE__ ) . '/views/vendor/edit.php';\n break;\n\n case 'new':\n $template = dirname( __FILE__ ) . '/views/vendor/new.php';\n break;\n\n default:\n $template = dirname( __FILE__ ) . '/views/vendor/list.php';\n break;\n }\n\n if ( file_exists( $template ) ) {\n include $template;\n }\n }", "public function index()\n {\n $vendorvoyages = Vendorvoyage::all();\n return view('jasavoyagecharter.vendorvoyage.index', compact('vendorvoyages'));\n }", "public function index(Request $request)\n {\n \t\n $vendors = Vendor::all();\n return view('vendor.index', compact('vendors'));\n \n }", "public function index() {\n $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }", "public function index()\n {\n return view('manufacturers.index', ['manufacturers' => Manufacturer::orderBy('id', 'DESC')->paginate(15)]);\n }", "public function index()\n {\n $sellers = Seller::all();\n\n return $this->showAll($sellers);\n }", "public function index()\n {\n $suppliers = Supplier::all();\n return view('inventory.supplier.admin-inventory-supplier', compact('suppliers'));\n }", "public function stores_list()\n\t{\n\t\t$data['store_list']=$this->store->get_all();\n\t\t$data['page']='Store List';\n\t\t$view = 'admin/stores/admin_store_list_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function listStore() {\n\n return view('store.list');\n }", "public function actionIndex()\n\t{\n $vendorsList = array();\n $w9_to_review = array();\n $queryString = '';\n\n if (!isset($_SESSION['limiter'])) {\n $limit=Aps::DISPLAY_LIMIT;\n\n } else {$limit=$_SESSION['limiter'];}\n\n\n // set last vendors list\n //if (isset($_SESSION['last_w9_list_search'])) {\n $queryString = $_SESSION['last_w9_list_search']['query'];\n $searchOptions = $_SESSION['last_w9_list_search']['options'];\n $sortOptions = $_SESSION['last_w9_list_search']['sort_options'];\n //if (trim($queryString) != '') {\n $companies = new Companies();\n $vendorsList = $companies->getListByQueryString($queryString, $searchOptions, $sortOptions,$limit);\n //}\n //}\n\n // company ids to review\n if (isset($_SESSION['w9_to_review'])) {\n $w9_to_review = $_SESSION['w9_to_review'];\n }\n\n $current_client_w9 = W9::getW9ByClientID(Yii::app()->user->clientID);\n\n $this->render('index', array(\n 'vendorsList' => $vendorsList,\n 'w9_to_review' => $w9_to_review,\n 'current_client_w9'=>$current_client_w9[0],\n 'queryString' => $queryString,\n ));\n\t}", "public function index()\n {\n //Authentication\n auth_admin();\n $data = array();\n $vendor_list = $this->vendor_model->select();\n $data[\"vendor_list\"] = $vendor_list;\n $data[\"scripts\"] = array(\n \"scripts/admin/vendor.js\"\n );\n $data[\"main_content\"] = $this->load->view(\"admin/vendor\", $data, true);\n $this->load->view(\"admin/master\", $data);\n }", "public function getActivatedVendors();" ]
[ "0.7750374", "0.7575048", "0.7466686", "0.7423623", "0.7416827", "0.72081375", "0.7065438", "0.7029023", "0.6833207", "0.68277013", "0.68007344", "0.6795353", "0.6777362", "0.672532", "0.6716553", "0.66233325", "0.6610905", "0.66060156", "0.656041", "0.65595734", "0.65130514", "0.65046173", "0.6502781", "0.64675504", "0.63885003", "0.6374685", "0.63592166", "0.62922466", "0.6284005", "0.6274023" ]
0.8129548
0
Load a vendor based on the passed vendor ID.
private function LoadVendorById($id) { $query = " SELECT * FROM [|PREFIX|]vendors WHERE vendorid='".(int)$id."' "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); return $GLOBALS['ISC_CLASS_DB']->Fetch($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function vendor($vendor_id)\n\t{\n\t\t$this->_vendors_array('all');\n\t\t\n\t\tif (isset($this->vendors_cache[$vendor_id]))\n\t\t{\n\t\t\treturn $this->vendors_cache[$vendor_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->vendors_cache[1];\n\t\t}\n\t}", "public function getVendor($id) {\n try {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $vendor = $objVendor->getVendor($id);\n return $vendor;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($e);\n }\n }", "public function load($itemId, $vendorId){\r\n\t\t$sql = 'SELECT * FROM item_vendor_x WHERE item_id = ? AND vendor_id = ? ';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($itemId);\n\t\t$sqlQuery->setNumber($vendorId);\n\r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "abstract protected function getExistingVendorProduct(int $vendorProductId);", "public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }", "public function getVendorThatExists()\n {\n // Given\n $this->_mockApi->expects($this->once())\n ->method('getResource')\n ->with($this->equalTo(\"vendors/v1\"))\n ->will($this->returnValue(self::$VENDOR_RESPONSE));\n\n // When\n $result = $this->_vendorProvider->getById(\"v1\");\n\n // Then\n $this->assertResult($result);\n }", "public function showVendor($id)\n {\n $ven = MasterVendor::whereId($id)->first();\n \n if ($ven) {\n return response()->json([\n 'success' => true, \n 'message' => 'Retrieved Successfully!',\n 'data' => $ven,\n ], 200);\n }\n else {\n return response()->json([\n 'success' => false, \n 'message' => 'Retrieved Failed!',\n 'data' => '',\n ], 401);\n }\n \n }", "public function GetVendor($id=null){\n\t\theader('Access-Control-Allow-Origin:*');\n\t\t$this->load->model('BookingModel');\n\t\t$data['booking_id']=$this->input->post('booking_id');\n\t\t$data['vendor_id']=$this->input->post('vendor_id');\n\t\t$data['vendors']=$this->BookingModel->GetVendorOS($this->input->post('city'),$this->input->post('cab'),$this->input->post('type'));\n\n\t\t $data['companies']=$this->BookingModel->GetCompanyOS($this->input->post('booking_id'),$this->input->post('type'));\n\t\t\n\t\tif($this->input->post('type')==\"outstation\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorLists',$data,true);\n\t\t} else if($this->input->post('type')==\"local\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorLocal',$data,true);\n\t\t} else if($this->input->post('type')==\"transfer\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorTransfer',$data,true);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function particularvendorlist($id)\n\t{\n\t\t$getParvendor=\"SELECT * from vendor where vendor_id = $id\";\n\t\t$vendor_data=$this->get_results( $getParvendor );\n\t\treturn $vendor_data;\n\t}", "public function getVendor(int $vendorId): ?Vendor\n {\n return $this->getVendorsCollection()->getItemById($vendorId);\n }", "public function getVendorId() {}", "public function setVendor(string $vendor)\n {\n }", "public function update_vendor($id, $data)\n\t{\n\t\t// Unset, if neccessary\n\t\tif ($data['api_id'] == '0')\n\t\t\t$data['api_id'] = NULL;\n\t\t\n\t\tif (empty($data['orderemail']))\n\t\t\t$data['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['ordername'] = NULL;\n\t\t\n\t\t// Limit to this vendor_id\n\t\t$this->db->where('id', $id);\n\t\t\n\t\t// Perform an update\n\t\t$this->db->update('vendors', $data);\n\t}", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "public function get_vendor($id, $select=FALSE)\n\t{\n\t\t// Particular fields? Why select unnecessary stuff?\n\t\tif ($select)\n\t\t{\n\t\t\t// Limit the list of fields\n\t\t\t$this->db->select($select);\n\t\t}\n\t\t\n\t\t// Set id, limit to one and perform\n\t\t$q = $this->db\n\t\t\t->where('id',$id)\n\t\t\t->limit(1)\n\t\t\t->get('vendors');\n\t\t\n\t\t// If we got something\n\t\tif ($q->num_rows() > 0)\n\t\t{\n\t\t\tif (!empty($r->structure))\n\t\t\t{\n\t\t\t\t$r->structure = unserialize($structure);\n\t\t\t}\n\t\t\t\n\t\t\t$r = $q->row();\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t// Return false otherwise\n\t\treturn FALSE;\n\t}", "public function getIosVendorId();", "private static function vendor() {\n $file = Storange::getPathFile('vendor/autoload.php');\n if (file_exists($file)) {\n include_once $file;\n } else {\n throw new exceptions\\LoadFiles('Error to load vendor autoload. Check the composer libs', 0);\n }\n }", "public function show($id)\n {\n $data = Vendor::find($id);\n return view('apps.pages.setup.vendor.vendor',['data'=>$data]);\n }", "private function SetVendorData()\n\t{\n\t\tif(isset($_REQUEST['vendorid'])) {\n\t\t\t$this->vendor = $this->LoadVendorById($_REQUEST['vendorid']);\n\t\t}\n\t\telse if(isset($GLOBALS['PathInfo'][1]) && $GLOBALS['PathInfo'][1] != '') {\n\t\t\t$this->vendor = $this->LoadVendorByFriendlyName($GLOBALS['PathInfo'][1]);\n\t\t}\n\n\t\t// Viewing the products that belong to a specific vendor\n\t\tif((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] == 'products') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'products')) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'products';\n\t\t}\n\n\t\t// Viewing a specific page\n\t\telse if((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] != '') || isset($_REQUEST['pageid'])) {\n\t\t\t//\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'page';\n\t\t}\n\n\t\t// Viewing vendor profile\n\t\telse if(isset($GLOBALS['PathInfo'][1]) || isset($_REQUEST['vendorid'])) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\t\t\t$this->displaying = 'profile';\n\t\t}\n\n\t\t// Otherwise, just showing a list of vendors\n\t\telse {\n\t\t\t$this->displaying = 'vendors';\n\t\t}\n\t}", "public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "protected function getVendorOrder($id) {\n\n\t\t$this->load->model('sale/vdi_order');\n\n\t\t$products = $this->model_sale_vdi_order->getOrderProducts($id);\n //if there were no products in the order belonging to this vendor,\n //return immediately, without any data about the customer\n\t\tif (0 == sizeof($products)) {\n return;\n\t\t}\n\t\telse {\n $order = $this->model_sale_vdi_order->getOrder($id);\n\n $result = array(\n \"order_id\" => $order['order_id'],\n \"customer_id\" => $order['customer_id'],\n \"firstname\" => $order['firstname'],\n \"lastname\" => $order['lastname'],\n \"email\" => $order['email'],\n \"telephone\" => $order['telephone'],\n \"payment_method\" => $order['payment_method'],\n \"shipping_firstname\" => $order['shipping_firstname'],\n \"shipping_lastname\" => $order['shipping_lastname'],\n \"shipping_address_1\" => $order['shipping_address_1'],\n \"shipping_address_2\" => $order['shipping_address_2'],\n \"shipping_city\" => $order['shipping_city'],\n \"shipping_postcode\" => $order['shipping_postcode'],\n \"shipping_zone_id\" => $order['shipping_zone_id'],\n \"shipping_zone\" => $order['shipping_zone'],\n \"shipping_zone_code\" => $order['shipping_zone_code'],\n \"shipping_country_id\" => $order['shipping_country_id'],\n \"shipping_country\" => $order['shipping_country'],\n \"shipping_iso_code_2\" => $order['shipping_iso_code_2'],\n \"shipping_iso_code_3\" => $order['shipping_iso_code_3'],\n \"payment_firstname\" => $order['payment_firstname'],\n \"payment_lastname\" => $order['payment_lastname'],\n \"payment_address_1\" => $order['payment_address_1'],\n \"payment_address_2\" => $order['payment_address_2'],\n \"payment_city\" => $order['payment_city'],\n \"payment_postcode\" => $order['payment_postcode'],\n \"payment_zone_id\" => $order['payment_zone_id'],\n \"payment_zone\" => $order['payment_zone'],\n \"payment_zone_code\" => $order['payment_zone_code'],\n \"payment_country_id\" => $order['payment_country_id'],\n \"payment_country\" => $order['payment_country'],\n \"payment_iso_code_2\" => $order['payment_iso_code_2'],\n \"payment_iso_code_3\" => $order['payment_iso_code_3']\n );\n\n $result['products'] = $products;\n\n return $result;\n }\n\t}", "public function productVendorLoad()\n\t{\n\t\t$product_id = $this->request->input('product_id');\n\t\t$locality_change_val = $this->request->input('locality_change_val');\n\t\t$selectVendorLocationIdQuery = DB::select(\"SELECT vendor_location_id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM product_vendor_locations\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE product_id = '$product_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND id = '$locality_change_val'\");\n\n\t\t$selectVendorLocationId = $selectVendorLocationIdQuery[0]->vendor_location_id;\n\t\techo '<input type=\"hidden\" id=\"locality_val\" value=\"'.$selectVendorLocationId.'\">';\n\t}", "public function getVendorById($vendor_id)\n {\n list($response, $statusCode, $httpHeader) = $this->getVendorByIdWithHttpInfo ($vendor_id);\n return $response; \n }", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "public function getVendorByIdWithHttpInfo($vendor_id)\n {\n \n // verify the required parameter 'vendor_id' is set\n if ($vendor_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $vendor_id when calling getVendorById');\n }\n \n // parse inputs\n $resourcePath = \"/beta/vendor/{vendorId}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n \n // path params\n \n if ($vendor_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"vendorId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($vendor_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'GET',\n $queryParams, $httpBody,\n $headerParams, '\\Infoplus\\Model\\Vendor'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\Infoplus\\ObjectSerializer::deserialize($response, '\\Infoplus\\Model\\Vendor', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\Infoplus\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Infoplus\\Model\\Vendor', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function addVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->addVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function show(Vendor $vendor)\n {\n return new VendorResource($vendor);\n }", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }" ]
[ "0.72453403", "0.6600764", "0.6299133", "0.6267735", "0.6171514", "0.61668396", "0.61414427", "0.6044051", "0.6036914", "0.6005247", "0.5944102", "0.5917201", "0.59106094", "0.5908154", "0.5848394", "0.58427936", "0.58005047", "0.57660264", "0.5745602", "0.572483", "0.57180536", "0.5631014", "0.5617919", "0.5613772", "0.5611109", "0.55770797", "0.55580574", "0.55466425", "0.5520356", "0.550161" ]
0.7850961
0
Load a vendor based on the passed vendor friendly name.
private function LoadVendorByFriendlyName($friendlyName) { $query = " SELECT * FROM [|PREFIX|]vendors WHERE vendorfriendlyname='".$GLOBALS['ISC_CLASS_DB']->Quote($friendlyName)."' LIMIT 1 "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); return $GLOBALS['ISC_CLASS_DB']->Fetch($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function vendor() {\n $file = Storange::getPathFile('vendor/autoload.php');\n if (file_exists($file)) {\n include_once $file;\n } else {\n throw new exceptions\\LoadFiles('Error to load vendor autoload. Check the composer libs', 0);\n }\n }", "public static function vendor($name)\n {\n $path = isset(self::$vendors[$name]) ? self::$vendors[$name] : null;\n if ($path === null) {\n throw new ApplicationException('Unable to find vendor \"' . $name . '\"');\n }\n return $path;\n }", "protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }", "function loadChumpCarClass($className) {\n \t\n $DS = \"\\\\\";\n $INCSEP = \";\";\n \n if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $DS = \"\\\\\";\n $INCSEP = \";\";\n } else {\n $DS = \"/\";\n $INCSEP = \":\";\n }\n \n /*\n * if they aren't loading a chump car class, skip.\n * \n */\n \n if(!preg_match('/chumpcar/i', $className)) {\n return ;\n }\n \n /* \n * try to pull ou the vender name \n * \n */\n \n $pm = array();\n $vendor = \"\";\n $actual = \"\";\n $orig = str_replace(\"\\\\\" , '_', $className);\n \n if(preg_match('/^([^\\\\\\\\_]+)_/', $className, $pm)) {\n $vendor = $pm[1]; \t\n }\n \n if(preg_match('/([^\\\\\\\\_]+)$/', $className, $pm)) {\n $actual = $pm[1]; \t\n }\n \n if(empty($actual)) {\n error_log(\"[chumpcar\\autoloader] ERROR - can not determin actual class name ($className)\");\n return ; \t\n }\n \n /* \n * replace _ with the directory separator, class names\n * are mangled by prepending with namespaces separated by \n * _, this convention is intended to be usable accross \n * a variety of PHP versions, where namesapces many not \n * actually be implemented yet.\n * \n */\n \n $className = str_replace(\"_\" , $DS, $className);\n $className = str_replace(\"\\\\\" , $DS, $className);\n \n /* \n * the locations to search, we search from here down,\n * and from our parent directory down (because the\n * namespace may include our vendor name)\n * \n */\n \n $searchPaths = array(\n dirname(__FILE__),\n dirname(dirname(__FILE__))\n );\n $searchPaths = array_merge($searchPaths, explode($INCSEP, get_include_path()));\n \n $suffixes = array(\n \".php\",\n \".class.php\",\n \".inc\"\n );\n \n /* auto-load */\n \n $toRequire = \"\";\n foreach($searchPaths as $prefix) {\n \n /* next path */\n \t\n foreach($suffixes as $suffix) {\n \t\n \t/* next naming style */\n \t\n $classFile = $prefix.$DS.$className.$suffix;\n \n if(is_readable($classFile)) {\n \t\n $toRequire = $classFile; \n \t\n } else {\n \t\n $classSuffixes = array(\n \".com\",\n \".net\",\n \".org\"\n );\n foreach($classSuffixes as $classSuffix) {\n \t\n \t$pm = array();\n \tif(preg_match('/^([^\\\\\\\\\\/]+)([\\\\\\\\\\/]+)(.*)$/',$className, $pm)) {\n $otherName = $pm[1].$classSuffix.$DS.$pm[3];\n $classFile = $prefix.$DS.$otherName.$suffix;\n \n if(is_readable($classFile)) {\n $toRequire = $classFile;\n break; \n }\n \t}\n }\n if(!empty($toRequire)) {\n break;\n }\n }\n }\n if(!empty($toRequire)) {\n \tbreak;\n }\n }\n \n if(empty($toRequire)) {\n \n /* we failed to find the class */\n\n error_log(\"[chumpcar\\autoloader] ERROR - can not find class file for '$className'.\");\n error_log(\"[chumpcar\\autoloader] ERROR - search path was: \".implode($INCSEP, $searchPaths));\t\n return ;\n }\n\n /* require it */\n \n require_once($toRequire);\n \n /* \n * if we have the ability to create class name aliases,\n * then do it, and create an unqualified name for the\n * class in the current script.\n * \n */\n\n if(version_compare(phpversion(), '5.3.0', '>')) {\n if(class_exists($orig,false)||interface_exists($orig,false)) { \n if(!class_exists($actual)&&!interface_exists($actual)) {\n class_alias($orig, $actual);\n }\n }\n }\n \n /* all done */\n }", "public function vendor($vendor_id)\n\t{\n\t\t$this->_vendors_array('all');\n\t\t\n\t\tif (isset($this->vendors_cache[$vendor_id]))\n\t\t{\n\t\t\treturn $this->vendors_cache[$vendor_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->vendors_cache[1];\n\t\t}\n\t}", "public function setVendor(string $vendor)\n {\n }", "private function LoadVendorById($id)\n\t{\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tWHERE vendorid='\".(int)$id.\"'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\treturn $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t}", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "public function getVendorThatExists()\n {\n // Given\n $this->_mockApi->expects($this->once())\n ->method('getResource')\n ->with($this->equalTo(\"vendors/v1\"))\n ->will($this->returnValue(self::$VENDOR_RESPONSE));\n\n // When\n $result = $this->_vendorProvider->getById(\"v1\");\n\n // Then\n $this->assertResult($result);\n }", "public function getVendorName(): string;", "function autoload($name) {\r\n require strtolower($name) . '.php';\r\n}", "public function load($name);", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "public function getVendorName(): string\n {\n return 'local';\n }", "public function show(Vendor $vendor)\n {\n return new VendorResource($vendor);\n }", "private function get_vendor_base_url($vendor){\n switch (strtolower($vendor)) {\n case 'dotclick':{\n return 'http://csms.dotklick.com/';\n }\n break; \n default:{\n return 'https://akspk.com';\n }\n break;\n }\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function show(Vendor $vendor)\n {\n //\n }", "public function addVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->addVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "protected function get(string $name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }", "public function getVendor()\n {\n return $this->_coreRegistry->registry('current_vendor');\n }", "public function getVendorByName(Request $request)\n {\n $q = $request->get('q');\n\n return Vendor::where('name', 'like', \"%$q%\")->paginate(null, ['id', 'name as text']);\n }", "public static function load($name) {\n\t $name = str_replace(\"\\\\\", DS, $name);\n\t\t$imagineBase = \\Configure::read('Imagine.base');\n\t\tif (empty($imagineBase)) {\n\t\t\t$imagineBase = \\CakePlugin::path('Imagine') . 'Vendor' . DS . 'Imagine' . DS . 'lib' . DS;\n\t\t}\n\n\t\t$filePath = $imagineBase . $name . '.php';\n\t\tif (file_exists($filePath)) {\n\t\t\trequire_once($filePath);\n\t\t\treturn;\n\t\t}\n\n\t\t$imagineBase = $imagineBase . 'Image' . DS;\n\t\tif (file_exists($imagineBase . $name . '.php')) {\n\t\t\trequire_once($imagineBase . $name . '.php');\n\t\t\treturn;\n\t\t}\n\t}", "abstract protected function getExistingVendorProduct(int $vendorProductId);", "protected function get($name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }", "public function getVendor($id) {\n try {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $vendor = $objVendor->getVendor($id);\n return $vendor;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($e);\n }\n }", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "protected function _loadPlugin($name)\n {\n $class = \"$name\\\\$name\";\n if ( class_exists($class,true) ) {\n return $class;\n } else {\n // try to require plugin class from plugin path\n return $this->tryRequire($name);\n }\n }", "private function SetVendorData()\n\t{\n\t\tif(isset($_REQUEST['vendorid'])) {\n\t\t\t$this->vendor = $this->LoadVendorById($_REQUEST['vendorid']);\n\t\t}\n\t\telse if(isset($GLOBALS['PathInfo'][1]) && $GLOBALS['PathInfo'][1] != '') {\n\t\t\t$this->vendor = $this->LoadVendorByFriendlyName($GLOBALS['PathInfo'][1]);\n\t\t}\n\n\t\t// Viewing the products that belong to a specific vendor\n\t\tif((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] == 'products') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'products')) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'products';\n\t\t}\n\n\t\t// Viewing a specific page\n\t\telse if((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] != '') || isset($_REQUEST['pageid'])) {\n\t\t\t//\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'page';\n\t\t}\n\n\t\t// Viewing vendor profile\n\t\telse if(isset($GLOBALS['PathInfo'][1]) || isset($_REQUEST['vendorid'])) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\t\t\t$this->displaying = 'profile';\n\t\t}\n\n\t\t// Otherwise, just showing a list of vendors\n\t\telse {\n\t\t\t$this->displaying = 'vendors';\n\t\t}\n\t}" ]
[ "0.6227921", "0.62190944", "0.60749084", "0.59802634", "0.5955264", "0.59233123", "0.5896874", "0.57646567", "0.5757373", "0.56738526", "0.55490035", "0.5510682", "0.5489889", "0.54622346", "0.54505336", "0.54214114", "0.54212606", "0.537454", "0.5317934", "0.5303057", "0.5286594", "0.5252365", "0.5249529", "0.5236446", "0.5207051", "0.5196252", "0.5183527", "0.51753753", "0.515732", "0.51461595" ]
0.7137081
0
Create a complete key from the trace and current level.
protected function composeKey() { $this->path = array_merge($this->trace, [$this->lastKey]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pmprorss_after_level_change_generate_key( $level_id, $user_id, $cancel ) {\r\n\r\n\tpmpromrss_getMemberKey( $user_id );\r\n\r\n}", "public function new_api_key($level,$ignore_limits,$is_private_key,$ip_addresses)\r\n {\r\n //generamos la key\r\n $key = $this->generate_token();\r\n //comprobamos si existe\r\n $check_exists_key = $this->db->get_where(\"keys\", array(\"key\" => $key));\r\n\r\n //mientras exista la clave en la base de datos buscamos otra\r\n while($check_exists_key->num_rows() > 0){\r\n $key = \"\";\r\n $key = $this->generate_token();\r\n }\r\n //creamos el array con los datos\r\n $data = array(\r\n \"key\" => $key,\r\n \"level\" => $level,\r\n \"ignore_limits\" => $ignore_limits,\r\n \"is_private_key\"=> $is_private_key,\r\n \"ip_addresses\" => $ip_addresses\r\n );\r\n\r\n $this->db->insert(\"keys\", $data);\r\n return $key;\r\n }", "public function buildKey($key): string;", "protected function _createKey() {\n return new PapayaDatabaseRecordKeyFields(\n $this,\n $this->_tableName,\n array('source_id', 'target_id')\n );\n }", "abstract protected function generateKey();", "function generateKey($attribs, $keyBefore){\n //call default method\n return($this->generateKeyDefault($attribs, $keyBefore));\n }", "private function getAPIKey($levelKey){\n $currentKey = $this->getUserKeyLevel();\n\n if ($currentKey[1] < $levelKey) {\n throw new SlicingDiceException(\"The key inserted is not allowed to perform this operation.\");\n } else {\n return $currentKey[0]; \n }\n }", "public function createNewKeyPair() {}", "public function createNewKeyPair() {}", "public function createKeyString()\n\t{\n\t\t$keystring = $this->factory->createKeyString( $this ) ;\n\t\treturn $keystring ;\n\t}", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "private function makeSigningKey() {\r\n\t\t$signing_key = $this->makeBase64HmacSha256($this->timestamp, $this->client_secret);\r\n\t\t$this->verbose('signing_key', $signing_key);\r\n\t\treturn $signing_key;\r\n\t}", "private function newKey()\n {\n $kp = sodium_crypto_box_keypair();\n //$pk = sodium_crypto_box_secretkey($kp);\n return $kp;\n }", "public function makeKey(int $productId): string\n {\n return self::SESSION_PREFIX.$productId;\n }", "protected function _generateKey()\n {\n $key = '';\n ksort($this->_keyData); //so that the order of the array doesn't matter in the key that is generated.\n foreach ($this->_keyData as $i => $val) {\n //\"clean\" the data some\n if (is_numeric($val)) {\n $val = (float)$val;\n //force it to be 4 decimal places every single time, and use thousands\n //seperator, just because we can and we need all numbers to be uniform\n //so they look the same even after getting sent to the database and coming back again.\n $val = number_format($val, 4, '.', ',');\n } else {\n $val = trim($val);\n }\n //NOTE: May need to do further \"cleaning\" to ensure value always stays\n //the same even after getting sent to and from the DB... if so do that\n //cleaning here, NOT outside of this class... we need 1 solution in 1\n //place, not 20 different solutions...\n\n $key = \"$i:_:{$key}:_:$val\";\n }\n //If debug enabled, show what the key is before hash, so we can troubleshoot\n //problems caused by the key changing when trying to decrypt.\n if (self::DEBUG) {\n trigger_error('DEBUG CRYPT: Key used before hash=' . $key);\n }\n $this->_keyString = sha1($key);\n }", "public function getNewEntriesKey(): string;", "abstract public function createNewKeyPair() ;", "private function newKey($prio, $is_default = false)\n {\n if (empty($this->cached_gateways)) {\n $this->gatewaySeq = 1;\n }\n if ($prio > 255) {\n $prio = 255;\n }\n return sprintf(\"%01d%04d%010d\", $is_default, 256 - $prio, $this->gatewaySeq++);\n }", "public function createTrackKey($save = TRUE)\n\t{\n\t\t$track_key = $this->statpro->createTrackKey();\n\t\t\n\t\tif ($save) $this->track_key = $track_key;\n\t\t\n\t\treturn $track_key;\n\t}", "function c_kv($arr)\n {\n if ( ! array_has($arr, ['k', 'v', 'ins_name', 'ins_id']))\n return ee(2);\n $ins = M($arr['ins_name'], 'kv');\n $r = $ins->create($arr);\n return $r ? ss($ins) : ee(1);\n }", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public static function createKey() {\r\n $MIN = 100000;\r\n $MAX = 922337203685477580;\r\n return mt_rand($MIN,$MAX);\r\n }" ]
[ "0.5731029", "0.56426436", "0.5442973", "0.54338914", "0.54260725", "0.52352804", "0.5192007", "0.5114318", "0.5114295", "0.50951606", "0.50743616", "0.505756", "0.50247395", "0.50134826", "0.49886194", "0.49650538", "0.4951346", "0.4929325", "0.49213785", "0.4906456", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.4900998", "0.48983842" ]
0.5840952
0
Remember a value into the provided value property.
protected function rememberValue( array $path, $value ) { $this->setValue($this->value, $path, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRememberToken($value) {\n dd('asd2f');\n if (! empty($this->getRememberTokenName())) {\n $this->{$this->getRememberTokenName()} = $value;\n }\n }", "public function setValue($value)\n {\n $this->_value = new Zend_Memory_Value($value, $this);\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "protected function setInStorage($property, $value)\n {\n $data = $this->getStorage();\n $data[$property] = $value;\n $this->setStorage($data);\n }", "public function setRememberToken($value)\n {\n $this->{$this->getRememberTokenName()} = $value;\n }", "public function value($value) {\n return $this->setProperty('value', $value);\n }", "public final function set($property, $value) \n\t{\n\t\t$_SESSION[$property] = $value;\n\t}", "public function setRememberToken($value)\n {\n $_token = $value;\n }" ]
[ "0.6398365", "0.6385415", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6302936", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6288608", "0.6287806", "0.6287806", "0.6260515", "0.62601537", "0.62178946", "0.6217272", "0.6190095" ]
0.7306414
0
Get notified about a new value, including complete path.
abstract public function gotValue( array $path, $value );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "function getChanged() {\n return $this->changed;\n }", "function getInfoChange($value, $field) {\n $id = $this->getVal($value, 'id');\n $newValue = $this->getRequestVal($field . $id);\n ($newValue) ? $return = $newValue : $return = $this->getVal($value, $field);\n return $return;\n }", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "public function observe() {}", "public static function send_profile_data_on_update( $old_value, $value ) {\n\t\tif ( ! isset( $value['completed'] ) || ! $value['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::send_profile_data();\n\t}", "public function setModified($value) {}", "public function getNewValue()\n {\n return $this->new_value;\n }", "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "public function getUpdated();", "public function getUpdated();", "public function getChange();", "public function update( \\Aimeos\\MW\\Observer\\Publisher\\Iface $p, $action, $value = null );", "public function getConfigChanged();", "public function measurementsChanged()\n {\n $this->notifyObservers();\n }", "public function setChanged($value)\n {\n return $this->_changed = (bool) $value;\n }", "public function push($value): void {}", "public function push($value): void {}", "public function push(string $path, $value)\n {\n return static::pushToPath($this->store, $path, $value);\n }", "public function hasChanged();", "public function hasChanged();", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "protected function rememberValue( array $path, $value ) {\n\t\t$this->setValue($this->value, $path, $value);\n\t}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function setPath(?string $value): void {\n $this->getBackingStore()->set('path', $value);\n }", "public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }", "public function isValueChanged();", "public function setChanged()\n {\n\n $this->_changed = true;\n\n }", "public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }", "private function changed()\n {\n $this->isDirty = true;\n }" ]
[ "0.5464466", "0.5256491", "0.52215356", "0.52132374", "0.5208679", "0.51402146", "0.51240957", "0.5103921", "0.50503993", "0.5049621", "0.5049621", "0.50245166", "0.5019494", "0.5014185", "0.5012766", "0.500505", "0.50029325", "0.50029325", "0.49880382", "0.49784255", "0.49784255", "0.49286136", "0.49117824", "0.4907606", "0.49064013", "0.4899077", "0.48897004", "0.48664927", "0.4860171", "0.48568144" ]
0.6074796
0
Lists all Peserta entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $paginator = $this->get('knp_paginator'); $query = $em->getRepository('AppBundle:Peserta')->dataAllQuery(); $pagination = $paginator->paginate( $query, $this->get('request')->query->get('page', 1), 25 ); return array( 'entities' => $pagination, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PruebasBundle:Paciente')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ArmensaViajesBundle:Viaje')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SmathEmpresaBundle:Empleado')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Entity::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DGPlusbelleBundle:SesionVentaTratamiento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MinsalsifdaBundle:SifdaEquipoTrabajo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4CampeonatoBundle:Partido')->findAll();\n //$e_h_p = $em->getRepository('Area4CampeonatoBundle:Equipo_has_Partido')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VCReservasBundle:Reserva')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getAllEntities();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('LicenciaBundle:AdmTipoAporte')->findAll();\r\n $paginator = $this->get('knp_paginator');\r\n $pagination = $paginator->paginate(\r\n $entities,\r\n $this->get('request')->query->get('page', 1) /*page number*/,\r\n 10\r\n );\r\n return array(\r\n 'entities' => $pagination,\r\n );\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager(\"ms_haberes_web\");\n\n $entities = $em->getRepository('LiquidacionesCuposAnualesBundle:Liquidaciones')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CpmJovenesBundle:Tema')->findAllQuery();\n \n return $this->paginate($entities);\n \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('JobHubBundle:Pays')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('INHack20InventarioBundle:Estado')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CmarMeetingBundle:Meeting')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('PruebasBundle:Turno')->findAll();\n return array('entities' => $entities,);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('INHack20EquipoBundle:Componente')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function indexAction() {\n\t$em = $this->getDoctrine()->getManager();\n\n\t$entities = $em->getRepository('MagypRendicionDeCajaBundle:Comprobante')->findAll();\n\n\treturn array(\n\t 'entities' => $entities,\n\t);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CostoOfertaBundle:OfertaProceso')->findAll();\n\n return $this->render('CostoOfertaBundle:OfertaProceso:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SuperAdminBundle:Departamento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BEEServicesBeeeaseBundle:ActionListe')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function listarEmpresasAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$empresa = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarEmpresa.html.twig', array('empresa'=>$empresa));\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('tBundle:UserToTask')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function listAll() \n { \n $tipoEncargados = $this->tipoEncargadoDao->listAll();\n $tipoEncargadoArreglo = array();\n foreach ( $tipoEncargados as $indice => $tipoEncargado ){\n $arreglo = array(\n 'id' => $tipoEncargado->getId(),\n 'etiqueta' => $tipoEncargado->getEtiqueta()\n );\n $tipoEncargadoArreglo[] = $arreglo;\n } \n return response( $tipoEncargadoArreglo , 200)->header('Content-Type', 'application/json');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminBundle:FuncionarioEmpresa')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }" ]
[ "0.70261055", "0.69781893", "0.6914875", "0.6900689", "0.6827159", "0.6733879", "0.6704343", "0.6655739", "0.6638931", "0.66299975", "0.65648454", "0.65525806", "0.65171635", "0.6507406", "0.65019435", "0.65000665", "0.649667", "0.6480085", "0.6453938", "0.64181656", "0.6416877", "0.6416708", "0.63987345", "0.63950306", "0.6387576", "0.6382907", "0.6364365", "0.6356707", "0.6342864", "0.63355595" ]
0.76476294
0
Modify control in such a way that it explicitly shows its validation state. Returns the modified element.
public function showValidation(Html $control): Html;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showValidation(Html $control)\n\t{\n\t\t$input = $control->getChildren()[0];\n\n\t\t/** @var BootstrapRenderer $renderer */\n\t\t$renderer = $this->getForm()->getRenderer();\n\n\t\t$renderer->configElem(\n\t\t\t$this->hasErrors() ? RendererConfig::inputInvalid : RendererConfig::inputValid,\n\t\t\t$input\n\t\t);\n\n\t\treturn $control;\n\t}", "public function getControl(): Nette\\Utils\\Html\n\t{\n\t\treturn parent::getControl()\n\t\t\t->setText((string) $this->getRenderedValue());\n\t}", "function cps_changeset_edit_form_validate($form, &$form_state) {\n}", "function render() {\n foreach ($this->request['invalid_elements'] as $element) {\n foreach ($element->errors as $error) {\n drupal_set_message($error, 'error');\n }\n }\n\n return parent::render();\n }", "protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }", "public function getControl()\r\n {\r\n return $this->_checkBoxTreeRender($this->_getTree());\r\n }", "protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }", "public function getControlHtml()\n {\n if ( isset( $this->_arrProperties['value'] ) \n && $this->_arrProperties['value'] == 1 ) {\n $this->arrAttributes['checked'] = 'checked';\n }\n \n $this->arrAttributes['type'] = 'checkbox';\n \n return parent::getControlHtml();\n }", "public function validateElement() {\r\n if (!$this->object->validate()) {\r\n /** @var modValidator $validator */\r\n $validator = $this->object->getValidator();\r\n if ($validator->hasMessages()) {\r\n foreach ($validator->getMessages() as $message) {\r\n $this->addFieldError($message['field'], $this->modx->lexicon($message['message']));\r\n }\r\n }\r\n }\r\n }", "public function setInvalid();", "public function validate()\n {\n return $this;\n }", "function validate() {\n\t return parent::validate();\n\t}", "function validate() {\n\t return parent::validate();\n\t}", "public function modifyFormElement()\n {\n $el = $this->getElement();\n if (!$el) {\n /**\n * @uses Parsonline_Exception_ContextException\n */\n require_once('Parsonline/Exception/ContextException.php');\n throw new Parsonline_Exception_ContextException(\n \"No form element is assigned to the element modifier yet\"\n );\n }\n $separator = $this->getSeparator();\n $additionalTitles = implode($separator, $this->getTitles());\n if (!$additionalTitles) return $this;\n \n $title = $el->getAttrib('title');\n $placement = $this->getPlacement();\n \n if (!$title) {\n $newTitle = $additionalTitles;\n } elseif ($placement === self::PREPEND) {\n $newTitle = $additionalTitles . $separator . $title;\n } else {\n if (!strrpos($title, $separator)) $title .= $separator;\n $newTitle = $title . $additionalTitles;\n }\n \n $el->setAttrib('title', $newTitle);\n return $this;\n }", "public function setNonEditable() {\n\n if($this->controlID != null) {\n throw new BadMethodCallException('You cannot set styles after the control is added to the UI.');\n }\n\n $this->style = self::NON_EDITABLE;\n }", "public function validate()\n {\n $result = parent::validate();\n \n if ($result === true)\n $this->setErrorMessage('');\n else\n $this->setErrorMessage(Resources::getValue(Resources::SRK_FORM_ERRORGENERIC));\n \n return $result;\n }", "function pmi_form_element($element, $value) {\n $t = get_t();\n\n $output = '<div';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\" class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n//echo $output; exit;\n\n return $output;\n}", "public function withValidation()\n {\n $this->enableValidation = true;\n return $this;\n }", "public function render() {\n /* verify all fields except checkbox */\n if($this->required\n && $this->form->isSubmitted()\n && !$this->checkValue()) {\n $this->error = TRUE;\n $this->cssClass = 'error';\n }\n\n /* verify checkbox */\n $tempName = str_replace('[]', NULL, $this->name);\n\n if($this->required\n && $this->form->isSubmitted()\n && $this->type == 'checkbox'\n && !isset($_REQUEST[$tempName])) {\n $this->error = TRUE;\n $this->cssClass = 'error';\n }\n\n $html = NULL;\n $this->value = htmlspecialchars($this->value);\n\n $html .= '<input type=\"'.$this->type.'\" id=\"'.$this->id.'\" name=\"'.$this->name.'\" value=\"'.$this->value.'\"';\n $html .= (bool)$this->size ? ' size= \"'.$this->size.'\"' : NULL;\n $html .= (bool)$this->maxlength ? ' maxlength= \"'.$this->maxlength.'\"' : NULL;\n $html .= (bool)$this->size ? ' size=\"'.$this->size.'\"' : NULL;\n $html .= ($this->type == 'text' || $this->type == 'password') ? ' class=\"' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'submit') ? ' class=\"submit ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'checkbox') ? ' class=\"checkbox ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'radio') ? ' class=\"radio ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'image') ? ' source=\"'.$this->source.'\"' : NULL;\n $html .= ($this->type == 'image' && (bool)$this->width && (bool)$this->height) ? ' style=\"width:'.$this->width.'px; height:'.$this->height.'px;\"' : NULL;\n $html .= (bool)$this->checked ? ' checked' : NULL;\n $html .= ' />';\n\n if (isset($this->label)) {\n $html .= '<span class=\"label\">' . $this->label . '</span>';\n }\n\n $this->html = ($this->type == 'hidden') ? $html : $this->wrap($html);\n }", "public function RenderElement() {\n\n // prepare most important attributes\n $Attr= $this->BuildAttributes(array('type'=>'checkbox'));\n // prepare attribute \"value\", remember - this is not value of [$Value, $InitValue]\n $Attr['value']= $this->GetOption('Value');\n // prepare attribute \"checked\"\n $Attr['checked']= $this->IsChecked() ? 'checked' : '';\n // render tag\n return $this->Form->RenderTag('input', $Attr, false);\n }", "public function validation($value) {\n return $this->setProperty('validation', $value);\n }", "public function getControl()\n\t{\n\t\t$control = parent::getControl();\n\t\t$control->addAttributes(array(\n\t\t\t'id' => $this->getHtmlId(),\n\t\t));\n\t\treturn $control;\n\t}", "private function checkError(): self\n {\n if (! $this->hasError()) {\n return $this;\n }\n\n $class = $this->get('class');\n\n if (is_null($class)) {\n $this->set('class', ' is-invalid');\n\n return $this;\n }\n\n return $this->set('class', $class.' is-invalid');\n }", "public function getControl()\n {\n return \\Nette\\Forms\\Controls\\BaseControl::getControl()->checked($this->value);\n }", "public function getValidation()\n {\n return $this->_objValidation;\n }", "public function renderElement($element)\r\n\t{\r\n\t\tif ($element instanceof TbFormInputElement) {\r\n\t\t\tif ($element->type === 'hidden') {\r\n\t\t\t\treturn \"<div style=\\\"display:none\\\">\\n\" . $element->renderInput() . \"</div>\\n\";\r\n\t\t\t} else {\r\n\t\t\t\treturn $element->render();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn parent::renderElement($element);\r\n\t}", "function validate()\n {\n $this->validation_error = '';\n return $this->_on_validate();\n }", "function webform2html_edit_form_validate($form, &$form_state) {\n if ($form_state['values']['op'] == t('Save')) {\n/* if (!empty($form_state['values']['h_txt'])) {\n $header = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['h_txt']) ) );\n if ( count($header) > 5) {\n form_set_error('h_txt', t('Up to 5 rows can be set!'));\n }\n }\n\n if (!empty($form_state['values']['f_txt'])) {\n $footer = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['f_txt']) ) );\n if ( count($footer) > 2) {\n form_set_error('f_txt', t('Up to 2 rows can be set!'));\n }\n }\n\n if (!(is_numeric($form_state['values']['h_font_size']) && ($form_state['values']['h_font_size'] > 0))) {\n form_set_error('h_font_size', t('Header font size must be numeric.'));\n }\n\n if (!(is_numeric($form_state['values']['p_font_size']) && ($form_state['values']['p_font_size'] > 0))) {\n form_set_error('p_font_size', t('Content font size must be numeric.'));\n }\n\n if (!(is_numeric($form_state['values']['f_font_size']) && ($form_state['values']['f_font_size'] > 0))) {\n form_set_error('f_font_size', t('Footer font size must be numeric.'));\n }\n*/\n }\n}", "public function getControl()\n\t{\n\t\t$container = clone $this->container;\n\t\t$separator = (string) $this->separator;\n\t\t$control = parent::getControl();\n\t\t$id = $control->id;\n\t\t$counter = 0;\n\t\t$value = $this->value === NULL ? NULL : (string) $this->getValue();\n\t\t$label = /*Nette\\Web\\*/Html::el('label');\n\n\t\tforeach ($this->items as $key => $val) {\n\t\t\t$control->id = $label->for = $id . '-' . $key;\n\t\t\t$control->checked = (string) $key == $value;\n\t\t\t$control->value = $key;\n\n\t\t\t/* Novak - vse bude HTML */\n\t\t\t/*if ($val instanceof Html) {\n\t\t\t\t$label->setHtml($val);\n\t\t\t} else {\n\t\t\t\t$label->setText($val);\n\t\t\t}*/\n\t\t\t$label->setHtml($val);\n\n\t\t\t// za posledni polozkou nebude oddelovac\n\t\t\tif($counter == count($this->items)-1) $separator = \"\";\n\n\t\t\t$container->add((string) $control . (string) $label . $separator);\n\t\t\t$counter++;\n\n\t\t}\n\n\t\treturn $container;\n\t}", "function _renderCheck($element) {\n $messages = $this->getMessagesFor($element->getName());\n $hasMessages = count($messages) > 0 ? TRUE : FALSE;\n\n $divError = $hasMessages ? \"has-error\" : \"\";\n $html = \"<div class=\\\"checkbox {$divError}\\\">\";\n $html .= \"<label for=\\\"{$element->getName()}\\\">{$this->render($element->getName())} {$element->getLabel()}</label>\";\n if ($hasMessages)\n $html .= \"<span class=\\\"help-block\\\">{$messages[0]}</span>\";\n $html .= \"</div>\";\n return $html;\n }" ]
[ "0.6486923", "0.5226122", "0.51745856", "0.5138641", "0.5123989", "0.51057434", "0.5105056", "0.50982845", "0.50856894", "0.5050322", "0.50332", "0.5009262", "0.5009262", "0.4969711", "0.49557018", "0.49370974", "0.49227545", "0.49195114", "0.4911167", "0.488827", "0.48259428", "0.48180205", "0.4812781", "0.480389", "0.47896746", "0.47596547", "0.47389972", "0.4716075", "0.4715381", "0.4711166" ]
0.6423105
1
Extracts the specified stub project.
private static function extractStubProject($filename) { //die(self::$stubDirectory . DIRECTORY_SEPARATOR . $filename); $stub_archive = new ZipArchive(); if ($stub_archive->open(self::$stubDirectory . DIRECTORY_SEPARATOR . $filename)) { $stub_archive->extractTo(self::$stubDirectory); $stub_archive->close(); } else { throw new \RuntimeException("Unable to extract the stub project archive from {$filename}!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public function getProject();", "public function setUp(): void\n {\n try {\n self::extractStubProject('example_project.zip');\n self::extractStubProject('no_tags_project.zip');\n } catch (\\RuntimeException $exception) {\n $this->fail($exception->getMessage());\n }\n parent::setUp();\n }", "private function getStub()\n {\n return $this->files->get($this->stubPath);\n }", "public function getProjectInfo(): ProjectInfoInterface;", "public function getGathercontentProject();", "function project_by_index($index) {\n $project = $this->parsed_items[$this->projects[$index]];\n return $project;\n }", "public function get($project);", "private function extract(): void\n {\n if (file_exists($this->tmpDir) && is_dir($this->tmpDir)) {\n $this->rrmdir($this->tmpDir);\n }\n\n mkdir($this->tmpDir);\n\n $this->zipClass->open($this->path);\n $this->zipClass->extractTo($this->tmpDir);\n\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {\n $this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));\n $index++;\n }\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getFooterName($index))) {\n $this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));\n $index++;\n }\n\n $this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());\n\n $this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());\n\n $this->document = file_get_contents(sprintf('%s%sword%sdocument.xml', $this->tmpDir, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function getProject(): ProjectContract\n {\n return $this->project;\n }", "public function extract(Package $package);", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "protected function getStub()\n {\n return file_get_contents(__DIR__ . '/../../Stubs/' . ucfirst($this->type() . 'Task.php'));\n }", "protected function getStub()\n {\n //\n }", "protected function compileMigrationStub()\n {\n $stub = $this->files->get(__DIR__ . '/../stubs/migration.stub');\n $this->replaceClassName($stub)\n ->replaceSchema($stub)\n ->replaceTableName($stub);\n return $stub;\n }", "public function project_info (Project $project)\n {\n return $project;\n }", "protected function getStubContents($stub)\n {\n $file_path = config('plugins.paths.plugins') . 'PluginBuilder/Console/Commands/stubs/' . $stub . '.stub';\n if ($this->filesystem->exists($file_path)) { // the stub exists\n return (new Stub(\n $file_path,\n $this->getReplacement())\n )->render();\n }\n }", "protected function copyStubToProject(): bool\n {\n return copy(\n $this->getStub(),\n $this->laravel->basePath('.php_cs')\n );\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/repository-interface.stub';\n }", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "private function getStub()\n {\n return app_path() . '\\Stubs\\repository_contract.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/repository.stub';\n }", "protected function getStub()\n {\n return $this->files->get($this->getStubPath().'/default.stub');\n }", "protected function givenAProjectMock()\n {\n return m::mock('phpDocumentor\\Descriptor\\ProjectDescriptor')->shouldIgnoreMissing();\n }", "public function extract();", "public function extract();", "protected function getStub()\n\t{\n\t\treturn __DIR__.'/stubs/api.stub';\n\t}", "protected function getStub()\n {\n return __DIR__.'/../stubs/composer.stub';\n }", "protected function getStub()\n {\n }" ]
[ "0.5373271", "0.53640515", "0.53146476", "0.51849705", "0.5161167", "0.5044851", "0.49952427", "0.49860922", "0.49542722", "0.49417424", "0.49267992", "0.4897874", "0.4879899", "0.4878462", "0.48598638", "0.48502138", "0.48323268", "0.4827383", "0.48273137", "0.48207086", "0.48061547", "0.47796333", "0.4776563", "0.47683248", "0.47637284", "0.4742649", "0.4742649", "0.47264636", "0.47199333", "0.47074506" ]
0.709411
0
TODO Name validation here;
function _name_check($str){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forName();", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "abstract protected function getName();", "abstract protected function getName();", "abstract function getName();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function name($name);", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract protected function getName() : string;", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n if ($this->get_limiter_id_by_name($this->initial_data[\"name\"], true)) {\n $this->id = $this->get_limiter_id_by_name($this->initial_data[\"name\"]);\n } else {\n $this->errors[] = APIResponse\\get(4209);\n }\n } else {\n $this->errors[] = APIResponse\\get(4167);\n }\n }", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n if ($this->get_limiter_id_by_name($this->initial_data[\"name\"], true)) {\n $this->parent_id = $this->get_limiter_id_by_name($this->initial_data[\"name\"]);\n } else {\n $this->errors[] = APIResponse\\get(4209);\n }\n } else {\n $this->errors[] = APIResponse\\get(4167);\n }\n }", "public function getNameBasic()\n {\n $generator = All::create();\n $name = $generator->getName();\n $this->assertRegexp('/.+/', $name);\n }", "public function get_name();", "public function get_name();", "public function get_name();" ]
[ "0.77205676", "0.7173988", "0.7173988", "0.7173988", "0.7087099", "0.7087099", "0.69720787", "0.69623166", "0.69623166", "0.69623166", "0.69623166", "0.69590634", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.6950729", "0.686793", "0.6781483", "0.67534274", "0.674694", "0.6739536", "0.6739536", "0.6739536" ]
0.74323785
1