query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get the purchaseable entity given the type and ID.
public static function getPurchaseable(string $type, mixed $id) : mixed { return Product::findOrFail($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function find($id){\n return Purchase::find($id);\n }", "public function getItemById($id)\n {\n return $this->type->find($id);\n }", "public function get($typeId);", "private function getEntity($id) {\n // when the request uses the internal id the given id starts with an underscore\n if(substr($id, 0, 1) == '_') {\n // get entity via _internal_id\n return Entity::findOrFail(substr($id, 1));\n } else {\n // get entity via GIS id\n return Entity::where('id', $id)->firstOrFail();\n }\n }", "protected function getEntityFromStorage() {\n $entity_type = $this->store->get('entity_type');\n $entity_id = $this->store->get('entity_id');\n\n /** @var \\Drupal\\Core\\Entity\\EntityInterface $entity */\n $entity = $this->entityTypeManager()->getStorage($entity_type)\n ->load($entity_id);\n\n return $entity;\n }", "protected function getEntity($entityId)\n {\n // is entityId is numeric then assume it is a transaction ID\n if (is_numeric($entityId)) {\n return $this->getRepo($this->repo)->fetchById($entityId);\n }\n\n // if not numeric assume it is a transaction reference\n return $this->getRepo($this->repo)->fetchByReference($entityId);\n }", "public function getPurchasableEntityTypeId();", "function getEntity() {\n if (!empty($this->entity_id) && !empty($this->entity_type) && entity_get_info($this->entity_type)) {\n // Create an array because array_shift passes in by reference.\n $entities = entity_load($this->entity_type, array($this->entity_id));\n return array_shift($entities);\n }\n }", "function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}", "public function getById(int $id): EntityInterface\n {\n }", "public function get($entityId)\n {\n return $this->accessControlManager->get(self::ACCESS_ENTITY_TYPE, $entityId);\n }", "public function getByEntityId(int $entityId): HokodoEntityInterface;", "public static function get($id, $user = null)\n {\n return Rest::getId($user, CorporatePurchase::resource(), $id);\n }", "public function getConcreteProduct(int $id): ApiItemTransfer;", "static private function _get($type, $id) {\n $objects = self::getStack($type);\n if (empty($objects)) {\n return FALSE;\n }\n if (isset($objects[$id])) {\n return self::convertToOriginalObject($objects[$id]);\n }\n return FALSE;\n }", "public function getById($id): ?IEntity;", "protected function getEntityById($id)\n {\n return $this->getEntityByTypeAndId($this->getEntityName(), $id);\n }", "function get_entity_by_id_cache($entity_type, $entity_id)\n{\n global $cache;\n\n $translate = entity_type_translate_array($entity_type);\n\n if (is_array($cache[$entity_type][$entity_id]))\n {\n\n return $cache[$entity_type][$entity_id];\n\n } else {\n\n switch($entity_type)\n {\n case \"bill\":\n if (function_exists('get_bill_by_id'))\n {\n $entity = get_bill_by_id($entity_id);\n }\n break;\n\n case \"port\":\n $entity = get_port_by_id($entity_id);\n break;\n\n default:\n $sql = 'SELECT * FROM `'.$translate['table'].'`';\n\n if (isset($translate['state_table']))\n {\n $sql .= ' LEFT JOIN `'.$translate['state_table'].'` USING (`'.$translate['id_field'].'`)';\n }\n\n if (isset($translate['parent_table']))\n {\n $sql .= ' LEFT JOIN `'.$translate['parent_table'].'` USING (`'.$translate['parent_id_field'].'`)';\n }\n\n $sql .= ' WHERE `'.$translate['table'].'`.`'.$translate['id_field'].'` = ?';\n\n $entity = dbFetchRow($sql, array($entity_id));\n if (function_exists('humanize_'.$entity_type)) { $do = 'humanize_'.$entity_type; $do($entity); }\n else if (isset($translate['humanize_function']) && function_exists($translate['humanize_function'])) { $do = $translate['humanize_function']; $do($entity); }\n break;\n }\n\n if (is_array($entity))\n {\n entity_rewrite($entity_type, $entity);\n $cache[$entity_type][$entity_id] = $entity;\n return $entity;\n }\n }\n\n return FALSE;\n}", "public function getById() {}", "public function getEntity() {\n\t\treturn get_entity($this->entity_guid);\n\t}", "public function getItem( $id );", "function get_by_id($id)\n {\n $this->db->join('user', 'user.user_id = t_purchase.user_id', 'left');\n $this->db->join('supplier', 'supplier.supplier_id = t_purchase.supplier_id', 'left');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function getItem($ID)\n {\n $Item = $this->mysql->QUERY(\n 'SELECT player_equipment.*,\n server_items.NAME,\n server_items.CATEGORY,\n server_items.LOOT_ID,\n server_items.SLOTS,\n server_items.DAMAGE,\n server_items.SHIELD,\n server_items.SHIELD_ABSORBATION,\n server_items.SPEED,\n server_items.SELLING_CREDITS\n FROM player_equipment, server_items\n WHERE player_equipment.USER_ID = ?\n AND player_equipment.PLAYER_ID = ?\n AND server_items.ID = player_equipment.ITEM_ID\n AND player_equipment.ID = ?',\n [$this->user->USER_ID, $this->user->PLAYER_ID, $ID]);\n\n if (!isset($Item[0])) {\n return false;\n } else {\n return new Item($Item[0], $this->mysql);\n }\n }", "public function getItem ($id);", "public function getEntity(): object\n {\n $entity = $this->entityManager->getRepository($this->className)->find($this->id);\n if (!$entity) {\n throw new Error('Entity not found for class `' . $this->className . '` and ID `' . $this->id . '`.');\n }\n\n return $entity;\n }", "public abstract function getById($id);", "public function getPurchase($_ID)\n {\n return $this->getUnique(\"purchases\", $_ID);\n }", "public function getEntity();", "public function getEntity();", "public function getEntity();", "abstract public function getById($id);", "abstract public function getById($id);", "public function getById($id)\n {\n $response = $this->get(\"v1/billing-types/$id\");\n $body = $this->decodeJson($response->getBody()->getContents());\n return $this->loadEntity($body->data);\n }", "public function findEntity($id);", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "public function getInvoice(string $id): Invoice;", "public function getById($id)\n {\n return $this->productRepository->getById($id);\n }", "public function getById( $id );", "public function getByCustomerId(int $customerId): HokodoEntityInterface;", "public function findOneEntity()\n {\n $company = $this->em->getRepository('APICoreBundle:Company')->findOneBy([\n 'title' => 'Test Company'\n ]);\n\n if ($company instanceof Company) {\n return $company;\n }\n\n return $this->createEntity();\n }", "public function getById(string $id);", "public function findById($id)\n {\n \t$product = $this->model->whereId($id)->first();\n \n \treturn $product;\n }", "public function getPurchasableId();", "protected function getOrderItemObjectByIdOrUuid($id)\n {\n \n if ($this->orderItem == null) {\n \n if (preg_match('/^\\d{1,}$/', $id, $res)) {\n $orderItem = OrderItemPeer::retrieveById($id);\n }\n else {\n $orderItem = OrderItemPeer::retrieveByUuid($id);\n }\n \n $this->forward404Unless($orderItem);\n $this->forward404Unless($orderItem->getMemberId() == $this->getUser()->getUserId());\n $this->orderItem = $orderItem;\n }\n \n return $this->orderItem;\n }", "public function getEntityId();", "public function getEntityId();", "public function getEntityId();", "public function getById($id)\n {\n return $this->product->find($id);\n \n }", "function findItem($type, $id)\n {\n foreach ($this->getItems() as $item)\n if ($item->item_id == $id && $item->item_type == $type)\n return $item;\n return null;\n }", "static public function get($type, $id = FALSE) {\n self::debug('*GET*');\n // Full collection\n if (!$id) {\n return self::_getStack($type);\n }\n // Id\n return self::_get($type, $id);\n }", "protected function fetchEntity(string $id): EntityInterface\n {\n $table = $this->loadModel();\n Assert::isInstanceOf($table, Table::class);\n\n $primaryKey = $table->getPrimaryKey();\n if (! is_string($primaryKey)) {\n throw new UnsupportedPrimaryKeyException();\n }\n\n try {\n $entity = $table->find()\n ->where([$table->aliasField($primaryKey) => $id])\n ->enableHydration(true)\n ->firstOrFail();\n Assert::isInstanceOf($entity, EntityInterface::class);\n\n return $entity;\n } catch (Exception $e) {\n // $id is a UUID, re-throwing the exception as we cannot fetch the record by lookup field(s)\n if (Validation::uuid($id)) {\n throw $e;\n }\n }\n\n /**\n * Try to fetch record by lookup field(s)\n *\n * @var \\Cake\\Datasource\\EntityInterface\n */\n $entity = $table->find()\n ->applyOptions(['lookup' => true, 'value' => $id])\n ->enableHydration(true)\n ->firstOrFail();\n\n return $entity;\n }", "public function purchase(): PurchaseReceiptInterface;", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }", "public function purchase()\r\n {\r\n return $this->hasOne('App\\Purchase');\r\n }", "public function getById($id, $type) {\n switch ($type) {\n case 'nsf': $sql = ROLETYPE_GETBYID_NSF; break;\n case 'local': $sql = ROLETYPE_GETBYID_LOCAL; break;\n default: throw new Exception(\"Type must be 'nsf' or 'local'\"); break;\n }\n\n $list = $this->makeEntityArray('RoleType', $sql, array($id));\n return isset($list[0]) ? $list[0] : null;\n }", "abstract protected function getObject($id);", "abstract public function retrieve($id);", "protected function getEntity($key)\n {\n $id = $this->getIdentifierFields();\n\n if (count($id) > 1) {\n // $key is a collection index\n $entities = $this->getEntities();\n return $entities[$key];\n } else if ($this->entities) {\n return $this->entities[$key];\n } else if ($qb = $this->getQueryBuilder()) {\n // should we clone the builder?\n $alias = $qb->getRootAlias();\n $where = $qb->expr()->eq($alias.'.'.current($id), $key);\n\n return $qb->andWhere($where)->getQuery()->getSingleResult();\n }\n\n return $this->getOption('em')->find($this->getOption('class'), $key);\n }", "public function getById()\n {\n }", "public function get(string $entity, $id): Storable\n {\n $key = $this->getId($entity, $id);\n\n if ($this->has($entity, $id)) {\n return $this->registry[$key];\n }\n\n return $this->getRepository($entity)->get($id);\n }", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the entity\r\n \t$cacheKey = $this->getCacheKey($key);\r\n \t// check if a entity with the passed primary key is available\r\n if (array_key_exists($cacheKey, $this->_entities)) {\r\n \treturn $this->_entities[$cacheKey];\r\n }\r\n // check if the requested entity exists in cache\r\n elseif($this->getCache()->test($cacheKey)) {\r\n \treturn $this->getCache()->load($cacheKey);\r\n }\r\n // if not return null\r\n else {\r\n \treturn null;\r\n }\r\n }", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function retrieve($entityName, $id);", "public abstract function get($id);", "public function retrieve($id)\n\t{\n\t\treturn new \\Entity\\User;\n\t}", "public function find(int $id): EntityInterface\n {\n return parent::find($id) ?: new CategoryEntity();\n }", "public function getById($id) {\n return $this->getBy(id, \"id\");\n }", "public function retrieveById($id);", "protected function _getResourcePurchasedModel()\r\n\t{\r\n\t\treturn $this->getModelFromCache('Brivium_CreResIntegration_Model_Purchased');\r\n\t}", "public function find($id)\n { \n $entity = $this->_find($id);\n return $entity;\n }", "public function getProductById(int $id);", "public function findOneById( int $int ): UserEntityInterface;", "public function get(BaseEntity $entity): BaseEntity\n {\n $result = $this->entityManager\n ->getRepository($entity->getClassName())\n ->find($entity);\n\n return $result ? $result : $entity;\n }", "public function getById(int $id);", "public function getEntityTypeId();", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PurchasePayment');\n }", "function entity($entityTypeKey, $entityId = null)\n {\n $entityModel = resolve(entity_class($entityTypeKey));\n return is_null($entityId) ? $entityModel : $entityModel->findOrFail($entityId);\n }", "public function findEntityById($id)\n {\n if (isset($this->entities[$id])) {\n return $this->entities[$id];\n }\n }", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function getEntity()\n\t{\n\t\treturn $this->hasKey() ? $this->database->find($this->key) : null;\n\t}", "public function get(string $id);", "abstract protected function getEntity();", "function get_by_type( $type_id )\n {\n $this->db->where('type_id', $type_id);\n $this->db->limit(1);\n return $this->db->get('card_types')->row();\n }" ]
[ "0.6024911", "0.569354", "0.5693223", "0.5675484", "0.56170624", "0.56156003", "0.5592275", "0.5563888", "0.5506988", "0.54994744", "0.54760885", "0.5464904", "0.54613847", "0.5430468", "0.5424405", "0.5391845", "0.53832227", "0.5364241", "0.5326241", "0.5281228", "0.52745485", "0.52608985", "0.52547234", "0.52518845", "0.52428526", "0.523337", "0.5230695", "0.5223739", "0.5223739", "0.5223739", "0.52164257", "0.52164257", "0.52136284", "0.5208737", "0.51840657", "0.5165276", "0.51531035", "0.51489943", "0.5144451", "0.5143854", "0.5141497", "0.51386946", "0.5137277", "0.51367235", "0.51346004", "0.51346004", "0.51346004", "0.5125499", "0.5124947", "0.51137674", "0.51089203", "0.5104654", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.5091071", "0.507441", "0.50684834", "0.50627804", "0.5061307", "0.5056015", "0.5052973", "0.5052744", "0.5052601", "0.5052484", "0.5046188", "0.50435054", "0.502359", "0.50205994", "0.50067705", "0.5001465", "0.4995128", "0.49908292", "0.49905515", "0.49857333", "0.49833784", "0.49820414", "0.49788508", "0.49677086", "0.49640688", "0.49634853", "0.49566096", "0.49440765", "0.49440765", "0.49440765", "0.49369675", "0.49350926", "0.4934133", "0.49318838" ]
0.73570967
0
Get the tax rate for the purchaseable item given the shipping address.
public static function getTaxRate(mixed $purchaseable, array $address) : int { return 18; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTaxRate()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->getTaxRate();\r\n }", "function get_tax_rate()\n\t{\n\t\tif(empty($this->address))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$rate\t= 0;\n\t\t\n\t\t$rate += $this->get_country_tax_rate();\n\t\t$rate += $this->get_zone_tax_rate();\n\t\t$rate += $this->get_area_tax_rate();\n\t\t\n\t\t//returns the total rate not affected by price of merchandise.\n\t\treturn $rate;\n\t}", "public function getTax()\n {\n $tax = 0;\n\n if (isset($this->_taxrate)) {\n $tax = $this->_taxrate * $this->_subtotal;\n }\n \n return $tax;\n }", "protected function _getShippingTaxAmount()\n {\n $quote = $this->getCustomQuote() ? $this->getCustomQuote() : $this->getQuote();\n return $quote->getShippingAddress()->getShippingTaxAmount();\n }", "public function getTaxRate();", "public function getShippingTaxAmount();", "public function getShippingTaxRate(Order $order)\n {\n $taxRateRequest = $this->taxCalculation->getRateRequest(\n $order->getShippingAddress(),\n $order->getBillingAddress(),\n null,\n $this->storeManager->getStore($order->getStoreId())\n );\n\n $taxRateRequest->setProductClassId($this->taxConfig->getShippingTaxClass());\n\n return $this->taxCalculation->getRate($taxRateRequest);\n }", "public function getBaseShippingTaxAmount();", "public function getTaxes() : float\n {\n $multiplier = app(CartLogistics::class)->getTaxRate(\n $this->purchaseable,\n $this->cart->shipping_address\n ) * 0.01;\n\n return $this->price * $multiplier;\n }", "public static function getShippingRate($address) {\n return 10;\n }", "public function getTaxRate()\n {\n if (is_null($this->taxRate)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_TAX_RATE);\n if (is_null($data)) {\n return null;\n }\n\n $this->taxRate = TaxRateModel::of($data);\n }\n\n return $this->taxRate;\n }", "public function getTaxCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->TotalTax) {\n $total += $item->TotalTax;\n }\n }\n\n if ($this->postage && $this->postage->Cost && $this->postage->Tax) {\n $total += ($this->postage->Cost / 100) * $this->postage->Tax;\n }\n \n return $total;\n }", "public function getExternalTaxRate();", "public function getTaxRate(MageOrder $order)\n {\n $store = $order->getStore();\n $taxClassId = null;\n\n $groupId = $order->getCustomerGroupId();\n if ($groupId !== null) {\n $taxClassId = $this->groupRepository->getById($groupId)->getTaxClassId();\n }\n\n /** @var DataObject|object $request */\n $request = $this->calculator->getRateRequest(\n $order->getShippingAddress(),\n $order->getBillingAddress(),\n $taxClassId,\n $store\n );\n\n $taxRateId = $this->scopeConfig->getValue(\n TaxConfig::CONFIG_XML_PATH_SHIPPING_TAX_CLASS,\n ScopeInterface::SCOPE_STORES,\n $store\n );\n\n return $this->calculator->getRate($request->setProductClassId($taxRateId));\n }", "function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}", "public function getBaseShippingTaxRefunded();", "public function getShippingTaxRefunded();", "public function getTaxAmount() {\n return $this->item->getTaxAmount();\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select SUM(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za ON tr.tax_zone_id = za.geo_zone_id left join \" . TABLE_GEO_ZONES . \" tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '\" . $country_id . \"') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '\" . $zone_id . \"') AND tr.tax_class_id = '\" . $class_id . \"' GROUP BY tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {\n $tax_multiplier = 0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier += $tax['tax_rate'];\n }\n return $tax_multiplier;\n } else {\n return 0;\n }\n}", "function get_tax($tax_class, $subtotal)\n{\n global $config, $tax_cache, $current_user_info;\n\n $rate = get_tax_rate($tax_class);\n\n if ($config['cart']['tax_base'] == 'shipping') {\n $tbase = 'ship';\n } else {\n $tbase = 'bill';\n }\n if (comparecsn($config['site_city'], $current_user_info[$tbase.'_city'])) {\n $tax_rate = $rate['tax_city'];\n } elseif (comparecsn($config['site_state'], $current_user_info[$tbase.'_state'])) {\n $tax_rate = $rate['tax_state'];\n } elseif (comparecsn($config['site_country'], $current_user_info[$tbase.'_country'])) {\n $tax_rate = $rate['tax_nation'];\n } else {\n $tax_rate = $rate['tax_world'];\n }\n\n return ($tax_rate / 100) * $subtotal;\n}", "protected function _calculateItemTaxPrice($item) {\n\t\t\t$response = 0.00;\n\t\t\treturn $response;\n\t\t}", "public function getTax(){\n $brutto = $this->getBrutto();\n return $brutto - ($brutto / (107) * 100);\n }", "protected function workoutOrderItemsTax($rate, $country): float\n {\n $order = $this->getOrderCached();\n $itemsTotal = 0;\n if ($order) {\n $items = $order->Items();\n if ($items) {\n foreach ($items as $item) {\n $itemsTotal += $this->getTotalTaxPerLineItem($item, $rate, $country);\n }\n }\n if ($order->hasMethod('GSTTaxExempt') && true === $order->GSTTaxExempt()) {\n return $itemsTotal = $itemsTotal * -1;\n }\n }\n if ($this->Config()->get('debug')) {\n $this->debugMessage .= '<hr />Total order items tax: $ ' . round($itemsTotal, 4);\n }\n\n return $itemsTotal;\n }", "public function getShippingRate();", "public function tax()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return (($item['price'] * $item['quantity']) / 100) * $this->config->get('cart.tax_rate');\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }", "public function avarageTaxRate($country_id){\n \t$country = Country::find($country_id);\n\n \t$sum = 0;\n \t$count = 0;\n\n \tforeach($country->states as $state){\n \t\tforeach($state->counties as $county){\n \t\t\t$sum += $county->tax_rate;\n \t\t\t$count++;\n \t\t}\n \t}\n\n \treturn round(($sum / $count),2);\n }", "public function getTaxRate($decimals = 0, $decimalPoint = ',', $thousandSeparator = '.')\n {\n return number_format($this->taxRate, $decimals, $decimalPoint, $thousandSeparator);\n }", "public function getTaxAmount()\n {\n return $this->getOrder()->getTaxAmount();\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n }\n\n $Qtax = Registry::get('Db')->prepare('select sum(tax_rate) as tax_rate from :table_tax_rates tr left join :table_zones_to_geo_zones za on tr.tax_zone_id = za.geo_zone_id left join :table_geo_zones tz on tz.geo_zone_id = tr.tax_zone_id where (za.zone_country_id IS NULL OR za.zone_country_id = \"0\" OR za.zone_country_id = :zone_country_id) AND (za.zone_id IS NULL OR za.zone_id = \"0\" OR za.zone_id = :zone_id) AND tr.tax_class_id = :tax_class_id group by tr.tax_priority');\n $Qtax->bindInt(':zone_country_id', (int)$country_id);\n $Qtax->bindInt(':zone_id', (int)$zone_id);\n $Qtax->bindInt(':tax_class_id', (int)$class_id);\n $Qtax->execute();\n\n if ($Qtax->fetch() !== false) {\n $tax_multiplier = 0;\n\n do {\n $tax_multiplier += $Qtax->value('tax_rate');\n } while ($Qtax->fetch());\n\n return $tax_multiplier;\n } else {\n return 0;\n }\n }", "protected function calculateTaxAmount()\n {\n\n //TAX ratio\n $tax_ratio = config('paths.tax') / 100;\n //Total amount as per current currency\n $total = Session::get('total') + Session::get('shipping_cost');\n //base currency total amount\n $bc_total = Session::get('bc_currency_total') + Session::get('bc_shipping_cost');\n //Tax amount for current currency\n $total_tax = round(($tax_ratio * $total), 2);\n //Tax amount for base currency\n $bc_total_tax = round(($tax_ratio * $bc_total), 2);\n Session::put('tax_amount', $total_tax);\n Session::put('bc_tax_amount', $bc_total_tax);\n return $total_tax;\n }", "public function getTaxAmount()\n {\n return $this->taxAmount;\n }", "function getTotalTax(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getTotalTax();\n\t}", "private function calculateTax( $shippingAddressID , $subtotal)\n\t{\n\t\t\n\t\t// Tax is calculated simply\n\t\t// If the ship-to state is Illinois, which is the same state the order is shipping from, then Illinois sales tax is applied.\n\t\t\n\t\t// Get the shipping address record\n\t\t$shippingAddress = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $shippingAddressID);\n\n\t\t// Determine where we are shipping from\n\t\t$shipFromState = Configuration::getConfigValue('shipFromState');\n\t\t$taxRate = Configuration::getConfigValue('shipFromStateTaxRate');\n\t\t\n\t\tif ( $shippingAddress['state'] == $shipFromState )\n\t\t{\n\t\t\t// The state is Illinois, so apply state sales tax\n\t\t\t$salesTax = $taxRate;\n\t\t\t$taxAmount = ($subtotal * $salesTax);\n\t\t}\n\t\telse\n\t\t\t$taxAmount = 0;\n\t\t\n\t\t\n\t\treturn $taxAmount;\n\t\t\n\t}", "function tep_get_tax_rate_value($class_id) {\n return tep_get_tax_rate($class_id, -1, -1);\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }", "protected function get_item_tax_rates( $item ) {\n\t\tif ( ! wc_tax_enabled() ) {\n\t\t\treturn array();\n\t\t}\n\t\t$tax_class = $item->product->get_tax_class();\n\t\treturn isset( $this->item_tax_rates[ $tax_class ] ) ? $this->item_tax_rates[ $tax_class ] : $this->item_tax_rates[ $tax_class ] = WC_Tax::get_rates( $item->product->get_tax_class(), $this->cart->get_customer() );\n\t}", "public function calculateTax(Entity\\User $user): float\n {\n foreach ($this->countryTax['options'] as $tax) {\n if ($user->getBillingAddress()->getCountry() == $tax['country']) {\n return $tax['rate'];\n }\n }\n return $this->countryTax['default_rate'];\n }", "function getTaxForPrice($price)\n\t\t{\n\t\t\t//get options\n\t\t\t$tax_state = pmpro_getOption(\"tax_state\");\n\t\t\t$tax_rate = pmpro_getOption(\"tax_rate\");\n\n\t\t\t//default\n\t\t\t$tax = 0;\n\n\t\t\t//calculate tax\n\t\t\tif($tax_state && $tax_rate)\n\t\t\t{\n\t\t\t\t//we have values, is this order in the tax state?\n\t\t\t\tif(!empty($this->billing) && trim(strtoupper($this->billing->state)) == trim(strtoupper($tax_state)))\n\t\t\t\t{\n\t\t\t\t\t//return value, pass through filter\n\t\t\t\t\t$tax = round((float)$price * (float)$tax_rate, 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//set values array for filter\n\t\t\t$values = array(\"price\" => $price, \"tax_state\" => $tax_state, \"tax_rate\" => $tax_rate);\n\t\t\tif(!empty($this->billing->state))\n\t\t\t\t$values['billing_state'] = $this->billing->state;\n\t\t\tif(!empty($this->billing->city))\n\t\t\t\t$values['billing_city'] = $this->billing->city;\n\t\t\tif(!empty($this->billing->zip))\n\t\t\t\t$values['billing_zip'] = $this->billing->zip;\n\t\t\tif(!empty($this->billing->country))\n\t\t\t\t$values['billing_country'] = $this->billing->country;\n\n\t\t\t//filter\n\t\t\t$tax = apply_filters(\"pmpro_tax\", $tax, $values, $this);\n\t\t\treturn $tax;\n\t\t}", "public function getTaxAmount() {\r\n return $this->taxAmount;\r\n }", "public function getShippingInclTax();", "public function getTaxPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->TaxPrice;\r\n\t}", "function get_payment_rate($subtotal) {}", "public function getGwTaxAmount() {\n return $this->item->getGwTaxAmount();\n }", "public function getTaxAmount();", "public function getBaseTaxAmount()\n {\n return $this->tax_amount;\n }", "public function getTax()\n {\n return $this->tax;\n }", "public function getBaseTaxAmount() {\n return $this->item->getBaseTaxAmount();\n }", "public function getTax(): Tax {\n\t\t\treturn Tax::fromArray( $this->value );\n\t\t}", "public function getBaseTaxAmount();", "public function getBaseShippingInclTax();", "public function getTax()\n {\n return $this->_tax;\n }", "public function getExternalTaxRateForShippingMethod()\n {\n if (is_null($this->externalTaxRateForShippingMethod)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE_FOR_SHIPPING_METHOD);\n if (is_null($data)) {\n return null;\n }\n\n $this->externalTaxRateForShippingMethod = ExternalTaxRateDraftModel::of($data);\n }\n\n return $this->externalTaxRateForShippingMethod;\n }", "public function tax(): float;", "public function get_total_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'total_tax' ) );\n\t}", "public function getTotalTaxAttribute()\n {\n if (empty($this->shopCalculations)) $this->runCalculations();\n return round($this->shopCalculations->totalTax + ($this->totalPrice * Config::get('shop.tax')), 2);\n }", "public function get_shipping_tax_amount( $tax_rate_id ) {\n\t\t$taxes = $this->get_shipping_taxes();\n\t\treturn isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0;\n\t}", "public function get_fee_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'fee_tax' ) );\n\t}", "static public function get_shipping_line_total_tax( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$tax = $order->get_shipping_tax(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$tax = $shipping->get_total_tax();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $tax;\n\n \t}", "public function getTax(Currency $currency)\n {\n return (new Money($this->tax, $currency))->getMoney()->multiply($this->quantity);\n }", "public function getGwBaseTaxAmount() {\n return $this->item->getGwBaseTaxAmount();\n }", "public function getExternalTaxRate()\n {\n return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;\n }", "public function getTax(): Tax\n\t{\n\t\treturn $this->tax;\n\t}", "public function get_cart_tax() {\n\t\t$cart_total_tax = wc_round_tax_total( $this->get_cart_contents_tax() + $this->get_shipping_tax() + $this->get_fee_tax() );\n\n\t\treturn apply_filters( 'woocommerce_get_cart_tax', $cart_total_tax ? wc_price( $cart_total_tax ) : '' );\n\t}", "public function getTaxRefunded() {\n return $this->item->getTaxRefunded();\n }", "public function getTaxRates($basket)\r\n {\r\n $result = array();\r\n\r\n if (!empty($basket['sShippingcostsTax'])) {\r\n $basket['sShippingcostsTax'] = number_format(floatval($basket['sShippingcostsTax']),2);\r\n\r\n $result[$basket['sShippingcostsTax']] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[$basket['sShippingcostsTax']])) unset($result[$basket['sShippingcostsTax']]);\r\n } elseif ($basket['sShippingcostsWithTax']) {\r\n $result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)])) unset($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)]);\r\n }\r\n\r\n\r\n if (empty($basket['content'])) {\r\n ksort($result, SORT_NUMERIC);\r\n return $result;\r\n }\r\n\r\n foreach ($basket['content'] as $item) {\r\n\r\n if (!empty($item[\"tax_rate\"])) {\r\n\r\n } elseif (!empty($item['taxPercent'])) {\r\n $item['tax_rate'] = $item[\"taxPercent\"];\r\n } elseif ($item['modus'] == 2) {\r\n // Ticket 4842 - dynamic tax-rates\r\n $resultVoucherTaxMode = Shopware()->Db()->fetchOne(\r\n \"SELECT taxconfig FROM s_emarketing_vouchers WHERE ordercode=?\r\n \", array($item[\"ordernumber\"]));\r\n // Old behaviour\r\n if (empty($resultVoucherTaxMode) || $resultVoucherTaxMode == \"default\") {\r\n $tax = Shopware()->Config()->get('sVOUCHERTAX');\r\n } elseif ($resultVoucherTaxMode == \"auto\") {\r\n // Automatically determinate tax\r\n $tax = $this->basket->getMaxTax();\r\n } elseif ($resultVoucherTaxMode == \"none\") {\r\n // No tax\r\n $tax = \"0\";\r\n } elseif (intval($resultVoucherTaxMode)) {\r\n // Fix defined tax\r\n $tax = Shopware()->Db()->fetchOne(\"\r\n SELECT tax FROM s_core_tax WHERE id = ?\r\n \", array($resultVoucherTaxMode));\r\n }\r\n $item['tax_rate'] = $tax;\r\n } else {\r\n // Ticket 4842 - dynamic tax-rates\r\n $taxAutoMode = Shopware()->Config()->get('sTAXAUTOMODE');\r\n if (!empty($taxAutoMode)) {\r\n $tax = $this->basket->getMaxTax();\r\n } else {\r\n $tax = Shopware()->Config()->get('sDISCOUNTTAX');\r\n }\r\n $item['tax_rate'] = $tax;\r\n }\r\n\r\n if (empty($item['tax_rate']) || empty($item[\"tax\"])) continue; // Ignore 0 % tax\r\n\r\n $taxKey = number_format(floatval($item['tax_rate']), 2);\r\n\r\n $result[$taxKey] += str_replace(',', '.', $item['tax']);\r\n }\r\n\r\n ksort($result, SORT_NUMERIC);\r\n\r\n return $result;\r\n }", "public function getTax() {\n return $this->_tax;\n }", "function tep_calculate_tax($price, $tax) {\n global $currencies;\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }", "private function _getRateTaxRequest(Quote $quote)\n {\n $rateTaxRequest = $this->taxCalculator->getRateRequest(\n $quote->getShippingAddress(),\n $quote->getBillingAddress(),\n $quote->getCustomerTaxClassId(),\n $quote->getStore(),\n $quote->getCustomerId()\n );\n return $rateTaxRequest;\n }", "public function calculate_taxes( $cart ) {\n\n\t\ttry {\n\n\t\t\t/**\n\t\t\t * Fire before calculating the cart tax at checkout.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdo_action( 'wc_avatax_before_checkout_tax_calculated' );\n\n\t\t\t// If at checkout and updating the order review (address changes, etc...) then ping the API\n\t\t\tif ( $this->ready_for_calculation() && $this->needs_calculation() ) {\n\n\t\t\t\t// Ping the API\n\t\t\t\t$response = wc_avatax()->get_api()->calculate_checkout_tax( $cart );\n\n\t\t\t\t$result = array(\n\t\t\t\t\t'lines' => $response->get_lines(),\n\t\t\t\t\t'total' => $response->get_total_tax(),\n\t\t\t\t);\n\n\t\t\t\t$this->store_tax_result( $result, $cart );\n\n\t\t\t// Or if not at checkout at all (add to cart, ect...), clear any calculations\n\t\t\t} else if ( ! $this->ready_for_calculation() ) {\n\n\t\t\t\t// Clear the calculated taxes from the session\n\t\t\t\t$this->clear_stored_tax_results();\n\n\t\t\t\treturn;\n\n\t\t\t// Otherwise, the order is being processed/paid, so grab the session\n\t\t\t} else {\n\n\t\t\t\t$result = $this->get_stored_tax_result( $cart );\n\t\t\t}\n\n\t\t\tif ( ! $result ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$total_tax = $result['total'];\n\t\t\t$shipping_tax = 0;\n\n\t\t\tforeach ( $result['lines'] as $line ) {\n\n\t\t\t\t$line_id = $line['id'];\n\t\t\t\t$line_tax = $line['total'];\n\n\t\t\t\t// If this is the shipping line, add to the shipping tax total\n\t\t\t\tif ( 'shipping' == $line_id ) {\n\n\t\t\t\t\t$shipping_tax += $line_tax;\n\n\t\t\t\t} else if ( isset( $cart->cart_contents[ $line_id ] ) ) {\n\n\t\t\t\t\t// Add the AvaTax line taxes\n\t\t\t\t\t$cart->cart_contents[ $line_id ]['line_tax'] += $line_tax;\n\t\t\t\t\t$cart->cart_contents[ $line_id ]['line_subtotal_tax'] += $line_tax;\n\n\t\t\t\t\t$cart->cart_contents[ $line_id ]['line_tax_data']['total']['avatax'] = $line_tax;\n\t\t\t\t\t$cart->cart_contents[ $line_id ]['line_tax_data']['subtotal']['avatax'] = $line_tax;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$subtotal_tax = $total_tax - $shipping_tax;\n\n\t\t\t$cart->taxes['avatax'] = $subtotal_tax;\n\t\t\t$cart->shipping_taxes['avatax'] = $shipping_tax;\n\n\t\t\t$cart->tax_total += $subtotal_tax;\n\t\t\t$cart->shipping_tax_total += $shipping_tax;\n\n\t\t\t$cart->total += $total_tax;\n\t\t\t$cart->subtotal += $subtotal_tax;\n\n\t\t\t/**\n\t\t\t * Fire after calculating the cart tax at checkout.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdo_action( 'wc_avatax_after_checkout_tax_calculated' );\n\n\t\t} catch ( SV_WC_API_Exception $e ) {\n\n\t\t\t$error = sprintf( __( 'Checkout Error: %s', 'woocommerce-avatax' ), $e->getMessage() );\n\n\t\t\tif ( wc_avatax()->logging_enabled() ) {\n\t\t\t\twc_avatax()->log( $error );\n\t\t\t}\n\t\t}\n\t}", "public function get_tax() {\n\t\treturn $this->_tax;\n\t}", "public function getTaxTotalAmount()\n {\n return $this->taxTotalAmount;\n }", "public function getBaseTaxRefunded() {\n return $this->item->getBaseTaxRefunded();\n }", "function get_cart_tax() {\n\t\t\t$cart_total_tax = $this->tax_total + $this->shipping_tax_total;\n\t\t\tif ($cart_total_tax > 0) return cmdeals_price( $cart_total_tax );\n\t\t\treturn false;\n\t\t}", "public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }", "function tep_calculate_tax($price, $tax) {\n global $currencies;\n\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n}", "public function getTax()\n\t{\n\t\treturn $this->getKeyValue('Tax'); \n\n\t}", "public function getShippingrate()\n\t{\n\t\tinclude_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';\n\t\t$shipping = new shipping;\n\t\techo $shipping->getShippingrate_calc();\n\t\texit;\n\t}", "public function tax()\n {\n return 0;\n }", "public function getTaxedPrice();", "function getTax($force = false)\n\t\t{\n\t\t\tif(!empty($this->tax) && !$force)\n\t\t\t\treturn $this->tax;\n\n\t\t\t//reset\n\t\t\t$this->tax = $this->getTaxForPrice($this->subtotal);\n\n\t\t\treturn $this->tax;\n\t\t}", "public function getGwTaxAmountRefunded() {\n return $this->item->getGwTaxAmountRefunded();\n }", "public function getShippingDiscountTaxCompensationAmount();", "private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}", "public function getBaseTaxRefunded();", "function getTax() \n\t{\n\t\t$tax = Option::where('attribute', '=', 'tax_mod')->first();\n\n\t\treturn (float)$tax->value;\n\t}", "public function getPurchaseTaxes() {\n return $this->purchaseTaxes;\n }", "public function getTaxAmount($decimals = 2, $decimalPoint = ',', $thousandSeparator = '.')\n {\n return number_format($this->taxAmount, $decimals, $decimalPoint, $thousandSeparator);\n }", "public function getTax(): ?float\n {\n return $this->tax;\n }", "public function getBaseShippingAmount();", "public function getSalesTax()\r\n {\r\n return $this->sales_tax;\r\n }", "public function getGwBaseTaxAmountRefunded() {\n return $this->item->getGwBaseTaxAmountRefunded();\n }", "public function getTaxPercent() {\n return $this->item->getTaxPercent();\n }", "public function getTaxRefunded();", "protected function _calculateItemShippingPrice($item) {\n\t\t\t$response = 0.00;\n\t\t\treturn $response;\n\t\t}", "function tep_calculate_tax($price, $tax) {\n return $price * $tax / 100;\n }", "public static function calculate_tax( $countrycode = \"\" ) {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n if ( \"\" == $countrycode ) {\n\n $address = edd_get_customer_address();\n\n if (isset($address['country']) && !empty($address['country']) && \"\" !== $address['country']) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }", "public function get_tax_amount( $tax_rate_id ) {\n\t\t$taxes = wc_array_merge_recursive_numeric( $this->get_cart_contents_taxes(), $this->get_fee_taxes() );\n\t\treturn isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0;\n\t}", "public function getTaxValue($country)\n {\n if (isset($this->tax[$country])) {\n return $this->tax[$country];\n }\n return 0;\n }", "public function get_item_tax_rate($row_id = FALSE, $fallback_default = FALSE)\r\n\t{\r\n\t\tif (isset($this->flexi->cart_contents['items'][$row_id]))\r\n\t\t{\r\n\t\t\t$item_data = $this->flexi->cart_contents['items'][$row_id];\r\n\t\t\t\t\t\t\r\n\t\t\t// If item has a manually set tax rate.\r\n\t\t\tif ($this->flexi_cart_lite_model->non_negative($item_data[$this->flexi->cart_columns['item_tax_rate']]))\r\n\t\t\t{\r\n\t\t\t\t$tax_rate = $item_data[$this->flexi->cart_columns['item_tax_rate']];\r\n\t\t\t}\r\n\t\t\t// If item does not have a manually set tax rate (i.e. set when item added to cart), attempt to lookup item tax rates from a database table.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$tax_rate = $this->flexi_cart_lite_model->get_database_item_tax_rate($item_data[$this->flexi->cart_columns['item_id']]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If a tax rate is set.\r\n\t\t\tif ($this->flexi_cart_lite_model->non_negative($tax_rate)) \r\n\t\t\t{\r\n\t\t\t\treturn $tax_rate;\r\n\t\t\t}\r\n\t\t\t// Else, return either the current cart tax rate or return FALSE.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn ($fallback_default) ? $this->flexi_cart->tax_rate(FALSE) : FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function getTaxTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getTaxTotal();\n }\n\n // Add any tax from postage\n $total += $this->PostageTax;\n\n return $total;\n }" ]
[ "0.7331706", "0.7083323", "0.70342153", "0.69549173", "0.68610805", "0.6824301", "0.6757231", "0.6756544", "0.6691957", "0.66610736", "0.6617559", "0.64207757", "0.6419773", "0.640179", "0.63801765", "0.6350403", "0.63330144", "0.63323116", "0.6330072", "0.63246536", "0.63149345", "0.6298139", "0.62462294", "0.6241626", "0.62347144", "0.6228886", "0.62185854", "0.6213903", "0.61951995", "0.61881334", "0.6110341", "0.610681", "0.6096095", "0.6086561", "0.60708517", "0.6048244", "0.60425925", "0.6019364", "0.60183954", "0.5978098", "0.5956286", "0.5945778", "0.5903122", "0.5896131", "0.5895286", "0.5881829", "0.58774066", "0.5873987", "0.5873175", "0.5846366", "0.58289486", "0.5819747", "0.5809925", "0.58004653", "0.58004415", "0.58002025", "0.5795535", "0.5745016", "0.57381", "0.57278305", "0.57048076", "0.5680267", "0.5676396", "0.56728786", "0.5671798", "0.5666058", "0.5645081", "0.56331456", "0.55948305", "0.55944484", "0.5578584", "0.5571687", "0.55661905", "0.5564072", "0.5548984", "0.5524279", "0.5518195", "0.5515282", "0.551432", "0.5513781", "0.5508662", "0.5493405", "0.54695874", "0.5468057", "0.546399", "0.54428023", "0.5441595", "0.54407895", "0.5440102", "0.5437168", "0.5432579", "0.5428503", "0.54185283", "0.541821", "0.5411453", "0.5406561", "0.54056984", "0.53859067", "0.5383574", "0.53828555" ]
0.7651447
0
Get insall date as string or unix timestamp.
public function getInstallDate($timestamp = false) { $date = $this->getConfig('general/install-date'); if (true === $timestamp): $date = strtotime($date); endif; return $date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }", "private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }", "public function freshTimestampString()\n {\n if(!is_null($this->dateFormat)){\n return date($this->dateFormat);\n }\n return time();\n }", "function util_datetime()\n{\n\t\treturn date(\"Y-m-d H:i:s\");\n}", "public function get_date()\n {\n $start_date = $this->start_date;\n if (0 >= (int) $start_date) {\n return false;\n }\n\n return date('Y-m-d H:i', $start_date / 1000);\n }", "function getDatestamp()\n{\n $d = new DateTime();\n return $d->getTimestamp() . \"\";\n}", "public static function getDate() {\r\n\t\treturn date('Y-m-d H:i:s');\r\n\t}", "public static function stringOrStamp($date) {\n\t\t// Get the current timestamp\n\t\tif ($date == 'now') {\n\t\t\treturn time();\n\t\t}\n \tif (is_numeric($date)) {\n \t\treturn $date;\n \t} else {\n \t\treturn strtotime(str_replace('/', '-', $date));\n \t}\n }", "public function GetAsTimestamp(){\r\n\t\t\t$timestamp = null;\r\n\t\t\tif( $this->year !== null && $this->month !== null && $this->day !== null ){\r\n\t\t\t\t$timestamp = strtotime( $this->year . '/' . $this->month . '/' . $this->day . ' ' . $this->hours . ':' . $this->minutes . ':' . $this->seconds );\r\n\t\t\t}\r\n\t\t\treturn $timestamp;\r\n\t\t}", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "protected function getSystemDate() {\n\t\treturn date('Y-m-d H:i:s');\n\t}", "private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }", "public function getDate()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('jS M Y');\n\t\t}", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "function funcs_getTimeStamp($date){\n\t$date = new Mydate($date);\n\treturn $date->getStamp();\n}", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function date();", "public function date();", "public function user_date()\n {\n // get user's timezone\n try {\n $tz = new DateTimeZone($this->config->get('timezone'));\n $date = new DateTime('now', $tz);\n }\n catch (Exception $e) {\n $date = new DateTime();\n }\n\n return $date->format('r');\n }", "function _unix_timestamp($date) { return strtotime($date); }", "function date_get_date($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date'], $timestamp);\n}", "function datum_nu2() {\n //\n\t\t\t$datestring \t\t\t\t= \"%Y-%m-%d\" ; \n\t\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\treturn mdate($datestring, $time);\n\t}", "public static function now ()\n\t\t{\n\t\t\treturn date(self::$dtFormat);\n\t\t}", "function timestamp($includeTime=true, $includeDate=true) {\r\n\t$parts = array();\r\n\tif ($includeDate) {\r\n\t\t$parts[] = \"Y-m-d\";\r\n\t}\r\n\tif ($includeTime) {\r\n\t\t$parts[] = \"H:i:s\";\r\n\t}\r\n\t$format = implode(\" \", $parts);\r\n\treturn date($format);\r\n}", "function variant_date_from_timestamp($timestamp) {}", "private static function timestamp(){\n date_default_timezone_set('Africa/Nairobi');\n $time = time();\n return date(\"Y-m-d G:i:s\", $time);\n }", "protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }", "function get_unix_time()\n {\n return $this->timestamp;\n }", "static public function timestamp()\r\n {\r\n $output = date('Y-m-d H:i:s', time());\r\n return $output;\r\n }", "function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}", "function uwa_getdate($timestamp=false) {\n\tif(!$timestamp) $timestamp = date_time_get_time();\n\t\n\tif(function_exists('adodb_getdate')) {\t// We can have problems with mktime when using dates before 1970 or hight 2038\n\t\t$func_name = 'adodb_getdate';\n\t} else {\n\t\t$func_name = 'getdate';\n\t}\n\treturn $func_name($timestamp);\n}", "function getDay(){\r\n return date('l',$this->timestamp);\r\n }", "function datum_nu() {\n\t\t//\n\t\t$datestring \t\t\t\t= \"%d-%m-%Y\" ; \n\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\n\t\treturn date($datestring, $time);\n\t\t//-----/\n\t}", "public function getDate(): string;", "function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }", "public function getDateString(){\n $date = Carbon::parse($this->created_at);\n $date->timezone = 'America/Montreal';\n return $date->format('d/m/Y');\n //return $date->format('m/d/Y');\n }", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "function mysql_timestamp(): string {\n\treturn date('Y-m-d H:i:s');\n}", "function dateToTimestamp($date){\n\t$dia=substr($date,0,2);\n\t$mes=substr($date,3,2);\n\t$ano=substr($date, 6,4);\t\n\t\n\t$timestamp= mktime(0,0,0,$mes,$dia,$ano);\n\treturn $timestamp;\n }", "public function getSaleDate()\n {\n if (!$this->sale_date) return null;\n return Formatter::date($this->sale_date);\n }", "public function getDate($key)\n {\n\n $value = trim($this->getParam($key));\n $unixTimeStamp = strtotime($value);\n if(!$unixTimeStamp){\n return \"\";\n }\n\n return date(\"Y-m-d\", $unixTimeStamp);\n }", "public static function now() {\n\t\t\treturn date('Y-m-d');\n\t\t}", "function timestamp($date){\n\t \n\t$return = strtotime($date);\n\treturn $return;\n}", "function getsystime() {\n\n return date('Y-m-d H:i:s');\n\n}", "public function getTimestamp()\n {\n return strtotime($this->getValue());\n }", "public function getDateIn() {\n $retVal = CommonProcess::convertDateTime($this->date_in, DomainConst::DATE_FORMAT_4, DomainConst::DATE_FORMAT_BACK_END);\n if (empty($retVal)) {\n return $this->date_in;\n }\n return $retVal;\n }", "protected function getTimeStamp() {\n return time().' ('.strftime( '%Y.%m.%d %H:%I:%S', time() ).')';\n }", "function timeStamp() {\r\n\t\t$php_timestamp = time();\r\n\t\t$stamp = date(\" h:i:s A - m/d/Y\", $php_timestamp);\r\n\t\treturn $stamp;\r\n\t}", "function variant_date_to_timestamp($variant) {}", "public function getTimestamp()\n {\n return $this->dateIssued->getTimestamp();\n }", "function entrydate($str='now'){\n return $time=strtotime($str); \n }", "public static function database_datetime($unix_timestamp = NULL)\n\t{\n\t\tif (is_null($unix_timestamp)) {\n\t\t\t$unix_timestamp = time();\n\t\t}\n\n\t\treturn date('Y-m-d H:i:s', $unix_timestamp);\n\t}", "public function getDate() : string\r\n {\r\n return $this->format('Y-m-d');\r\n }", "public function getStrDate()\n {\n return $this->getCurrentTranslation()->getStrDate();\n }", "public function getDate() : ?string ;", "function sysdate()\n\t\t{\n\t\t\treturn 'now';\t\t\t\n\t\t}", "abstract public function getTstamp();", "function timestampToDate($t) {\n return date(\"d-m-Y\",$t);\n}", "protected static function getTimestamp()\n\t{\n\t\treturn date(\"Y-m-d H:00:00\");\n\t}", "public function GetToAsTimestamp()\n\t{\n\t\t//Alerts don't pass time as a string, they pass as unix ms\n\t\tif(!strtotime($this->to))\n\t\t{\n\t\t\treturn $this->to;\n\t\t}\n\t\treturn strtotime($this->to);\n\t}", "function timeStamp(){\n\t\techo date(\"is\");\n\t}", "public static function now()\n {\n return date(self::DATETIME_PHP_FORMAT);\n }", "function db_date() {\n\treturn date(\"Y-m-d H:i:s\");\n}", "public function dateStartFriendly(): string\n {\n return Carbon::parse($this->date_start)->format('d-m-Y');\n }", "public function getCreatedAt()\n {\n return $this->sys->getCreatedAt();\n }", "public function valueOf()\n {\n return $this->getPreciseTimestamp(3);\n }", "public static function date($timestamp) {\n return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';\n }", "public function getSmartDate()\r\n {\r\n $now = Date::now();\r\n\r\n //other year\r\n if ($this->year != $now->year)\r\n {\r\n return $this->getValue(self::MASK_DATE_USER);\r\n }\r\n //today\r\n else if ($this->isToday())\r\n {\r\n if ($this->getHour() == 0 && $this->getMinute() == 0 && $this->getSecond())\r\n {\r\n return 'Hoje'; //$this->getValue( self::MASK_DATE_USER );\r\n }\r\n\r\n return $this->getValue(self::MASK_HOUR);\r\n }\r\n //other day\r\n else\r\n {\r\n $date = $this->strftime('%d %b');\r\n $search = array('01', '02', '03', '04', '05', '06', '07', '08', '09');\r\n $replace = array('1', '2', '3', '4', '5', '6', '7', '8', '9');\r\n\r\n return self::correctMonthNames(str_replace($search, $replace, $date));\r\n }\r\n }", "function getDateTime(){\r\n return date('jS F Y\\, g:ia',$this->timestamp);\r\n }", "public function getCreated()\n {\n if (is_string($this->created))\n $this->created = new UDate($this->created);\n return $this->created;\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "public function getTimestamp(): ?string;", "public function date_as_string ()\n {\n $f = $this->parent_folder ();\n return $f->format_date ($this->date);\n }", "function _getFormattedTimestamp()\n {\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\n }", "public function getTimestamp()\n\t{\n\t\treturn $this->getValue('timestamp');\n\t}", "function date_now() {\n return date(\"Y-m-d\");\n}", "public function __datetoday() {\n\t\t\treturn date(\"Y-m-d\");\n\t\t}", "function get_sql_date()\n {\n $year=$this->get_year();\n $month=$this->get_month();\n if (strlen($month)<2)\n {\n $month=\"0\".$month;\n }\n\n $day=$this->get_day();\n\n if (strlen($day)<2)\n {\n $day=\"0\".$day;\n }\n return $year.\"-\".$month.\"-\".$day.\" 00:00:00\";\n }", "function now_date($time = false,$format = 'Y-m-d H:i:s') :string\n {\n $time = $time ?: time();\n return date($format, $time);\n }", "protected function getDate() {\n\t\treturn date('Y-m-d h:i:s');\n\t}", "function date_get_date_time($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date_time'], $timestamp);\n}", "public static function getTimestamp($time){\n return date('Y-m-d H:i:s',$time);\n }", "public function toTimestamp(): ?int\n {\n $gc = new GregorianCalendar();\n $julianDay = $gc->ymdToJd(($this->year > 0 && $this->epoch) ? -$this->year : $this->year, $this->monthDigital ?: 1, $this->day ?: 1);\n return ($julianDay - 2440588) * 86400;\n }", "function date_sql2timestamp($date)\r\n\t{\r\n\t\t$date = explode(\"-\", $date);\r\n\r\n\t\t$timestamp = mktime(0, 0, 0, $date[1], $date[2], $date[0]);\r\n\t\treturn $timestamp;\r\n\t}", "protected function createTimestampFromDate($date_field) {\n // date of event if existing, else current time\n if ($date_field != \"\") {\n $date_field = trim($date_field);\n // Assuming dd/mm/yy or dd-mm-yy\n $dateParts = explode(\"/\", $date_field);\n if (sizeof($dateParts) == 1) {\n $dateParts = explode(\"-\", $date_field);\n }\n if ($this -> options['date_format'] == \"MM/DD/YYYY\") {\n $timestamp = mktime(0,0,0,$dateParts[0],$dateParts[1],$dateParts[2]);\n } else if ($this -> options['date_format'] == \"YYYY/MM/DD\") {\n $timestamp = mktime(0,0,0,$dateParts[2],$dateParts[0],$dateParts[1]);\n } else {\n $timestamp = mktime(0,0,0,$dateParts[1],$dateParts[0],$dateParts[2]);\n }\n return $timestamp;\n } else {\n return \"\";\n }\n }", "public function getCreatedThingTransferDate()\n {\n $value = $this->get(self::CREATEDTHINGTRANSFERDATE);\n return $value === null ? (string)$value : $value;\n }", "function dateToCal($timestamp) {\nreturn date('Ymd\\THis', $timestamp);\n}", "function getDatetime(){\n return date('Y-m-d H:i:s');\n}", "public static function timestamp($time=false) {\n\t\tglobal $db; //TODO: REMOVE GLOBAL REFERENCE\n\t\treturn pudl::convert_tz(\n\t\t\tself::from_unixtime($time !== false ? $time : $db->time()),\n\t\t\tnew pudlGlobal('time_zone'),\n\t\t\t'UTC'\n\t\t);\n\t}", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "function readTimestamp(): int;", "public function dateSend()\n {\n if ($this->time) {\n return $this->time->format('m/d/Y');\n }\n }", "public function getLastLogInFormatted(): string\n {\n return $this->getLastLogIn()->format('Y-m-d H:i:s');\n }", "public function sysdate() {\n\t\t\treturn 'TRUNC(SYSDATE)';\n\t\t}", "function app_date($format, $timestamp=false) {\n\tif(!$timestamp) $timestamp = date_time_get_time();\n\t\n\tif(function_exists('adodb_date')) {\t// We can have problems with mktime when using dates before 1970 or hight 2038\n\t\t$func_name = 'adodb_date';\n\t} else {\n\t\t$func_name = 'date';\n\t}\n\treturn $func_name($format, $timestamp);\n}", "public function getDate();", "public function getDate();", "public static function curTimestamp()\n {\n return date_timestamp_get(new DateTime());\n }" ]
[ "0.6584574", "0.6401228", "0.63973445", "0.63957477", "0.63336086", "0.6308657", "0.6271829", "0.62694335", "0.6213727", "0.62132204", "0.62018937", "0.61947423", "0.6191948", "0.6181961", "0.6169604", "0.6164096", "0.61176515", "0.61176515", "0.60971963", "0.6067716", "0.60630995", "0.6060523", "0.60382867", "0.60358745", "0.6033028", "0.60261756", "0.6021644", "0.60116315", "0.60109377", "0.60060215", "0.5994101", "0.5976704", "0.59761643", "0.59618664", "0.5948973", "0.59467685", "0.59391797", "0.59391797", "0.59391797", "0.59279335", "0.59124625", "0.5907737", "0.58980364", "0.58899206", "0.58747345", "0.5871891", "0.587162", "0.5852538", "0.5845565", "0.5843063", "0.58294415", "0.5818298", "0.58127403", "0.58088636", "0.58063275", "0.580356", "0.5802169", "0.5801731", "0.57978356", "0.5786579", "0.5784046", "0.57802176", "0.5779421", "0.5775601", "0.5775502", "0.5774243", "0.57705337", "0.576741", "0.5765143", "0.5759325", "0.5758357", "0.5756826", "0.5754414", "0.5753475", "0.5730104", "0.5729641", "0.5728348", "0.57052684", "0.57010055", "0.56997335", "0.5698804", "0.56766963", "0.5667757", "0.5658811", "0.56526893", "0.56480986", "0.5642017", "0.5640867", "0.5639065", "0.5638526", "0.5634455", "0.56315565", "0.56315565", "0.56314945", "0.5629256", "0.5628251", "0.5623519", "0.56208766", "0.5615644", "0.5615644", "0.56099224" ]
0.0
-1
if we've got an account user
public function hasAccountUser($store=null) { return 0 < strlen(trim($this->getAccountUser($store))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUser();", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "public static function checkAccount () {\n $user_id = session::getUserId();\n if ($user_id) {\n $a = q::select('account')->filter('id =', $user_id)->fetchSingle();\n \n // user may have been deleted\n if (empty($a)) {\n self::killSessionAll($user_id);\n return false;\n } \n \n if ($a['locked'] == 1) {\n self::killSessionAll($user_id);\n return false;\n }\n }\n return true;\n }", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "public function hasuser()\n {\n return is_object($this->luser);\n }", "public function checkUserExist($account){\n $query = \"select * from members where account=\\\"$account\\\"\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return true;\n }\n return false;\n }", "function user_AuthIsUser() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['user']) && ($AUTH['user'] !== 0);\n}", "public function userExists( $user_name ) { return true;}", "public function existeUser($acc){\n\t\tUtilidades::_log(\"existeUser($acc)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$registro=$select->fetch();\n\t\tif(null != registro['id']){\n\t\t\t$usado=False;\n\t\t}else{\n\t\t\t$usado=True;\n\t\t}\t\n\t\treturn $usado;\n\t}", "private function isUser() : bool\n {\n return $this->role('user');\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "public function hasUser(): bool\n {\n return ! is_null($this->user);\n }", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function exists($user_query){\n\t\t\n\t\t//CALL MEMBER FUNCTION QUERY OF THE CURRENT OBJECT\n\t\t$result = $this->query(\"Select username from users where username='\".$user_query.\"'\");\n\t\t\n\t\t//COUNT RESULTS FROM QUERY\n\t\t$count = mysqli_num_rows($result);\n\n\t\t//IF COUNT HAS COUNTED ONE OR MORE RESULTS, RETURN FALSE BECAUSE EMAIL/USER IS ALREADY REGISTERED!\n\t\tif($count>0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function getUserExiste(){\n return $this->userExist;\n }", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function userExists( $username ) {\n return true;\n }", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "function is() {\n global $_SESSION;\n if (! empty($_SESSION['payback']['user'])) return true;\n else return false;\n }", "function is_user( $user )\n {\n //Unimplemented\n }", "function forum_user_check() {\n\t global $vbulletin;\n\n\t // SEARCH VB DATABASE FOR LOGGED-IN SE USER\n\t $vb_user_query = $vbulletin->db->query_write(\"SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM \" . TABLE_PREFIX . \"user WHERE username='\".$this->user_info[user_username].\"' LIMIT 1\");\n\n\t // RETURN TRUE/FALSE IF VB USER EXISTS\n\t if($vbulletin->db->num_rows($vb_user_query) == 1) {\n\t $this->forum_user = $vbulletin->db->fetch_array($vb_user_query);\n\t return true;\n\t } else {\n\t return false;\n\t }\n\n\t}", "function check_user($user)\n\t\t{\n\n\t\t}", "public function check_insta_user() {\n \n }", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "public function hasUsername(){\n return $this->_has(4);\n }", "public function hasUsername() : bool;", "function userExists($uid)\r\n {\r\n return $this->UD->userExists($uid);\r\n }", "public function account()\n {\n if ($response = $this->request('account')) {\n if (isset($response->success) && $response->success == true) {\n return $response->account;\n }\n }\n return false;\n }", "public function OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }", "public function showFbConnectToAccountMsg()\n {\n if ($this->getConfig()->getRequestParameter(\"fblogin\")) {\n if (!$this->getUser() || ($this->getUser() && $this->getSession()->getVariable('_blFbUserIdUpdated'))) {\n return true;\n } else {\n return false;\n }\n }\n\n return false;\n }", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public function hasUsername(){\n return $this->_has(6);\n }", "public function hasUsername(){\n return $this->_has(6);\n }", "function isUser(){\n\t\tif(isset($_SESSION['type']) && $_SESSION['type']=='user')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function CheckTransactionUser() {\n\t\t\t\t\t\tif (isset ( $_SESSION ['UserSession'] )) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t}", "function loggedInUserId(){\n if (isLoggedIn()) {\n $result = query(\"SELECT * FROM users WHERE user_name = '\".$_SESSION['username'].\"' \");\n confirm($result);\n $user = mysqli_fetch_array($result);\n //check if there is an existing user\n return mysqli_num_rows($result) >= 1 ? $user['user_id'] : false;\n }\n return false;\n}", "public function user_exists() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT user_id FROM `users` WHERE user_id = '$this->user_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call user_exists because the user id is invalid');\r\n\t\t}\r\n\t}", "public function hasUsername() {\n return $this->_has(1);\n }", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "protected function hasAccount(): bool\n {\n if (null === $this->hasAccount) {\n $account = $this->accountContext->getAccount();\n if (null !== $account) {\n $this->account = $account;\n $this->hasAccount = true;\n } else {\n $this->hasAccount = false;\n }\n }\n\n return $this->hasAccount;\n }", "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "public function userExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function user(){\r\n if (!$this->isLogged()){\r\n return false;\r\n }\r\n return $_SESSION['dbauth'];\r\n }", "static function getUser()\n {\n return isset($_SESSION['user']) ? UserQuery::create()->findOneById($_SESSION['user']) : false;\n }", "private function isUsernameAvailable($user) {\n $connect = $this->dc->connect();\n $username = $user->getUsername();\n \n $records = $connect->prepare('SELECT id,username,password FROM users WHERE username = :username');\n $records->bindParam(':username', $username);\n $records->execute();\n $results = $records->fetch(\\PDO::FETCH_ASSOC);\n\n return !$results;\n }", "function getUser() {\r\n\t\treturn false;\r\n\t}", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function auth() {\n\t\t\t// Check if user has not a session\n\t\t\tif (!$this->session->has('user')) return false;\n\n\t\t\t// Get the user from session\n\t\t\t$user = $this->session->get('user');\n\t\t\t$field = array_keys($user)[1] ?? null;\n\t\t\t$value = array_values($user)[1] ?? null;\n\n\t\t\t// If user does not exists\n\t\t\tif (!$this->user->exists($field, $value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\treturn true;\n\t\t}", "public function check()\n {\n $user = $this->user();\n return !empty($user);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "function isUser($username){\n $results = sqlSelectOne(\"SELECT * FROM users WHERE user_username='$username'\", 'user_username');\n if ($results === null) {\n return false;\n }\n return true;\n}", "public function hasActiveUser()\n {\n return $this->user && $this->user->active;\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "public function isAccountant()\n {\n return (\\Auth::user()->role == 'accountant');\n }", "public function check()\t{\n\t\treturn ! is_null($this->user());\n\t}", "function is_user()\n\t{\n\n\tif ($this->session->userdata('user') == false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\telse\n\t\t{\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "public function validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function userExists()\n\t{\n\t\t$uid = mysql_real_escape_string($_POST[\"uid\"]);\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid';\";\n\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\n\t\t$exists = (mysql_numrows($result) == 1) ? true : false;\n\n\t\treturn $exists;\n\t}", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "function isUserLoggedin() \n {\n $stmt = self::$_db->prepare(\"SELECT count(id_user) AS c FROM user WHERE session=:sid\");\n $sid = session_id();\n $stmt->bindParam(\":sid\", $sid);\n $stmt->execute();\n $count = $stmt->fetch()[\"c\"];\n if($count == 1)\n {\n return \"true\";\n }\n else if($count < 1)\n {\n return \"false\";\n }\n else\n {\n return \"Error: More then one identical User could be logged in!\";\n }\n }", "public function check_user_social(){\n\t\t\treturn $this->dao->check_user_social($this->db, $_POST['iduser']);\n\t\t}", "public function existUser($user,$pwd){\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n\t}", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function userExists(){\r\n\t\t$bool = false ;\r\n\t\t$pseudo = addslashes($this -> getPseudo()) ;\r\n\t\t$r = execute(\"select count(User_pseudo) as nb from UserTab where User_pseudo='\".$pseudo.\"'\");\t\r\n\t\twhile($l = mysql_fetch_assoc($r)){\r\n\t\t\tif($l['nb'] > 0)\r\n\t\t\t\t$bool = true ;\r\n\t\t}\t\t\r\n\t\r\n\t\treturn $bool ;\r\n\t }", "public function userExists($login){\n $usr = $this->userInfo($login);\n if($usr == null) { // uzivatel neni v DB\n return false;\n }\n else {\n return true;\n }\n }", "public function userExists($user) {\n $user = $this->connection->escape_string($user);\n\n $result = $this->query(\"SELECT user FROM Users U where U.user='$user'\");\n\n return ($result->num_rows > 0);\n }", "public function loginExists() {\n return (bool) $this->local_account;\n }", "private function checkUser($_AdUser)\n {\n //get the user path from config\n $u = config('azureAdAuth.user_model');\n $theUser = $u::where('email', $_AdUser->userPrincipalName)->first();\n if($theUser == null){\n // create the user\n $usr = new $u();\n $usr->email = $_AdUser->userPrincipalName;\n $usr->name = $_AdUser->displayName;\n $usr->password = Hash::make($_AdUser->id);\n $usr->save();\n\n $theUser = $usr;\n }\n Auth::login($theUser);\n return Auth::check();\n }", "function isUserLoggedIn()\n\t{\n\t\tglobal $loggedInUser,$db,$db_table_prefix;\n\t\t\n\t\t$sql = \"SELECT User_ID,\n\t\t\t\tPassword\n\t\t\t\tFROM \".$db_table_prefix.\"Users\n\t\t\t\tWHERE\n\t\t\t\tUser_ID = '\".$db->sql_escape($loggedInUser->user_id).\"'\n\t\t\t\tAND \n\t\t\t\tPassword = '\".$db->sql_escape($loggedInUser->hash_pw).\"' \n\t\t\t\tAND\n\t\t\t\tActive = 1\n\t\t\t\tLIMIT 1\";\n\t\t\n\t\tif($loggedInUser == NULL)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Query the database to ensure they haven't been removed or disabled\n\t\t\tif(returns_result($sql) > 0)\n\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No result returned kill the user session, user removed or disabled\n\t\t\t\t$loggedInUser->userLogOut();\n\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function ownerLoggedIn()\n {\n // For now just check session for an email and owner type\n if ( empty($_SESSION['email']) || $_SESSION['type'] != 'owner')\n return false;\n else\n return true;\n\n }", "protected function isAccountExist()\n {\n $sessionId = \\Session::getId();\n $account = Account::where('session_id', $sessionId)->first();\n if (!$account) return false;\n\n return true;\n }", "public static function check ()\n {\n return (bool)self::$user;\n }", "public function hasUserConnected() {\n $accessTokenIG = get_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME );\n $accessTokenFB = get_option( self::FACEBOOK_TOKEN );\n\n return ! empty( $accessTokenIG ) || ! empty( $accessTokenFB );\n }", "public static function check()\n {\n return !is_null(static::user());\n }", "abstract protected function getUser();", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "function _user_exists($username)\n {\n $this->where('username', $username);\n $user = $this->get('users');\n //return true/false\n if ($user)\n {\n return true;\n } else {\n return false;\n }\n }", "function isUserExist($con,$androidId,$username,$email){\n\t$sql = \"SELECT * FROM `access`,`owner` WHERE owner.email = access.email AND owner.android_id = '\".$androidId.\"' AND owner.email='\".$email.\"' AND access.username='\".$username.\"' AND access.enable = 'Y'\";\n\n\t$result = mysqli_query($con,$sql);\n\t$value = @mysqli_num_rows($result);\n\n\tif ($value){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "public function userExists($userId) {\n\t\t$sql = \"select userName from user where userName = ? LIMIT 1\";\n\t\t$result = $this->executeQuery($sql, array($userId));\n\t\treturn count($result) == 1; \n\t}", "protected function Authorized(){\n // usuario\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return true;\n }\n \n // Autorizar la solicitud atendiendo a la activacion del usuario\n\t\t$uType = $this->getUserType();\n\t\t\n\t\tif ($uType >= USER_CLIENT){ // Ok user is active\n\t\t\t$res = DBHelper::Select('users', '*', \"email='{$this->user}'\");\n\t\t\t//if ((!$res[0]['name'] || !$res[0]['phone']) && $res[0]['expiration'] - time() >= 7 * 24 * 3600){\n\t\t\t//\t$this->url = Url::Parse(\n // \t\t\"http://\".HTTP_HOST.\"/__www/set-user-info.php?user={$this->user}&success_url=\" . urlencode((string)$this->data->url)\n \t//\t);\n\t\t\t//}\n\t\t}elseif(DBHelper::is_user_registered($this->user) > 0){ \n // La activacion del usuario ha expirado. Redirigir a\n // la pagina de recarga\n\t\t\t\n /** @var Url url */\n $url = $this->getUrlFromData();\n if (stripos($url->host, HTTP_HOST) === FALSE){\n\t\t\t $this->url = Url::Parse(ACCOUNT_EXPIRED_URL . \"&user={$this->user}&mobile={$this->data->mobile}&success_url=\". urlencode((string)$this->data->url));\n }\n\t\t}else {\n // Se permite acceso solamente al servidor de Aurora\n return FALSE;\n }\n \n return true;\n\t}", "function isAuthenticated()\n{\n $result = false;\n if (isset($_SESSION[\"username\"])) {\n // Fetch user from the database\n require_once(\"model/users.php\");\n $user = getUserByUsername($_SESSION[\"username\"] ?? \"\");\n // Check if user exists\n if (!empty($user)) {\n $result = true;\n } else {\n // Remove username from the session variable since the user doesn't exist anymore\n unset($_SESSION[\"username\"]);\n }\n }\n return $result;\n}" ]
[ "0.7299746", "0.7208972", "0.71624637", "0.71423554", "0.7059531", "0.7027429", "0.69669676", "0.69559383", "0.68789154", "0.68209875", "0.67681235", "0.6725602", "0.6707058", "0.66801476", "0.666999", "0.6665352", "0.666201", "0.6659236", "0.6657844", "0.6649224", "0.664802", "0.6645466", "0.66439086", "0.66414785", "0.66255045", "0.6617006", "0.6604971", "0.6591741", "0.6583702", "0.65795416", "0.65631133", "0.65606236", "0.6557422", "0.65469587", "0.6533616", "0.65310407", "0.6521906", "0.6521775", "0.65175235", "0.65175235", "0.651537", "0.65111774", "0.65095454", "0.6506052", "0.6498417", "0.64862305", "0.64749634", "0.6466021", "0.6465969", "0.6458132", "0.6454342", "0.64435244", "0.64343166", "0.64288694", "0.64133465", "0.6410198", "0.64089733", "0.6395206", "0.63896537", "0.6388208", "0.6388208", "0.6388208", "0.6388208", "0.6388208", "0.6378712", "0.6376856", "0.6368075", "0.6367779", "0.6367779", "0.63673085", "0.6363962", "0.63599336", "0.6348513", "0.63472486", "0.63453233", "0.6339645", "0.633727", "0.6324506", "0.6317095", "0.63155985", "0.63136256", "0.6312645", "0.63064533", "0.62953746", "0.629512", "0.62919307", "0.62825835", "0.628255", "0.62814593", "0.62794393", "0.6276972", "0.62735546", "0.6272951", "0.6271879", "0.6271835", "0.6267461", "0.6266627", "0.6263503", "0.62633747", "0.62630796" ]
0.65634763
30
if we've got an account signature
public function hasAccountSignature($store=null) { return 0 < strlen(trim($this->getAccountSignature($store))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = $this->_token;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function checkSignature() {\n\t\tif (! defined ( \"TOKEN\" )) {\n\t\t\tthrow new Exception ( 'TOKEN is not defined!' );\n\t\t}\n\t\t\n\t\t$signature = $_GET [\"signature\"];\n\t\t$timestamp = $_GET [\"timestamp\"];\n\t\t$nonce = $_GET [\"nonce\"];\n\t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array (\n\t\t\t\t$token,\n\t\t\t\t$timestamp,\n\t\t\t\t$nonce \n\t\t);\n\t\t// use SORT_STRING rule\n\t\tsort ( $tmpArr, SORT_STRING );\n\t\t$tmpStr = implode ( $tmpArr );\n\t\t$tmpStr = sha1 ( $tmpStr );\n\t\t\n\t\tif ($tmpStr == $signature) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\t\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n\n\n\n if (!defined(\"self::TOKEN\")) {\n throw new \\Exception('TOKEN is not defined!');\n }\n\n $signature = $this->getRequest()->get('signature');\n $timestamp = $this->getRequest()->get('timestamp');\n $nonce = $this->getRequest()->get('nonce');\n\n $token = self::TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n $logger = $this->get('logger');\n $logger->error($signature.'==='.$tmpStr);\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $logfile = fopen(\"./log/token_log\", \"a\");\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isSignatureRequired();", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n // 接收参数\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\n // 把参数 压如数组\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\n // use SORT_STRING rule\n // 字典序排序\n\t\tsort($tmpArr, SORT_STRING);\n\n // 切割数组\n\t\t$tmpStr = implode( $tmpArr );\n // 哈希加密\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n // 判断 加密后参数 对比 传递来的加密签名\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature($token)\r\n {\r\n /*if (!defined(\"TOKEN\")) {\r\n throw new Exception('TOKEN is not defined!');\r\n }*/\r\n\r\n $signature = $_GET[\"signature\"];\r\n $timestamp = $_GET[\"timestamp\"];\r\n $nonce = $_GET[\"nonce\"];\r\n\r\n //$token = TOKEN;\r\n $tmpArr = array($token, $timestamp, $nonce);\r\n // use SORT_STRING rule\r\n sort($tmpArr, SORT_STRING);\r\n $tmpStr = implode( $tmpArr );\r\n $tmpStr = sha1( $tmpStr );\r\n\r\n if( $tmpStr == $signature ){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function eth_verify_wallet($addr, $sig) {\n\treturn true;\n}", "private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }", "function checkSignature($encodingAesKey,$token,$corpId)\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"msg_signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $echoStr = $_GET[\"echostr\"]; \n $token = TOKEN;\n $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);\n $errCode = $wxcpt->VerifyURL($signature, $timestamp, $nonce, $echoStr, $sEchoStr);\n if ($errCode == 0) {\n //\n // 验证URL成功,将sEchoStr返回\n //HttpUtils.SetResponce($sEchoStr);\n echo $sEchoStr;\n return true;\n } else {\n print(\"ERR: \" . $errCode . \"\\n\\n\");\n return false;\n }\n }", "public function isRequestSigned()\r\n\t{\r\n\t\t$headers = $this->getAllHeaders();\r\n\r\n\t\tif (!isset($headers[\"Authorization\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!isset($headers[\"Signature\"]))\r\n\t\t\treturn false;\r\n\r\n\t\tif (!($this->appId = $this->getApplicationId()))\r\n\t\t\treturn false;\r\n\r\n\t\t$this->secret = $this->appService->getApplicationSecret($this->appId);\r\n\r\n\t\tif (!$this->secret)\r\n\t\t\treturn false;\r\n\r\n\t\t$signature = $headers[\"Signature\"];\r\n\t\t$expected = $this->create();\r\n\r\n\t\treturn $this->compare($signature, $expected);\r\n\t}", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "public function getUserSignature(): ?string;", "public function usesSignatures() {\n\t\t\treturn $this->signKey !== null;\n\t\t}", "private function checkSignature($signature,$timestamp,$nonce)\n {\n $token = Yii::$app->params['wechat']['token'];\n if (!$token) {\n echo 'TOKEN is not defined!';\n } else {\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }\n }", "public function isSigKeyPersonnel()\n {\n return $this->sigs()->where('main', 3)->count() > 0;\n }", "public function is_signed() : bool\n {\n return ($this->signed) ? true : false;\n }", "public function validateSignature(string $instance, string $apiKey, string $platform): bool\n {\n $payrexx = $this->getInterface($instance, $apiKey, $platform);\n try {\n $payrexx->getOne(new SignatureCheck());\n return true;\n } catch (\\Payrexx\\PayrexxException $e) {\n return false;\n }\n }", "function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}", "public function getSignature();", "function checkSign($echoStr){\r\n if(wmpBasic::checkSignature($this->cfg)){\r\n die($echoStr); \r\n }else{\r\n die('Error: checkSignature');\r\n }\r\n }", "public function isSigMember()\n {\n return $this->sigs()->where('main', 0)->count() > 0;\n }", "function verify_signature($file) {\n $dds = new WebService_DigiDocService_DigiDocService();\n $file[\"content\"] = File::readLocalFile($file[\"tmp_name\"]);\n unlink($file[\"tmp_name\"]);\n\n if ($file[\"format\"] === \"bdoc\") {\n $ret = $dds->StartSession(\"\", base64_encode($file[\"content\"]), FALSE, \"\");\n } else {\n $parser = new DigiDoc_Parser($file[\"content\"]);\n $ret = $dds->StartSession(\"\", $parser->getDigiDoc(TRUE), FALSE, \"\");\n }\n\n if (PEAR::isError($ret)) {\n return \"ERROR: \" . $ret->getMessage();\n }\n $sig_info = $ret[\"SignedDocInfo\"]->SignatureInfo;\n if (is_array($sig_info)) {\n return \"ERROR: The claim can have only one signature.\";\n }\n\n if ($sig_info->Status !== \"OK\") {\n $error = $sig_info->Error;\n return \"ERROR: The signature is invalid - $error->Description ($error->Code).\";\n }\n return \"OK\";\n}", "function getAuthSignature()\n {\n return $this->_authSignature;\n }", "function verify_digital_signature($fname) {\n\n\tglobal $g;\n\n\treturn mwexec(\"/usr/bin/gzsig verify \" .\n\tescapeshellarg(\"{$g['etc_path']}/id_rsa.pub\") . \" \" .\n\tescapeshellarg($fname));\n}", "public function validate_signature($params) {\n\n $new_sig = Utils::generate_signature($params['data'], $params['secret']);\n\n if ($new_sig == $params['signature']) {\n return true;\n } else {\n return false;\n }\n\n }", "private function checkSignature($str='')\n {\n $signature = isset($_GET[\"signature\"])?$_GET[\"signature\"]:'';\n $signature = isset($_GET[\"msg_signature\"])?$_GET[\"msg_signature\"]:$signature; //如果存在加密验证则用加密验证段\n $timestamp = isset($_GET[\"timestamp\"])?$_GET[\"timestamp\"]:'';\n $nonce = isset($_GET[\"nonce\"])?$_GET[\"nonce\"]:'';\n\n $token = $this->token;\n $tmpArr = array($token, $timestamp, $nonce,$str);\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}", "function sign()\n {\n\n //Get particular key\n\n $keyResponse = $this->get('\"'.$this->id.'\"');\n\n\n if ($keyResponse){\n //Get the key version reference on Azure\n $keyID = $this->key_version;\n\n //Sign with given key\n $signResponse = $this->keyVaultKey->sign($keyID, $this->algorithm,$this->hash);\n\n\n //If success, return signature\n if ($signResponse[\"responsecode\"] == 200) {\n $signatureValue = $signResponse['data']['value'];\n $this->signature = $signatureValue;\n return true;\n }\n\n //Return signing error from Azure\n else {\n $this->keyVault_error = $signResponse[\"responseMessage\"][\"message\"];\n return false;\n }\n\n }\n\n //Return key error from Azure\n else{\n $this->keyVault_error = $keyResponse[\"responseMessage\"][\"message\"];\n return false;\n\n }\n\n }", "private function signature(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\t\n\t\t\t$data = $this->_request['data'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$sig_name = strtolower(preg_replace(\"/[\\W\\s+]/\",\"\", $first_name.'_'.$last_name.'_'.$current_datetime->format('Y-m-d_His')));\n\t\t\t$signature = base64_decode(str_replace(\"data:image/png;base64,\",\"\",$data));\n\t\t\t$result=file_put_contents(\"../signatures/\".$sig_name.\".png\",$signature);\t\n\t\t\tif($result){\n\t\t\t\t $this->response($sig_name.'.png', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Signature Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\n\t\t}", "public function hasAccount($key);", "protected function hasPrivateKey() {}", "public function hasToBeSignedByUser($user) {\r\n\r\n /*\r\n * No need to sign for 'never' \r\n */\r\n if ($this->description['hasToBeSigned'] === 'never') {\r\n return false;\r\n }\r\n\r\n /*\r\n * Always need to sign for 'always'\r\n */\r\n if ($this->description['hasToBeSigned'] === 'always') {\r\n return true;\r\n }\r\n\r\n /*\r\n * Otherwise check if license has been signed once\r\n */\r\n return !$this->context->dbDriver->check(RestoDatabaseDriver::SIGNATURE, array(\r\n 'email' => $user->profile['email'],\r\n 'licenseId' => $this->description['licenseId']\r\n ));\r\n }", "function has_account()\n{\n return file_exists(DEFAULT_ACCOUNTFILE);\n}", "function hasValidBitcointalkData()\n{\n $isValid =\n isset($_POST[\"profil\"]) && isset($_POST[\"signature\"]);\n \n return $isValid;\n}", "public function check_signature($request, $consumer, $token, $signature) {\n $built = $this->build_signature($request, $consumer, $token);\n return $built == $signature;\n }", "protected function isCaptureCallForAuth()\n {\n return $this->reader->getResponseCode() === self::CAPTURE_CALL_FOR_AUTH_STATUS_CODE;\n }", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function getSignature()\n {\n return $this->_signature;\n }", "function isVerified(){\n\n}", "public function ReturningFromPayment()\n\t{\n\t\treturn isset($_GET['MAC']);\n\t}", "public function isSigned(){\n\t\tif(isset($_POST['signed'])) { // comes from login form\n\t\t\t$attributes = array('email'=>$_POST['email'],'password'=>md5($_POST['password']));\n\t\t\t// parent::checkFields($attributes);\n\t\t\t$this->user->setAttributes($attributes);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isSigLeader()\n {\n return $this->sigs()->where('main', 1)->count() > 0;\n }", "public function mefSignature() {\r\n\t$encoded_header = base64_encode('{\"alg\": \"HS512\",\"typ\": \"JWT\"}');\r\n\t$iss = 'CISCAR';\r\n\tif(isset($_GET['annuaire']) && $_GET['annuaire'] == 2 )\r\n\t{\r\n\t\t\t$iss = 'GCR';\r\n\t}\r\n\t// base64 encodes the payload json\r\n\t$encoded_payload = base64_encode('{\r\n\t\t\t\"iat\": \"'.time().'\",\r\n\t\t\t\"iss\": \"'.$iss.'\",\r\n\t\t\t\"aud\": \"https://boxstva-client.stva.com\",\r\n\t\t\t\"sub\": \"'.$this->getIndividuID().'\",\r\n\t\t\t\"family_name\": \"'.utf8_encode($this->getNom()).'\",\r\n\t\t\t\"given_name\": \"'.utf8_encode($this->getPrenom()).'\",\r\n\t\t\t\"ordering_party\": \"'.$this->getRolePrinc().'\",\r\n\t\t\t\"entities\": \"'.$this->getRattachements().'\"\r\n\t\t}');\r\n\t\r\n\t// base64 strings are concatenated to one that looks like this\r\n\t$header_payload = $encoded_header . '.' . $encoded_payload;\r\n\t\r\n\t//Setting the secret key environnement de Pre-PROD\r\n\t//\"aud\": \"http://box-gcr-pp.stva.com.s3-website-eu-west-1.amazonaws.com\",\r\n\t//$secret_key = '+XgiH7AFTCCUSbuFyMiqYThoStVW7etx32VRhSAKvCrqZPK2rZ4r1gtXoBlZHEismbALi8KKdmdRd3MnoH/19nfwIOV0+tX8blaUy/cQLxCQmfL8BlWuDutdegs72js2zvGpbS1YxXgjWhd4RjsVPn0HSL7q3EBJBORwAELOpI4GZuqSCn1n/R/veZiq7giAv7Gxi+J1A+EOTXtOzZSiQa/tYvcm6xaPTNPzP9HdgxAeKMN4FV44dG+Q66wD14WYOBAo1IPHKvAdWSS53uwRVAb7HDDfflVLcib851LG7fLC6JXaUmdK0iTEU3qJV32wzlF5phax9t16GdJfmCqAxJDMHx0iIVtZYajZPHnPYzXoHHCSilHmPoPZZkmKjlC12L1m87QKVySqP9K3J9fORW+Tn3QIkIcvl+GA4vqomk7/eVP8NT9MwIOvV9pjMJl+cGIoIYYQZmqQ3+Pa7d1NjV0bx6I9WlJNAKYxC5zFvVzqlx5j/H5Wq91WLOrZZNGaE/kygrLmyCYWQiCNzNbwvEsAgCPUgGy0o9o2itVEL4zwzRWPrNDp4fivhMA87QzbzFkDvX9B6PBb1R/3EFy1uSAk22ovyK/fMmN6GRTNeDQdGRi/U64Ys9mA+UjzBi22gy8ZIgFfcnCfJIinMO5PCh2BJ2AQq3kKxe4AMEQmeno=';\r\n\r\n\t//Setting the secret key environnement de PRODUCTION\r\n\t//\"aud\": \"https://boxstva-client.stva.com\",\r\n\t$secret_key = 'Rn2ZvoU+dTOtpE/BOUEuMaf65G2l7lA1nDJV56hmLcl17Y6F2EPCSIrKRCCVWc/Zda7m5Bp/g9BYUIRVTvgmtlcghGRBtswGFwMjq0Ye4QVtmpa8qZBI0sTHGjnbwTvmqZmf1v2TAcJWsAIJsRcoX0IchGvhaEKUMnLAXAUQT4mBhSdUY7H/ZckUthciFveKtxvmKMfjOLJNqciD8fVapuzQBqSRzFhTifVceLG1EmouRnoE5vg3RERwEhpVqFmt0fo+VCOinAR0nHG5Nq0XWXUTmGGsbOcDljLxz+oLAN28cffMc+6OfxkRX3L5ILId3pHMvV+MJns9FCZSA6+u87s3K31fLARCvVP6aVXXRn+M6CGBLxjQtbGopeQCHBRaliNxGr5LJIAkLFusBeG7jqIpGToxqy+D87tiYrg1zG2iRFTkKtvMJRZxdEkCnwJx4jOmuVboKCdtAqCQNX9e4I6jKp+Gs8edSbbV+17TY422DqV+sOXIxMA6udZ1vWm9eDE25dVVoRfiQXC7U/BLEGkV3ocs5du15nD1+NEODqlrVW+2WceQ1yQcSF4hRsU7Wk1pJ+aMRvFkx6PV028nSLExxTTPkxw07BmmDU5W9E6KbLB1/NFtseSyzgxTacGlFEVxmS+Zq846NLcNTrwQuM15Bub4zAy1N8Qv2NeQs4I=';\r\n\t\r\n\t// Creating the signature, a hash with the s512 algorithm and the secret key. The signature is also base64 encoded.\r\n\t$signature = base64_encode(hash_hmac('sha512', $header_payload, $secret_key, true));\r\n\t//$signature = hash_hmac('sha512', $header_payload, $secret_key, true);\r\n\t\r\n\t// Creating the JWT token by concatenating the signature with the header and payload, that looks like this:\r\n\t$jwt_token = $header_payload . '.' . $signature;\r\n\t\r\n\t//listing the resulted JWT\r\n\t//echo $jwt_token;\r\n\t//print $jwt_token;\r\n\treturn $jwt_token;\r\n\t\r\n\t//$decoded_jwt = explode(\".\",$jwt_token);\r\n\t//$decoded_header = base64_decode($decoded_jwt[0]);\r\n\t//$decoded_payload = base64_decode($decoded_jwt[1]);\r\n\t//$decoded_signature = base64_decode($decoded_jwt[2]);\r\n\t//echo $decoded_signature;\r\n\t\r\n\t//die();\r\n\r\n\r\n//\t\t$data = 'my data';\r\n\t\t\r\n//\t\t//Crée une nouvelle clé privée et publique\r\n//\t\t$new_key_pair = openssl_pkey_new(array(\r\n//\t\t\t\t\"private_key_bits\" => 1024,\r\n//\t\t\t\t\"private_key_type\" => OPENSSL_KEYTYPE_RSA,\r\n//\t\t));\r\n//\t\topenssl_pkey_export($new_key_pair, $private_key_pem);\r\n\t\t\r\n//\t\t$details = openssl_pkey_get_details($new_key_pair);\r\n//\t\t$public_key_pem = $details['key'];\r\n\t\t\r\n//\t\t//Création de la signature\r\n//\t\topenssl_sign($data, $signature, $private_key_pem, OPENSSL_ALGO_SHA1);\r\n\t\t\r\n//\t\t//Sauvegarde pour utilisation ultérieur\r\n//\t\tfile_put_contents('private_key.pem', $private_key_pem);\r\n//\t\tfile_put_contents('public_key.pem', $public_key_pem);\r\n//\t\tfile_put_contents('signature.dat', $signature);\r\n//\t\tprint $private_key_pem;\r\n//\t\t//Vérification de la signature\r\n//\t\t$r = openssl_verify($data, $signature, $public_key_pem, \"sha1WithRSAEncryption\");\r\n//\t\tvar_dump($r);\r\n\t}", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function is_verified()\n {\n return false;\n }", "function handle_upload_signature(){\r\n\t\t$config = array();\r\n\t\t$config['upload_path'] = './assets/image_uploads/signature';\r\n\t\t$config['allowed_types'] = 'gif|jpg|png';\r\n\t\t\r\n\t\t$this->load->library('upload', $config);\r\n\t\t$this->upload->initialize($config);\r\n\t\tif (isset($_FILES['bank_signature']) && !empty($_FILES['bank_signature']['name'])){\r\n\t\t\tif ($this->upload->do_upload('bank_signature')){\r\n\t\t\t\t// set a $_POST value for 'image' that we can use later\r\n\t\t\t\t$upload_data = $this->upload->data();\r\n\t\t\t\t$_POST['old_signature'] = $upload_data['file_name'];\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\t// possibly do some clean up ... then throw an error\r\n\t\t\t\t$this->form_validation->set_message('handle_upload_signature', $this->upload->display_errors());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} \r\n\t}", "public static function verifySignature($signature, $msg, $key) : bool\n {\n $verified = sodium_crypto_sign_verify_detached(\n sodium_hex2bin($signature),\n sodium_hex2bin(self::hashObject($msg)),\n sodium_hex2bin($key)\n );\n\n return is_bool($verified) && $verified == true;\n }", "function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}", "function handle_upload_signature(){\r\n\t\t$config = array();\r\n\t\t$config['upload_path'] = './assets/image_uploads/signature';\r\n\t\t$config['allowed_types'] = 'gif|jpg|png';\r\n\r\n\t\t$this->load->library('upload', $config);\r\n\t\t$this->upload->initialize($config);\r\n\t\tif (isset($_FILES['signature']) && !empty($_FILES['signature']['name'])){\r\n\t\t\tif ($this->upload->do_upload('signature')){\r\n\t\t\t\t// set a $_POST value for 'image' that we can use later\r\n\t\t\t\t$upload_data = $this->upload->data();\r\n\t\t\t\t$_POST['old_signature'] = $upload_data['file_name'];\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\t// possibly do some clean up ... then throw an error\r\n\t\t\t\t$this->form_validation->set_message('handle_upload_signature', $this->upload->display_errors());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract protected function isSavedCardsPaymentMethod();", "public function check($type)\n {\n switch ($type)\n {\n case Signature::TYPE_SUBSCRIBO_BASIC:\n if (empty($this->basicToken)) {\n return false;\n }\n return true;\n case Signature::TYPE_SUBSCRIBO_DIGEST:\n if (empty($this->digestToken)) {\n return false;\n }\n if (empty($this->digestSecret)) {\n return false;\n }\n return true;\n default:\n return false;\n }\n }", "protected function generateSignature($content) {\n switch ($this->authentication_type) {\n case 'cert': //authenticating using certificate\n if (!$cert_store = file_get_contents($this->auth_certificate)) {\n echo \"Error: Unable to read the cert file\\n\"; // . \\Yii::getAlias('@webroot');\n return FALSE;\n } else {\n if (openssl_pkcs12_read($cert_store, $cert_info, $this->auth_certificate_pswd)) {\n openssl_sign($content, $signature, $cert_info['pkey'], $this->auth_certificate_sign_algorithm);\n return base64_encode($signature);\n }\n }\n break;\n case 'cred': //authenticating using username and password\n/////code here\n return FALSE;\n break;\n\n default: //authenticating via certificate as default\n if (!$cert_store = file_get_contents($this->auth_certificate)) {\n echo \"Error: Unable to read the cert file\\n\"; // . \\Yii::getAlias('@webroot');\n return FALSE;\n } else {\n if (openssl_pkcs12_read($cert_store, $cert_info, $this->auth_certificate_pswd)) {\n openssl_sign($content, $signature, $cert_info['pkey'], $this->auth_certificate_sign_algorithm);\n return base64_encode($signature);\n }\n }\n break;\n }\n }", "public function VerifySignature($signature) {\n return $this->signature->check_signature($this->request, $this->consumer, $this->token, $signature);\n }", "private function checkSign($fields, $sign) {\n\n\t\tksort($fields);\n\t\treset($fields);\n\t\t$signString = '';\n\t\twhile (list ($key, $val) = each($fields)) {\n\t\t\t$signString .= $key . '=' . $val . '&';\n\t\t}\n\t\t$signString = substr($signString, 0, count($signString) - 2);\n\t\t$signed = md5($signString . $this->ifSet($this->meta['key']));\n\n\t\tif ($signed == $sign) return true; else return false;\n\t}", "private function IsFreeAccount() {\n $ret = TRUE;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_USERAGENT, DOWNLOAD_STATION_USER_AGENT);\n curl_setopt($curl, CURLOPT_COOKIEFILE, $this->TOUTDEBRID_COOKIE);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_URL, $this->TOUTDEBRID_ACCOUNT_URL);\n $AccountRet = curl_exec($curl);\n curl_close($curl);\n preg_match('/Compte:.*<b>(.*)<\\/b>/', $AccountRet, $match);\n if (isset($match[0])) {\n $compare = strtolower($match[0]);\n if (strstr($compare, $this->TOUTDEBRID_PREMIUM_ACCOUNT_KEYWORD)) {\n $ret = FALSE;\n }\n }\n return $ret;\n }", "protected function validHasSignature()\n {\n if (! $this->request->has('signature')) {\n throw new VanillaInvalidRequestException('Missing signature parameter.');\n }\n }", "public static function checkSignature(array $option)\n {\n if (empty($option['signature']))\n {\n return 'signature miss';\n }\n\n if (empty($option['appid']))\n {\n return 'appid miss';\n }\n\n if (empty($option['timestamp']))\n {\n return 'timestamp miss';\n }\n\n if (empty($option['nonce']))\n {\n return 'nonce miss';\n }\n\n $signature = $option['signature'];\n $appid = $option['appid'];\n $timestamp = $option['timestamp'];\n $nonce = $option['nonce'];\n\n //当前时间的前后20分钟内有效,防止重放攻击\n //真实保证请求的唯一性,防止重放攻击需要利用redis保存20分钟有效期的nonce+timestamp,如redis有此记录表示该请求已被消耗\n $curTime = time();\n if ($timestamp > ($curTime + 1200) || $timestamp < ($curTime - 1200))\n {\n return 'timestamp error';\n }\n\n if (!in_array($appid, array_keys(static::$appIdArr)))\n {\n return 'appid error';\n }\n\n $secret = static::$appIdArr[$appid];\n unset($option['signature']);//signature不参与生成签名\n $createSign = static::createSignature($option, $secret);//后期静态绑定 since PHP 5.3.0\n\n if ($signature != $createSign)\n {\n return 'signature error';\n }\n\n return true;\n }", "protected function checkSignature()\n {\n $headers = \\Yii::$app->request->headers;\n\n $signature = $headers->get('paypal-transmission-sig');\n if (!$signature)\n throw new BadRequestHttpException;\n\n $checkString = sprintf('%s|%s|%s|%s',\n $headers->get('paypal-transmission-id'),\n $headers->get('paypal-transmission-time'),\n $this->webHookId,\n crc32(\\Yii::$app->request->rawBody)\n );\n\n $certUrl = $headers->get('paypal-cert-url');\n if (!$certUrl)\n throw new BadRequestHttpException;\n\n $publicKey = $this->fetchPublicKey($certUrl);\n if (!$publicKey)\n throw new \\Exception('Certificate error');\n\n// $algo = ArrayHelper::getValue($headers, 'paypal-hash-algo');\n\n $result = openssl_verify($checkString, base64_decode($signature), $publicKey);\n return $result === 1;\n }", "public function getSignature() : string\n {\n return $this->signature;\n }", "public function validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateUrlSignature()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'id' => 'required',\n 'expires' => 'required',\n 'hash' => 'required',\n 'signature' => 'required',\n ]);\n\n if($validator->passes()) {\n if(!$this->request->hasCorrectSignature($this->request, false)) {\n $this->apiResponse->setError(\"URL Signature is invalid.\");\n }\n\n if(!$this->request->signatureHasNotExpired($this->request)) {\n $this->apiResponse->setError(\"URL has expired.\");\n }\n\n /**\n * @var User|MustVerifyEmail $user\n */\n $user = User::find($this->request->input('id', null));\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user found.\");\n } else {\n if (! hash_equals((string) $this->request->input('id'), (string) $user->getKey())) {\n throw new AuthorizationException;\n }\n\n if (! hash_equals((string) $this->request->input('hash'), sha1($user->getEmailForVerification()))) {\n throw new AuthorizationException;\n }\n\n $this->apiResponse->setSuccess(['email' => $user->getEmailForVerification()]);\n }\n } else {\n $this->apiResponse->handleErrors($validator);\n }\n\n return $this->apiResponse->returnResponse();\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function getSignature()\n {\n return $this->signature;\n }", "public function verified()\n {\n return $this->verifyToken === null;\n }", "abstract function is_paying();", "abstract public function verify($data, $signature);", "public function getSignature() {\n $headers = $this->getHeaders();\n foreach ($headers as $key => $value) {\n if (strtolower($key) === 'x-hub-signature') {\n return $value;\n }\n }\n return '';\n }", "public function sign()\n {\n }", "function signup_nonce_check($result)\n {\n }", "public function authorize()\n {\n if (app()->environment() == 'testing') {\n return true;\n }\n \n $signature = $this->header('X-Pingplusplus-Signature');\n return $this->verify_signature(file_get_contents('php://input'), $signature) === 1;\n }", "public function testAuthenticateUserFalseStringToSign ()\n {\r\n $this->setExpectedException('SignatureDoesNotMatchException');\n $this->storage->authenticateUser($this->email1, $this->signature1, false);\n }", "private function hash_validation() { //check hash\n\n\t\t$testMode = getRequest('ik_pw_via');\n\n\t\tif(isset($testMode) && $testMode == 'test_interkassa_test_xts'){\n\t\t\t$secretKey = $this->object->test_key;\n\t\t} else {\n\t\t\t$secretKey = $this->object->secret_key;\n\t\t}\n\n\t\t$data = array();\n\n\t\tforeach ($_REQUEST as $key => $value) {\n if (!preg_match('/ik_/', $key)) continue;\n $data[$key] = $value;\n }\n\n\t\t$ik_sign = $data['ik_sign'];\n\t\t$sign = $this->createSign($data,$secretKey);\n\n\t\t$this->wrlog(\"hash: \".$sign);\n\t\t$this->wrlog(\"ik_sign: \".$ik_sign);\n\t\treturn $sign == $ik_sign ? true : false;\n\t}", "function Check()\n {\n $this->_RegenerateId();\n return (isset($_SESSION['ss_fprint1']) && $_SESSION['ss_fprint1'] == $this->_Fingerprint());\n }", "public function isVerified(): bool;", "function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}", "protected function validConditionSigned()\n {\n return $this->request->has('timestamp') || $this->request->has('signature');\n }", "public function hasVerification()\r\n {\r\n // No need for CVN in creating/updating token\r\n return Mage::getModel('ewayrapid/method_notsaved')->hasVerification();\r\n }", "function verify_person () {\n $bh=new gs_base_handler($this->data,$this->params);\n $f=$bh->validate();\n if (!is_object($f) || !is_a($f,'g_forms')) return $f;\n $d=$f->clean();\n\n $rec=person($this->params['role']);\n if (!$rec) {\n $f->trigger_error('FORM_ERROR','REC_NOTFOUND');\n return $bh->showform($f);\n }\n\n $fname=$this->params['field_name'].'_secret';\n $ga=new GoogleAuthenticator;\n $code=$ga->getCode($rec->$fname);\n\n\n if ($code!=$d['ga_code']) {\n $f->trigger_error('FORM_ERROR','GA_INCORRECT_CODE');\n return $bh->showform($f);\n }\n\n $person=person();\n $fname=$this->params['field_name'].'_verified';\n $person->$fname=TRUE;\n return true;\n }", "function license_exists($lic) {\n\tglobal $DB;\n\n\tif(!isset($lic) || empty($lic) || is_null($lic)) {\n\t\treturn true;\n\t}\n\t$lic = $DB->EscapeQueryStmt($lic);\n\t$DB->Query(\"SELECT COUNT(*) AS TOT FROM Account WHERE License = '{$lic}'\");\n\t$tot = $DB->GetRow();\n\treturn (isset($tot[\"TOT\"]) && intval($tot[\"TOT\"]) > 0);\n}", "public function processPayment() {\n\t\t\tif ($this->order->authorizeTransaction()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function testAuthenticateUserFalseSignature ()\n {\r\n $this->setExpectedException('SignatureDoesNotMatchException');\r\n $this->storage->authenticateUser($this->email1, false, $this->stringToSign1);\n }", "public function testValidSignature()\n {\n $authId = key($this->keys);\n $authSecret = reset($this->keys);\n $timestamp = 1432075982;\n\n $headers = [\n 'Content-Type' => 'text/plain',\n 'X-Authorization-Timestamp' => $timestamp,\n 'Authorization' => 'acquia-http-hmac realm=\"Pipet service\",'\n . 'id=\"' . $authId . '\",'\n . 'nonce=\"d1954337-5319-4821-8427-115542e08d10\",'\n . 'version=\"2.0\",'\n . 'headers=\"\",'\n . 'signature=\"MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc=\"',\n ];\n $request = new Request(\n 'GET',\n 'https://example.acquiapipet.net/v1.0/task-status/133?limit=10',\n $headers\n );\n\n $authenticator = new MockRequestAuthenticator(\n new MockKeyLoader($this->keys),\n null,\n $timestamp\n );\n\n $key = $authenticator->authenticate($request);\n\n $this->assertInstanceOf(KeyInterface::class, $key);\n $this->assertEquals($authId, $key->getId());\n $this->assertEquals($authSecret, $key->getSecret());\n }", "public function getSignature(): string\n {\n return $this->signature;\n }", "public function getSignature(): string\n {\n return $this->signature;\n }", "function signature()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\t$t_sig = $this->parser->unconvert($this->member['signature'], $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html']);\r\n\r\n\t\t$ibforums->lang['the_max_length'] = $ibforums->vars['max_sig_length']\r\n\t\t\t? $ibforums->vars['max_sig_length']\r\n\t\t\t: 0;\r\n\r\n\t\t$data = array(\r\n\t\t\t'TEXT' => $this->member['signature'],\r\n\t\t\t'SMILIES' => 1,\r\n\t\t\t'CODE' => 1,\r\n\t\t\t'SIGNATURE' => 0,\r\n\t\t\t'HTML' => $ibforums->vars['sig_allow_html'],\r\n\t\t);\r\n\r\n\t\t$this->member['signature'] = $this->parser->prepare($data);\r\n\r\n\t\tif ($ibforums->vars['sig_allow_html'] == 1)\r\n\t\t{\r\n\t\t\t$this->member['signature'] = $this->parser->parse_html($this->member['signature'], 0);\r\n\t\t}\r\n\r\n\t\t$this->output .= View::make(\r\n\t\t\t\"ucp.signature\",\r\n\t\t\t[\r\n\t\t\t\t'sig' => $this->member['signature'],\r\n\t\t\t\t't_sig' => $t_sig,\r\n\t\t\t\t'key' => $std->return_md5_check(),\r\n\t\t\t\t'select_syntax' => $std->code_tag_button()\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "public function getSignature() {\n\t\treturn $this->signature;\n\t}" ]
[ "0.6770142", "0.67143047", "0.6664379", "0.66574883", "0.6638612", "0.6638612", "0.6638612", "0.6627542", "0.66254014", "0.66165674", "0.6585539", "0.65357363", "0.6534501", "0.63947386", "0.6371259", "0.62868315", "0.6242764", "0.6218835", "0.6115981", "0.6115776", "0.61092263", "0.6092262", "0.5994734", "0.59942234", "0.59915847", "0.59832186", "0.5976732", "0.59646076", "0.5952989", "0.5951477", "0.59267604", "0.5916956", "0.58418304", "0.5840883", "0.5816983", "0.57969904", "0.57829815", "0.57807213", "0.57729805", "0.57338494", "0.57063985", "0.5701351", "0.5696178", "0.5692693", "0.5672185", "0.5667358", "0.5653132", "0.56483406", "0.56188315", "0.5599806", "0.55605006", "0.555817", "0.55512255", "0.5544368", "0.5544203", "0.5543992", "0.55384827", "0.55379283", "0.5537512", "0.55122256", "0.5512018", "0.54992265", "0.5499127", "0.54975814", "0.54917806", "0.5482867", "0.54807425", "0.54773164", "0.5473002", "0.5470422", "0.5467097", "0.54660356", "0.546545", "0.546545", "0.546545", "0.546545", "0.546545", "0.54556453", "0.54529196", "0.5436186", "0.5434972", "0.5433994", "0.5425459", "0.5411145", "0.54100734", "0.5406884", "0.54023325", "0.53963023", "0.53934693", "0.5384549", "0.53790236", "0.53756064", "0.5373638", "0.53645414", "0.5361529", "0.5359844", "0.53598213", "0.53598213", "0.5343795", "0.53386915" ]
0.70445544
0
if we've got credentials
public function hasCredentials($store=null) { return ($this->hasAccountUser($store) && $this->hasAccountSignature($store)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}", "public function canManageCredentials()\n {\n return true;\n }", "abstract public function credentials();", "abstract public function getCredentials();", "public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }", "protected function validCredentials(){\n $valid_credentials = !empty($this->consumerKey);\n $valid_credentials = ($valid_credentials && !empty($this->consumerSecret));\n $valid_credentials = ($valid_credentials && $this->consumerKey === variable_get('ebs_consumer_key', '')); \n $valid_credentials = ($valid_credentials && $this->consumerSecret === variable_get('ebs_consumer_secret', ''));\n \n return $valid_credentials;\n }", "public function shouldAllowCredentials(): bool {\n return $this->configuration['allow_credentials'];\n }", "protected function shouldFetchClientCredentials(): bool\n {\n return config('twitch-api.oauth_client_credentials.auto_generate')\n && $this->hasClientId()\n && $this->hasClientSecret();\n }", "function canDisplayCredentials()\n\t{\n\t\treturn env('SHOW_CREDENTIALS','false') == 'true';\n\t}", "private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }", "public function analisarCredito()\n {\n return true;\n }", "public function analisarCredito()\n {\n return true;\n }", "public function getCredentials(): ?object;", "private function _allowCredentials(): string\n {\n return ($this->config['AllowCredentials']) ? 'true' : 'false';\n }", "public function checkCredentials()\n\t{\n\t\t$user = $this->_getLoggedUser();\n\t\tif (null === $user) {\n\t\t\t$_SESSION['url'] = $_SERVER['REQUEST_URI'];\n\t\t\t$this->redirectTo();\n\t\t}\n\t\treturn $user;\n\t}", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "public function isLoaded()\n {\n return $this->password && $this->username;\n }", "public function analisarCredito()\n {\n return false;\n }", "private function _validateCredentials($credentials){\n if(empty($credentials->username) || empty($credentials->password)) return false;\n $admin = $this->_getPassword($credentials->username);\n if(empty($admin)) return false;\n $decodedPassword = $this->encryption->decrypt($admin->password);\n return $credentials->password == $decodedPassword;\n }", "public function attempt(Credentials $credentials): bool\n {\n }", "protected function shouldCacheClientCredentials(): bool\n {\n return config('twitch-api.oauth_client_credentials.cache');\n }", "protected function checkCredentials() {\n $client = \\Drupal::service('akamai.edgegridclient');\n if ($client->isAuthorized()) {\n drupal_set_message('Authenticated to Akamai.');\n }\n else {\n drupal_set_message('Akamai authentication failed.', 'error');\n }\n }", "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public function isAuthenticate()\n {\n return !empty($this->access_token);\n }", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public function checkAuthentication() {}", "public function getCredentials()\n { return $this->get('credentials'); }", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function getCredentials() {\r\n\t\t\r\n\t\treturn $this->_credentials;\r\n\t\t\r\n\t}", "public function use_authentication() {\n return $this->proxy_user && $this->proxy_pass;\n }", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public function init_credentials()\n\t{\n\t\tif($this->get_session('admin') != null)\n\t\t{\n\t\t\t$this->credentials['admin'] \t\t\t= $this->get_session('admin');\n\t\t\t$this->credentials['grupo_admin'] \t\t= $this->get_session('admin_grupo');\n\t\t\t$this->credentials['permissoes_admin'] \t= $this->get_session('admin_permissoes');\n\t\t\t\n\t\t\t$this->credentials['workspace_id'] \t\t= $this->get_session('workspace_id');\n\t\t\t$this->credentials['workspace_nome']\t= $this->get_session('workspace_nome');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->credentials = null;\n\t\t}\n\t}", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "public function readCredentials() {\n\t\t$key = ! empty( $_POST['connection']['key'] ) ? $_POST['connection']['key'] : '';\n\n\t\tif ( empty( $key ) ) {\n\t\t\treturn $this->error( __( 'You must provide a valid WebinarJamStudio key', TVE_DASH_TRANSLATE_DOMAIN ) );\n\t\t}\n\n\t\t$this->setCredentials( $_POST['connection'] );\n\n\t\t$result = $this->testConnection();\n\n\t\tif ( $result !== true ) {\n\t\t\treturn $this->error( sprintf( __( 'Could not connect to WebinarJamStudio using the provided key (<strong>%s</strong>)', TVE_DASH_TRANSLATE_DOMAIN ), $result ) );\n\t\t}\n\n\t\t/**\n\t\t * finally, save the connection details\n\t\t */\n\t\t$this->save();\n\n\t\treturn $this->success( __( 'WebinarJamStudio connected successfully', TVE_DASH_TRANSLATE_DOMAIN ) );\n\n\t}", "static function hasCredentials($action): bool\n {\n if ($action == 'login') {\n return true;\n }\n\n // for any other action, it is enough just to be logged in\n return App::$container['auth'] ?? false;\n }", "public function authenticating($credentials)\n\t{\n\t\t$user \t= $this->model->key($credentials['key'])->first();\n\n\t\tif(!$user)\n\t\t{\n\t\t\tthrow new Exception(\"Key tidak terdaftar!\", 1);\n\t\t}\n\n\t\tif(!Hash::check($credentials['secret'], $user->secret))\n\t\t{\n\t\t\tthrow new Exception(\"secret Tidak Cocok!\", 1);\n\t\t}\n\n\t\treturn true;\n\t}", "public function auth ()\n {\n $params = ['grant_type'=>'client_credentials'];\n $headers = ['Authorization' => 'Basic ' . base64_encode($this->_client_id.':'.$this->_client_secret)];\n $this->_request(Request::AUTH_URL, CurlClient::POST, $params, $headers);\n $token = Arr::get ($this->_body, 'access_token');\n $this->token($token);\n return ( ! empty ($token));\n }", "public function checkAuth();", "public function checkAuth();", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "public static function checkCredentials()\n {\n static $result = null;\n\n if ($result === null) {\n // Get merchant settings\n $merchantSettings = self::getMerchantSettings();\n\n $result = (is_array($merchantSettings) && !empty($merchantSettings['result']) && self::isValidResponse($merchantSettings));\n if ($result) {\n self::$merchantSettings = $merchantSettings;\n }\n }\n\n return $result;\n }", "public function authenticate() {\n\t\treturn FALSE;\n\t}", "public function hasLogin()\r\n\t{\r\n\t\treturn (!empty($this->username) && !empty($this->password));\r\n\t}", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "function authenticationNeeded()\n {\n\n // define all the global variables\n global $user;\n\n // check if user has 2-factor authentication enabled\n if (!$user->twoFactorEnabled()) {\n return false;\n }\n\n // check if secret key has been setup\n if ($user->get2FactorCode() == \"\") {\n return false;\n }\n\n // check if current session has been authenticated\n if (isset($_SESSION[\"authenticated\"])) {\n if ($_SESSION[\"authenticated\"] == true) {\n return false;\n }\n }\n\n // if no errors then ask for authentication\n return true;\n }", "private function compare_with_login()\n {\n }", "public function esTarjetaCredito() {\n return true;\n }", "private function isOAuthAuthenticated() {\r\n\t\tGLOBAL $wgYammerAccessKey, $wgYammerAccessSecret;\r\n\t\treturn !empty($wgYammerAccessKey) && !empty($wgYammerAccessSecret);\r\n\t}", "public function getCredentials()\n {\n return $this->credentials;\n }", "public function getCredentials()\n {\n return $this->credentials;\n }", "public function isAuth() {}", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "public function getCredentials()\n\t{\n\t\treturn $this->credentials;\n\t}", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "protected function hasLoginBeenProcessed() {}", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function retrieveByCredentials(array $credentials)\n {\n return false;\n }", "public function isAuthenticated() {\n\t}", "public function getCredential();", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }", "public function checkAuth() {\n\n /*\n * Dummy stuff - just to test the authentication loop\n */\n if ($_SERVER['PHP_AUTH_USER'] === $this->config['general']['admin']['user'] && $_SERVER['PHP_AUTH_PW'] === $this->config['general']['admin']['password']) {\n return true;\n }\n\n return false;\n }", "public function isAuthorized(){\n\t\t// Check that username is not empty and exists\n\t\t;return ($username = $_SERVER['PHP_AUTH_USER']) && array_key_exists($username, $this->users_pwds)\n\t\t// Check passord validity\n\t\t&& $this->users_pwds[$username] === $_SERVER['PHP_AUTH_PW']\n\t\t;\n\t}", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "public function getCredentials() {\n\t\treturn $this->_credentials;\n\t}", "public function supportsCredentials(array $credentials)\n {\n return array_keys($credentials) === array('login', 'password');\n }", "public function readCredentials()\n {\n $apiId = !empty($_POST['connection']['appId']) ? $_POST['connection']['appId'] : '';\n $apiUsername = !empty($_POST['connection']['apiUsername']) ? $_POST['connection']['apiUsername'] : '';\n $apiPassword = !empty($_POST['connection']['apiPassword']) ? $_POST['connection']['apiPassword'] : '';\n\n if (empty($apiId) || empty($apiUsername) || empty($apiPassword)) {\n return $this->error('You must provide a valid iContact AppID/Username/Password');\n }\n\n $this->setCredentials($_POST['connection']);\n\n $result = $this->testConnection();\n\n if ($result !== true) {\n return $this->error('Could not connect to iContact: ' . $result);\n }\n\n /**\n * finally, save the connection details\n */\n $this->save();\n $this->success('iContact connected successfully');\n }", "private static function get_credentials($credential_key = null) {\r\n\t\t\t$credentials = self::get_settings('credentials');\r\n\r\n\t\t\treturn empty($credentials) ? false :\r\n\t\t\t\t\t\t(is_null($credential_key) ? $credentials :\r\n\t\t\t\t\t\t\t(isset($credentials[$credential_key]) ? $credentials[$credential_key] : false));\r\n\t\t}", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}", "public static function getAuth()\n {\n if( !isset($_SESSION['FOXY_userid']) ) {\n return false;\n }\n return true;\n }", "protected function isAuthenticate() {\n $em = $this->getEm();\n $repository = $em->getRepository('Ephp\\Bundle\\WsInvokerBundle\\Entity\\Log\\LogAuthentication');\n /* @var $repository \\Ephp\\Bundle\\WsInvokerBundle\\Entity\\Log\\LogAuthenticationRepository */\n return $repository->checkOrCreateToken($this->getUtente(), $this->persist);\n }", "protected function isLoginInProgress() {}", "function _verifyCredentials($ac_token) {\n $api = 'https://api.twitter.com/1/account/verify_credentials.json';\n return $this->_execTwApi($ac_token, $api, array(), 'get');\n }", "public function getCredentials()\n {\n return '';\n\n }", "private function authCredUser(){\n\t\t\n\t\t// UC 3 1: User wants to authenticate with saved credentials\n\t\t\t// - System authenticates the user and presents that the authentication succeeded and that it happened with saved credentials\n\t\t$inpName = $this->view->getInputName(true);\t\n\t\t$inpPass = $this->view->getInputPassword(true);\n\n\t\t$answer = $this->model->loginCredentialsUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\n\t\tif($answer == null){\n\t\t\t$this->view->showLogin(false);\n\t\t\t\n\t\t} else if($answer == true){\t\t\n\t\t\t$this->view->storeMessage(\"Inloggning lyckades via cookies\");\n\t\t\treturn $this->view->showLogin(true);\n\t\t} else {\t\t\n\t\t\t// 2a. The user could not be authenticated (too old credentials > 30 days) (Wrong credentials) Manipulated credentials.\n\t\t\t\t// 1. System presents error message\n\t\t\t\t// Step 2 in UC 1\t\t\t\t\n\t\t\t$this->view->removeCredentials();\n\t\t\t$this->view->storeMessage(\"Felaktig eller föråldrad information i cookie\");\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function getServerCredentials()\n {\n if ($connections = $this->command->option('on')) {\n $this->connections->setActiveConnections($connections);\n }\n\n // Check for configured connections\n $availableConnections = $this->connections->getAvailableConnections();\n $activeConnections = $this->connections->getActiveConnections();\n\n // If we didn't set any connection, ask for them\n if (!$activeConnections->count() && empty($availableConnections)) {\n $connectionName = $this->ask('askWith', 'No connections have been set, please create one', 'production');\n $this->getConnectionCredentials($connectionName);\n\n return;\n } elseif (!$activeConnections->count()) {\n $available = array_keys($availableConnections);\n $connection = $this->ask('askWith', 'No default connection, pick one', head($available), $available);\n $this->connections->setActiveConnections($connection);\n }\n\n // Else loop through the connections and fill in credentials\n foreach ($activeConnections as $connection) {\n $connectionName = $connection->getConnectionKey()->name;\n\n $servers = Arr::get($availableConnections, $connectionName.'.servers');\n $servers = array_keys($servers);\n foreach ($servers as $server) {\n $this->getConnectionCredentials($connectionName, $server);\n }\n }\n }", "public function firstParty() {\r\n return $this->personal_access_client || $this->password_client;\r\n }", "function isAuth()\n {\n $db = $this->getDatabaseConnection();\n $sesPrefix = $db->dsn['database'];\n if (empty($_SERVER['PHP_AUTH_USER'])) {\n @session_start();\n }\n if (!empty($_SESSION[__CLASS__][$sesPrefix .'-auth'])) {\n // in session...\n $a = unserialize($_SESSION[__CLASS__][$sesPrefix .'-auth']);\n $u = DB_DataObject::factory('core_company');\n if ($u->get($a->id)) { //&& strlen($u->passwd)) {\n return true;\n }\n $_SESSION[__CLASS__][$sesPrefix .'-auth'] = '';\n \n }\n // not in session or not matched...\n \n \n return false;\n \n }", "private function checkCredentials(array $args = []): bool\n {\n if (empty($args['credentials'])) {\n throw new VisacheckException('You did not provide the Visacheck client credentials in the configuration.', $args);\n }\n $id = data_get($args, 'credentials.id', null);\n $secret = data_get($args, 'credentials.secret', null);\n if (empty($id)) {\n throw new VisacheckException('The client \"id\" key is absent in the credentials configuration.', $args);\n }\n if (empty($secret)) {\n throw new VisacheckException('The client \"secret\" key is absent in the credentials configuration.', $args);\n }\n return true;\n }", "public function isAuthenticatedSuccessfully(): bool;", "public function isAuth();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function authorize(): bool\n {\n return config('fenerum.webhook_auth_username') === $this->getUser() &&\n config('fenerum.webhook_auth_password') === $this->getPassword();\n }", "public function getCredentials()\n {\n return '';\n }", "public function isCredentialsExpired()\n {\n return ! $this->isCredentialsNonExpired();\n }", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "public function authenticate() { return false; }", "public function authenticate()\n\t{\n\t if($this->pop_authenticate($this->username, $this->password,\"192.168.121.26\"))\n {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n }\n else\n {\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n }\n\t\treturn !$this->errorCode;\n\t}", "function checkAuth() {\n\tglobal $conf;\n\t\n}", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}" ]
[ "0.7717896", "0.7279266", "0.72288924", "0.7169351", "0.7161567", "0.702927", "0.7021048", "0.68298554", "0.67666334", "0.67508", "0.66146696", "0.66146696", "0.66101295", "0.6608334", "0.65727717", "0.65677303", "0.654459", "0.6528564", "0.65263957", "0.6473036", "0.646379", "0.64543647", "0.6438722", "0.64236933", "0.64236933", "0.64051425", "0.6404487", "0.6393194", "0.6360256", "0.63532484", "0.63509154", "0.6337867", "0.63339704", "0.6331423", "0.6322843", "0.630549", "0.6299101", "0.62860644", "0.6284847", "0.6278209", "0.6278209", "0.62701696", "0.62668806", "0.6253767", "0.6248579", "0.62456477", "0.6238478", "0.6233536", "0.6222633", "0.62165797", "0.62161684", "0.6213165", "0.6213165", "0.6206068", "0.619855", "0.619364", "0.6190935", "0.6188555", "0.61853755", "0.617279", "0.6169482", "0.61650264", "0.6157257", "0.6155851", "0.61490744", "0.614532", "0.6143509", "0.61389416", "0.6119042", "0.6116214", "0.611341", "0.6112498", "0.61084163", "0.61074513", "0.61017567", "0.60996914", "0.609788", "0.6094212", "0.60780495", "0.60719836", "0.60715353", "0.60712826", "0.60709", "0.607065", "0.6066076", "0.6050299", "0.6044913", "0.6033162", "0.6033162", "0.6033162", "0.6033162", "0.60249954", "0.6020573", "0.60164785", "0.60155517", "0.60142213", "0.5999097", "0.59978014", "0.59974664", "0.599492" ]
0.67312074
10
Get account bank data.
public function getAccountBankData($store=null) { $bankData = new ArrayObject(array()); $bankData->offsetSet('accountOwner',$this->getConfig('shipper/bank_data_accountOwner', $store)); $bankData->offsetSet('accountNumber',$this->getConfig('shipper/bank_data_accountNumber', $store)); $bankData->offsetSet('bankCode', $this->getConfig('shipper/bank_data_bankCode', $store)); $bankData->offsetSet('bankName', $this->getConfig('shipper/bank_data_bankName', $store)); $bankData->offsetSet('iban', $this->getConfig('shipper/bank_data_iban', $store)); $bankData->offsetSet('bic', $this->getConfig('shipper/bank_data_bic', $store)); $bankData->offsetSet('note', $this->getConfig('shipper/bank_data_note', $store)); return $bankData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBankData()\n {\n $bankdata = null;\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n (!$quote->getCustomerIsGuest()) ? $customerId = $quote->getCustomer()->getId() : $customerId = '';\n $piEncryption = new Pi_Util_Encryption_MagentoEncryption();\n if (!$quote->getCustomerIsGuest() && $piEncryption->isBankdataSetForUser($customerId)) {\n $bankdata = $piEncryption->loadBankdata($customerId);\n } else {\n $bankdata = array (\n 'owner' => Mage::getSingleton('core/session')->getAccountHolder()\n );\n\n if(Mage::getSingleton('core/session')->getIban()) {\n $bankdata['iban'] = Mage::getSingleton('core/session')->getIban();\n } else {\n $bankdata['accountnumber'] = Mage::getSingleton('core/session')->getAccountNumber();\n $bankdata['bankcode'] = Mage::getSingleton('core/session')->getBankCodeNumber();\n }\n }\n return $bankdata;\n }", "public function getBankAccount()\n {\n return $this->getData(self::BANK_ACCOUNT);\n }", "public function getAccountBank()\n {\n return $this->account_bank;\n }", "public function getBankAccount()\n {\n \treturn $this->db->get_where('bank_account',array('delete_status'=>0))->result();\n }", "public function get_bankcash() {\n\t return $this->db->get(\"tat_finance_bankcash\");\n\t}", "public function getAccountData() {\n\t\t$this->_loadAccountData();\n\t\treturn $this->_accountData;\n\t}", "public function getBankList()\n {\n $url = Moota::BASE_URL . Moota::ENDPOINT_BANK_INDEX;\n\n return (new ParseResponse(\n Zttp::withHeaders([\n 'User-Agent' => 'Moota/2.0',\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer ' . Moota::$ACCESS_TOKEN\n ])->get($url), $url\n ))\n ->getResponse()\n ->getBankData();\n }", "public function getBankAccount()\n {\n return $this->bankAccount;\n }", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "public function getBankAccount() {\n return $this->bankAccount;\n }", "public static function getAllBank()\n {\n return DB::table('banks')->select('id', 'name')->get();\n }", "public function bankaccounts() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('bankaccount_id'));\n $data['bankaccount'] = $this->account_model->getBankaccounts(array('mbankaccounts.mbankaccount_id' => $id));\n $data['balance'] = $this->account_model->getBankBalance(array('mbankaccount_id' => $id));\n $data['fixed_deposit'] = $this->account_model->getBankFixedDeposits(array('mbankaccount_id' => $id));\n $data['transactions'] = $this->account_model->getTransactions(false, array('ttransactions.mbankaccount_id' => $id, 'ttransactions.status' => 1));\n } else {\n $data['bankaccounts'] = $this->account_model->getBankaccounts();\n }\n $bank_data['name'] = \"accounts\";\n $data['bank_data'] = $bank_data;\n $this->view('bankaccounts', $data);\n }", "public function getDepositBankAccount()\n {\n return BankAccount::doesntHave('user')\n ->whereHas('bank.operatingCountries', function (Builder $query) {\n $query->where('code', $this->country);\n })\n ->has('supportedCurrency')->where('currency', $this->currency)\n ->latest()->first();\n }", "public function all(): array\n {\n return Billingo::get('bank_accounts');\n }", "public function getIndex()\n\t{\n\t //\n\t $bankAccount = BankAccount::all();\n\n\t return $bankAccount;\n\n\t}", "public function getAccountInformation()\n {\n return $this->api->getBinanceApiRequest('v3/account');\n }", "function getAccountBalances() {\n\t\t$balances = $this->data->get(\"acountInfoBalances_Data\");\n\t\t$date = $this->data->get(\"acountInfoBalances_Date\");\n\n\t\tif ($balances && $date) {\n\t\t\t$date = Time::fromString($date);\n\n\t\t\tif ($date->isNow()) {\n\t\t\t\treturn json_decode($balances);\n\t\t\t}\n\t\t}\n\n\t\t$date = Time::now();\n\t\t$account = $this->getAccountInfo();\n\t\t$balances = [];\n\t\t$balancesArray = [];\n\t\t\n\t\tif ($account) {\n\t\t\t$balances = $account->getBalances();\n\n\t\t\tforeach($balances AS $balance) {\n\t\t\t\t$balancesArray[] = (object)Array(\n\t\t\t\t\t\"balanceInStroops\" => $balance->getBalance()->toString(),\n\t\t\t\t\t\"assetCode\" => $balance->getAsset()->getCode(),\n\t\t\t\t\t\"assetIssuer\" => !$balance->getAsset()->isNative() ? $balance->getAsset()->getIssuer()->getPublicKey() : null,\n\t\t\t\t\t\"assetIsNative\" => $balance->getAsset()->isNative() ? true : false\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->data->set(\"acountInfoBalances_Data\", json_encode($balancesArray));\n\t\t$this->data->set(\"acountInfoBalances_Date\", $date->toString());\n\t\t$this->data->save();\n\n\t\treturn $balancesArray;\n\t}", "public function getBalances ()\n\t{\n\t\treturn $this->call ('account/getbalances', array(), true);\n\t}", "public function getBalance()\n {\n \t$getbrand = mysql_query(\"select * from brands where ref='\" . $_SESSION['brand'] . \"'\");\n $getbrandrow = mysql_fetch_array($getbrand);\n $manager = new Manager();\n return $manager->setBrand($getbrandrow['api_type'])->getBalance();\n }", "public function getAccount();", "public function index()\n {\n return response(BankAccount::all()->jsonSerialize(), 200);\n }", "public function get_bankDetails()\r\n {\r\n $this->db->select('first_name,middle_name, surname, school_name, department,b.reg_number,bank_name,bank_branch, bank_account,amount');\r\n $this->db->from('users u', 'left');\r\n $this->db->join('programmes p','p.prog_id=u.program','left');\r\n $this->db->join('departments d','d.dept_id=p.department_id','left');\r\n $this->db->join('schools s','s.sch_id=d.sch_id','left');\r\n $this->db->join('bank_details b','b.reg_number=u.reg_number');\r\n $query=$this->db->get();\r\n return $query->result_array();\r\n }", "public static function getBalance()\n {\n if (Cache::has('wallets_' . auth()->id())) {\n $balanceRecords = Cache::get('wallets_' . auth()->id());\n } else {\n $balanceRecords = self::where('wallet_id', auth()->user()->wallet->id)->get();\n self::cacheAllWallets($balanceRecords);\n }\n return $balanceRecords;\n }", "private function getBankOptions() {\n \n $this->checkBankOptions();\n $aBanks = $this->fetchBankOptions();\n return $aBanks;\n }", "public function getBankcode()\n {\n return $this->bankcode;\n }", "function get_banks() {\n $aBankOptions = $this->getBankOptions();\n $aBanks = array();\n foreach ($aBankOptions as $id => $text) {\n $aBanks[] = array(\n \"id\" => $id,\n \"text\" => $text\n );\n }\n return $aBanks;\n }", "public function selectData() {\n $database = \\Drupal::database();\n $query = $database->select('bank_account_cards', 'ac');\n $query->fields('ac', ['rid','uid','type','card_number','expiry_date','cvv','card_name','debit','default']);\n $query->condition('ac.uid', $this->getUserId());\n $query->orderBy('default', 'DESC');\n\n return $query->execute()->fetchAll();\n }", "public function get_balance() {\n\t\t$balance = self::make_api_call( 'balances' );\n\t\tif ( 'ok' === $balance['error'] ) {\n\t\t\treturn $balance['result'];\n\t\t}\n\t\treturn array();\n\t}", "public function getBalances() {\n return $this ->apiCall('account/getbalances');\n }", "public function getBankId()\n {\n return $this->bank_id;\n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "function getBOCAccount($accountid = 'a746637b91b19a261a67d8bd') {\n\t//bankid bda8eb884efcef7082792d45\n\t//accountid a746637b91b19a261a67d8bd\n\t//viewid 5710bba5d42604e4072d1e92\n\t//\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t\t\t 'Auth-Provider-Name: 01460900080600',\n\t\t\t\t\t\t\t 'Auth-ID: 123456789',\n\t\t\t\t\t\t\t 'Ocp-Apim-Subscription-Key: f1817e51b3fb4d2ca3fc279d0df3a061'\n\t\t\t\t\t\t\t ),\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"http://api.bocapi.net/v1/api/banks/bda8eb884efcef7082792d45/accounts/$accountid/5710bba5d42604e4072d1e92/account\",\n\t // CURLOPT_URL => \"192.168.88.202:8080/customer/$custId/goals\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function banks()\n {\n return Cache::remember('banks', $this->cacheTime, function () {\n return collect(Paymentmethods::getBanks(10))->pluck('name', 'id');\n });\n }", "function get_balances()\n {\n $balances = $this->call_api('/v1/account/balances');\n \n return $balances;\n }", "private function get()\n {\n $db = 'Ernio\\\\Bankas\\\\' . $this->settings;\n return $db::get();\n }", "public function getBalance(): array\n {\n $out = $this->request('getBalance');\n return $out['result'];\n }", "private function getData($account)\n {\n $where = array('url' => $account);\n $data = $this->_dbTable->getRow($where, array('idaccount', 'name'));\n return $data;\n }", "public function show(AccountBank $accountBank)\n {\n //\n }", "public function find($bankAccountId): array\n {\n return Billingo::get(\"bank_accounts/{$bankAccountId}\");\n }", "public function getAccountInfo() {\n\t\treturn $this->get($this->api_url . 'account/info');\n\n $data = $this->http_oauthed($this->api_url . 'account/info');\n return json_decode($data,true);\n\n }", "public function get_balance()\n\t{\n\t\t$this->template = '';\n\t\t$this->auto_render = FALSE;\n\t\t\n\t\t// Initialize the nexmo library\n\t\t$nexmo_sms = new Nexmo_SMS();\n\t\t\n\t\theader(\"Content-type: application/json; charset=utf-8\");\n\t\tprint $nexmo_sms->get_account_balance();\n\t}", "public function index()\r\n {\r\n\r\n $data = UserBankAccount::where('user_id', Sentinel::getUser()->id)->get();\r\n\r\n return view('user_bank_account.data', compact('data'));\r\n }", "public function ViewAllBankTransferData()\n {\n $clientBalance = BankTransferWithdrawModel::all();\n $clientBalanceArr = array();\n\n if( $clientBalance->count() > 0) {\n \n foreach ($clientBalance as $k => $v) {\n $clientBalanceArr[$k][\"id\"] = $v->id;\n $clientBalanceArr[$k][\"suit\"] = $v->user->suit;\n $clientBalanceArr[$k][\"name\"] = $v->user->name;\n $clientBalanceArr[$k][\"BankName\"] = $v->BankName;\n $clientBalanceArr[$k][\"accountName\"] = $v->accountName;\n $clientBalanceArr[$k][\"iban\"] = $v->iban;\n $clientBalanceArr[$k][\"amount\"] = $v->amount;\n $clientBalanceArr[$k][\"photo\"] = '\n <a href=\"' . asset($v->photo). '\" >\n <img src=\"'.asset($v->photo).'\" style=\"width:50px;height:50px\" />\n </a> \n ';\n $clientBalanceArr[$k][\"relationship\"] = $v->relationship;\n $clientBalanceArr[$k][\"status\"] = $v->status;\n $clientBalanceArr[$k][\"created_at\"] = $v->created_at;\n $clientBalanceArr[$k][\"updatted_at\"] = $v->updated_at;\n }\n\n }\n\n return view(\"admin.withdraws.withdrawsList\", compact(\"clientBalanceArr\"));\n\n\n return view('');\n }", "public function getBalance()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$setting = D('Setting');\n\t\t\t$sql = \"select * from lib_setting \";\n\t\t\t$return = $setting->query($sql);\n\t\t\tif ($return) {\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'data' => null\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'data' => null\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function getBankList($bank_id = 0)\n\t{\n\n\t\tif($bank_id > 0)\n\t\t{\n\t\t\t$this->db->where('id > ',$bank_id);\n\t\t}\n\t\t\n\t\t$query1 = $this->db->get('tbl_bank');\n\n\t\t$data = $query1->result();\n\n\t\techo $myJSON = json_encode($data);\n\t}", "function currentBalance($accesstoken, $account_id, $api_root) {\n\t\t$ch = curl_init();\n\t\t\n\t\t$headr = array(\n\t\t\t'Content-type: application/json',\n\t\t\t'Authorization: Bearer '.$accesstoken\n\t\t);\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, \"$api_root/balance?account_id=$account_id\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headr);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$rest = curl_exec($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t$json = json_decode($rest, true);\n\t\t\n\t\t// we can change the once mondo adds multiple bank accounts per login, but for the moment we can just go for account #0\n\t\treturn $json;\n\t}", "static function getServiceBal($connection){\r\n //get balance\r\n $accno = $_SESSION['accno'];\r\n\r\n $sql = \"SELECT balance FROM _accounts WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n $statement->execute(array(':account'=>$accno));\r\n $row = $statement->fetchall();\r\n\r\n $balance = \"\";\r\n foreach ($row as $key => $value) {\r\n $balance = $value['balance'];\r\n }\r\n return $balance;\r\n }", "public function bankAccount($number)\n {\n return $this->send('GET', \"check/bank_account_number/{$number}\");\n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "function getBankLists() {\r\n\t\t$idealPlugin = os_payments::loadPaymentMethod('os_ideal');\t\t\r\n\t\t$params = new JRegistry($idealPlugin->params) ;\t\t\r\n\t\t$partnerId = $params->get('partner_id');\r\n\t\t$ideal = new iDEAL_Payment($partnerId) ;\r\n\t\t$bankLists = $ideal->getBanks();\r\n\t\treturn $bankLists ;\r\n\t}", "public function info_blast_credit_balance() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/info/blast_credit_balance.json\");\n }", "public function testListUserBankAccounts() {\n $createUser = PromisePay::User()->create($this->userData);\n \n // update bank account data with the id of just created user\n $this->bankAccountData['user_id'] = $createUser['id'];\n \n // create a Bank Account\n $createBankAccount = PromisePay::BankAccount()->create($this->bankAccountData);\n \n // Lookup Bank Accounts associated with the user\n $userBankAccounts = PromisePay::User()->getListOfBankAccounts($createUser['id']);\n \n $this->assertEquals($this->bankAccountData['bank_name'], $userBankAccounts['bank']['bank_name']);\n }", "public function getBankId()\n {\n if (!empty($this->info['bank_id'])) {\n return $this->info['bank_id'];\n }\n }", "public function accountBalance() {\n $data = [\n 'Initiator' => $this->initiatorUsername,\n 'SecurityCredential' => $this->securityCredential,\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->shortCode,\n 'IdentifierType' => '4',\n 'Remarks' => 'Checking Account Balance',\n 'QueueTimeOutURL' => $this->apiBaseUrl.'/mobilepay/bal/time_out',\n 'ResultURL' => $this->apiBaseUrl.'/mobilepay/bal/result'\n ];\n return $this->remotePostCall('mpesa/accountbalance/v1/query', $data);\n }", "public function getAccountInformation()\n {\n $account = array(\n 'id' => $this->_account->getId(),\n 'nickname' => $this->_account->getNickname(),\n 'firstname' => $this->_account->getFirstname(),\n 'lastname' => $this->_account->getLastname(),\n 'created_at' => $this->_account->getCreated_at()\n ->format('d.m.Y H:M:s'),\n 'image' => $this->getProfileImage()\n );\n\n return $account;\n }", "public function getRecord($id)\n\t{\n\t\treturn $this->db->get_where('bank_account',array('id'=>$id))->row();\n\t}", "public function index()\n {\n //\n $bankAccount = BankAccount::where('user_id',Auth::user()->id)->get();\n return BankAccountResource::collection($bankAccount);\n }", "public function getAccounts();", "public function pseBank()\n {\n return $this->request(\n \"GET\",\n \"/restpagos/pse/bancos.json\",\n $api_key = $this->epayco->api_key,\n $options = null,\n $private_key = $this->epayco->private_key,\n $test = $this->epayco->test,\n $switch = true,\n $lang = $this->epayco->lang\n );\n }", "public static function getBankAccounts($cobSession, $userSession)\n\t\t{\n\t\t\t$url = \"https://developer.api.yodlee.com/ysl/restserver/v1/accounts\";\n\n\t\t\t$curl = curl_init();\n\n\t\t\tcurl_setopt_array($curl, array(\n\t\t\t CURLOPT_SSL_VERIFYPEER => false,\n\t\t\t CURLOPT_URL => $url,\n\t\t\t CURLOPT_RETURNTRANSFER => 1,\n\t\t\t CURLOPT_TIMEOUT => 360,\n\t\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Authorization: {cobSession='.$cobSession.',userSession='.$userSession.'}'\n\t\t\t )\n\t\t\t));\n\n\t\t $response = curl_exec($curl);\n\n\t\t\tif ($response) {\n\t\t\t\treturn json_decode($response, TRUE); // return bank account data as object\n\t\t\t}\n\t\t}", "public function get_balance_sheet()\n {\n /*\n * retrieve trial balance.\n * prepare component of balance sheet as arrays.\n */\n $trial = $this->get_trial();\n\n $current_assets = array();\n $fixed_assets = array();\n $liabilities = array();\n $equity = array();\n\n /*\n * loop through trial balance data and distribute each component.\n * separate between activa, pasiva and modal\n */\n foreach ($trial as $row) {\n if ($row[\"position\"] == \"DEBITS\") {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"debit\"]);\n } else {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"credit\"]);\n }\n\n if ($row[\"account\"] == \"[Assets] Inventory\" || $row[\"account\"] == \"[Assets] Cash\") {\n $current_assets[] = $temp;\n }\n if ($row[\"account\"] == \"[Assets] Cart, Sign, Equipment\") {\n $fixed_assets[] = $temp;\n }\n if ($row[\"account\"] == \"[Liabilities and Equity] Loans\") {\n $liabilities[] = $temp;\n }\n if ($row[\"account\"] == \"[Liabilities and Equity] Equity : Paid-in Capital\") {\n $equity[] = $temp;\n }\n }\n\n return array($current_assets, $fixed_assets, $liabilities, $equity);\n }", "public function getBanks()\n {\n $postData = array(\n static::APILOGIN => $this->szkwalApiLogin,\n static::APIPASS => $this->szkwalApiPass,\n );\n $res = $this->request('GetBanksData', $postData);\n $this->checkSzkwalError($res);\n\n preg_match_all('/(.*)/', $res, $matches);\n if (isset($matches[1]) && isset($matches[1][0])) {\n $data = json_decode($matches[1][0], true);\n foreach ($data as &$d) {\n $d['availability'] = json_decode($d['availability'], true);\n }\n } else {\n throw new TException(static::INVALIDRESPONSE);\n }\n\n return $data;\n }", "public function fetch_banks(){\n $query = $this->db->where('status_id', 1)->get('banks');\n if($query){\n return $query->result_array();\n }else{\n return false;\n }\n }", "public static function getAllBalance() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n return self::$rpcClient->getbalance();\n }", "public function balancesAndInfo()\r\n {\r\n return $this->httpRequest(\"balances-and-info\",\"POST\",[\"wapi\" => true],true);\r\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function getbalance()\n {\n $theAccountBalance = [\"currency\" => \"NGN\", \"balance\"=> 0];\n try {\n $thePaystack = new Paystack();\n $theCurrentAcctBalance = $thePaystack->checkBalance();\n if ( isset($theCurrentAcctBalance['data']) && count($theCurrentAcctBalance['data'])){\n $theAccountBalance = $theCurrentAcctBalance['data'][0];\n }\n } catch (\\Throwable $th) {\n //throw $th;\n return $th;\n }\n\n return $theAccountBalance;\n }", "function btce_account_info($key, $secret) {\n // has stuff like active funds...\n return json_btce_generic_read($key, $secret, 'getInfo');\n}", "public function getbalance(){\n $balance = $this->_run('getbalance');\n return $balance;\n }", "function _getBalance()\n {\n $url = 'cmd=account';\n\n $response = $this->_callURL($url);\n\n if (is_a($response, 'PEAR_Error')) {\n return PEAR::raiseError(sprintf(_(\"Send failed. %s\"), $response['error_message']));\n }\n\n if (!array_key_exists('error_code', $response)) {\n return $response['balance'];\n } else {\n return $this->getError($response['error_message'], _(\"Could not check balance. %s\"));\n }\n }", "public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "public function getData()\n {\n return DataTables::of(App\\Models\\Deposit::where('company_id', Auth::user()->company_id))->make(true);\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function index()\n {\n $bank_accounts = BankAccount::with('financial_organization')->orderBy('id', 'DESC')->paginate(10);\n return response()->json([\n 'bank_accounts' => $bank_accounts\n ], 200);\n }", "public function bankdetailGet($id)\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.get',\n array('id' => $id)\n );\n return $fullResult;\n }", "public function getMyBank($UID)\n\t\t{\n\t\t}", "public function getBalance()\n {\n return Cash::orderBy('id', 'desc')\n ->value('solde');\n }", "public function account_info() {\r\n return $this->request_info(\"v2/account\");\r\n }", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function accountBalances(): string\n {\n $endpoint = '/account/balances';\n\n return $this->privateRequest($endpoint);\n }", "function getDataAdminAccount() {\r\n\t\t\t$query = $this->pdo->prepare('select * from admin_account');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "public function bankAccountsV2Get()\n {\n list($response) = $this->bankAccountsV2GetWithHttpInfo();\n return $response;\n }", "public function getBalance();", "public function fetch_bank_profile($id){\n $query = $this->db->join('nationality_08 b', 'a.01_nationality=b.08_id')\n ->join('bank_details_16 c', 'a.01_id=c.01_id')\n ->where('a.01_id', $id)\n ->get('register_01 a');\n if($query){\n return $query->result_array();\n }\n else{\n return false;\n }\n }", "function bankDetail()\n\t{\n\t\t$this->db->select('bankdetail');\n\t\t$this->db->from('site_config');\n\t\t$this->db->where('id','1');\n\t\t$query = $this->db->get();\n\t\treturn $query;\t\n\t}", "public function getBalance()\n {\n $params = http_build_query(\n array(\n 'action' => 'getbalance',\n 'lgn' => $this->config['login'],\n 'pwd' => $this->config['password'],\n )\n );\n\n return CurlHelper::send(self::URL . '?' . $params);\n }", "static public function getDataForId($id) {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Data = DB::getInstance()->query('SELECT * FROM `'.PREFIX.'account` WHERE `id`=\"'.(int)$id.'\" LIMIT 1')->fetch();\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\treturn $Data;\r\n\t}", "public function get_all_balance($id)\n {\n if($id==0){\n $q=$this->db->where(['admin_id'=>1])->get('admin');\n $bal=$q->result_array()[0]['admin_chips'];\n }else if($id>999){\n $q=$this->db->where(['client_id'=>$id])->get('clients');\n $bal=$q->result_array()[0]['client_balance'];\n }else{\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n $bal=$q->result_array()[0]['dist_balance'];\n }\n return $bal;\n }", "public function getBanks()\n {\n return $this->hasMany(Bank::className(), ['gl_account_id' => 'account_id']);\n }", "public function show(BankData $bankData)\n {\n //\n }", "protected function _loadAccountData() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_MEMBID_.\" = ?\", array($this->_userid));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = ?\", array($this->_username));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_EMAIL_.\" = ?\", array($this->_email));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function getBankInfo($request, $response) {\n \t$publishable_key = getenv('STR_PUB');\n\n $has_account = StripeDB::select('acct_id')\n ->where('user_id', $this->auth->user()->id)\n ->first();\n\n \treturn $this->view->render($response, 'dashboard/bankInfo.twig', [\n \t\t'pub_key' => $publishable_key,\n 'has_account' => $has_account->acct_id,\n \t]);\n }", "public function get_balance() {\n $url = \"https://api.labsmobile.com/get/balance.php?username=\".$this->LMaccount_username.\"&password=\".$this->LMaccount_password;\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n $result = curl_exec($ch);\n curl_close($ch);\n\n if(stripos($result, \"<code>\") !== FALSE) {\n\t return $this->_xml_extract(\"code\", $result);\n } else {\n\t return \"\";\n }\n }", "public function getBanks()\n {\n return $this->hasMany(Bank::className(), ['currency_id' => 'currency_id']);\n }", "public function getBankAccount(): ?BankAccountInterface\n {\n return new BankAccount($this->data->bankAccount);\n }", "public function index()\n {\n $accounts = AccountBank::all();\n\n return view('admin.panel.account-bank.list.index', compact('accounts'));\n }" ]
[ "0.81649417", "0.7855384", "0.781611", "0.77169925", "0.7426276", "0.7417318", "0.7324795", "0.730518", "0.7256578", "0.7245826", "0.717948", "0.71005434", "0.6898566", "0.6825485", "0.68176085", "0.67050344", "0.6691094", "0.66618496", "0.665019", "0.6631288", "0.662615", "0.66214013", "0.65854883", "0.6580629", "0.6543395", "0.6536343", "0.6498171", "0.646727", "0.64553106", "0.6435423", "0.6392489", "0.63830006", "0.6372382", "0.6360667", "0.63583857", "0.6357862", "0.63315636", "0.6303253", "0.62977827", "0.6296317", "0.62759477", "0.62720144", "0.62659633", "0.62382114", "0.623585", "0.6231266", "0.62264854", "0.621964", "0.6203312", "0.6203312", "0.6203312", "0.6184251", "0.6182976", "0.61663747", "0.61540467", "0.6141173", "0.6127919", "0.6124978", "0.61147743", "0.61096954", "0.61020696", "0.6098191", "0.6096218", "0.6095254", "0.6094663", "0.60867757", "0.6086543", "0.6085214", "0.6083556", "0.60829324", "0.60738623", "0.60700005", "0.6030612", "0.601581", "0.59947073", "0.5993631", "0.59842825", "0.5983845", "0.59830034", "0.5981743", "0.5980161", "0.5980161", "0.5980161", "0.59787804", "0.5969529", "0.5966252", "0.59381276", "0.5936568", "0.5926763", "0.59235734", "0.5919612", "0.59188855", "0.5914921", "0.5914076", "0.59126776", "0.5903873", "0.5902625", "0.5891883", "0.58864975", "0.5882071" ]
0.6830292
13
Get payment mehtods for cash on delivery (COD).
public function getPaymentMethodsForCod() { return $this->_toArrayObject($this->getConfig( 'packages/global_settings_payments-for-cod')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMonto(){\n\n $var_sum = CarritoProductosWeb::model()->findBySql('select ROUND(sum(`precio_total`), 2) as `precio_total` from carrito_productos_web \n WHERE id_pedido ='.$this->id_pedido, array());\n\n return $var_sum->precio_total;\n }", "public function getSalesFromCOD()\n {\n $salesFromCOD = Order::whereNotIn('status', ['cancelled', 'refunded'])->where('payment_type', 'cod')\n // ->when(auth()->user()->hasRole('vendor'), function ($query) {\n // $query->where('vendor_id', auth()->user()->vendor->id);\n // })\n ->sum('total_price');\n return $salesFromCOD;\n }", "public function getPaymentData($orden){\n\n $query = $this->db->query(\"SELECT numeroOrden,SUM((compra.cantidad*productos.precio))AS costoProducto,SUM(compra.costoEnvio)AS costoEnvio, SUM((compra.cantidad*productos.precio))+SUM(compra.costoEnvio) AS subtotal FROM compra INNER JOIN productos ON compra.producto = productos.id_producto where numeroOrden='\".$orden.\"' GROUP BY numeroOrden\");\n\n return $query->row();\n\n }", "public function medicinesAdditionalCharge()\n\t{\n\t\t$medicines = $this->database->table('lek_pojistovny')\n\t\t\t->where('hradene', 'doplatok')->select('ID_leku');\n\n\t\tforeach ($medicines as $item)\n\t\t\t$pole[] = $item->ID_leku;\n\n\t\treturn $this->database->table(self::TABLE_NAME)->where('ID_leku', $pole);\n\t}", "public function getPayment() {\n return $this->request(\n \"GET\",\n \"/shops/{$this->shop_id}/receipts/{$this->receipt_id}/payments\",\n \"Payment\"\n )\n ->first();\n }", "public function get_payment_details($order)\n {\n $raw_response = wp_safe_remote_get(\n $this->endpoint . '/charges/' . $order->get_order_key(),\n array(\n 'method' => 'GET',\n 'timeout' => 30,\n 'user-agent' => 'WooCommerce/' . WC()->version,\n 'headers' => array(\n 'Content-Type' => 'application/json;',\n 'Authorization' => 'Bearer ' . $this->gateway->get_option('api_token')\n ),\n 'httpversion' => '1.1',\n )\n );\n\n WC_Gateway_Orangepay::log('Orangepay - get_payment_details() response: ' . wc_print_r($raw_response, true));\n\n if (isset($raw_response['body']) && ($response = json_decode($raw_response['body'], true))) {\n if (isset($response['data'])) {\n $data = $response['data'];\n if (isset($data['charge'])) {\n return $data['charge'];\n }\n }\n }\n\n return null;\n }", "function getPromoList()\n {\n return array(array('reason'=>'test_discount','amount'=>3.5));\n }", "protected function getPayment()\n {\n return $this->getOrder()->getPayment();\n }", "public function getCODPaymentData(){ \n $query = \"SELECT * FROM tbl_payment WHERE id ='3'\"; // id = 3 for Check Cash on delivery\n $result = $this->db->select($query);\n return $result;\n }", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "public function getCharges();", "private function _getCostoServizioDeposito($mc, $giorni , $tipo_costo = PreventivatoreDettagliato::COSTO_CLIENTE)\n {\n $tariffa = ParametriServizio::getParametro(ParametriServizio::TARIFFA_DEPOSITO);\n if ($tipo_costo == PreventivatoreDettagliato::COSTO_CLIENTE)\n $costo = $mc * $tariffa['prezzo'] * $giorni;\n else\n $costo =$mc * $tariffa['tariffa_operatore'] * $giorni;\n\n return round($costo,2);\n }", "public function getTotalPaid();", "private function getPaymentMethod(){\r\n\r\n $paymentMethod = 1;\r\n switch($this->medio_pago){\r\n case 'webpay': {\r\n $paymentMethod = 1;\r\n break;\r\n }\r\n case 'servipag': {\r\n $paymentMethod = 2;\r\n break;\r\n }\r\n case 'multicaja': {\r\n $paymentMethod = 3;\r\n break;\r\n }\r\n case 'onepay': {\r\n $paymentMethod = 5;\r\n break;\r\n }\r\n case 'flow': {\r\n $paymentMethod = 9;\r\n break;\r\n }\r\n case 'webpay3c': {\r\n $paymentMethod = 13;\r\n break;\r\n }\r\n case 'mach': {\r\n $paymentMethod = 15;\r\n break;\r\n }\r\n default : {\r\n $paymentMethod = 1;\r\n break;\r\n } \r\n }\r\n\r\n return $paymentMethod;\r\n }", "public function medicinesPaid($paid)\n\t{\n\t\t$pole = [];\n\t\tif ($paid) {\n\t\t\t$medicines = $this->database->table('lek_pojistovny')\n\t\t\t\t->where('hradene', 'hradene')->select('ID_leku');\n\t\t}\n\t\telse {\n\t\t\t$medicines = $this->database->table('lek_pojistovny')\n\t\t\t\t->where('hradene', 'nehradene')->select('ID_leku');\n\t\t}\n\n\t\tforeach ($medicines as $item)\n\t\t\t$pole[] = $item->ID_leku;\n\n\t\treturn $this->database->table(self::TABLE_NAME)->where('ID_leku', $pole);\n\t}", "public function get_payment_methods()\n\t{\n\t\t//retrieve all invoice\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}", "function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}", "public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }", "public function getQuantidadeMesesDepreciados() {\n\n if (empty($this->iQuantidadeMesesDepreciado)) {\n\n if (!empty($this->iCodigoBem)) {\n\n $oDaoBensHistoricoCalculo = db_utils::getDao(\"benshistoricocalculobem\");\n $sWhereHistorico = \" t57_ativo is true and \";\n $sWhereHistorico .= \"t57_processado is true and \";\n $sWhereHistorico .= \"t58_bens = {$this->getCodigoBem()} \";\n $sCamposHistorico = \"t58_bens, t58_benstipodepreciacao\";\n $sSqlBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_query_calculo(null,\n $sCamposHistorico,\n \"t57_datacalculo\",\n $sWhereHistorico);\n $rsBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_record($sSqlBensHistoricoCalculo);\n $iTotalMeses = 0;\n $iTotalDepreciacoes = $oDaoBensHistoricoCalculo->numrows;\n for ($i = 0; $i < $iTotalDepreciacoes; $i++) {\n\n $oDadosCalculo = db_utils::fieldsMemory($rsBensHistoricoCalculo, $i);\n $iTotalMeses++;\n if ($oDadosCalculo->t58_benstipodepreciacao == 6) {\n $iTotalMeses = 0;\n }\n }\n }\n $this->iQuantidadeMesesDepreciados = $iTotalMeses;\n }\n\n return $this->iQuantidadeMesesDepreciados;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getMfpServiceChargesDIA(){\n return $this->hasMany(Mfp_procurement_service_charges_at_dia::class, 'mfp_procurement_id', 'id'); \n }", "public function getDeliveryOrder();", "public function consumo_medio_diario($codart){\n\n $hoy=date('Y-m-d');\n $fecha_inicio = date('Y-m-d', strtotime(\"-$this->meses month\", strtotime( $hoy ) ));\n $consumo = 0;\n\n $query1 = Planilla_entrega_renglones::find();\n $query1->joinWith(['remito']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n \n $query1->andFilterWhere(['>=','PE_FECHA', $fecha_inicio]);\n\n $consumo += $query1->sum('PR_CANTID');\n\n \n $query1 = Devolucion_salas_renglones::find();\n\n $query1->joinWith(['devolucion_encabezado']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n\n $query1->andFilterWhere(['>=','DE_FECHA', $fecha_inicio]);\n\n $consumo -= $query1->sum('PR_CANTID');\n \n $segundos=strtotime('now') - strtotime($fecha_inicio);\n \n $dias=intval($segundos/60/60/24);\n return $consumo/$dias;\n\n }", "function get_discount($order_code = ''){\n $apply_discount = '';\n if ($order_code){\n $order = $this->Orders->get_order($order_code);\n if ($order && !empty($order['prebooking_discount'])){\n $apply_discount = array(\n 'start_date' => date('Y-m-d'),\n 'description' => 'Ưu đãi khi đặt trước',\n 'en_description' => 'Discount when pre-ordering',\n 'priority' => '10',\n 'table' => array(\n '0' => $order['prebooking_discount']\n ),\n 'is_prebook' => 1\n );\n }\n }\n return $apply_discount;\n }", "private function getPaymentInfo()\n {\n $baseUrl = 'http://embeddables.eastus2.cloudapp.azure.com/payment/';\n\n return json_decode(\n file_get_contents(\n $baseUrl . 'payment.json'\n )\n );\n }", "public function getCardsPaymentMethods()\n {\n $payment_methods = Mage::getModel('mercadopago/core')->getPaymentMethods();\n $payment_methods_types = array(\"credit_card\", \"debit_card\", \"prepaid_card\");\n $types = array();\n\n //percorre todos os payments methods\n foreach ($payment_methods['response'] as $pm) {\n\n //filtra por payment_methods\n if (in_array($pm['payment_type_id'], $payment_methods_types)) {\n $types[] = $pm;\n }\n }\n\n return $types;\n }", "public function getPaymentMethod()\n {\n // get pusat\n $pusatCode = m_company::where('c_type', 'PUSAT')->select('c_id')->first();\n $pusatCode = $pusatCode->c_id;\n\n $data = m_paymentmethod::where('pm_isactive', 'Y')\n ->whereHas('getAkun', function ($q) use ($pusatCode) {\n $q->where('ak_comp', $pusatCode);\n })\n ->with('getAkun')\n ->get();\n\n return response()->json([\n 'data' => $data\n ]);\n }", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }", "public function returnPaymentType($start_date,$end_date){\n\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t$select = $mcoCash->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_cash\"), array('type','amount' => new Zend_Db_Expr('SUM(amount)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'full_composition' => new Zend_Db_Expr('CAST(SUM(value*amount) as DECIMAL(11,3))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'liquid_composition' => new Zend_Db_Expr('(SUM(CASE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE CAST((value*amount)-((value*amount)*0.0037) as DECIMAL(11,2)) END))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'cbtu_transfer' => new Zend_Db_Expr('SUM(CASE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE 0 END)')))\n\t\t->joinInner(array('m' => 'mco'), 'm.id=mc.mco_id')\n\t\t->where('date_operation >= ?', Application_Model_General::dateToUs($start_date))\n\t\t->where('date_operation <= ?', Application_Model_General::dateToUs($end_date))\n\t\t->where('status=1')\n\t\t->group('type');\n\t\treturn $mcoCash->fetchAll($select);\n\t}", "public function getTotalPayment()\n\t{\n\t\treturn $this->total_payment;\n\t}", "private function _getMCMontaggioOLD()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n if ($arredo->getServizioMontaggio())\n {\n $tmp = $arredo->getMC();\n if ($arredo->getParametroB() == Arredo::MONTATO_PIENO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_PIENO);\n $mc+= $tmp;\n\n }\n\n if ($arredo->getParametroB() == Arredo::MONTATO_VUOTO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_VUOTO);\n $mc+= $tmp;\n\n }\n }\n\n }\n\n return $mc;\n }", "public function totalColecao(){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\r\n\t\treturn $oSicasSalarioMinimoBD->totalColecao();\r\n\t}", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function get_company_invoice_payment_recd() {\n $invoice = $this->input->post('invoice');\n $data = $this->classtraineemodel->company_invoice($invoice);\n $data->invoice_excess_amt = empty($data->invoice_excess_amt) ? 0 : $data->invoice_excess_amt;\n \n if ($data->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($data->company_id);\n $data->company_name = $tenant_details->tenant_name;\n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $data->company_id);\n $data->company_name = $company_details[0]->company_name;\n }\n $data->discount_label = rtrim($this->course->get_metadata_on_parameter_id($data->discount_type), ', ');\n $gst_label = ($data->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($data->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($data->gst_rule), ', ');\n }\n $data->gst_label = $gst_label;\n $data->inv_date = date('d/m/Y', strtotime($data->inv_date));\n $data->amount_refund = round($data->amount_refund, 2);\n $recd = $this->classtraineemodel->get_invoice_paid_details($invoice);\n foreach ($recd as $k => $row) {\n $mode_ext = ($row->mode_of_pymnt == 'CHQ') ? ' Chq#: ' . $row->cheque_number: '';\n $recd[$k]->recd_on = date('d/m/Y', strtotime($row->recd_on));\n $recd[$k]->mode = rtrim($this->course->get_metadata_on_parameter_id($row->mode_of_pymnt), ', ').$mode_ext;\n }\n $res = array('data' => $data, 'recd' => $recd);\n echo json_encode($res);\n exit();\n }", "public function totalBillOS()\n {\n return $this->bills->sum('outstanding');\n }", "public static function listPaymentMethods()\n {\n return [\n [\n 'id' => self::PAYMENT_BY_CASH,\n 'name' => 'Tiền mặt',\n ],\n [\n 'id' => self::PAYMENT_BY_CONTRACT,\n 'name' => 'Hợp đồng',\n ],\n ];\n }", "public function fetch_order_payment_method(Request $request) {\n $data['orders'] = Order::where('payment_method', $request->method)->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['sum_price'] = Order::where('payment_method', $request->method)->sum('subtotal_price');\n $data['sum_delivery'] = Order::where('payment_method', $request->method)->sum('delivery_cost');\n $data['sum_total'] = Order::where('payment_method', $request->method)->sum('total_price');\n $data['method'] = $request->method;\n\n return view('admin.orders' , ['data' => $data]);\n }", "public function getDiscountInvoiced();", "public function totalColecao(){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\r\n\t\treturn $oSicasConsultaMedicaBD->totalColecao();\r\n\t}", "public function getCODValue(){ \n $query = \"SELECT * FROM tbl_payment WHERE id ='3'\"; // id = 3 for Check Cash on delivery\n $result = $this->db->select($query);\n return $result;\n }", "public function getMontacargasC()\n {\n\n return $this->montacargas_c;\n }", "public function getPaymentMethods() {\r\n\t\t//@TODO: Insert PaymentMethods into the datebase, create table\r\n\t\t$payment_methods = array();\r\n\t\t\t$payment_methods[0] = array('id' => 0, 'name' => 'AMEX');\r\n\t\t\t$payment_methods[1] = array('id' => 1, 'name' => 'Discover');\r\n\t\t\t$payment_methods[2] = array('id' => 2, 'name' => 'Mastercard');\r\n\t\t\t$payment_methods[3] = array('id' => 3, 'name' => 'Visa');\r\n\t\t\t$payment_methods[4] = array('id' => 4, 'name' => 'Store Credit');\r\n\t\t\t$payment_methods[5] = array('id' => 5, 'name' => 'Check');\r\n\t\t\t$payment_methods[6] = array('id' => 6, 'name' => 'Wire Transfer');\r\n\t\t\t$payment_methods[7] = array('id' => 7, 'name' => 'Trade');\r\n\t\t\t$payment_methods[9] = array('id' => 9, 'name' => 'Cash');\r\n\t\treturn $payment_methods; //array\r\n\t}", "private final function _getPayments(order $order) {\n\t\t$payments = array();\n\t\tforeach ($order->payments->records as $payment) {\n\t\t\tif (PAYMENT_TYPES_PBB_BANK == $payment->payment_option_id) {\n\t\t\t\t$payments = $payment;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $payments;\n\t}", "private function _getCostoServizioMontaggio($mc, $tipo_costo = PreventivatoreDettagliato::COSTO_CLIENTE)\n {\n $tariffa = ParametriServizio::getParametro(ParametriServizio::TARIFFA_MONTAGGIO);\n if ($tipo_costo == PreventivatoreDettagliato::COSTO_CLIENTE)\n $costo = $mc * $tariffa['prezzo'];\n else\n $costo = $mc * $tariffa['tariffa_operatore'];\n return round($costo,2);\n }", "function getFondoPatrimonial(){\n\t\t$sql = \"SELECT\n\t\t\tSUM(`operaciones_mvtos`.`afectacion_real` *\n\t\t\t`eacp_config_bases_de_integracion_miembros`.`afectacion`) AS 'monto'\n\n\t\tFROM\n\t\t\t`operaciones_mvtos` `operaciones_mvtos`\n\t\t\t\tINNER JOIN `eacp_config_bases_de_integracion_miembros`\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\tON `operaciones_mvtos`.`tipo_operacion` =\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`miembro`\n\t\tWHERE\n\t\t\t(`operaciones_mvtos`.`socio_afectado` =\" . $this->mCodigo . \")\n\t\t\tAND\n\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` = 2607)\n\t\t\tGROUP BY\n\t\t\t\t`operaciones_mvtos`.`fecha_afectacion`,\n\t\t\t\t`operaciones_mvtos`.`socio_afectado`,\n\t\t\t\t`operaciones_mvtos`.`docto_afectado`,\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`\n\t\t\tORDER BY\n\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`\";\n\n\t\t$monto = mifila($sql, \"monto\");\n\t\treturn $monto;\n\t}", "public function getTotalDue();", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "public function getPayments()\r\n {\r\n return $this->admin->sGetPaymentMeans();\r\n }", "function clinic_payment_calculation($appliaction)\n{\n\tif ($appliaction->application_type == 1) {\n\t\t$payment_array['form_chargis'] = 200;\n\t\t$payment_array['registration_chargis'] = 500;\n\t\t$payment_array['renual_charges'] = 250*2;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'] + $payment_array['renual_charges'];\n\t} else {\n\t\t$peneltyOnTotalMonth = getDiffrentBetweenTwoDatesInMonth($appliaction->date_of_expiry_certificate,date('Y-m-d'));\n\t\t$payment_array['form_chargis'] = 100;\n\t\t$payment_array['registration_chargis'] = 250*3 + $peneltyOnTotalMonth*100;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'];\n\t}\n\treturn json_decode(json_encode($payment_array));\n}", "public function getOtherCharges() { \n \n $result = 0;\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $purchaseData = DB::select('SELECT * FROM purchase_master WHERE is_deleted_status = \"N\" AND id = '.$purchaseIds.'');\n if (!empty($purchaseData)) {\n $otherCharges = !empty($purchaseData[0]->other_charges) ? $purchaseData[0]->other_charges : '0.00'; \n echo $otherCharges;\n }\n\n }", "private function _getCostoServizioImballoCarico($mc, $tipo_costo = PreventivatoreDettagliato::COSTO_CLIENTE )\n {\n $tariffa = ParametriServizio::getParametro(ParametriServizio::TARIFFA_IMBALLO_CARICO);\n if ($tipo_costo == PreventivatoreDettagliato::COSTO_CLIENTE)\n $costo = $mc * $tariffa['prezzo'];\n else\n $costo = $mc * $tariffa['tariffa_operatore'];\n return round($costo,2);\n }", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "public function getCharges()\n {\n return $this->charges;\n }", "public function getCosto()\n {\n return $this->costo;\n }", "public function getDeterminarMetodologiaCalculo()\r\n\t\t{\r\n\t\t\t// Se refiere al parametro \"base-calculo\" de la entidad \"tipos-propagandas\".\r\n\t\t\t$idMetodo = 0;\r\n\r\n\t\t\t$tipo = self::getDatosPropaganda()->tipoPropaganda;\r\n\t\t\tif ( isset($tipo->base_calculo) ) {\r\n\t\t\t\t$idMetodo = (int)$tipo->base_calculo;\r\n\t\t\t}\r\n\t\t\treturn $idMetodo;\r\n\t\t}", "public function getDiscounts(): array;", "public function calculatePayment()\n {\n }", "public static function getCartao($doador){\r\n return (new Database('cartao'))->select(' doador ='. $doador)\r\n ->fetchObject((self::class));\r\n }", "public function getMonto()\n {\n return $this->monto;\n }", "public function getMonto()\n {\n return $this->monto;\n }", "public function getMonto()\n {\n return $this->monto;\n }", "public function f_get_PaymentDtls()\n {\n\n $sql = $this->db->query(\" SELECT memo_no, mr_no, cr_dt FROM td_dm_paymentdtls \");\n return $sql->result();\n\n }", "public function getCoMantenimiento()\n\t{\n\t\treturn $this->co_mantenimiento;\n\t}", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "public function getPaymentInfo($cart)\n {\n /** Do not show Billmate Checkout as payment option in store */\n return false;\n }", "public function getDiscountData() {\n return array(\n 'discValue' => $this->discValue,\n 'discValueCode' => $this->discValueCode,\n 'minPurchaseVal' => $this->minPurchaseVal,\n 'receiptDisc' => $this->receiptDisc,\n 'maxreceDisc' => $this->maxreceDisc\n );\n }", "public function get_payment_methods()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "function get_mecanismos_carga()\n\t{\n\t\t$param = $this->get_definicion_parametros(true);\t\t\n\t\t$tipos = array();\n\t\tif (in_array('carga_metodo', $param, true)) {\n\t\t\t$tipos[] = array('carga_metodo', 'Método de consulta PHP');\n\t\t}\n\t\tif (in_array('carga_lista', $param, true)) {\n\t\t\t$tipos[] = array('carga_lista', 'Lista fija de Opciones');\n\t\t}\t\t\n\t\tif (in_array('carga_sql', $param, true)) {\t\t\n\t\t\t$tipos[] = array('carga_sql', 'Consulta SQL');\n\t\t}\n\t\treturn $tipos;\n\t}", "public function get_total_discapacitados(){\n\t\t$sql = mysqli_query(Conecta::conx(),\"SELECT COUNT(DISCAPACIDAD) AS discapacitados FROM datos_salud WHERE DISCAPACIDAD = 'SI'\") or die('error en la consulta:' .$sql. mysqli_errno(Conecta::conx()));\n\t\t//$sql .= \"\";\n\t\tif($reg=mysqli_fetch_array($sql)){\n\t\t\t$this->discapacitados=$reg[\"discapacitados\"];\n\t\t}\n\t\treturn $this->discapacitados;\n\n\t\tmysqli_close(Conecta::conx());\n\t\n\t}", "public function getPaymentCycle()\n {\n return $this->payment_cycle;\n }", "public function getAllCashPaidInvoiceDetails(){\n\n try {\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "public function getCodFiscaleMedico() {\n return $this->_codFiscale;\n }", "function getDiscountByOrder($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND (class = 'ot_customer_discount' OR class='ot_gv')\");\n\t\t$disctot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$disctot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $disctot;\n\t}", "public function dinero(){\n $query = $this->db->query(\"SELECT SUM(price) AS total FROM property_unity WHERE property_id=1 AND status=1\");\n return $query->row();\n }", "public static function metaPayment($post = null)\n {\n $v = get_post_meta($post->ID, 'payment_methods', true);\n print_r($v);\n }", "public function get_data() {\n\n\t\t$data = array();\n\t\t$i = 0;\n\t\t// Payment query.\n\t\t$payments = give_get_payments( $this->get_donation_argument() );\n\n\t\tif ( $payments ) {\n\n\t\t\tforeach ( $payments as $payment ) {\n\n\t\t\t\t$columns = $this->csv_cols();\n\t\t\t\t$payment = new Give_Payment( $payment->ID );\n\t\t\t\t$payment_meta = $payment->payment_meta;\n\t\t\t\t$address = $payment->address;\n\n\t\t\t\t// Set columns.\n\t\t\t\tif ( ! empty( $columns['donation_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_id'] = $payment->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['seq_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['seq_id'] = Give()->seq_donation_number->get_serial_code( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['title_prefix'] ) ) {\n\t\t\t\t\t$data[ $i ]['title_prefix'] = ! empty( $payment->title_prefix ) ? $payment->title_prefix : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['first_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['first_name'] = isset( $payment->first_name ) ? $payment->first_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['last_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['last_name'] = isset( $payment->last_name ) ? $payment->last_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['email'] ) ) {\n\t\t\t\t\t$data[ $i ]['email'] = $payment->email;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['company'] ) ) {\n\t\t\t\t\t$data[ $i ]['company'] = empty( $payment_meta['_give_donation_company'] ) ? '' : str_replace( \"\\'\", \"'\", $payment_meta['_give_donation_company'] );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['address_line1'] ) ) {\n\t\t\t\t\t$data[ $i ]['address_line1'] = isset( $address['line1'] ) ? $address['line1'] : '';\n\t\t\t\t\t$data[ $i ]['address_line2'] = isset( $address['line2'] ) ? $address['line2'] : '';\n\t\t\t\t\t$data[ $i ]['address_city'] = isset( $address['city'] ) ? $address['city'] : '';\n\t\t\t\t\t$data[ $i ]['address_state'] = isset( $address['state'] ) ? $address['state'] : '';\n\t\t\t\t\t$data[ $i ]['address_zip'] = isset( $address['zip'] ) ? $address['zip'] : '';\n\t\t\t\t\t$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['comment'] ) ) {\n\t\t\t\t\t$comment = give_get_donor_donation_comment( $payment->ID, $payment->donor_id );\n\t\t\t\t\t$data[ $i ]['comment'] = ! empty( $comment ) ? $comment->comment_content : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_total'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_total'] = give_format_amount( give_donation_amount( $payment->ID ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_code'] ) ) {\n\t\t\t\t\t$data[ $i ]['currency_code'] = empty( $payment_meta['_give_payment_currency'] ) ? give_get_currency() : $payment_meta['_give_payment_currency'];\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_symbol'] ) ) {\n\t\t\t\t\t$currency_code = $data[ $i ]['currency_code'];\n\t\t\t\t\t$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_status'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_status'] = give_get_payment_status( $payment, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_gateway'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_gateway'] = $payment->gateway;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_mode'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_mode'] = $payment->mode;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_id'] = $payment->form_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_title'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_title'] = get_the_title( $payment->form_id );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_level_id'] = $payment->price_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_title'] ) ) {\n\t\t\t\t\t$var_prices = give_has_variable_prices( $payment->form_id );\n\t\t\t\t\tif ( empty( $var_prices ) ) {\n\t\t\t\t\t\t$data[ $i ]['form_level_title'] = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 'custom' === $payment->price_id ) {\n\t\t\t\t\t\t\t$custom_amount_text = give_get_meta( $payment->form_id, '_give_custom_amount_text', true );\n\n\t\t\t\t\t\t\tif ( empty( $custom_amount_text ) ) {\n\t\t\t\t\t\t\t\t$custom_amount_text = esc_html__( 'Custom', 'give' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = $custom_amount_text;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_date'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_date'] = date( give_date_format(), $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_time'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_time'] = date_i18n( 'H', $payment_date ) . ':' . date( 'i', $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['userid'] ) ) {\n\t\t\t\t\t$data[ $i ]['userid'] = $payment->user_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donorid'] ) ) {\n\t\t\t\t\t$data[ $i ]['donorid'] = $payment->customer_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donor_ip'] ) ) {\n\t\t\t\t\t$data[ $i ]['donor_ip'] = give_get_payment_user_ip( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_private'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\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'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t\t'compare' => '!=',\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\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\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\t$data[ $i ]['donation_note_private'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_to_donor'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\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\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data[ $i ]['donation_note_to_donor'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\t// Add custom field data.\n\t\t\t\t// First we remove the standard included keys from above.\n\t\t\t\t$remove_keys = array(\n\t\t\t\t\t'donation_id',\n\t\t\t\t\t'seq_id',\n\t\t\t\t\t'first_name',\n\t\t\t\t\t'last_name',\n\t\t\t\t\t'email',\n\t\t\t\t\t'address_line1',\n\t\t\t\t\t'address_line2',\n\t\t\t\t\t'address_city',\n\t\t\t\t\t'address_state',\n\t\t\t\t\t'address_zip',\n\t\t\t\t\t'address_country',\n\t\t\t\t\t'donation_total',\n\t\t\t\t\t'payment_gateway',\n\t\t\t\t\t'payment_mode',\n\t\t\t\t\t'form_id',\n\t\t\t\t\t'form_title',\n\t\t\t\t\t'form_level_id',\n\t\t\t\t\t'form_level_title',\n\t\t\t\t\t'donation_date',\n\t\t\t\t\t'donation_time',\n\t\t\t\t\t'userid',\n\t\t\t\t\t'donorid',\n\t\t\t\t\t'donor_ip',\n\t\t\t\t);\n\n\t\t\t\t// Removing above keys...\n\t\t\t\tforeach ( $remove_keys as $key ) {\n\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t}\n\n\t\t\t\t// Now loop through remaining meta fields.\n\t\t\t\tforeach ( $columns as $col ) {\n\t\t\t\t\t$field_data = get_post_meta( $payment->ID, $col, true );\n\t\t\t\t\t$data[ $i ][ $col ] = $field_data;\n\t\t\t\t\tunset( $columns[ $col ] );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filter to modify Donation CSV data when exporting donation\n\t\t\t\t *\n\t\t\t\t * @since 2.1\n\t\t\t\t *\n\t\t\t\t * @param array Donation data\n\t\t\t\t * @param Give_Payment $payment Instance of Give_Payment\n\t\t\t\t * @param array $columns Donation data $columns that are not being merge\n\t\t\t\t * @param Give_Export_Donations_CSV $this Instance of Give_Export_Donations_CSV\n\t\t\t\t *\n\t\t\t\t * @return array Donation data\n\t\t\t\t */\n\t\t\t\t$data[ $i ] = apply_filters( 'give_export_donation_data', $data[ $i ], $payment, $columns, $this );\n\n\t\t\t\t$new_data = array();\n\t\t\t\t$old_data = $data[ $i ];\n\n\t\t\t\t// sorting the columns bas on row\n\t\t\t\tforeach ( $this->csv_cols() as $key => $value ) {\n\t\t\t\t\tif ( array_key_exists( $key, $old_data ) ) {\n\t\t\t\t\t\t$new_data[ $key ] = $old_data[ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$data[ $i ] = $new_data;\n\n\t\t\t\t// Increment iterator.\n\t\t\t\t$i ++;\n\n\t\t\t}\n\n\t\t\t$data = apply_filters( 'give_export_get_data', $data );\n\t\t\t$data = apply_filters( \"give_export_get_data_{$this->export_type}\", $data );\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t\treturn array();\n\n\t}", "static function FacturacionMensual($cliente, $mes, $tipo) {\n $response = array('nombres' => array(), 'cantidades' => array());\n $t = '';\n if ($mes == 'ACTUAL') {\n $inicio = date('Y-m-d', strtotime('first day of this month'));\n $fin = date('Y-m-d');\n $t = ucfirst(strftime('%B', strtotime('this month')));\n }\n if ($mes == 'ANTERIOR') {\n $inicio = date('Y-m-d', strtotime('first day of last month'));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', strtotime('-1 month')).' - '.strftime('%B %Y');\n }\n if ($mes == '3MESES') {\n $s = strtotime('-3 months');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n }\n if ($mes == '6MESES') {\n $s = strtotime('-6 months');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n if ($mes == '12MESES') {\n $s = strtotime('-1 year');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n if ($mes == '24MESES') {\n $s = strtotime('-2 year');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n $f_c = $cliente ? \" AND f.idcliente=$cliente\" : '';\n if ($tipo == 'MES') {\n $select = 'YEAR( f.fechaemision ) ano, MONTH( f.fechaemision ) mes, ';\n $groupby = 'GROUP BY ano, mes';\n } else {\n $select = 'f.fechaemision fecha, ';\n $groupby = 'GROUP BY f.fechaemision';\n }\n $q = \"SELECT $select SUM( g.total + g.valorseguro ) total\nFROM \".self::$table.\" f, \".Guia::$table.\" g\nWHERE g.idfactura = f.id AND f.fechaemision BETWEEN '$inicio' AND '$fin' $f_c\n$groupby\";\n $result = DBManager::execute($q);\n $n = DBManager::rows_count($result);\n if ($n != 0) {\n $total = 0;\n while ($f = mysql_fetch_assoc($result)) {\n if ($tipo == 'MES') {\n $response['nombres'][] = strftime('%b %y', strtotime($f['ano'].'-'.$f['mes'].'-01'));\n } else {\n $response['nombres'][] = strftime('%d/%b/%Y', strtotime($f['fecha']));\n }\n $n++;\n $total += $f['total'];\n $response['cantidades'][]=intval($f['total']);\n }\n $response['total'] = intval($total);\n $response['prom'] = intval($total/$n);\n }\n $response['texto'] = $t;\n return $response;\n }", "public function getCreditos()\n {\n return $this->creditos;\n }", "public function order_payment()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesPayment', 'sales_order_id', 'id');\n }", "private function _getCostoServizioSmontaggioImballoCarico($mc , $tipo_costo = PreventivatoreDettagliato::COSTO_CLIENTE )\n {\n $tariffa = ParametriServizio::getParametro(ParametriServizio::TARIFFA_SMONTAGGIO_IMBALLO_CARICO);\n if ($tipo_costo == PreventivatoreDettagliato::COSTO_CLIENTE)\n $costo = $mc * $tariffa['prezzo'];\n else\n $costo = $mc * $tariffa['tariffa_operatore'];\n return round($costo,2);\n }", "function payment() {\n\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/payment';\n\t\t$json = file_get_contents($url);\n\t\treturn json_decode($json);\n\t}", "public function getPaymentAmountType()\n {\n return $this->_fields['PaymentAmountType']['FieldValue'];\n }", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function getCusto()\n {\n return $this->custo;\n }", "public function getMonto()\n {\n if($this->input->post('id_vehiculo'))\n {\n $id_vehiculo = $this->input->post('id_vehiculo');\n $registro = $this->model->getRegistros($id_vehiculo);\n \n foreach ($registro as $row) \n {\n echo $row->precio_venta;\n }\n }\n }", "public function getMontoRecibido()\n {\n $montoRecibido = 0;\n foreach ($this->recursoRecibido as $recibido)\n {\n $moneda=$recibido->getMoneda();\n $montoRecibido+=($recibido->getMonto()*$moneda->getPrecioBs());\n }\n return $montoRecibido;\n }", "public function getCusto() {\n return $this->custo;\n }", "function getAllMco_proveedores()\n {\n $data_mco_proveedores = $this->gateway->getAllMco_proveedores();\n return $data_mco_proveedores;\n\n }", "public function getStatusPayment()\r\n {\r\n return $this->statusPayment;\r\n }", "public function getMfpServiceCharges(){\n return $this->hasMany(Mfp_procurement_service_charges::class, 'mfp_procurement_id', 'id'); \n }", "public function payments()\n {\n return $this->hasMany(\\Cot\\Payment::class);\n }", "public function getPaymentData(\\Magento\\Sales\\Model\\Order $order)\n {\n $cardholder = $order->getPayment()->getCcOwner();\n $cardholder = $cardholder === null ? '' : $cardholder;\n\n $message = 'Card holder found on base mapper: ' . $cardholder;\n $this->logger->debug($message, ['entity' => $order]);\n\n return $cardholder;\n }", "public function get_centroCosto(){\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct AREA.COD_CC2, AREA.NOM_CC2 \n\t\t\t\t\t\tFROM CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL, EMPLEADOS_GRAL GRAL\n\t\t\t\t\t\tWHERE EPL.COD_EPL = GRAL.COD_EPL\n\t\t\t\t\t\tAND EPL.COD_CC2=AREA.COD_CC2\n\t\t\t\t\t\tand AREA.estado='A'\n\t\t\t\t\t\tand EPL.estado='A'\n\t\t\t\t\t\torder by nom_cc2 asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"COD_CC2\"],\n\t\t\t\t\t\t\t\t\t\t \"area\"\t => utf8_encode($fila[\"NOM_CC2\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t}", "function paymentmethods() {\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,payment_method,status FROM #__em_paymentmethod\";\r\n $db->setQuery($query);\r\n $result = $db->loadObjectList();\r\n return $result;\r\n }", "public function getCoti_total(){\n return $this->coti_total;\n }", "public function iN_PaymentMethods() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_payment_methods WHERE payment_method_id = '1'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn $data;\n\t}", "public function getMontoCuota()\n {\n return $this->monto_cuota;\n }" ]
[ "0.59718084", "0.58963865", "0.58940333", "0.5891447", "0.5856245", "0.573496", "0.57002467", "0.5655362", "0.5655049", "0.5618459", "0.55948913", "0.5582112", "0.5536112", "0.5509875", "0.5471665", "0.54503226", "0.54482335", "0.54482335", "0.5440876", "0.5422798", "0.5409899", "0.5409899", "0.5409899", "0.5406757", "0.5404677", "0.5371613", "0.53631616", "0.5350815", "0.5349628", "0.53491974", "0.53466684", "0.53334445", "0.53196377", "0.53177714", "0.5313555", "0.53109545", "0.5307654", "0.5301752", "0.5299394", "0.52957785", "0.52850544", "0.5274384", "0.5267474", "0.5253784", "0.5253546", "0.5252562", "0.5247295", "0.52465063", "0.52415985", "0.52250564", "0.5224407", "0.5221947", "0.5219308", "0.5214095", "0.5211472", "0.5208238", "0.5205902", "0.5203065", "0.5192985", "0.5189766", "0.5189541", "0.5186793", "0.5186793", "0.5186793", "0.5181462", "0.5181462", "0.5176704", "0.5172236", "0.51711524", "0.51693606", "0.516746", "0.51596993", "0.5153834", "0.5152948", "0.51445043", "0.5144032", "0.51433533", "0.5134514", "0.5126717", "0.51260215", "0.51254225", "0.5124739", "0.5123982", "0.51208603", "0.5116138", "0.51157236", "0.5110589", "0.5109429", "0.5107338", "0.50994116", "0.50959694", "0.5095852", "0.50912654", "0.5085828", "0.5083509", "0.50798154", "0.50777304", "0.5075854", "0.50757086", "0.50747216" ]
0.59257525
1
Use product weight as default value for shipment creation.
public function useProductWeightAsDefault() { return (1 == $this->getConfig('packages/global_settings_default_weight')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultWeight($stage);", "public function setWeight() {\n }", "public function transferProductsToDefaultWarehouse();", "public function testSetWeightProduct()\n {\n $product = new Product();\n $value = 100;\n $product->setWeight($value);\n $this->assertEquals($value, $product->getWeight());\n }", "function set_weight($weight) {\n $this->weight = $weight;\n }", "function setSyncProdWeight()\n {\n }", "function setShipping($ship_key)\n {\n return 4.50;\n }", "public function getProductWeightUnit()\n {\n return (string) $this->getConfig(\n 'packages/global_settings_default_weight_unit');\n }", "protected function getShippingWeight(Mage_Catalog_Model_Product $product){\n $weight = (float) $product->getWeight();\n $weight = !empty($weight) ? $weight . ' lb' : '';\n\n return $weight;\n }", "public function setShipmentWeight(float $weight = null): ShippableInterface;", "protected function getDefaultPackage($product, $simpleProductWeight) {\n\treturn array(\n\t 'description' => $product->getName(),\n\t 'packaging' => $this->getConfigData('defaults/packaging'),\n\t 'fragile' => $this->getConfigData('defaults/fragile'),\n\t 'weight' => $product->getWeight() ? $product->getWeight() : $simpleProductWeight,\n\t 'length' => $this->getConfigData('defaults/length'),\n\t 'width' => $this->getConfigData('defaults/width'),\n\t 'height' => $this->getConfigData('defaults/height')\n\t);\n }", "public function setWeight($weight);", "public function setWeight($weight);", "public function setWeight($weight);", "public function setWeight($weight);", "public function setWeightAttribute($weight = null)\n\t{\n\t\t$this->attributes['weight'] = intval($weight);\n\t}", "public function setProducts_attributes_weight( $products_attributes_weight ) {\n\t\t$this->products_attributes_weight = $products_attributes_weight;\n\t}", "public function setWeight($weight)\n {\n $this->weight = $weight;\n }", "public function setDefaultProduct($product) {\n $this->values->put('DefaultProduct', $product);\n }", "public function setWeight($weight=1)\n\t{\n\t\t$this->weight = intval($weight);\n\t}", "private function setShippingOptions() {\n // Reset the settings if this is a recrawl\n if ($this->getSaverData()->isRecrawl()) {\n // Set dimensions and weight\n $this->product->set_weight('');\n $this->product->set_length('');\n $this->product->set_width('');\n $this->product->set_height('');\n\n // Set shipping class\n $this->product->set_shipping_class_id(0);\n }\n\n // No shipping for virtual products.\n if ($this->wcData->isVirtual()) {\n $this->product->set_virtual(true);\n return;\n }\n\n // Not a virtual product.\n $this->product->set_virtual(false);\n\n // Set dimensions and weight\n $this->product->set_weight($this->wcData->getWeight());\n $this->product->set_length($this->wcData->getLength());\n $this->product->set_width($this->wcData->getWidth());\n $this->product->set_height($this->wcData->getHeight());\n\n // Set shipping class\n $this->product->set_shipping_class_id($this->wcData->getShippingClassId());\n }", "public function getShipmentWeight(): ?float;", "public function getProducts_attributes_weight_prefix() {\n\t\treturn $this->products_attributes_weight_prefix;\n\t}", "public function getProducts_attributes_weight() {\n\t\treturn $this->products_attributes_weight;\n\t}", "function warehouse_shipping( $products, $destination_country){\r\n\t\t$pweight=0;\r\n\t\t$amount=0;\r\n\t\t$baseshippingprice=false;\r\n\t\tforeach ( $products as $product ) {\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif($_enable_warehouse!=1) continue;\r\n\t\t\tif ( is_product_disable_shipping_weight( $product['product_id'] ) ) {\r\n continue;\r\n\t\t }\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif ( isset( $product['variation_id'] ) ) {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['variation_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['variation_id'], '_downloadable', true );\r\n\t\t\t} else {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['product_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['product_id'], '_downloadable', true );\r\n\t\t\t}\r\n\r\n\t\t\tif ( ( $is_virtual == 'yes' ) || ( $is_downloadable == 'yes' ) ) {\r\n\t\t\t\t$downloadable_count++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\r\n\t\t\t// if warehouse shipping enable for this product\r\n\t\t\tif($_enable_warehouse==1){\r\n\t\t\t\t\r\n\t\t\t\t$pweight+=$product['data']->get_weight()* $product['quantity'];\r\n\t\t\t}\r\n\t\t\t$price[ $seller_id ]['totalp_price'] += $product['line_total'];\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t$dps_country_rates= get_option('_dps_country_rates', true );\r\n\t\t$dps_weight_rates = get_option('_dps_weight_rates', true );\r\n\t\t$dps_threshold_values = get_option('_dps_threshold_value', true );\r\n\t\t$dps_threshold_value=$dps_threshold_values['threshold'];\r\n\t\tif ( isset( $dps_weight_rates[$destination_country] ) ){\r\n\t\t\t\t\t\r\n\t\t\t$baseshippingprice=false;\r\n\t\t\t$cnt=0;\r\n\t\t\tforeach ( $dps_weight_rates[$destination_country]['wf'] as $weight => $weight_rate ){\r\n\t\t\t\t $weightfrom=$dps_weight_rates[$destination_country]['wf'][$cnt];\r\n\t\t\t\t $weightto=$dps_weight_rates[$destination_country]['wto'][$cnt];\r\n\t\t\t\t $weightrate=$dps_weight_rates[$destination_country]['rate'][$cnt];\r\n\t\t\t\t//echo $price[$seller_id]['state_rates']=$weightrate;\r\n\t\t\t\t\r\n\t\t\t\tif($weightfrom<$pweight && $weightto>=$pweight){\r\n\t\t\t\t\t$priceliesonweightrange=true;\r\n\t\t\t\t\t $price[$seller_id]['shipping_rates']=$weightrate;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t $cnt++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($dps_threshold_value[$destination_country])){\r\n\t\t\tif($dps_threshold_value[$destination_country]>0){\r\n\t\t\t\tif($price[$seller_id]['totalp_price']>$dps_threshold_value[$destination_country]){\r\n\t\t\t\t\t$price[$seller_id]['shipping_rates']=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( !empty( $price ) ) {\r\n foreach ( $price as $s_id => $value ) {\r\n $amount = $amount + ( ( isset($value['shipping_rates']) ? $value['shipping_rates'] : 0 ) );\r\n\t\t\t\t\r\n\t\t\t\t\r\n }\r\n }\r\n\t\t\r\n\t\treturn $amount;\r\n}", "function pewc_set_product_weight_meta( $cart_item_data, $item, $group_id, $field_id, $value ) {\n\n\t$item_weight = ! empty( $cart_item_data['product_extras']['weight'] ) ? $cart_item_data['product_extras']['weight'] : 0;\n\tif( $item['field_type'] == 'calculation' && ( ! empty( $item['formula_action'] ) && $item['formula_action'] == 'weight' ) ) {\n\t\t$cart_item_data['product_extras']['weight'] = $item_weight + $value;\n\t}\n\n\treturn $cart_item_data;\n\n}", "function getWeight(){return $this->weight;}", "function getWeight() { return $this->_weight; }", "protected function getProductAttrCodeUseForSearchWeight()\n {\n if (null === $this->_productAttrCodeUseForSearchWeight) {\n $this->_productAttrCodeUseForSearchWeight = $this->_helper->getGeneralSetting('advanced/product_search_weight');\n }\n return $this->_productAttrCodeUseForSearchWeight;\n }", "public function GetWeight() {\n\t\treturn 10;\n\t}", "public function getDefaultQuantity(): int|null;", "public function setWeight(float $weight) : void\n\t{\n\t\tif($weight < 0.0) {\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t'Weight must be greater than 0.0 ounces'\n\t\t\t);\n\t\t}\n\t\t\n\t\tif($weight > 1120.0) {\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t'Weight must not be greater than 1120.0 ounces (70 pounds)'\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->weight = $weight;\n\t}", "public function setProducts_attributes_weight_prefix( $products_attributes_weight_prefix ) {\n\t\t$this->products_attributes_weight_prefix = $products_attributes_weight_prefix;\n\t}", "public function setWeight(FedEx_PickupService_Weight $weight)\n {\n $this->Weight = $weight;\n return $this;\n }", "function pewc_set_product_weight( $cart ) {\n\n\tif ( is_admin() && ! defined( 'DOING_AJAX' ) ) {\n\t\treturn;\n\t}\n\n\tif ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) {\n\t\treturn;\n\t}\n\n\tforeach( $cart->get_cart() as $cart_item ) {\n\t\t$item_weight = floatval( $cart_item['data']->get_weight() );\n\t\tif ( ! empty( $cart_item['product_extras']['weight'] ) ) {\n\t\t\t$item_weight += $cart_item['product_extras']['weight'];\n\t\t\t$cart_item['data']->set_weight( $item_weight );\n\t\t}\n\t}\n\n}", "function get_weight() {\n\t\tif ($this->data['weight']) return $this->data['weight'];\n\t}", "function setWeight($minweight = 50) {\n echo \"The height is : $minweight <br>\";\n}", "private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}", "public function setWeight(?int $weight)\n {\n $this->weight = $weight;\n\n return $this;\n }", "public function get_weight(){\n\t\treturn $this->weight;\n\t}", "public function getWeight() \r\n {\r\n return $this->weight;\r\n }", "public function getWeight() {\n }", "public function getActiveWeightFeature()\n {\n $feature = $this->getSettingValue('weight_by', null);\n \t$feature = ($feature == '') ? null : $feature;\n \treturn $feature;\n }", "function getWeight() {\n return $this->weight;\n }", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "public function getWeight(): ?SupermodelIoLogisticsExpressExportDeclarationLineItemsItemWeight\n {\n return $this->weight;\n }", "public function makeDefault() {\n $this->update([\n 'color' => null,\n 'size' => null\n ]);\n }", "public function getWeightLimit()\n {\n }", "public function setWeightTotal(float $total): ShippableInterface;", "public function getWeight()\n {\n }", "public function getWeight()\n {\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getDefaultProductID() {\n return self::$defaultProductID;\n }", "public static function getDefaultAttribute($product_id, $minimum_quantity = 0){\n static $combinations = array();\n\n if (!JeproshopCombinationModelCombination::isFeaturePublished()){\n return 0;\n }\n\n if (!isset($combinations[$product_id])){\n $combinations[$product_id] = array();\n }\n\n if (isset($combinations[$product_id][$minimum_quantity])){\n return $combinations[$product_id][$minimum_quantity];\n }\n\n $db = JFactory::getDBO();\n $query = \"SELECT product_attribute.product_attribute_id FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \";\n $query .= JeproshopShopModelShop::addSqlAssociation('product_attribute'). ($minimum_quantity > 0 ? JeproshopProductModelProduct::sqlStock('product_attribute') : \"\");\n $query .= \" WHERE product_attribute_shop.default_on = 1 \" .($minimum_quantity > 0 ? \" AND IFNULL(stock.quantity, 0) >= \" .(int)$minimum_quantity : \"\");\n $query .= \" AND product_attribute.product_id = \" . (int)$product_id;\n\n $db->setQuery($query);\n $result = $db->loadResult();\n\n if (!$result){\n $query = \"SELECT product_attribute.product_attribute_id FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \";\n $query .= JeproshopShopModelShop::addSqlAssociation('product_attribute'). ($minimum_quantity > 0 ? JeproshopProductModelProduct::sqlStock('product_attribute') : \"\");\n $query .= \" WHERE product_attribute.product_id = \" .(int)$product_id .($minimum_quantity > 0 ? \" AND IFNULL(stock.quantity, 0) >= \".(int)$minimum_quantity : \"\");\n\n $db->setQuery($query);\n $result = $db->loadResult();\n }\n\n if (!$result){\n $query = \"SELECT product_attribute.product_attribute_id FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \";\n $query .= JeproshopShopModelShop::addSqlAssociation('product_attribute') . \" WHERE product_attribute_shop.\" . $db->quoteName('default_on') . \" = 1 AND product_attribute.\";\n $query .= \"product_id = \" .(int)$product_id;\n\n $db->setQuery($query);\n $result = $db->loadResult();\n }\n\n if (!$result){\n $query = \"SELECT product_attribute.product_attribute_id FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \";\n $query .= JeproshopShopModelShop::addSqlAssociation('product_attribute'). \" WHERE product_attribute.product_id = \" .(int)$product_id;\n\n $db->setQuery($query);\n $result = $db->loadResult();\n }\n\n $combinations[$product_id][$minimum_quantity] = $result;\n return $result;\n }", "public function applyDefaultValues()\n {\n $this->pothnbr = '';\n $this->pothstat = 'N';\n $this->pothrcptdate = '';\n $this->intbwhse = '';\n $this->pothglpd = 0;\n $this->pothairship = 'N';\n $this->potherinreview = 'N';\n $this->pothexchctry = '';\n $this->pothexchrate = '0.0000000';\n $this->intbwhseorig = '';\n $this->pothlandcost = '0.0000000';\n $this->pothrcptnbr = 0;\n $this->pothlandbasedon = '';\n $this->pothinvcnbr = '';\n $this->pothinvcdate = '';\n $this->pothfrtamt = '0.00';\n $this->pothmiscamt = '0.00';\n $this->dateupdtd = '';\n $this->timeupdtd = '';\n $this->dummy = 'P';\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "function is_product_disable_shipping_weight( $product_id ) {\r\n $enabled = get_post_meta( $product_id, '_disable_shipping', true );\r\n\r\n if ( $enabled == 'yes' ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "function init() {\r\n\t\t$this->instance_form_fields = include( 'settings/settings-custom-shipping.php' );\r\n\t\t$this->title = $this->get_option( 'title' );\r\n\t\t$this->express_title\t\t\t\t\t\t=\t$this->get_option( 'express_title' );\r\n\t\t$this->conditional_cost\t\t\t\t\t= $this->get_option( 'conditional_cost' );\r\n\t\t$this->express_delivery_status\t= $this->get_option( 'express_delivery_status' );\r\n\t\t$this->express_delivery_price\t\t= $this->get_option( 'express_delivery_price' );\r\n\r\n\t\t$weight_steps_arr = explode( ', ', $this->weight_steps );\r\n\r\n\t\tforeach ( $weight_steps_arr as $weight_step ) {\r\n\t\t\t$this->{'price_below_'.\"{$weight_step}\".'_kg'} = $this->get_option( 'price_below_'.$weight_step.'_kg', 0 );\r\n\r\n\t\t\t$this->weight_based_cost[$weight_step] = $this->get_option( 'price_below_'.$weight_step.'_kg', 0 );\r\n\t\t}\r\n\t}", "public function weight() {\r\n\t\treturn (int)$this->techData['weight'];\r\n\t}", "public function getWeight():?int\n {\n return $this->weight;\n }", "public function getWeight() {\n return $this->weight;\n }", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "public function getWeight() {\n\t\treturn $this->weight;\n\t}", "public function setWeight($weight) {\n $this->weight = $weight;\n return $this;\n }", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "protected function get_default_shipping_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}", "function xanth_db_install_weight_entry()\r\n{\r\n\t//depend from content format module,category,view mode\r\n\treturn 200;\r\n}", "public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }", "public function setWeight(?SupermodelIoLogisticsExpressExportDeclarationLineItemsItemWeight $weight): self\n {\n $this->initialized['weight'] = true;\n $this->weight = $weight;\n\n return $this;\n }", "public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }", "public function store(Request $request)\n {\n if($request->has('default'))\n {\n Weight::where('default',1)->update(['default'=>0]);\n }\n $this->validate($request,[\n 'translate' => [\n 'name' => 'required',\n 'unit_code' => 'required',\n ],\n 'value' => 'required',\n\n ]); \n\n return \\Process::store(request(),'weights',[\n 'translate' => [\n 'name',\n 'unit_code',\n ],\n 'value'=>request('value'),\n 'default'=>request('default',0),\n ],cp.'weights',function ($query){\n return redirect(cp.'weights');\n\n });\n }", "function ws_ls_weight_start()\n{\n\tif(!is_user_logged_in()) {\n\t\treturn '';\n\t}\n\n\tif (ws_ls_get_config('WE_LS_DATA_UNITS') == \"pounds_only\") {\n\t\t$weight = ws_ls_get_start_weight_in_pounds();\n\t}\n\telse {\n\t\t$weight = ws_ls_get_weight_extreme(get_current_user_id());\n\t}\n\treturn we_ls_format_weight_into_correct_string_format($weight);\n}", "public function setWeight($weight) {\n /*\n * param validation using built-in function\n */\n if(is_numeric($weight) && $weight >= 0) {\n $this->weight = $weight;\n return $this;\n } else {\n throw new InvalidCarWeightException();\n }\n }", "public function getProductWeight(Product $product)\n {\n if (null === $this->get('weight_unit')) {\n // use system weight\n $weight = $product->getWeight();\n $multiplier = $this->getMultiplier($this->getGlobal('weight_unit'));\n return $weight * $multiplier;\n }\n // use custom attribute value\n $weight = $product->getData($this->get('product_weight'));\n $multiplier = $this->getMultiplier($this->get('weight_unit'));\n return $weight * $multiplier;\n }", "function carton_get_weight( $weight, $to_unit ) {\n\n\t$from_unit \t= strtolower( get_option('carton_weight_unit') );\n\t$to_unit\t= strtolower( $to_unit );\n\n\t//Unify all units to kg first\n\tif ( $from_unit !== $to_unit ) {\n\n\t\tswitch ( $from_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 0.001;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 0.4536;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 0.0283;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Output desired unit\n\t\tswitch ( $to_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 1000;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 2.2046;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 35.274;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ( $weight < 0 ) ? 0 : $weight;\n}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "function handle_shipping_weight() {\r\n\t$user_id = get_current_user_id();\r\n\t\r\n\tif ( ! is_user_logged_in() ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ( ! dokan_is_user_seller( get_current_user_id() ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ( isset( $_POST['dokan_update_shipping_options'] ) && wp_verify_nonce( $_POST['dokan_shipping_form_field_nonce'], 'dokan_shipping_form_field' ) ) {\r\n\r\n\t\t\r\n\r\n \r\n\t\r\n\t\tif ( isset( $_POST['dps_dokan_country_to'] ) ) {\r\n\r\n\t\t\tforeach ($_POST['dps_dokan_country_to'] as $key => $value) {\r\n\t\t\t\t$country = $value;\r\n\t\t\t\t$c_price = floatval( $_POST['dps_dokan_country_to_price'][$key] );\r\n\r\n\t\t\t\tif( !$c_price && empty( $c_price ) ) {\r\n\t\t\t\t\t$c_price = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( !empty( $value ) ) {\r\n\t\t\t\t\t$rates[$country] = $c_price;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$threshold_value = floatval( $_POST['dps_threshold_value'][$key] );\r\n\r\n\t\t\t\tif( !$threshold_value && empty( $threshold_value ) ) {\r\n\t\t\t\t\t$threshold_value = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( !empty( $value ) ) {\r\n\t\t\t\t\t$threshold_values['threshold'][$country] = $threshold_value;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdate_user_meta( $user_id, '_dps_country_rates', $rates );\r\n\t\t\r\n\t\tupdate_user_meta( $user_id, '_dps_threshold_value', $threshold_values );\r\n\t\tupdate_user_meta( $user_id, '_dps_weight_rates', $_POST['dps_weightrange'] );\r\n\t\t\r\n\r\n \r\n\t\t$shipping_url = dokan_get_navigation_url( 'settings/shipping' );\r\n\t\twp_redirect( add_query_arg( array( 'message' => 'shipping_saved' ), $shipping_url ) );\r\n\t\texit();\r\n\t}\r\n\t\t\r\n}", "public function getWeight() : float\n\t{\n\t\treturn $this->weight;\n\t}", "public function setDefaultPaxPrice()\n {\n if (!$this->additionalprice) {\n $this->additionalprice = $this->transport ? 25 : $this->price;\n }\n return $this;\n }", "public function __construct( $product = 0 ) {\n\t\t$this->set_default_properties();\n\t\tadd_filter( 'woocommerce_product_export_row_data', array( $this, 'add_person_types' ), 20, 2 );\n\t\tadd_filter( 'woocommerce_product_export_product_default_columns', array( $this, 'add_column_names' ), 20, 2 );\n\t}", "private function weightScore() {\n $this->maxScore = round($this->maxScore*self::SCORE_WEIGHT); \n }", "public function get_shipping_cost()\n {\n $products = $this->get();\n $shipping = 0;\n if (! empty($products)) {\n foreach ($products as $product) {\n if ($product['weight'] <= 200) {\n $shipping += 1.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 500) {\n $shipping += 3.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 800) {\n $shipping += 5.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1000) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } else {\n $shipping += 20.00 * ($_SESSION['cart'][$product['id']]);\n }\n }\n return $shipping; \n }\n else {\n return 0.00;\n }\n\n }", "public function setWeightDeclared($weightDeclared) {\n $this->_weightDeclared = $weightDeclared;\n }", "protected function setProductivity()\n {\n $this->productivity = random_int(8, 12);\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "function twentynineteen_child_wc_add_min_qty_product_field() {\n echo '<div class=\"options_group\">';\n woocommerce_wp_text_input( \n array( \n 'id' => '_wc_min_qty_product', \n 'label' => esc_html__( 'Minimum Quantity', 'twentynineteen-child-min-quantity' ), \n 'placeholder' => '',\n 'desc_tip' => 'true',\n 'description' => esc_html__( 'Optional: Set a minimum quantity limit allowed per order.', 'twentynineteen-child-min-quantity' ) \n )\n );\n echo '</div>';\n }" ]
[ "0.6399315", "0.62592727", "0.6171714", "0.6135379", "0.6060049", "0.60186696", "0.5954842", "0.5953273", "0.59354156", "0.5896598", "0.58802015", "0.5865587", "0.5865587", "0.5865587", "0.5865587", "0.5844055", "0.5833352", "0.5825303", "0.5791595", "0.57279557", "0.5718041", "0.5715037", "0.5697835", "0.56926477", "0.56890297", "0.56662256", "0.5645697", "0.56088513", "0.5598922", "0.5591593", "0.55782455", "0.5532642", "0.54938567", "0.5462973", "0.54590327", "0.5419553", "0.5377648", "0.5373733", "0.53489214", "0.5345551", "0.5334141", "0.53295285", "0.53263074", "0.53244555", "0.5299565", "0.5293981", "0.5279329", "0.52729976", "0.5270451", "0.5266044", "0.5266044", "0.5250723", "0.5250723", "0.5250723", "0.5250723", "0.5250723", "0.5250723", "0.5249849", "0.52486724", "0.52458715", "0.5245345", "0.5244195", "0.52430177", "0.523457", "0.5223426", "0.5203835", "0.5188457", "0.5186124", "0.51768017", "0.5169552", "0.5169552", "0.5169552", "0.5169552", "0.5169552", "0.5169552", "0.5169552", "0.51594055", "0.5140534", "0.5133794", "0.5125147", "0.5122201", "0.5121017", "0.5114277", "0.5109944", "0.5096825", "0.50943357", "0.50873214", "0.5081178", "0.5081178", "0.5081178", "0.50692546", "0.5062356", "0.5058711", "0.50499696", "0.504686", "0.5042534", "0.50375956", "0.50318915", "0.50293386", "0.50289845" ]
0.69027114
0
Get product weight unit
public function getProductWeightUnit() { return (string) $this->getConfig( 'packages/global_settings_default_weight_unit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}", "function carton_get_weight( $weight, $to_unit ) {\n\n\t$from_unit \t= strtolower( get_option('carton_weight_unit') );\n\t$to_unit\t= strtolower( $to_unit );\n\n\t//Unify all units to kg first\n\tif ( $from_unit !== $to_unit ) {\n\n\t\tswitch ( $from_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 0.001;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 0.4536;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 0.0283;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Output desired unit\n\t\tswitch ( $to_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 1000;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 2.2046;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 35.274;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ( $weight < 0 ) ? 0 : $weight;\n}", "public function getWeight() : float\n\t{\n\t\treturn $this->weight;\n\t}", "public function getTotalWeight()\n {\n return $this->getQuantity() * $this->getProduct()->getWeight();\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function weight() {\r\n\t\treturn (int)$this->techData['weight'];\r\n\t}", "public function get_weight(){\n\t\treturn $this->weight;\n\t}", "public function getWeight() {\n return $this->weight;\n }", "public function getWeight() {\n return $this->item->getWeight();\n }", "public function getWeight() {\n\t\treturn $this->weight;\n\t}", "public function getProductWeight(Product $product)\n {\n if (null === $this->get('weight_unit')) {\n // use system weight\n $weight = $product->getWeight();\n $multiplier = $this->getMultiplier($this->getGlobal('weight_unit'));\n return $weight * $multiplier;\n }\n // use custom attribute value\n $weight = $product->getData($this->get('product_weight'));\n $multiplier = $this->getMultiplier($this->get('weight_unit'));\n return $weight * $multiplier;\n }", "public function getWeight() \r\n {\r\n return $this->weight;\r\n }", "public function getWeightUnitValue($value, array $product)\n {\n if (empty($this->_system_units['weight_class_description'])) {\n $this->getWeightUnits();\n }\n $units = $this->_system_units['weight_class_description'];\n if (!isset($units[$product['weight_class_id']])\n ) {\n return 0;\n }\n $all = $this->getAllUnits();\n $unit = $units[$product['weight_class_id']]['unit'];\n return $value / $all[$unit]['divider'];\n }", "public function getWeight()\n {\n return $this->getTypeInstance(true)->getWeight($this);\n }", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "function get_weight() {\n\t\tif ($this->data['weight']) return $this->data['weight'];\n\t}", "public function getWeight() {\n }", "function getWeight() {\n return $this->weight;\n }", "public function getProducts_attributes_weight() {\n\t\treturn $this->products_attributes_weight;\n\t}", "protected function getShippingWeight(Mage_Catalog_Model_Product $product){\n $weight = (float) $product->getWeight();\n $weight = !empty($weight) ? $weight . ' lb' : '';\n\n return $weight;\n }", "public function getProducts_attributes_weight_prefix() {\n\t\treturn $this->products_attributes_weight_prefix;\n\t}", "function getWeight() { return $this->_weight; }", "public function getWeight()\n {\n }", "public function getWeight()\n {\n }", "function getWeight(){return $this->weight;}", "private function getUnit($product)\n { \n $units= $product->units;\n\n if(!$units->isEmpty())\n {\n $unitName=NULL;\n\n foreach ($units as $unit) {\n\n $unitName .= $unit->unit_type . \"+\";\n }\n\n return trim($unitName,\"+\");\n\n }\n else\n {\n return NULL;\n }\n }", "public function getWeight() : int\n {\n return $this->_weight;\n }", "function shop_uc_product_weight($variables) {\n $amount = $variables['amount'];\n $units = $variables['units'];\n\n// $output = '<div class=\"product-info weight\">'; // Sudhakar\n $output = t('!weight', array('!weight' => uc_weight_format($amount, $units)));\n// $output .= '</div>'; // Sudhakar\n\n return $output;\n}", "public function getWeightTotal(): float;", "public function getUnitPrice()\n\t{\n\t\treturn $this->getKeyValue('unit_price'); \n\n\t}", "public function getTotalWeight(): float\n {\n return $this->totalWeight;\n }", "public function GetWeight() {\n\t\treturn 10;\n\t}", "function getUtilisation(){\n\n $total = $this-> getTotalWeight() ;\n \n return round(($total / $this->capacity) * 100, 2);\n\n }", "protected function getMultiplier($unit)\n {\n $all = [\n 'g' => 0.001,\n 'kg' => 1,\n 'kgs' => 1, // system unit\n 'lbs' => 0.453592,\n\n 'mm' => 0.001,\n 'cm' => 0.01,\n 'm' => 1,\n ];\n\n return $all[$unit] ?? 1;\n }", "public function weight()\n {\n return $this->getCartItemCollection()->sum(function ($item) {\n return $item->getTotalWeight();\n });\n }", "public function get_weight() : ?float\n {\n //return null to be consistent with get_variant() and get_language()\n if ($this->get_last_error()) {\n return null;\n }\n return $this->weight;\n }", "public function getUnitOfMeasure()\n {\n return $this->unitOfMeasure;\n }", "public function getUnitCost()\n {\n return $this->producer->getUnitCost();\n }", "public function getQuantityByUnit()\n {\n return $this->quantity_by_unit;\n }", "public function getUnitsPerEm() {}", "public function getUnitPrice()\n {\n return $this->_unitPrice;\n }", "public function getRoleWeight() {\n if (isset($this->rRole)) {\n return $this->rRole->weight;\n }\n return 1000000;\n }", "public function getTotalWeight()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->Weight && $item->Quantity) {\n $total = $total + ($item->Weight * $item->Quantity);\n }\n }\n \n return $total;\n }", "public function getUnitPrice()\n\t{\n\t\treturn $this->unitPrice;\n\t}", "public function getUnitPrice()\n {\n return $this->unitPrice;\n }", "public function getUnitPrice() {\n $prices = $this->getPricetable();\n $key = 'ns';\n if ( $this->is_hs ) {\n $key = 'hs';\n }\n\n return $prices->get( $key );\n }", "public function getDocumentProductUnitaryValue()\n {\n return (string) $this->document_product_unitary_value;\n }", "protected function getProductAttrCodeUseForSearchWeight()\n {\n if (null === $this->_productAttrCodeUseForSearchWeight) {\n $this->_productAttrCodeUseForSearchWeight = $this->_helper->getGeneralSetting('advanced/product_search_weight');\n }\n return $this->_productAttrCodeUseForSearchWeight;\n }", "public function getUnitPurchaseCost()\n {\n if ($this->producer->isWorkOrder()) {\n return $this->producer->getUnitCost();\n } elseif ($this->producer->isStockItem()) {\n return $this->standardUnitCost;\n } else {\n return $this->producer->getUnitCost();\n }\n }", "function ws_ls_weight_difference_target()\n{\n\tif(!is_user_logged_in()) {\n\t\treturn '';\n\t}\n\n\tif (ws_ls_get_config('WE_LS_DATA_UNITS') == \"pounds_only\")\n\t{\n\t\t$target_weight = ws_ls_get_target_weight_in_pounds();\n\t\t$recent_weight = ws_ls_get_recent_weight_in_pounds();\n\t}\n\telse\n\t{\n\t\t$target_weight = ws_ls_get_target_weight_in_kg();\n\t\t$recent_weight = ws_ls_get_weight_extreme(get_current_user_id(), true);\n\t}\n\t$difference = $recent_weight - $target_weight;\n\n\t$display_string = ($difference > 0) ? \"+\" : \"\";\n\n\t$display_string .= we_ls_format_weight_into_correct_string_format($difference);\n\n\treturn $display_string;\n}", "public function getTotalWeight()\n {\n $weight = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $weight = $weight + $basketProduct->getProduct()->getWeight() * $basketProduct->getQuantity();\n }\n }\n \n return $weight;\n }", "public function getMultiplier()\n {\n return $this->multiplier;\n }", "public function getUnit();", "protected function _getUnitsPerEm() {}", "public function getUnitOfMeasure(): string\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\\sprintf(__METHOD__.\" get '%s'\", $this->unitOfMeasure));\n return $this->unitOfMeasure;\n }", "function it_returns_the_weight() {\n $this->weight()->shouldBe( '17.91 KB' );\n }", "public function getElUnit() {\n return $this->cElUnit;\n }", "function ws_ls_weight_difference()\n{\n\tif(!is_user_logged_in()) {\n\t\treturn '';\n\t}\n\n\tif (ws_ls_get_config('WE_LS_DATA_UNITS') == \"pounds_only\"){\n\t\t$start_weight = ws_ls_get_start_weight_in_pounds();\n\t\t$recent_weight = ws_ls_get_recent_weight_in_pounds();\n\t}\n\telse\t{\n\t\t$start_weight = ws_ls_get_start_weight_in_kg();\n\t\t$recent_weight = ws_ls_get_weight_extreme(get_current_user_id(), true);\n\t}\n\n\t$difference = $recent_weight - $start_weight;\n\n\t$display_string = ($difference > 0) ? \"+\" : \"\";\n\n\t$display_string .= we_ls_format_weight_into_correct_string_format($difference);\n\n\treturn $display_string;\n}", "protected function _convertWeight($weight)\n {\n if($this->commerceWeightUnit === 'g')\n {\n return $weight/1000;\n } \n \n if($this->commerceWeightUnit === 'lb')\n {\n return $weight*0.453;\n }\n\n return $weight;\n }", "public function getUnits() : string\r\n {\r\n return $this->strUnits;\r\n }", "public function getWeightLimit()\n {\n }", "public function getUnitCost()\n {\n return $this->unitCost;\n }", "public function getMassUnitAttribute()\n {\n return new Mass($this->weight, $this->weight_unit);\n }", "public function getTermFrequencyWeight(): float\n {\n return $this->termFrequencyWeight;\n }", "function wpsl_get_distance_unit() {\n\n global $wpsl_settings;\n\n return apply_filters( 'wpsl_distance_unit', $wpsl_settings['distance_unit'] );\n}", "function getTotalWeight()\n { $total = 0 ;\n if (count($this->items) > 0) \n { \n for ($p=0; $p<count($this->items); $p++) \n {\n $total = $total + $this->items[$p];\n }\n }\n return $total;\n }", "public function getTempUnit() {\n\t\treturn $this->unit;\n\t}", "public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }", "public function getWeightClass() {}", "public function getDistanceUnit() {\n\t\treturn $this->distanceUnit;\n\t}", "public function getTermDeviationWeight(): float\n {\n return $this->termDeviationWeight;\n }", "public function getQuantity(): float;", "public function getWeightings() {\n\t\treturn $this->_weights;\n\t}", "public function getW() {}", "private function _calculate_weight( $carts )\n\t{\n\t\t$total_weight = 0;\n\t\t$weights = 0;\n\n\t\tforeach( $carts as $cart_product )\n\t\t{\n\t\t\t$product = $cart_product['data'];\n\t\t\t// jika berat kosong (null), berat default diambil dari nilai berat setting JNE\n\t\t\t$weight = ( $product->weight ) ? $product->weight : $this->jne_settings['weight'] ;\n\t\t\t// detai content \n\t\t\t$content = '<tr class=\"row-jne-weight-data\"><td class=\"col-1\">'. $product->post->post_title;\n\t\t\t// memiliki volume\n\t\t\tif( $product->length && $product->width && $product->height ) {\n\t\t\t\t// hitung volume\n\t\t\t\t$volume = $product->length * $product->width * $product->height;\n\t\t\t\t// hitung volumetrik\n\t\t\t\t$volumetik = ($volume / 6000) * $weight;\n\t\t\t\t// Apabila hitungan volumetrik lebih berat dari berat aktual, maka biaya kirim dihitung berdasarkan berat volumetrik.\n\t\t\t\t$weight = ($volumetik > $weight) ? $volumetik : $weight ;\n\t\t\t\t// detai content \n\t\t\t\t$content .= sprintf(' (%sx%sx%s)', $product->length, $product->width, $product->height);\n\t\t\t} \n\t\t\t// detai content \n\t\t\t$content .= '</td><td class=\"col-2\">:</td><td class=\"col-3\">'. $this->_floor_dec($weight).' kg</td></tr>';\n\n\t\t\t// hitung berat per kuantitas\n\t\t\t$weight = $weight * $cart_product['quantity'];\n\t\t\t// increase\n\t\t\t$weights += $weight;\n\n\t\t\t// set detai content \n\t\t\t$this->_tooltip_content .= $content;\n\t\t}\n\t\t\n\t\t// prehitungan toleransi\n\t\tif($weights > 1) {\n\t\t\t$tolerance = $this->jne_settings['tolerance'];\n\t\t\t$_weights = $this->_floor_dec($weights, 2);\n\t\t\t$intval = intval($weights);\n\t\t\t$diff = $_weights - $intval;\n\t\t\t$total_weight = $diff > $tolerance ? ceil($weights) : $intval;\n\n\t\t\t/* uncomment this for debugging\n\t\t\tjne_rate_debug(array(\n\t\t\t\t'weights' => array(\n\t\t\t\t\t'default' => $weights,\n\t\t\t\t\t'precision' => $_weights\n\t\t\t\t),\n\t\t\t\t'fraction' => array(\n\t\t\t\t\t'up' => ceil($weights),\n\t\t\t\t\t'down' => $intval\n\t\t\t\t),\n\t\t\t\t'diff' => array(\n\t\t\t\t\t'default' => $weights - $intval,\n\t\t\t\t\t'precision' => $diff\n\t\t\t\t),\n\t\t\t\t'tolerance' => $tolerance,\n\t\t\t\t'total_weight' => $total_weight\n\t\t\t));\n\t\t\t*/\n\t\t\n\t\t\t$this->_tooltip_content .= '<tr class=\"row-jne-weight-tolerance\"><td class=\"col-1 text-right\">Tolerance</td><td class=\"col-2\">:</td><td class=\"col-3\">'.$tolerance.' kg</td></tr>';\n\t\t} \n\t\telse $total_weight = 1;\n\t\t\t\n\t\t$this->_tooltip_content .= '<tr class=\"row-jne-weight-total\"><td class=\"col-1 text-right\">Total</td><td class=\"col-2\">:</td><td class=\"col-3\">'.$total_weight.' kg</td></tr>';\n\n\t\treturn $total_weight;\n\t}", "public function getUnitsConversion(): float\n {\n return $this->inputUnit->getConversionForTargetUnit($this->getOutputUnit());\n }", "public function getUnitAmount();", "public function getUnit()\n\t{\n\t\treturn null;\n\t}", "public function getProdWingspan()\n {\n return $this->prod_wingspan;\n }", "public function getProdScale()\n {\n return $this->prod_scale;\n }", "abstract public function getNumberOfMaterialByUnit(): ?float;", "public static function __weightedGradeAvr(){\r\n if(self::__getTotalUnits() == 0){\r\n $totlWeightedAvr = 0;\r\n }\r\n else{\r\n $totlWeightedAvr = self::__getTotalGrade() / self::__getTotalUnits();\r\n }\r\n return number_format($totlWeightedAvr, 2, '.', '');\r\n }", "public function getUnitLabel()\n {\n return $this->unitLabel;\n }", "public function getUnit(): ?string\n {\n return $this->unit;\n }", "public function getUnitValue(): float\n\t{\n\t\treturn $this->unitValue;\n\t}", "public function getUnits(): int\n\t{\n\t\treturn $this->units;\n\t}", "public function getCubicWeight()\n {\n if (null !== $this->manualCubicWeight) {\n return clone $this->manualCubicWeight;\n }\n\n return new Real($this->getLength()->toNative() *\n $this->getWidth()->toNative() *\n $this->getHeight()->toNative() *\n self::CUBIC_WEIGHT_CONVERSION_FACTOR);\n }", "public function getW() {\n\t\t\treturn $this->_w;\n\t\t}", "function ws_ls_weight_start()\n{\n\tif(!is_user_logged_in()) {\n\t\treturn '';\n\t}\n\n\tif (ws_ls_get_config('WE_LS_DATA_UNITS') == \"pounds_only\") {\n\t\t$weight = ws_ls_get_start_weight_in_pounds();\n\t}\n\telse {\n\t\t$weight = ws_ls_get_weight_extreme(get_current_user_id());\n\t}\n\treturn we_ls_format_weight_into_correct_string_format($weight);\n}" ]
[ "0.75652397", "0.73698014", "0.7227389", "0.71346897", "0.7115272", "0.7115272", "0.7115272", "0.7115272", "0.7115272", "0.7115272", "0.7073693", "0.7072941", "0.70675737", "0.70406574", "0.7040433", "0.70281273", "0.7024127", "0.70174015", "0.70108044", "0.70030725", "0.70030725", "0.70030725", "0.70030725", "0.70030725", "0.70030725", "0.70030725", "0.69833505", "0.69565165", "0.6931338", "0.6899256", "0.68646085", "0.67872995", "0.6736101", "0.66900754", "0.66900754", "0.66664153", "0.66385424", "0.66297066", "0.6607618", "0.6597279", "0.6583125", "0.65740556", "0.6557332", "0.64912623", "0.6466199", "0.6428285", "0.64230394", "0.6410468", "0.63936335", "0.639047", "0.631696", "0.63118386", "0.62873936", "0.6285296", "0.6285005", "0.62798184", "0.6266187", "0.6202131", "0.6199374", "0.61828136", "0.617956", "0.61684763", "0.6164144", "0.61343706", "0.6118591", "0.6093815", "0.60879546", "0.6087463", "0.60555", "0.6054665", "0.6046494", "0.6021269", "0.6017424", "0.6012118", "0.60018396", "0.5988689", "0.59715754", "0.596386", "0.59617305", "0.5959897", "0.5959792", "0.5956469", "0.59216535", "0.59193194", "0.5914477", "0.5906221", "0.59051335", "0.59038615", "0.5903853", "0.5898633", "0.5893907", "0.58938795", "0.5879783", "0.5870745", "0.58674914", "0.58644897", "0.58580476", "0.5838079", "0.5837776", "0.5835505" ]
0.8492666
0
Get default profile id.
public function getProfileDefault() { return $this->getConfig('packages/global_settings_default-profile'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDefaultProfileId()\n {\n return config('betta.default_profile_id');\n }", "private function getProfileId()\n {\n $identity = $this->getIdentity();\n \n return $identity !== null && $identity->getCurrentProfile() ? $identity->getCurrentProfile()->profile_id : null;\n }", "public static function getCurrentUserId()\n {\n $profile = self::getProfile();\n\n return $profile ? $profile->getProfileId() : 0;\n }", "public function GetId() {\n\t\t\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['id'];\n\t}", "private function getGlobalProfileId()\n {\n $identity = $this->getIdentity();\n \n return $identity !== null && $identity->getGlobalProfile() ? $identity->getGlobalProfile()->profile_id : null;\n }", "public function getProfileId() \n {\n if (!$this->hasProfileId()) \n {\n $this->profileId = '';\n }\n\n return $this->profileId;\n }", "function getProfileID() {\n\t\treturn $this->_ProfileID;\n\t}", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "public function getDefaultIndividualId()\n {\n // 1. If no user is logged return empty string\n $loggedInUser = $this->getLoggedInUser();\n if (!$loggedInUser) {\n // no user is logged in\n return '';\n }\n\n // 2. A user is logged in, try to use its default individual\n $loggedInUser = $this->getLoggedInUser();\n if (isset($loggedInUser['default_individual'])) {\n return $loggedInUser['default_individual']['id'];\n }\n\n // 3. Try to use one of the root individuals in one of the user sites\n // get the sites where the user is a member in\n $results = $this->getFamilyGraph()->api('me/memberships');\n if ($results && isset($results['data']) && count($results['data']) > 0) {\n // iterate over the sites and try to get the root individual\n $memberships = $results['data'];\n foreach($memberships as $membership) {\n // for each site get the default root individual\n $siteId = $membership['site']['id'];\n $site = $this->getFamilyGraph()->api($siteId, array('fields' => 'default_root_individual'));\n if (isset($site['default_root_individual'])) {\n $individualId = $site['default_root_individual']['id'];\n return $individualId;\n }\n }\n }\n \n // 4. failed to find a default individual\n return '';\n }", "public function getProfileId() : Uuid {\n\t\treturn ($this->profileId);\n\t}", "public function profile(): string\n {\n if ($this->profile) {\n return $this->profile;\n }\n\n return $this->app['opx.profile'] ?? 'default';\n }", "public static function current_id():int|null\n {\n try {\n return Auth::user()->activeProfile->id ?? null;\n } catch (\\Throwable $e) {\n report($e);\n }\n return null;\n }", "public function getProfileId()\n {\n return $this->profile_id;\n }", "public function getProfileId() {\n\t\treturn($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "public function getProfileId(): ?int {\n\t\treturn ($this->profileId);\n\t}", "public function getSavedJobProfileId(): string {\n\t\treturn ($this->savedJobProfileId);\n\t}", "public function getProfileId() {\n\t\treturn $this->profileId;\n\t}", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\n }", "public function getDefaultId() : ?string;", "public function getProfileImageProfileId() {\n\t\treturn($this->profileImageProfileId);\n\t}", "public function getUserProfileId() : Uuid{\n\t\treturn($this->userProfileId);\n\t}", "public function getdefaultExecPersonId()\n {\n return $this->defaultexecperson_id;\n }", "function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }", "function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }", "public function getUserProfileId(): Uuid {\n\t\treturn ($this->userProfileId);\n\t}", "public function getUserProfileId() {\n return($this->userProfileId); \n }", "public function getProfile()\n {\n return $this->getFieldValue(self::FIELD_PROFILE);\n }", "private function getDefaultCountryId()\n {\n $defaultCountryId = $this->directoryHelper->getDefaultCountry();\n if ($this->config->getDefaultCountryId()) {\n $defaultCountryId = $this->config->getDefaultCountryId();\n } else if ($this->config->isGeoIpDetectionEnabled() && $this->geoIpAdapter->isAvailable()) {\n $countryIdByIp = $this->getCountryIdByIp();\n if ($countryIdByIp) {\n $defaultCountryId = $countryIdByIp;\n }\n }\n return $defaultCountryId;\n }", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function profilePicPath()\n {\n \treturn $this->defaultProfilePicPath;\n }", "public function getGalleryProfileId(): string {\n\t\treturn ($this->galleryId);\n\t}", "static function getDefaultAccessId() {\n $access_id = Setting::get(\"default_access\");\n if (!$access_id) {\n $access_id = \"public\";\n }\n return $access_id;\n }", "static public function get_user_id()\n\t{\n\t\tif (isset($_SESSION[self::$cookie_name_prefix .self::USER_ID]))\n\t\t\treturn $_SESSION[self::$cookie_name_prefix .self::USER_ID];\n\t\telse\n\t\t\treturn null;\n\t}", "public static function getDefaultTeam()\n\t{\n\t\t$user = JFactory::getUser();\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select($db->quoteName('profile_value'))\n\t\t\t->from($db->quoteName('#__user_profiles'))\n\t\t\t->where($db->quoteName('profile_key') . ' = ' . $db->quote('wissensmatrix.team'))\n\t\t\t->where($db->quoteName('user_id') . ' = ' . $user->id);\n\t\t$db->setQuery($query);\n\n\t\treturn (int) json_decode($db->loadResult());\n\t}", "public static function getDefaultAdministratorId() { self::checkInit(); return self::$defaultAdministratorId; }", "protected static function getCurrentUserId()\n {\n return null;\n }", "public function getUserProfileName(): string {\n\t\treturn ($this->userProfileName);\n\t}", "public function getProfileName() {\n\t\treturn ($this->profileName);\n\t}", "protected function getDefaultWebsiteId(): int\n {\n return (int) $this->invoice->getStore()->getWebsiteId();\n }", "static function getProfileID($user_id)\n\t{\n\n\t\t$profile = ORM::for_table('PROFILE')->select('profile_id')->where('owner_id', $user_id)->find_one();\n\n\t\treturn $profile;\n\t}", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "public function getArticleProfileId(): Uuid {\n\t\treturn ($this->articleProfileId);\n\t}", "function getProfileName() {\n\t\treturn $this->_ProfileName;\n\t}", "public function getProfile() {\n\t\treturn $this->profile;\n\t}", "public function GetProfile()\n {\n return $this->profile;\n }", "public function getRatingProfileId() : Uuid {\n\treturn($this->ratingProfileId);\n}", "protected function getCurrentUserId()\n\t{\n\t\treturn get_current_user_id();\n\t}", "function getFirstprofileId(&$analytics) {\n\n // Get the list of accounts for the authorized user.\n $accounts = $analytics->management_accounts->listManagementAccounts();\n\n if (count($accounts->getItems()) > 0) {\n $items = $accounts->getItems();\n $firstAccountId = $items[0]->getId();\n\n // Get the list of properties for the authorized user.\n $properties = $analytics->management_webproperties\n ->listManagementWebproperties($firstAccountId);\n\n if (count($properties->getItems()) > 0) {\n $items = $properties->getItems();\n $firstPropertyId = $items[0]->getId();\n\n // Get the list of views (profiles) for the authorized user.\n $profiles = $analytics->management_profiles\n ->listManagementProfiles($firstAccountId, $firstPropertyId);\n\n if (count($profiles->getItems()) > 0) {\n $items = $profiles->getItems();\n\n // Return the first view (profile) ID.\n return $items[0]->getId();\n\n } else {\n throw new Exception('No views (profiles) found for this user.');\n }\n } else {\n throw new Exception('No properties found for this user.');\n }\n } else {\n throw new Exception('No accounts found for this user.');\n }\n}", "public function getOrganizationProfileId(): int {\n\t\treturn ($this->organizationProfileId);\n\t}", "function getProfile(){\n $profile = $this->loadUser();\n return $profile;\n }", "public function profile() {\n return $this->profile;\n }", "public function getCurrentUserId();", "public function getblogProfileId(): Uuid {\n\t\treturn ($this->blogProfileId);\n\t}", "public function getProfileName()\n\t\t{\n\t\t return $this->profileName;\n\t\t}", "function current_user_profile($user_id = null)\n{\n if (is_null($user_id)) {\n $user_id = current_user_id();\n }\n\n// return \\base\\libs\\Redis::getUserProfile($user_id);\n}", "public function getBaseOrganizationId()\n {\n return $this->_getVar('user_base_org_id');\n }", "public function getEmployProfileId() {\n\t\treturn ($this->employProfileId);\n\t}", "public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token == null) {\n return 0;\n }\n else {\n $userDB = DB::table('users')\n ->where('token', $token)\n ->where('timeout', '>=', $now)\n ->where('deleted_at', null)\n ->select('id')\n ->get()->toArray();\n if (isset($userDB) && !empty($userDB)) {\n return $userDB[0]->id;\n }\n }\n return 0;\n }\n catch(Exception $e) {\n throw $e;\n }\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }", "public function getDefaultProductID() {\n return self::$defaultProductID;\n }", "public static function current():Profile|null\n {\n try {\n return Auth::user()->activeProfile ?? null;\n } catch (\\Throwable $e) {\n report($e);\n }\n return null;\n }", "protected function defaultProfilePhotoUrl(): string\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=7F9CF5&background=EBF4FF';\n }", "public function get_user_id();", "function get_id() {\n\t// Check Altis config first.\n\t$juicer_id = has_altis_config() ? Altis\\get_config()['hm-juicer']['juicer-id'] : false;\n\tif ( ! empty( $juicer_id ) ) {\n\t\treturn $juicer_id;\n\t}\n\n\t// Check the JUICER_ID constant and return it if it exists.\n\tif ( defined( 'JUICER_ID' ) ) {\n\t\treturn JUICER_ID;\n\t}\n\n\t// Return the option, if it exists.\n\treturn Settings\\juicer_get_option( 'juicer_id', false );\n}", "public static function getUserNoProfile()\n {\n $user = static::get();\n if (isset($user->noPerfil)) {\n return $user->noPerfil;\n }\n }", "function getFirstprofileId(&$analytics) {\n\n\t // Get the list of accounts for the authorized user.\n\t $accounts = $analytics->management_accounts->listManagementAccounts();\n\n\t if (count($accounts->getItems()) > 0) {\n\t $items = $accounts->getItems();\n\t $firstAccountId = $items[0]->getId();\n\n\t // Get the list of properties for the authorized user.\n\t $properties = $analytics->management_webproperties\n\t ->listManagementWebproperties($firstAccountId);\n\n\t if (count($properties->getItems()) > 0) {\n\t $items = $properties->getItems();\n\t $firstPropertyId = $items[0]->getId();\n\n\t // Get the list of views (profiles) for the authorized user.\n\t $profiles = $analytics->management_profiles\n\t ->listManagementProfiles($firstAccountId, $firstPropertyId);\n\n\t if (count($profiles->getItems()) > 0) {\n\t $items = $profiles->getItems();\n\n\t // Return the first view (profile) ID.\n\t return $items[0]->getId();\n\n\t } else {\n\t throw new Exception('No views (profiles) found for this user.');\n\t }\n\t } else {\n\t throw new Exception('No properties found for this user.');\n\t }\n\t } else {\n\t throw new Exception('No accounts found for this user.');\n\t }\n\t}", "public function getProfileImageImageId() {\n\t\treturn($this->profileImageImageId);\n\t}", "public static function id ()\n {\n return self::user()->getId();\n }", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "public function getBillingProfileId();", "protected function getDefaultRoleIdentifier() {\n\t\t$roleIdentifier = \\OpenAgenda\\Application\\Controller\\AuthenticationController::ROLE_DefaultRole;\n\t\tif (!empty($this->authenticationSettings['defaultRole'])) {\n\t\t\t$roleIdentifier = $this->authenticationSettings['defaultRole'];\n\t\t}\n\t\treturn $roleIdentifier;\n\t}", "public function get_user_id() {\n if (!empty($this->userid)) {\n return $this->userid;\n }\n\n global $SESSION, $USER;\n\n if (!empty($SESSION->homeworkblockuser)) {\n return $SESSION->homeworkblockuser;\n }\n\n $mode = $this->get_mode();\n\n if ($mode == 'parent') {\n\n // In parent mode, but no child is selected so select the first child.\n $children = $this->get_users_children($USER->id);\n $child = reset($children);\n $SESSION->homeworkblockuser = $child->userid;\n return $child->userid;\n } else {\n return $USER->id;\n }\n }", "public function get_id()\n {\n\n $user_type = $this->isStaff ? \"staff\" : \"user\";\n\n return $this->database->get($user_type,'id',['user_url' => $this->username]);\n\n }", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "private function getDefaultCountryId()\n {\n return 2;\n }", "public function getDefaultConfirmStaffId()\n {\n return null;\n }", "public function getDefaultViewerId()\n {\n return null;\n }", "public function getProfile(){\n\t\treturn (new Profile($this->userName));\n\t}", "function get_current_user_id()\n {\n }", "public function getId()\n {\n return isset($this->sessionStorage->user['id']) ? (int) $this->sessionStorage->user['id'] : 0;\n }", "public function getCommentProfileId(): Uuid {\n\t\treturn ($this->commentProfileId);\n\t}", "public function getCurrentOrganizationId()\n {\n $orgId = $this->_getVar('user_organization_id');\n\n //If not set, read it from the cookie\n if ($this->isCurrentUser() && ((null === $orgId) || (\\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {\n $request = $this->getRequest();\n if ($request) {\n $orgId = \\Gems_Cookies::getOrganization($this->getRequest());\n }\n if (! $orgId) {\n $orgId = 0;\n }\n $this->_setVar('user_organization_id', $orgId);\n }\n return $orgId;\n }", "function labdevs_get_user_current_id()\n{\n global $current_user;\n get_currentuserinfo();\n return $current_user->ID;\n}", "public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }", "public function getVoteProfileId(): int {\n\t\treturn ($this->voteProfileId);\n\t}", "protected function _getProfilePicturePath()\n {\n if ($this->_properties['profile_picture_dir'] && $this->getOriginal('profile_picture')) {\n return '../files/users/profile_picture/' . $this->_properties['profile_picture_dir'] . '/square_' . $this->getOriginal('profile_picture'); \n }\n return 'default-profile_picture.png';\n }", "public function getUserId()\n {\n if (array_key_exists(\"userId\", $this->_propDict)) {\n return $this->_propDict[\"userId\"];\n } else {\n return null;\n }\n }", "public function getPrimaryUid() {\n return $this->get(self::PRIMARY_UID);\n }", "public function getDefaultCatalogId()\n {\n return $this->getSessionData(self::SESSION_KEY_DEFAULT_SHARED_CATALOG_ID);\n }", "public function getProfileIDByURL( $url ) {\n\t\t$current = $this->getWebProperty( $url );\n\t\tif ( $current != null ) {\n\t\t\ttry {\n\t\t\t\t$profile = $this->getFirstProfile( $current );\n\t\t\t\treturn $profile;\n\t\t\t} catch ( Google_Service_Exception $e ) {\n\t\t\t\t$this->errors[] = $e;\n\t\t\t} catch ( Google_IO_Exception $e ) {\n\t\t\t\t$this->errors[] = $e;\n\t\t\t} catch ( Google_Auth_Exception $e ) {\n\t\t\t\t$this->errors[] = $e;\n\t\t\t} catch ( Google_Exception $e ) {\n\t\t\t\t$this->errors[] = $e;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static function getCurrentID() {\n return Session::get(Privilege::SESSION_NAME_ID);\n }", "protected function defaultProfilePhotoUrl()\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=252f3f&background=EBF4FF';\n }" ]
[ "0.8440343", "0.75058216", "0.74652416", "0.72822857", "0.72566247", "0.72167706", "0.7024806", "0.6932436", "0.6924023", "0.69183254", "0.6901203", "0.6885088", "0.6815207", "0.67513794", "0.67199427", "0.67199427", "0.67104375", "0.66082895", "0.65800005", "0.65502393", "0.65422016", "0.65416884", "0.6526463", "0.6497494", "0.64514184", "0.64301664", "0.641617", "0.6376648", "0.6340598", "0.6321465", "0.62842053", "0.6266629", "0.62486976", "0.6246957", "0.6189482", "0.61753327", "0.6172206", "0.612724", "0.6126394", "0.61231244", "0.6095496", "0.6095126", "0.6092993", "0.60826117", "0.6079796", "0.6076407", "0.6074779", "0.6056597", "0.6051683", "0.60506266", "0.60504913", "0.60434645", "0.6040518", "0.60264426", "0.601878", "0.60182077", "0.60147", "0.6014424", "0.6013752", "0.6013678", "0.60135704", "0.6011085", "0.6010687", "0.6010687", "0.6010687", "0.59897035", "0.59892964", "0.59872746", "0.59723103", "0.59683913", "0.59561527", "0.595076", "0.59408605", "0.5932387", "0.5930733", "0.5928845", "0.5918956", "0.59039557", "0.590329", "0.5897719", "0.589607", "0.5894949", "0.5889228", "0.58877933", "0.5884153", "0.58816737", "0.5879096", "0.58779913", "0.5872726", "0.5869704", "0.5869543", "0.5866866", "0.5865425", "0.58632314", "0.58550096", "0.58548254", "0.5850117", "0.5844297", "0.5842236", "0.5840532" ]
0.7339066
3
Get all enabled profiles.
public function getAllEnabledProfiles() { return $this->_toArrayObject($this->getConfig( 'packages/global_settings_enabled-profiles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllProfiles()\n {\n return self::$profiles;\n }", "public function getProfiles()\n {\n return $this->profiles;\n }", "public static function getAllProfiles() {\r\n $allProfiles = array();\r\n \r\n try {\r\n $db = Database::getDB();\r\n $stmt = $db->prepare(\"select * from Profiles\");\r\n $stmt->execute();\r\n \r\n foreach ($stmt as $row) {\r\n $profile = new Profile($row);\r\n\r\n if (!is_object($profile) || $profile->getErrorCount()!=0)\r\n throw new PDOException(\"Failed to create valid profile\");\r\n \r\n $allProfiles[] = $profile;\r\n }\r\n \r\n } catch (PDOException $e) {\r\n $profile->setError('profilesDB', 'PROFILE_GET_ALL_FAILED');\r\n } catch (RuntimeException $e) {\r\n if (isset($profile))\r\n $profile->setError(\"database\", \"DB_CONFIG_NOT_FOUND\");\r\n }\r\n \r\n return $allProfiles;\r\n }", "public function profiles()\n {\n $sql = \"SELECT *\n FROM profile\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public static function getProfiles() {\n $db = Db::instance();\n $q = \"SELECT * FROM `\".self::DB_TABLE.\"`\";\n $result = $db->query($q);\n\n $profiles = array();\n if($result->num_rows != 0) {\n while($row = $result->fetch_assoc()) {\n $profiles[] = self::getProfile($row['profile_id']);\n }\n }\n return $profiles;\n }", "static function profiles() {\n global $LANG;\n\n $a_profil = array();\n $a_profil[] = array('profil' => 'agent',\n 'name' => $LANG['plugin_fusioninventory']['profile'][2]);\n $a_profil[] = array('profil' => 'remotecontrol',\n 'name' => $LANG['plugin_fusioninventory']['profile'][3]);\n $a_profil[] = array('profil' => 'configuration',\n 'name' => $LANG['plugin_fusioninventory']['profile'][4]);\n $a_profil[] = array('profil' => 'wol',\n 'name' => $LANG['plugin_fusioninventory']['profile'][5]);\n $a_profil[] = array('profil' => 'unknowndevice',\n 'name' => $LANG['plugin_fusioninventory']['profile'][6]);\n $a_profil[] = array('profil' => 'task',\n 'name' => $LANG['plugin_fusioninventory']['profile'][7]);\n\n return $a_profil;\n }", "public static function GetProfilesValues()\n\t{\n\t\treturn self::$aPROFILES;\n\t}", "public function getPaymentProfiles() {\n if (!$this->hasData('payment_profiles')) {\n $profilesArray = array();\n $profiles = Mage::getModel('ipay/profile')->getCollection()\n ->addCustomerFilter($this->getCustomer());\n foreach ($profiles as $profile) {\n if ($profile->getIsVisible()) { // don't display on frontend\n $profilesArray[] = $profile;\n }\n }\n }\n $this->setPaymentProfiles($profilesArray);\n return $this->getData('payment_profiles');\n }", "public function index()\n {\n return ProfileResource::collection(Profile::all());\n }", "public function profiles()\n {\n return $this->hasMany(Profile::class);\n }", "public function getPaymentProfileList()\n {\n return $this->paymentProfileList;\n }", "public function index()\n {\n $profiles = Profiles::Latest()->paginate(20);\n return $profiles;\n }", "public static function getProfiles()\n {\n $db = DataBase::connect();\n\n $result = $db->query('SELECT * FROM `profile`');\n\n $profiles = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n\n $profiles[$i]['profile'] = $row['profile'];\n $profiles[$i]['ukr_title'] = $row['ukr_title'];\n $profiles[$i]['upper_ukr_title'] = $row['upper_ukr_title'];\n\n $i++;\n }\n return $profiles;\n }", "public static function getInProgressProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'in-progress');\n\n\t}", "public function existing_profiles()\n {\n if ($this->db->table_exists('profiles'))\n {\n $this->db->select('id, temperatureopt, temperaturemax, lighthours, moisture, phvaluemin, phvaluemax');\n $this->db->where('is_default', '1');\n $query = $this->db->get('profiles');\n return $query;\n }\n }", "public static function getSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'subscribed');\n\n\t}", "public function getWebProfileList()\n {\n $url = $this->host . '/v1/payment-experience/web-profiles';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function getUsuariosProfiles()\n {\n $users= User::select('id','first_name')\n ->with('profile')\n ->where('first_name','<>','administrador')\n ->orderBy('first_name','ASC')\n ->get();\n dd($users->toArray());\n }", "public function index()\n {\n $profiles = Profile::all();\n return $this->showAll($profiles);\n }", "public function profiles()\n {\n return $this->hasMany('Profile');\n }", "public static function getExpiredProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'expired');\n\n\t}", "public function getAllActive()\n {\n return Team::enabled()->get();\n }", "public function getReturnProfiles()\n {\n return $this->return_profiles;\n }", "public function getProfiles()\n {\n return $this->hasMany(Profiles::className(), ['city_id' => 'id']);\n }", "function drush_dslm_profiles() {\n // Bootstrap dslm, this grabs the instantiated and configured dslm library object\n if (!$dslm = _dslm_bootstrap()) {\n return FALSE;\n }\n\n // Pull the profiles\n $profiles = $dslm->getProfiles();\n\n // Iterate through the profiles array and print them out\n foreach ($profiles as $name => $profile) {\n $out .= \"$name:\\n\";\n foreach($profile['all'] as $version) {\n $out .= \" $version\\n\";\n }\n }\n\n drush_log(trim($out), 'ok');\n return TRUE;\n}", "function getProfileConfig() {\n $this->load->model('Usermodel');\n $this->Usermodel->getProfileConfiguration();\n }", "public function getOneClickApplyProfiles();", "function get_all_user_settings()\n {\n }", "public function getShippingProfiles()\n {\n return $this->shipping_profiles;\n }", "public function users()\n {\n return $this->getUsers(\n config('auth.model') ?: config('auth.providers.users.model')\n );\n }", "public static function getEnabled()\n {\n return array_filter(\n $providers = array_keys(self::getProviders(), true, true),\n function ($provider) {\n // if ('google' === $provider && ends_with(config('app.url'), '.local')) {\n // return false;\n // }\n\n return self::isConfigured($provider);\n }\n );\n }", "public function getAllActiveUsers()\n {\n $connection = Db::getConnection();\n\n $userDataRecords = $connection->fetchAll(\n \"SELECT id, name, email \n FROM {$this->tableName} \n WHERE active = ?\", \n [1]\n );\n \n $userObjects = [];\n \n foreach($userDataRecords as $userData) {\n $userObjects[] = $this->initializeObject($userData);\n }\n\n return $userObjects;\n }", "private function getAllProfils() {\n\t\tif (isset($this->profils)) {\n\t\t\treturn $this->profils;\n\t\t}\n\t\t$this->profils = array();\n\t\t$query = \"SELECT p.*, date_format(u.last_login, '%Y-%m-%d') as last_login\n\t\t\tFROM \".DB_PREFIX.\"profil p, \".DB_PREFIX.\"user u\n\t\t\tWHERE u.braldahim_id = p.idBraldun\n\t\t\tORDER BY idBraldun ASC;\";\n\t\t$res = mysql_query($query, $this->db);\n\t\twhile ($row = mysql_fetch_assoc($res)) {\n\t\t\t$this->profils[] = $row;\n\t\t}\n\t\tmysql_free_result($res);\n\t}", "private function fetch_social_profiles() {\n\t\t$profiles = [];\n\t\t$social_profiles = [\n\t\t\t'facebook_site',\n\t\t\t'instagram_url',\n\t\t\t'linkedin_url',\n\t\t\t'myspace_url',\n\t\t\t'youtube_url',\n\t\t\t'pinterest_url',\n\t\t\t'wikipedia_url',\n\t\t];\n\t\tforeach ( $social_profiles as $profile ) {\n\t\t\t$social_profile = $this->helpers->options->get( $profile, '' );\n\t\t\tif ( $social_profile !== '' ) {\n\t\t\t\t$profiles[] = \\urldecode( $social_profile );\n\t\t\t}\n\t\t}\n\n\t\t$twitter = $this->helpers->options->get( 'twitter_site', '' );\n\t\tif ( $twitter !== '' ) {\n\t\t\t$profiles[] = 'https://twitter.com/' . $twitter;\n\t\t}\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_organization_social_profiles' - Allows filtering social profiles for the\n\t\t * represented organization.\n\t\t *\n\t\t * @api string[] $profiles\n\t\t */\n\t\t$profiles = \\apply_filters( 'wpseo_schema_organization_social_profiles', $profiles );\n\n\t\treturn $profiles;\n\t}", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function getProjectProfiles()\n {\n return $this->hasMany(ProjectProfile::className(), ['projectId' => 'id']);\n }", "function get_enabled_users() {\n // Execute the query\n $query = $this->db->query('SELECT * from UserAccount WHERE is_enabled=1');\n // Check if any results are returned from the query\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row) {\n $data[] = array(\n 'email' => $row['email'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'is_admin' => $row['is_admin']\n );\n }\n } else {\n $data = \"Error: could not retrieve list of enabled accounts.\";\n }\n return $data;\n }", "public function getUserProfiles()\n {\n return $this->hasMany(UserProfile::class, ['department_id' => 'id']);\n }", "public function getAllUserProfiles() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->getAllUserProfiles($gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "public function showId($id)\n {\n $profiles = Profiles::where('profile_id', $id)->get();\n return $profiles;\n }", "public function getOnlineUsers()\n {\n return $this->onlineUsers->getOnlineUsers();\n }", "private function getAllConfig() {\n $this->user_panel->checkAuth();\n $this->config->findAll();\n }", "public static function getDetailsProfile(){\n return Profile::find()\n ->joinWith('userService')\n ->joinWith('user')\n ->where(['profile.status' => 10, 'user.status'=> 10])\n ->distinct()->all();\n }", "public function allActive()\n {\n return Guests::where(array('is_active' => 1))->get();\n }", "public function getCouponProfiles()\n {\n return $this->coupon_profiles;\n }", "public function getAll()\n {\n\n return $this->users;\n }", "public function getAllProfiles($accountId = null)\n\t{\n\t\t$profiles = array();\n\t\t$webProperties = array();\n\n\t\tforeach($this->getAccounts() as $account) {\n\t\t\tif ($accountId != null && $account['id'] != $accountId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$webProperties[$account['name']] = $this->getWebProperties($account['id']);\n\t\t}\n\n\t\tforeach($webProperties as $accountName => $wps) {\n\t\t\tforeach($wps as $wp) {\n\t\t\t\ttry {\n\t\t\t\t\t$ps = $this->getProfiles($wp['accountId'], $wp['id']);\n\t\t\t\t\tif (!empty($ps)) {\n\t\t\t\t\t\t$profiles[$accountName][$wp['name']] = $ps;\n\t\t\t\t\t}\n\t\t\t\t} catch (RequestException $e) {\n\t\t\t\t\tif ($e->getCode() == 403) {\n\t\t\t\t\t\t// permissions changed - do nothing\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $profiles;\n\t}", "public function company_all_profiles_json() {\n $this->autoRender = false;\n $profile_pending = $this->Role->find('list', array(\n 'fields' => array('name'),\n 'conditions' => array(\n 'Role.comp_id' => $this->Auth->user('id'),\n )));\n return json_encode($profile_pending);\n }", "public static function getAllReference()\n {\n return self::with('profiles')->get()->pluck('profiles.0.name', 'user_id')->filter()->toArray();\n }", "public function getUsers() {\n return $this->userHandler->getUsers();\n }", "public function getEnabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_INSTALLED;\n });\n }", "public function getProfilesToShow()\n\t{\n\t\treturn $this->profilesToShow;\n\t}", "public function all()\n {\n $this->loadSettingsIfNotLoaded();\n\n return $this->settings;\n }", "public function get_all()\n {\n $sql = <<<SQL\n SELECT \n pigeon_keys.id as keys_id, pigeon_keys.users_id, profiles.first_name, profiles.last_name, users.username, pigeon_keys.key, pigeon_keys.level, pigeon_keys.date_created\n FROM \n profiles , users, {$this->rest_keys_table} pigeon_keys\n WHERE\n pigeon_keys.users_id = users.id\n AND\n profiles.user_id = users.id\nSQL;\n\n return $this->db->query($sql)->result_array();\n\n }", "public function getAll()\n {\n return $this->appUser->orderBy('first_name')->get()->toArray();\n }", "private function getActiveSocialLoginProviders() : array\n {\n return array_values(collect(ArrHelper::getList('social_login_providers', 'config'))->filter(function ($item) {\n return config('config.auth.'.$item) ? true : false;\n })->all());\n }", "public function getAllActive() {}", "public function getUserProfile();", "public function retrieveAllUsers () {\n return $this->usersDB;\n }", "public function getAllUsers(): array\n {\n return $this->users;\n }", "public function getAllSettings()\n {\n return $this->settings;\n }", "public function getAllActiveUsers(): array\n {\n $allUsersInfo = $this->googleSheetsClient->getAllUsersInfo();\n\n $allActiveUsersInfo = array_filter(\n $allUsersInfo,\n function ($user) {\n return ($user[User::ACTIVE] === 'yes');\n }\n );\n\n return array_map(\n function ($entry) {\n // Unset 'active', since ID Stores only return active users.\n unset($entry[User::ACTIVE]);\n\n // Convert the resulting user info to a User.\n return self::getAsUser($entry);\n },\n $allActiveUsersInfo\n );\n }", "function ds_get_social_profiles() {\n\n // Return a filterable social profile.\n return apply_filters(\n 'ds_social_profiles',\n array()\n );\n \n}", "public function retrieveAllWebProperties() {\n\t\t$this->initialiseAPIs();\n\t\t$properties = $this->service->management_webproperties->listManagementWebproperties( '~all' );\n\t\t$arr_properties = array();\n\t\t/** @var Google_Service_Analytics_Webproperty $p */\n\t\tforeach ( $properties as $p ) {\n\t\t\t$arr_properties[ $p->getId() ] = array(\n\t\t\t\t'id' => $p->getId(),\n\t\t\t\t'accountId' => $p->getAccountId(),\n\t\t\t\t'name' => $p->getName(),\n\t\t\t\t'profileCount' => $p->profileCount,\n\t\t\t\t'websiteUrl' => $p->getWebsiteUrl()\n\t\t\t);\n\t\t}\n\t\treturn $arr_properties;\n\t}", "public function getProfile()\n {\n $res = $this->getEntity()->getProfile();\n\t\tif($res === null)\n\t\t{\n\t\t\t$this->setProfile(SDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->findByCriteria('Profile', array('primary' => $this::getPrimary())));\n\t\t\treturn $this->getEntity()->getProfile();\n\t\t}\n return $res;\n }", "public function getSkinsAll()\n {\n return array(\n \\XLite::CUSTOMER_INTERFACE => self::PATH_CUSTOMER,\n \\XLite::COMMON_INTERFACE => self::PATH_COMMON,\n \\XLite::ADMIN_INTERFACE => self::PATH_ADMIN,\n \\XLite::CONSOLE_INTERFACE => self::PATH_CONSOLE,\n \\XLite::MAIL_INTERFACE => self::PATH_MAIL,\n \\XLite::PDF_INTERFACE => self::PATH_PDF,\n );\n }", "public static function getAllEnabled()\n {\n $c = new Criteria();\n $c->add(ServerPeer::IS_ENABLED, true);\n return parent::doSelect($c);\n }", "public function getPostbackProfiles()\n {\n return $this->postback_profiles;\n }", "public function get_profile_data() {\n\t\treturn $this->db->get_where('users', array('id' => $this->session->userdata('user_id')))->row_array();\n\t}", "public function allOnline()\n {\n return $this->model->where('active', '=', true)\n ->orderBy('created_at', 'DESC')\n ->get();\n }", "public static function getPersonsUsers(){\n return self::getPersonsByRole();\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "public function getReturnPolicyProfileList()\n {\n return $this->returnPolicyProfileList;\n }", "public function getAll() {\r\n $query = $this->db->get(USERS);\r\n return $query->result_array();\r\n }", "public function getUsers()\n {\n return User::where('user_status', 1)->get();\n }", "public function getEnabledSites()\n\t{\n\t\t$sites = get_option('social_curator_enabled_sites');\n\t\t$enabled = array();\n\t\tif ( !is_array($sites) ) return $enabled;\n\t\tforeach ( $sites as $key => $site ){\n\t\t\tif ( isset($site['enabled']) ) $enabled[] = $key;\n\t\t}\n\t\treturn $enabled;\n\t}", "public function getAllUsersFull() {\n return $this->mapper->getAllUsersFull();\n }", "public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }", "public function getAllEnabledStoreIds(): array;", "public function getAll() {\n $data=[];\n\n foreach($this->settings AS $name=>$value) {\n $data[$name]=$this->get($name);\n }\n\n return $data;\n }", "function get_all_tbl_profile()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('tbl_profile')->result_array();\n }", "public function getProperties(): array\n {\n return $this->propertyRepository->findEnabledByChannel($this->channelContext->getChannel());\n }", "public static function getUsersToImpersonate()\n {\n $userProfileTable = UserProfile::tableName();\n $userTable = User::tableName();\n $query = new Query();\n $query->select([\"CONCAT(\" . $userProfileTable . \".nome, ' ', \" . $userProfileTable . \".cognome, ' - userId: ', \" . $userProfileTable . \".user_id, ' - userProfileId: ', \" . $userProfileTable . \".id) AS userNameSurname\"]);\n $query->from($userTable);\n $query->innerJoin($userProfileTable, $userProfileTable . '.user_id = ' . $userTable . '.id');\n $query->andWhere([$userTable . '.deleted_at' => null]);\n $query->andWhere([$userProfileTable . '.deleted_at' => null]);\n $query->andWhere([$userTable . '.status' => User::STATUS_ACTIVE]);\n $query->andWhere([$userProfileTable . '.attivo' => UserProfile::STATUS_ACTIVE]);\n $query->andWhere(['not like', 'email', '#deleted_']);\n $query->andWhere(['<>', $userTable . '.id', \\Yii::$app->user->id]);\n $query->indexBy('id');\n $usersToImpersonate = $query->column();\n return $usersToImpersonate;\n }", "public function applicants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_APPLICANT)->get();\n }", "public function index()\n {\n $user_id = Auth::id();\n $user_info = Profile::where('user_id', $user_id)->get();\n\n return $user_info;\n }", "public function getAdminProfile() {\n $this->db->select('*');\n $this->db->where('status', 1);\n $query = $this->db->get('tbl_admin');\n if ($query->num_rows() > 0) {\n return $query->row_array();\n }\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function allActive()\n {\n return IncomeTypes::where(array('is_active' => 1))->get();\n }", "public function getProfileIds()\n {\n $query = Profile::find()\n ->joinWith(['city' => function (ActiveQuery $query) {\n $query->joinWith(['region']);\n }], false)\n ->where([\n '{{%regions}}.id' => $this->_leader->region_id\n ]);\n\n return $query->column();\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function retrieveAllAtributesObjects($profileId) {\r\n $class = get_class($this->getInvoker());\r\n $id = $this->getInvoker()->getId();\r\n return mdAttributeHandler::retrieveAllAttributesObjects($profileId, $class, $id);\r\n }", "public function profiles()\n {\n return $this->belongsToMany('App\\Models\\Profile')->withTimestamps();\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM users WHERE role_id = 2;\";\n $stm = App::$db->prepare($sql);\n $stm->setFetchMode(\\PDO::FETCH_OBJ);\n $stm->execute();\n return $stm->fetchAll();\n }", "public function getUserList() {\n return $this->users;\n }", "function listUsers() {\n return $this->users;\n }", "public function getAllAvailable()\n {\n return $this->allPermissions;\n }", "public function getUsers() {\n return $this->users;\n }", "function getUsers(){\n\t\t\t$this->loadModel('User');\n\t\t\treturn $this->User->find(array());\n\t\t}", "public function active()\n {\n return $this->newQuery('getUsers', ['type' => 'ActiveUsers']);\n }", "public function getAllDevise()\n {\n return static::$deviseImpdao->findAll(self::CLASSNAMEDEVISE);\n\n }" ]
[ "0.80094993", "0.7224373", "0.6879615", "0.6873839", "0.6852592", "0.6334127", "0.62846684", "0.62764776", "0.62368697", "0.62311965", "0.62114984", "0.62074256", "0.61975193", "0.6160011", "0.6127556", "0.61159116", "0.6109766", "0.60652804", "0.60302776", "0.5971348", "0.59683776", "0.5954321", "0.58911484", "0.5867682", "0.58352053", "0.58341646", "0.5824127", "0.58114564", "0.579835", "0.57697135", "0.5733057", "0.5717684", "0.571439", "0.5707646", "0.5704827", "0.56961536", "0.5676825", "0.56609595", "0.5640787", "0.56348205", "0.56132644", "0.55896294", "0.55679715", "0.5565901", "0.5554594", "0.55487126", "0.55317605", "0.5516119", "0.5509494", "0.55084866", "0.55000156", "0.5498997", "0.5493981", "0.54642963", "0.546083", "0.5454109", "0.5452891", "0.54320484", "0.5422396", "0.5421722", "0.54205066", "0.5395135", "0.538193", "0.53783846", "0.5373312", "0.5373285", "0.53642344", "0.5352486", "0.5341878", "0.5340028", "0.53372633", "0.5336509", "0.5335334", "0.53352064", "0.532932", "0.5326132", "0.5323663", "0.5323444", "0.53155273", "0.53144073", "0.53126436", "0.5299091", "0.52966803", "0.52952605", "0.5289473", "0.5288532", "0.52746433", "0.52705866", "0.52636456", "0.5263353", "0.5261262", "0.5258654", "0.52536947", "0.52526295", "0.52498907", "0.5243913", "0.52403855", "0.52345747", "0.52302843", "0.5230238" ]
0.8846744
0
Get all available profiles.
public function getAllProfiles() { return self::$profiles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProfiles()\n {\n return $this->profiles;\n }", "public static function getProfiles() {\n $db = Db::instance();\n $q = \"SELECT * FROM `\".self::DB_TABLE.\"`\";\n $result = $db->query($q);\n\n $profiles = array();\n if($result->num_rows != 0) {\n while($row = $result->fetch_assoc()) {\n $profiles[] = self::getProfile($row['profile_id']);\n }\n }\n return $profiles;\n }", "public function profiles()\n {\n $sql = \"SELECT *\n FROM profile\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllEnabledProfiles()\n {\n return $this->_toArrayObject($this->getConfig(\n 'packages/global_settings_enabled-profiles'));\n }", "public static function getAllProfiles() {\r\n $allProfiles = array();\r\n \r\n try {\r\n $db = Database::getDB();\r\n $stmt = $db->prepare(\"select * from Profiles\");\r\n $stmt->execute();\r\n \r\n foreach ($stmt as $row) {\r\n $profile = new Profile($row);\r\n\r\n if (!is_object($profile) || $profile->getErrorCount()!=0)\r\n throw new PDOException(\"Failed to create valid profile\");\r\n \r\n $allProfiles[] = $profile;\r\n }\r\n \r\n } catch (PDOException $e) {\r\n $profile->setError('profilesDB', 'PROFILE_GET_ALL_FAILED');\r\n } catch (RuntimeException $e) {\r\n if (isset($profile))\r\n $profile->setError(\"database\", \"DB_CONFIG_NOT_FOUND\");\r\n }\r\n \r\n return $allProfiles;\r\n }", "public function index()\n {\n $profiles = Profiles::Latest()->paginate(20);\n return $profiles;\n }", "public static function getProfiles()\n {\n $db = DataBase::connect();\n\n $result = $db->query('SELECT * FROM `profile`');\n\n $profiles = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n\n $profiles[$i]['profile'] = $row['profile'];\n $profiles[$i]['ukr_title'] = $row['ukr_title'];\n $profiles[$i]['upper_ukr_title'] = $row['upper_ukr_title'];\n\n $i++;\n }\n return $profiles;\n }", "static function profiles() {\n global $LANG;\n\n $a_profil = array();\n $a_profil[] = array('profil' => 'agent',\n 'name' => $LANG['plugin_fusioninventory']['profile'][2]);\n $a_profil[] = array('profil' => 'remotecontrol',\n 'name' => $LANG['plugin_fusioninventory']['profile'][3]);\n $a_profil[] = array('profil' => 'configuration',\n 'name' => $LANG['plugin_fusioninventory']['profile'][4]);\n $a_profil[] = array('profil' => 'wol',\n 'name' => $LANG['plugin_fusioninventory']['profile'][5]);\n $a_profil[] = array('profil' => 'unknowndevice',\n 'name' => $LANG['plugin_fusioninventory']['profile'][6]);\n $a_profil[] = array('profil' => 'task',\n 'name' => $LANG['plugin_fusioninventory']['profile'][7]);\n\n return $a_profil;\n }", "public function index()\n {\n return ProfileResource::collection(Profile::all());\n }", "public function index()\n {\n $profiles = Profile::all();\n return $this->showAll($profiles);\n }", "private function fetch_social_profiles() {\n\t\t$profiles = [];\n\t\t$social_profiles = [\n\t\t\t'facebook_site',\n\t\t\t'instagram_url',\n\t\t\t'linkedin_url',\n\t\t\t'myspace_url',\n\t\t\t'youtube_url',\n\t\t\t'pinterest_url',\n\t\t\t'wikipedia_url',\n\t\t];\n\t\tforeach ( $social_profiles as $profile ) {\n\t\t\t$social_profile = $this->helpers->options->get( $profile, '' );\n\t\t\tif ( $social_profile !== '' ) {\n\t\t\t\t$profiles[] = \\urldecode( $social_profile );\n\t\t\t}\n\t\t}\n\n\t\t$twitter = $this->helpers->options->get( 'twitter_site', '' );\n\t\tif ( $twitter !== '' ) {\n\t\t\t$profiles[] = 'https://twitter.com/' . $twitter;\n\t\t}\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_organization_social_profiles' - Allows filtering social profiles for the\n\t\t * represented organization.\n\t\t *\n\t\t * @api string[] $profiles\n\t\t */\n\t\t$profiles = \\apply_filters( 'wpseo_schema_organization_social_profiles', $profiles );\n\n\t\treturn $profiles;\n\t}", "public function getWebProfileList()\n {\n $url = $this->host . '/v1/payment-experience/web-profiles';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function profiles()\n {\n return $this->hasMany(Profile::class);\n }", "public function getUsuariosProfiles()\n {\n $users= User::select('id','first_name')\n ->with('profile')\n ->where('first_name','<>','administrador')\n ->orderBy('first_name','ASC')\n ->get();\n dd($users->toArray());\n }", "public function getAllUserProfiles() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->getAllUserProfiles($gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "public function existing_profiles()\n {\n if ($this->db->table_exists('profiles'))\n {\n $this->db->select('id, temperatureopt, temperaturemax, lighthours, moisture, phvaluemin, phvaluemax');\n $this->db->where('is_default', '1');\n $query = $this->db->get('profiles');\n return $query;\n }\n }", "public function showId($id)\n {\n $profiles = Profiles::where('profile_id', $id)->get();\n return $profiles;\n }", "public function getPaymentProfiles() {\n if (!$this->hasData('payment_profiles')) {\n $profilesArray = array();\n $profiles = Mage::getModel('ipay/profile')->getCollection()\n ->addCustomerFilter($this->getCustomer());\n foreach ($profiles as $profile) {\n if ($profile->getIsVisible()) { // don't display on frontend\n $profilesArray[] = $profile;\n }\n }\n }\n $this->setPaymentProfiles($profilesArray);\n return $this->getData('payment_profiles');\n }", "public static function GetProfilesValues()\n\t{\n\t\treturn self::$aPROFILES;\n\t}", "public static function getInProgressProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'in-progress');\n\n\t}", "public function profiles()\n {\n return $this->hasMany('Profile');\n }", "public function getProfiles()\n {\n return $this->hasMany(Profiles::className(), ['city_id' => 'id']);\n }", "public static function getSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'subscribed');\n\n\t}", "public function getPaymentProfileList()\n {\n return $this->paymentProfileList;\n }", "private function getAllProfils() {\n\t\tif (isset($this->profils)) {\n\t\t\treturn $this->profils;\n\t\t}\n\t\t$this->profils = array();\n\t\t$query = \"SELECT p.*, date_format(u.last_login, '%Y-%m-%d') as last_login\n\t\t\tFROM \".DB_PREFIX.\"profil p, \".DB_PREFIX.\"user u\n\t\t\tWHERE u.braldahim_id = p.idBraldun\n\t\t\tORDER BY idBraldun ASC;\";\n\t\t$res = mysql_query($query, $this->db);\n\t\twhile ($row = mysql_fetch_assoc($res)) {\n\t\t\t$this->profils[] = $row;\n\t\t}\n\t\tmysql_free_result($res);\n\t}", "public function index()\n {\n $user_id = Auth::id();\n $user_info = Profile::where('user_id', $user_id)->get();\n\n return $user_info;\n }", "public function listProfiles()\n\t{\n\t$users = User::all();\n\treturn View::make('users/index')->with('users', $users);\n\t}", "public function public_profile_get() {\n $this->response(App\\Auth::profile(), REST_Controller::HTTP_OK);\n }", "public function getUserProfile();", "public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }", "public function getReturnProfiles()\n {\n return $this->return_profiles;\n }", "function drush_dslm_profiles() {\n // Bootstrap dslm, this grabs the instantiated and configured dslm library object\n if (!$dslm = _dslm_bootstrap()) {\n return FALSE;\n }\n\n // Pull the profiles\n $profiles = $dslm->getProfiles();\n\n // Iterate through the profiles array and print them out\n foreach ($profiles as $name => $profile) {\n $out .= \"$name:\\n\";\n foreach($profile['all'] as $version) {\n $out .= \" $version\\n\";\n }\n }\n\n drush_log(trim($out), 'ok');\n return TRUE;\n}", "public function index()\n\t{\n\t\t$profiles = Profile::paginate(10);\n\n\t\treturn view('admin.profiles.index', compact('profiles'));\n\t}", "public function getProfileListAction()\n {\n $profileList = $this->careerProfileRepository->findBy(['isArchived' => 0]);\n $this->listViewFactory->setViewFactory(ProfileViewFactory::class);\n return $this->viewHandler->handle(View::create($this->listViewFactory->create($profileList)));\n }", "public function index()\n {\n $profiles = Profile::simplePaginate(10);\n return(view('profiles.index',['profiles' => $profiles]));\n }", "public function users()\n {\n return $this->getUsers(\n config('auth.model') ?: config('auth.providers.users.model')\n );\n }", "public static function getAllReference()\n {\n return self::with('profiles')->get()->pluck('profiles.0.name', 'user_id')->filter()->toArray();\n }", "public function manageProfiles()\r\n {\r\n $profiles = Profile::latest()->paginate(6);\r\n $users = User::all();\r\n return view('profiles.manage_profiles')->with('profiles',$profiles)->with('users',$users);\r\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function getOneClickApplyProfiles();", "public function fetch(): object\n {\n return $this->get('userProfile/v1/internal/users/' . $this->accountId . '/profiles');\n }", "public function fetch(): object\n {\n return $this->get('userProfile/v1/internal/users/' . $this->accountId . '/profiles');\n }", "public function index_all(){\n // SELECT * FORM table\n $profiles = Profile::withTrashed()->get();\n return view('profile.index', compact('profiles'));\n }", "public function index()\n {\n $users_profiles = UsersProfile::all();\n\n return view('admin.users_profiles.index', compact('users_profiles'));\n }", "public function getShippingProfiles()\n {\n return $this->shipping_profiles;\n }", "public function index()\n {\n $users = DB::table('users')->paginate(8);\n\n foreach ($users as &$user) {\n $user->profile_picture = Helper::getUserResource($user->profile_picture, $user->id);\n }\n\n return view('show_profiles', [\n 'users' => $users,\n ]);\n }", "public function getUserProfiles()\n {\n return $this->hasMany(UserProfile::class, ['department_id' => 'id']);\n }", "public function getAllProfiles($accountId = null)\n\t{\n\t\t$profiles = array();\n\t\t$webProperties = array();\n\n\t\tforeach($this->getAccounts() as $account) {\n\t\t\tif ($accountId != null && $account['id'] != $accountId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$webProperties[$account['name']] = $this->getWebProperties($account['id']);\n\t\t}\n\n\t\tforeach($webProperties as $accountName => $wps) {\n\t\t\tforeach($wps as $wp) {\n\t\t\t\ttry {\n\t\t\t\t\t$ps = $this->getProfiles($wp['accountId'], $wp['id']);\n\t\t\t\t\tif (!empty($ps)) {\n\t\t\t\t\t\t$profiles[$accountName][$wp['name']] = $ps;\n\t\t\t\t\t}\n\t\t\t\t} catch (RequestException $e) {\n\t\t\t\t\tif ($e->getCode() == 403) {\n\t\t\t\t\t\t// permissions changed - do nothing\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $profiles;\n\t}", "function ds_get_social_profiles() {\n\n // Return a filterable social profile.\n return apply_filters(\n 'ds_social_profiles',\n array()\n );\n \n}", "public function listAction()\n {\n $users = $this->container->get( 'wg.openid.user_manager' )->findUsers();\n return $this->container->get('templating')->renderResponse(\n 'WGOpenIdUserBundle:Profile:list.html.twig', array(\n 'users' => $users,\n ));\n }", "public function getProjectProfiles()\n {\n return $this->hasMany(ProjectProfile::className(), ['projectId' => 'id']);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function index()\n {\n $this->authorize('viewAny', User::class);\n\n $users = User::all();\n\n return view('profiles.index', compact('users'));\n }", "function getProfileConfig() {\n $this->load->model('Usermodel');\n $this->Usermodel->getProfileConfiguration();\n }", "public function indexAction()\n {\n $page = (int) $this->getParam('page', 1);\n $pageSize = (int) $this->getParam('size', 25);\n\n $profileRepoFactory = new Application_Factory_ProfileRepository();\n $profileRepo = $profileRepoFactory->createService();\n\n $this->view->profiles = $profileRepo->paginator($page, $pageSize);\n }", "public function getProfile()\n {\n $stats['countries'] = DB::table('countries')->select('countries.country_id','countries.title')->where('is_active','=','1')\n ->get();\n $stats['cities'] = DB::table('cities')->select('cities.city_id','cities.title')->where('is_active','=','1')->get();\n return view('administrator.profile')->with('stats',$stats);\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function testDestiny2GetProfile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function profileList(){\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('tb_user');\n\t\t\t$this->db->order_by('id','DESC');\n\n\t\t\t$result =$this->db->get();\n\t\t\t$result = $result->result(); \n\t\t\treturn $result;\n\t\t}", "public function getProfilesToShow()\n\t{\n\t\treturn $this->profilesToShow;\n\t}", "public function GetAllDevise() {\n if ($this->get_request_method() != \"GET\") {\n $this->response('', 406);\n }\n\n $sql = $this->db->prepare(\"SELECT * FROM devise\");\n $sql->execute();\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n }", "public function index()\n {\n $per_page = request('per_page');\n\n $clients = $this->profileRepository->all(is_null($per_page) ? 10 : $per_page);\n\n return response()->json($clients);\n }", "function findAllUniversitiesAccountsandProfiles()\n {\n $this->gdlog()->LogInfoStartFUNCTION(\"findAllUniversitiesAccountsandProfiles\");\n $fr;\n $sqlstmnt = \"SELECT \".\n $this->dbfas(\"university_account.uid, \".\n \"university_account.sdesc, \".\n \"university_account.emailkey, \".\n \"university_profile.uid, \".\n \"university_profile.name, \".\n \"university_profile.content, \".\n \"university_profile.city, \".\n \"university_profile.cfg_region_uid, \".\n \"university_profile.cfg_country_uid, \".\n \"university_profile.foundeddate\").\n \" FROM university_account \".\n \"JOIN match_university_account_to_university_profile on \".\n \"match_university_account_to_university_profile.university_account_uid = university_account.uid \".\n \"JOIN university_profile on \".\n \"match_university_account_to_university_profile.university_profile_uid = university_profile.uid\";\n\n $dbcontrol = new ZAppDatabase();\n $dbcontrol->setApplicationDB(\"GROUPYOU\");\n $dbcontrol->setStatement($sqlstmnt);\n $dbcontrol->execSelect();\n if($dbcontrol->getTransactionGood())\n {\n if($dbcontrol->getRowCount() > 0)\n {\n $this->setResults_AllAccountsandProfiles($dbcontrol->getStatement()->fetchAll(PDO::FETCH_ASSOC));\n $this->gdlog()->LogInfoDB($this->getResults_AllAccountsandProfiles());\n $fr = $this->gdlog()->LogInfoRETURN(\"ACCOUNTS_FOUND\");\n }\n else\n {\n $fr = $this->gdlog()->LogInfoRETURN(\"ACCOUNTS_NOT_FOUND\");\n }\n }\n else\n {\n $fr = $this->gdlog()->LogInfoERROR(\"TRANSACTION_FAIL\");\n }\n $this->gdlog()->LogInfoEndFUNCTION(\"findAllUniversitiesAccountsandProfiles\");\n return $fr;\n }", "public function getAll()\n {\n return $this->appUser->orderBy('first_name')->get()->toArray();\n }", "public function index()\n {\n\n if (!$this->authenticate(5)) {\n return $this->sendError('You are not authenticated.');\n }\n\n $user = Pegawai::with(['user', 'riwayatPendidikans', 'riwayatPekerjaans', 'dataKepegawaians'])->get();\n\n return $this->sendResponse($user, 'Profiles retrieved successfully.');\n }", "public static function getExpiredProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'expired');\n\n\t}", "public function index()\n {\n try {\n $profile = Auth::user()->profile;\n\n return $this->responseOk(\n $this->profileRepository->getOptions($profile)\n );\n } catch (Exception $controllerException) {\n report($controllerException);\n $errorMessage = config('app.debug') ? $controllerException->getMessage() : 'An error occured while retrieving your options';\n\n return $this->responseInternalError($errorMessage);\n }\n }", "public function testDestiny2GetLinkedProfiles()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function setProfiles($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\ZwiftPHP\\Protobuf\\Profile::class);\n $this->profiles = $arr;\n\n return $this;\n }", "public function profileInfo()\n {\n\n return response()->json(User::where('id', '=', Auth::user()->id)->get());\n }", "public static function getPersonsUsers(){\n return self::getPersonsByRole();\n }", "public function getProfile()\n {\n $res = $this->getEntity()->getProfile();\n\t\tif($res === null)\n\t\t{\n\t\t\t$this->setProfile(SDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->findByCriteria('Profile', array('primary' => $this::getPrimary())));\n\t\t\treturn $this->getEntity()->getProfile();\n\t\t}\n return $res;\n }", "public function getUserProfile(){\n\n\t\treturn $this->cnuser->getUserProfile($this->request->header('Authorization'));\n\t}", "private function getProfiles($arguments)\n {\n $totalScripts = $arguments[\"totalScripts\"]; // total no of scripts\n\t\t$currentScript = $arguments[\"currentScript\"]; // current script number\n $lastLoginWithIn = $arguments[\"lastLoginWithIn\"]; // last login with in [time specified]\n \n if(!$lastLoginWithIn || !strlen($lastLoginWithIn))\n {\n $lastLoginWithIn = self::LAST_LOGIN_SINCE;\n }\n \n if(null === $this->m_objNewJs_Jprofile_Slave)\n {\n if($this->m_bDebugInfo)\n $this->logSection('Error: ', 'Not able to establish connection with newjs_slave');\n return false;\n }\n \n /*\n * Where Condition for reteriveing set of profiles\n */\n $time = new DateTime();\n $time->sub(date_interval_create_from_date_string($lastLoginWithIn));\n \n $whereCndArray= array('LAST_LOGIN_DT'=>$time->format('Y-m-d'));\n if($this->m_bDebugInfo)\n {\n $this->logSection('DebugInfo: Where Cond on last login date', $whereCndArray['LAST_LOGIN_DT']);\n }\n \n /*\n * Get list of all profiles whose score are not stored on db\n */\n $this->m_arrProfiles = $this->m_objNewJs_Jprofile_Slave->getUncomputedProfiles($totalScripts,$currentScript,$lastLoginWithIn,self::LIMIT_PROFILES);\n \n if($this->m_bDebugInfo)\n {\n $this->logSection('DebugInfo: Counts of profiles reterieved : ',count($this->m_arrProfiles));\n }\n }", "public function getCouponProfiles()\n {\n return $this->coupon_profiles;\n }", "function get_all_user_settings()\n {\n }", "public function get_all()\n {\n $sql = <<<SQL\n SELECT \n pigeon_keys.id as keys_id, pigeon_keys.users_id, profiles.first_name, profiles.last_name, users.username, pigeon_keys.key, pigeon_keys.level, pigeon_keys.date_created\n FROM \n profiles , users, {$this->rest_keys_table} pigeon_keys\n WHERE\n pigeon_keys.users_id = users.id\n AND\n profiles.user_id = users.id\nSQL;\n\n return $this->db->query($sql)->result_array();\n\n }", "public function profiles()\n {\n return $this->belongsToMany('App\\Models\\Profile')->withTimestamps();\n }", "public function index()\n {\n $profiles = Profile::all(); \n return view('profile.index', compact('profiles'));\n }", "public function actionIndex()\n {\n $searchModel = new ProfileSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getSubstitutesHome()\n {\n $players = $this->profileSrv->loadProfiles($this->match->getSubstitutesHome());\n $ret = [];\n foreach ($players as $player) {\n $ret[] = $this->substPlayer($player);\n }\n\n return $ret;\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function get_profile_data() {\n\t\treturn $this->db->get_where('users', array('id' => $this->session->userdata('user_id')))->row_array();\n\t}", "public function index()\n {\n return view('profiles.profile');\n }", "public function getAll()\n {\n\n return $this->users;\n }", "public function loadProfileInformation() {\n\t\t\t$procedure = \"get\" . $this->mode_ . \"Information\"; \n\t\t\t$this->profileInformation_ = $this->dbHandler_->call($procedure, \"%d\", array($this->id_));\n\t\t}", "public function getprofiles(Request $request){\n $profiles = Profile::where('pid', 'like', strval($request->input('value')).'%')\n ->orWhere('first_name', 'like', '%'.strval($request->input('value')).'%')\n ->orWhere('last_name', 'like', '%'.strval($request->input('value')).'%')\n ->get();\n return response()->json(array('status' => true, 'data' => $profiles));\n }", "public function getUsers() {\n return $this->userHandler->getUsers();\n }", "public function getProfile()\n {\n ProfileResource::withoutWrapping();\n MinistryResource::withoutWrapping();\n\n if (request()->has('complete') && request()->complete) {\n return new ProfileResource(auth()->user());\n } else {\n return new MinistryResource(auth()->user());\n }\n }", "public function company_all_profiles_json() {\n $this->autoRender = false;\n $profile_pending = $this->Role->find('list', array(\n 'fields' => array('name'),\n 'conditions' => array(\n 'Role.comp_id' => $this->Auth->user('id'),\n )));\n return json_encode($profile_pending);\n }", "public function users()\n {\n try {\n $resp = $this->httpService->request('GET', 'user/get', []);\n return $resp['data']['openid'];\n } catch (\\Exception $e) {\n $this->logError($e);\n return array();\n }\n }", "public function index(Request $request)\n {\n return $this->profileService->index($request);\n }", "public static function getUsersToImpersonate()\n {\n $userProfileTable = UserProfile::tableName();\n $userTable = User::tableName();\n $query = new Query();\n $query->select([\"CONCAT(\" . $userProfileTable . \".nome, ' ', \" . $userProfileTable . \".cognome, ' - userId: ', \" . $userProfileTable . \".user_id, ' - userProfileId: ', \" . $userProfileTable . \".id) AS userNameSurname\"]);\n $query->from($userTable);\n $query->innerJoin($userProfileTable, $userProfileTable . '.user_id = ' . $userTable . '.id');\n $query->andWhere([$userTable . '.deleted_at' => null]);\n $query->andWhere([$userProfileTable . '.deleted_at' => null]);\n $query->andWhere([$userTable . '.status' => User::STATUS_ACTIVE]);\n $query->andWhere([$userProfileTable . '.attivo' => UserProfile::STATUS_ACTIVE]);\n $query->andWhere(['not like', 'email', '#deleted_']);\n $query->andWhere(['<>', $userTable . '.id', \\Yii::$app->user->id]);\n $query->indexBy('id');\n $usersToImpersonate = $query->column();\n return $usersToImpersonate;\n }", "function get_list() {\n\t\t$query = \"select pr_id, pr_cu_id from \".$this->_db_table;\n\t\t$cloudprofile_name_array = array();\n\t\t$cloudprofile_name_array = htvcenter_db_get_result_double ($query);\n\t\treturn $cloudprofile_name_array;\n\t}", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }", "public function all()\n {\n return $this->get('/user/memberships/orgs');\n }", "abstract protected function getUserProfile();", "public function getUsersProfiles($data = array()) {\r\n \r\n $results = $this->dbDriver->query('SELECT userid, email, groups, username, givenname, lastname, to_char(registrationdate, \\'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"\\') as registrationdate, country, organization, organizationcountry, flags, topics, activated, validatedby, to_char(validationdate, \\'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"\\') as validationdate FROM usermanagement.users' . (isset($data['groupid']) ? ' WHERE \\'' . pg_escape_string($data['groupid']) . '\\' = any(groups)' : (isset($data['keywords']) ? ' WHERE email LIKE \\'' . pg_escape_string($data['keywords']) .'\\' OR username LIKE \\'' . pg_escape_string($data['keywords']) .'\\' OR givenname LIKE \\'' . pg_escape_string($data['keywords']) .'\\' OR lastname LIKE \\'' . pg_escape_string($data['keywords']) .'\\' OR country LIKE \\'' . pg_escape_string($data['keywords']) .'\\' OR organization LIKE \\'' . pg_escape_string($data['keywords']) .'\\'' : '')) . (isset($data['limit']) ? ' LIMIT ' . pg_escape_string($data['limit']) : '') . (isset($data['offset']) ? ' OFFSET ' . pg_escape_string($data['offset']) : '') );\r\n $profiles = array();\r\n while ($profile = pg_fetch_assoc($results)) {\r\n $profile['groups'] = substr($profile['groups'], 1, -1);\r\n\r\n $profiles[] = array(\r\n 'userid' => $profile['userid'],\r\n 'email' => $profile['email'],\r\n 'picture' => $this->getPicture($profile['email']),\r\n 'groups' => $profile['groups'],\r\n 'username' => $profile['username'],\r\n 'givenname' => $profile['givenname'],\r\n 'lastname' => $profile['lastname'],\r\n 'registrationdate' => $profile['registrationdate'],\r\n 'country' => $profile['country'],\r\n 'organization' => $profile['organization'],\r\n 'organizationcountry' => $profile['organizationcountry'],\r\n 'flags' => $profile['flags'],\r\n 'topics' => $profile['topics'],\r\n 'activated' => (integer) $profile['activated'],\r\n 'validatedby' => $profile['validatedby'],\r\n 'validationdate' => $profile['validationdate']\r\n );\r\n }\r\n return $profiles;\r\n }" ]
[ "0.76938975", "0.7554028", "0.7531999", "0.7419739", "0.73789954", "0.71549535", "0.7145779", "0.7130317", "0.69913375", "0.6816248", "0.6780083", "0.6635774", "0.6546788", "0.6477172", "0.6423515", "0.6371681", "0.63626415", "0.636209", "0.6333797", "0.63159496", "0.6303276", "0.6279211", "0.62751806", "0.6199196", "0.61695457", "0.6162089", "0.6142904", "0.61080635", "0.609238", "0.60889775", "0.60643566", "0.6042219", "0.6029567", "0.60068387", "0.600063", "0.59596586", "0.5954185", "0.5930159", "0.59265065", "0.5917125", "0.58885884", "0.58885884", "0.5879295", "0.5874558", "0.5863787", "0.58634615", "0.5861172", "0.58503574", "0.5842882", "0.5838523", "0.5808972", "0.5792547", "0.5792547", "0.5792547", "0.5773994", "0.57529086", "0.5747918", "0.5744561", "0.57383263", "0.5732303", "0.5729224", "0.5717973", "0.5713644", "0.570386", "0.5697172", "0.5687248", "0.56863135", "0.56817883", "0.56804353", "0.56770426", "0.5675045", "0.5660613", "0.56593263", "0.5659273", "0.5635756", "0.5633956", "0.56264704", "0.56227756", "0.5615215", "0.56123704", "0.56122875", "0.56031567", "0.5598599", "0.55982447", "0.5596553", "0.55911535", "0.5587218", "0.55863255", "0.5585727", "0.5574576", "0.5564926", "0.55617183", "0.5557384", "0.55440533", "0.5543599", "0.5539945", "0.5536495", "0.5535284", "0.5528756", "0.5522746" ]
0.8343363
0
Get customs declaration codes.
public function getCustomsDeclarationCodes() { return $this->_toArrayObject($this->getConfig( 'countryCodesCustomsDeclaration')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function codes()\n {\n return static::CODES;\n }", "public function getCustomCodesForHead() {\n return $this->custom;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "public function codes()\n {\n return $this->codes;\n }", "static function getCodes() {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "public function getCodes () {\n $list = [\n '' => '全部',\n 'optask' => '任务',\n 'patientrecord' => '运营备注',\n 'patientstage' => '患者阶段',\n 'patientgroup' => '患者分组',\n 'patientremark' => '患者文本备注',\n ];\n\n return $list;\n }", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "public static function mainCodes()\n {\n return static::MAIN_CODES;\n }", "public function getItemCodes()\n {\n return $this->itemCodes;\n }", "public function getAllCode(){\n return parent::getAll('code_ade');\n }", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "public function getCode()\n {\n return static::CODE;\n }", "protected function _getExportAttrCodes()\n {\n return [];\n }", "protected function _getExportAttrCodes()\n {\n return [];\n }", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function termcodes() {\n\t\treturn $this->terms->termcodes();\n\t}", "public function getCodeDefinitions()\n {\n return $this->definitions;\n }", "public function get_mms_customer_codes()\n {\n if ($this->_mms_customer_codes && is_array($this->_mms_customer_codes)) {\n return $this->_mms_customer_codes;\n } else {\n return FALSE;\n }\n }", "public function getFeatureCodes()\n {\n return isset($this->FeatureCodes) ? $this->FeatureCodes : null;\n }", "public function getCustomConsentTypes()\n {\n return apply_filters('gdpr/consent/types/custom', $this->customConsentTypes);\n }", "public function getCode() : int;", "public function getCodes()\n {\n \n $materials = $this->materialsDao->getAll();\n \n $codesArr = array_map(function ($material) {\n return $material->code;\n }, $materials);\n\n return $codesArr;\n }", "public function getCode() {}", "public function list_handled_codes()\n {\n $list = array();\n $list['filedump'] = array(do_lang('CONTENT'), do_lang('filedump:NOTIFICATION_TYPE_filedump'));\n return $list;\n }", "final function getCode();", "public function getCode()\n {\n }", "public function getCode(): int;", "public function getCode()\n {\n return $this->get(self::CODE);\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function getCode() {\n return $this->get(self::CODE);\n }", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "function getISO3166Codes()\n {\n return array('myan', 'myan');\n }", "public function getDiscountCodes()\n {\n if (is_null($this->discountCodes)) {\n /** @psalm-var ?list<mixed> $data */\n $data = $this->raw(self::FIELD_DISCOUNT_CODES);\n if (is_null($data)) {\n return null;\n }\n $this->discountCodes = $data;\n }\n\n return $this->discountCodes;\n }", "public function getCustomClasses()\n {\n return $this->custom_classes;\n }", "public static function getTypeList() {\n return array(\n self::TYPE_CODE_1=>self::TYPE_STRING_1,\n self::TYPE_CODE_2=>self::TYPE_STRING_2,\n self::TYPE_CODE_3=>self::TYPE_STRING_3,\n self::TYPE_CODE_4=>self::TYPE_STRING_4,\n self::TYPE_CODE_5=>self::TYPE_STRING_5,\n self::TYPE_CODE_6=>self::TYPE_STRING_6\n );\n }", "public function getCustomInfoTypes()\n {\n return $this->custom_info_types;\n }", "public function getCustomInfoTypes()\n {\n return $this->custom_info_types;\n }", "public function getNoticeCodes()\n {\n return static::NOTICE_CODES;\n }", "public function getCodeIdentifier() : array\n {\n $list = [];\n\n foreach ($this->binds as $codeName => $value){\n $list['codeName'] = Str::snake($codeName);\n $list['value'] = intval($value);\n }\n\n return $list;\n }", "protected function _getCharCodesTable() {}", "protected function _getCharCodesTable() {}", "private function codes()\n {\n $a_http_status_codes = array(\n 100 => 'Continue', 102 => 'Processing',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content',\n 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported',\n 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found',\n 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout',\n 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 421 => 'Misdirected Request',\n 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required',\n 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large',\n 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented',\n 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected',\n 510 => 'Not Extended', 511 => 'Network Authentication Required'\n );\n return $a_http_status_codes;\n }", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "public function hasCodeType(){\n return $this->_has(3);\n }", "public function getCode()\n {\n return $this->__get(\"code\");\n }", "public function getCode(): string;", "public function getCode(): string;", "public function getCode(): string;", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getCode(): ?array\n\t{\n\t\treturn $this->code;\n\t}", "public function get_code() {\n\t\treturn $this->code;\n\t}", "public function getCode()\n {\n return $this->values[\"code\"];\n }", "public function hasCodeType(){\n return $this->_has(4);\n }", "public function hasCodeType(){\n return $this->_has(4);\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getCode():string;", "public function getCode()\n {\n return $this->_code;\n }", "public function getCode()\n {\n return $this->_code;\n }", "public function getCode()\n {\n return $this->_code;\n }", "public function GetCode () \r\n\t{\r\n\t\treturn ($Code);\r\n\t}", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function code()\n {\n return $this->code;\n }", "public function code()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->getValueObject('code');\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode()\r\n {\r\n return $this->code;\r\n }" ]
[ "0.7246435", "0.7213599", "0.6729026", "0.6716096", "0.66558594", "0.6532033", "0.63091815", "0.62757987", "0.60895455", "0.6071909", "0.60070395", "0.59655815", "0.5938012", "0.5938012", "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.58669645", "0.58310103", "0.58184046", "0.5800605", "0.57904226", "0.5789005", "0.5738031", "0.5717832", "0.5714191", "0.56909627", "0.56761533", "0.5595938", "0.55899197", "0.55892617", "0.5554396", "0.5544754", "0.5539656", "0.55115813", "0.54928243", "0.54723567", "0.54683226", "0.54683226", "0.54622346", "0.5450725", "0.54496306", "0.54496306", "0.544819", "0.5441182", "0.5437203", "0.543645", "0.54311925", "0.54311925", "0.54311925", "0.5425951", "0.5425951", "0.5425951", "0.5407952", "0.5403245", "0.54010063", "0.5392686", "0.5392686", "0.5391067", "0.5391067", "0.5391067", "0.538487", "0.5374439", "0.5374439", "0.5374439", "0.5374306", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.5374045", "0.536786", "0.536786", "0.5366288", "0.5357901", "0.5357901", "0.5356609" ]
0.85516614
0
Get profile by package code.
public function getProfileByPackageCode($code = self::PACKAGE_EPN, $storeId = null) { $profile = null; // Throw new exception if given code not exists in config.xml. if (!$this->getConfig($code, $storeId)): throw new Dhl_Intraship_Model_Config_Exception(sprintf( 'package code "%s" is invalid.', $code)); endif; $profile = clone new ArrayObject($this->getConfig($code, $storeId)); // Convert country codes values to array object. if ($profile->offsetExists('countryCodes') && !$profile->offsetGet('countryCodes') instanceof ArrayObject ): $profile->offsetSet('countryCodes', $this->_toArrayObject( $profile->offsetGet('countryCodes'))); else: $profile->offsetSet('countryCodes', null); endif; // Convert enabled profile values to array object. if (!$profile->offsetGet('enabled-profiles') instanceof ArrayObject): $profile->offsetSet('enabled-profiles', $this->_toArrayObject( $profile->offsetGet('enabled-profiles'))); endif; return $profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_profile( $key = '' ){\n\t$file = abspath('/contents/user/profile.yaml');\n\tif ( !file_exists($file) )\n\t\treturn -1;\n\n\t$profile = spyc_load_file( $file );\n\t$profile = array_change_key_case_recursive( $profile );\n\n\tif ( !empty($key) && $key = strtolower($key) ){\n\t\tif ( array_key_exists($key, $profile) )\n\t\t\treturn $profile[$key];\n\n\t\treturn null;\n\t}\n\n\treturn $profile;\n}", "static function getProfile($profile_id)\n\t{\n\t\t$profile = ORM::for_table('PROFILE')->where('profile_id', $profile_id)->find_array();\n\n\t\treturn $profile;\n\t}", "public function getProfile()\n {\n $res = $this->getEntity()->getProfile();\n\t\tif($res === null)\n\t\t{\n\t\t\t$this->setProfile(SDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->findByCriteria('Profile', array('primary' => $this::getPrimary())));\n\t\t\treturn $this->getEntity()->getProfile();\n\t\t}\n return $res;\n }", "protected function getProviderFromCode($code)\r\n {\r\n return Directory::getInstance()->locate($code);\r\n }", "public function getProfile()\n {\n return $this->getFieldValue(self::FIELD_PROFILE);\n }", "public function get($code) {\n $q = \"SELECT * FROM claim_codes WHERE code = :code\";\n $vars = array ( ':code' => $code);\n if ($this->profiler_enabled) { Profiler::setDAOMethod(__METHOD__); }\n $ps = $this->execute($q, $vars);\n return $this->getDataRowAsObject($ps, \"ClaimCode\");\n }", "public function getProfile(){\n\t\treturn (new Profile($this->userName));\n\t}", "public function getByCode($code);", "public function getProfile() {\n\t\treturn $this->profile;\n\t}", "public function profile() {\n return $this->profile;\n }", "public function GetProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n $profile = new \\login\\user\\Profile($this->db);\n if (array_key_exists('profile_id', $this->data)) {\n $profile->loadFromId($this->data['profile_id']);\n }\n return $profile;\n }", "public function getUserProfile(){\n\n\t\treturn $this->cnuser->getUserProfile($this->request->header('Authorization'));\n\t}", "public function getProfileByCountryCode($countryCode, $profileName = null, $storeId = null)\n {\n $countryCode = strtoupper($countryCode);\n $match = null;\n foreach (self::$_packageCodes as $code):\n $pack = $this->getProfileByPackageCode($code, $storeId);\n // Find the right package for the given country code.\n if ($pack->offsetExists('countryCodes') &&\n $pack->offsetGet('countryCodes') instanceof ArrayObject\n ):\n if ($pack->offsetGet('countryCodes')->offsetExists($countryCode)):\n $match = $pack;\n endif;\n endif;\n endforeach;\n // Use BPI package while receiver country is not germany or europe.\n if (null === $match):\n return null;\n endif;\n // Get clean object.\n $profile = new ArrayObject();\n $profile->offsetSet('code', $match->offsetGet('code'));\n $profile->offsetSet('weight', $match->offsetGet('weight'));\n $profile->offsetSet('enabled-profiles',\n $match->offsetGet('enabled-profiles'));\n // Unset unsupported shipment types.\n foreach ($match->offsetGet('enabled-profiles') as $shipment => $value):\n $profile->offsetGet('enabled-profiles')->offsetSet(\n $shipment, $match->offsetGet($shipment));\n endforeach;\n // Set current profile id to result object.\n $partnerId = null;\n if (null !== $profileName):\n if (!in_array($profileName, self::$profiles)):\n throw new Dhl_Intraship_Model_Config_Exception(sprintf(\n 'profile \"%s\" is invalid.', $profileName));\n endif;\n // Set partner id to the correct value,\n // if is enabled and in $profileName\n if ($profile->offsetGet('enabled-profiles')->offsetExists($profileName)):\n $partnerId = $profile->offsetGet('enabled-profiles')\n ->offsetGet($profileName);\n endif;\n endif;\n $profile->offsetSet('partnerId', $partnerId);\n // Unset match.\n unset($match);\n return $profile;\n }", "function getProfile(){\n $profile = $this->loadUser();\n return $profile;\n }", "function getProfile($prj_id, $usr_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->getProfile($usr_id);\n }", "function yz_profile() {\n\treturn Youzer_Profile::get_instance();\n}", "public static function findByCode($code)\n {\n return self::findOne($code);\n }", "public function getUserByCode($code) {\r\n $query = $this->db->limit(1)\r\n ->get_where(USERS, array('password_code' => $code));\r\n return $query->row();\r\n }", "public function getUserProfile();", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function profile(): string\n {\n if ($this->profile) {\n return $this->profile;\n }\n\n return $this->app['opx.profile'] ?? 'default';\n }", "public static function get($profileId)\n\t{\n\t\treturn new FrontendProfilesProfile((int) $profileId);\n\t}", "public function get_profile($user_profile_data){\n\t\t$user_name = $_SESSION['username'];\n\t\t// get user id for the logged in user\n\t\t$user_id = Database::user_id_query($user_name);\n\t\t//call static fucntion to get contents of user profile\n\t\t$user_profile_data = UserProfileHelper::get_user_profile($user_id);\n\t\treturn $user_profile_data;\n\t}", "abstract protected function getUserProfile();", "public function getFromCode($code)\n {\n return parent::getFromCode($code);\n }", "public function user($code){\r\n\r\n $this->client->authenticate($code);\r\n\r\n if($this->client->getAccessToken()){\r\n\r\n return $this->serviceOauth->userinfo->get();\r\n \r\n }\r\n }", "public static function findByCode($code)\n {\n if (array_key_exists($code, static::$codeCache)) {\n return static::$codeCache[$code];\n }\n\n $status = static::whereCode($code)->first();\n\n return static::$codeCache[$code] = $status;\n }", "public function get_by_code($code = NULL)\n {\n $this->clusterpoint->connect();\n \n try\n {\n $query = $this->clusterpoint->term($code, \"//access/code\");\n $documents = $this->clusterpoint->api->search($query, 0, 1, array(), \"descending\");\n \n return (count($documents)) ? array_shift($documents) : NULL;\n }\n catch(CPS_Exception $e)\n {\n throw $e;\n }\n }", "public static function getProfileBy($type, $value) {\r\n $allowed = ['profileID', 'email'];\r\n $profile = null;\r\n \r\n try {\r\n if (!in_array($type, $allowed))\r\n throw new PDOException(\"$type not allowed search criterion for Profile\");\r\n \r\n $db = Database::getDB();\r\n $stmt = $db->prepare(\r\n \"select * from Profiles\r\n where ($type = :$type)\");\r\n $stmt->execute(array(\":$type\" => $value));\r\n \r\n if(count($stmt) > 1)\r\n throw new PDOException(\"Error: multiple results returned\");\r\n \r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n if ($row !== false)\r\n $profile = new Profile($row);\r\n \r\n } catch (PDOException $e) {\r\n $profile->setError('profilesDB', 'PROFILE_GET_FAILED');\r\n } catch (RuntimeException $e) {\r\n $profile->setError(\"database\", \"DB_CONFIG_NOT_FOUND\");\r\n }\r\n \r\n return $profile;\r\n }", "function get_profile_usrid($usrid){\r\n\t\r\n}", "public function getProfileClass(): string {\n $main_module = $this->xot->main_module;\n $class = 'Modules\\\\'.$main_module.'\\Models\\Profile';\n\n return $class;\n }", "public function getBillingProfile();", "function getProfile($id){\n return $this->activity_model->fetchProfile($id)->row();;\n }", "public function getByCode($code) {\n\n\t\t$select = $this->_db->select()\n\t\t\t->from(array('device' => 'device'))\n\t\t\t->joinInner(array('account' => 'account'), 'account.account_code = device.account_code', array('account_name'))\t\t\t\n\t\t\t->joinLeft(array('room' => 'room'), 'room.room_code = device.room_code and room_deleted = 0')\t\t\n\t\t\t->where('account_deleted = 0 and account.account_code = ?', $this->_account)\n\t\t\t->where('device_code = ?', $code)\n\t\t\t->limit(1);\t\t\n\n\t\t$result = $this->_db->fetchRow($select);\n\t\treturn ($result == false) ? false : $result = $result;\t\t\n\t}", "function profile_info() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "function get_profile_usrnm($usrname){\r\n\t\r\n}", "public function getProfileId() {\n\t\treturn $this->profileId;\n\t}", "public function loadByCode($code)\r\n {\r\n return $this->load($code, 'code');\r\n }", "function getPatty($code)\n {\n foreach( $this->xml->patties->patty as $patty )\n {\n if( $patty['code'] == $code )\n {\n $result['code'] = (string) $patty['code'];\n $result['price'] = (string) $patty['price'];\n $result['name'] = (string) $patty;\n\n return $result;\n }\n }\n\n return 1;\n }", "public function getFromCode($code)\n {\n if($code != null)\n {\n $this->db->select('I.*', FALSE);\n $this->db->select('T.name AS type');\n $this->db->select('S.status AS status');\n $this->db->from('items AS I');\n $this->db->join('item_type AS T', 'T.id = I.item_type_id');\n $this->db->join('item_status AS S', 'S.id = I.item_status_id');\n $query = $this->db->where('I.code', $code)\n ->limit(1)\n ->get();\n if(!empty($query->result()))\n {\n return $query->result()[0];\n }\n else\n {\n return NULL;\n }\n }\n }", "public function get_setting($code){\n\t\tif(!is_array($this->settings_cache)){\n\t\t\t$this->load_settings();\n\t\t}\n\t\treturn $this->settings_cache[$code];\n\t}", "public static function getCountryByCode($code){\n return Country::findOne([ 'code'=> $code]);\n }", "public function getProfileId() {\n\t\treturn($this->profileId);\n\t}", "public function getCurrentProfile(){\n\n try{\n\n if( $this->hasToken() ){\n\n $account = $this->asObj( '/profile' );\n\n return $account->data;\n\n }\n else\n throw new ClientException(\"You need an authorization token, in order to request a profile.\");\n\n }\n catch (ResourceNotFoundException $e){\n //account does not exist\n return NULL;\n }\n\n }", "private function getProfile() {\n if(!$this->profile = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/app/get_user_data.jsp?_plus=true')) {\n throw new Exception($this->feedErrorMessage);\n }\n }", "public function loadByCode($code)\n {\n $this->_requestedCode = $code;\n\n return $this->load($code, 'code');\n }", "public function getSource()\n {\n return 'nidara_kid_profile';\n }", "public static function getSportFromCode($code)\n {\n switch (strtolower(trim($code))) {\n case SportMapperInterface::RUNNING:\n case 'run':\n return SportMapperInterface::RUNNING;\n case SportMapperInterface::CYCLING_SPORT:\n case 'cycling':\n return SportMapperInterface::CYCLING_SPORT;\n case SportMapperInterface::CYCLING_TRANSPORT:\n return SportMapperInterface::CYCLING_TRANSPORT;\n case SportMapperInterface::SWIMMING:\n return SportMapperInterface::SWIMMING;\n default:\n return SportMapperInterface::OTHER;\n }\n }", "private function getCountryByCode($code)\n {\n // Check if country exist in cache.\n if (array_key_exists($code, $this->countries)) {\n return $this->countries[$code];\n }\n // Fetch country.\n $country = $this->manager->getRepository(static::$countryEntityName)->findOneBy(['code' => $code]);\n if (!$country) {\n throw new \\Doctrine\\ORM\\EntityNotFoundException('code = ' . $code);\n }\n // Add country to cache.\n $this->countries[$code] = $country;\n\n return $country;\n }", "public function get($code) {\n\t\t$code = strtoupper($code);\n\t\t$this->assertCurrency($code);\n\t\treturn $this->currencies[$code];\n\t}", "public static function findByCode($code) {\n return self::find()->where(['code' => $code])->one();\n }", "function getTypeIdByCode($code) {\n $id = 0;\n $conn = \\DB\\getConnection();\n\n // Run the query and get the user details\n $query = sprintf(\"SELECT id\n FROM PaymentTypes\n WHERE code = '%s'\",\n $conn->escape_string($code));\n\n $result = $conn->query($query);\n\n if ($result->num_rows) {\n $row = mysqli_fetch_assoc($result);\n $id = $row['id'];\n }\n\n return $id;\n}", "public function get_auth_code( $code ) {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\treturn $tokens->get( $code );\n\t}", "protected function getCountryByCode(string $code)\n {\n global $db;\n require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';\n $pays = new \\Ccountry($db);\n if ($pays->fetch(0, $code) > 0) {\n return $pays->id;\n }\n\n return false;\n }", "public function getProfileResult($token){\n\t\treturn $this->_profiles[$token];\n\t}", "static function get_country($code) {\n $countries = self::get_countries();\n foreach($countries as $c) {\n if($c->code == $code || $c->code2l == $code) {\n return $c;\n }\n }\n return FALSE;\n }", "public function findCoupon($code)\n {\n return array_get($this->coupons, $code);\n }", "public function getProfileId() \n {\n if (!$this->hasProfileId()) \n {\n $this->profileId = '';\n }\n\n return $this->profileId;\n }", "public function getByCode($code)\n\t{\t\t\n\t\t$select = $this->_db->select()\t\n\t\t\t\t\t->from(array('_comm' => '_comm'))\t\t\t\t\n\t\t\t\t\t->joinLeft('account', 'account.account_code = _comm.account_code and account_deleted = 0')\t\n\t\t\t\t\t->joinLeft(array('areapost' => 'areapost'), 'areapost.areapost_code = account.areapost_code')\t\t\t\t\t\n\t\t\t\t\t->where('_comm_code = ?', $code)\t\t\t\t\t\n\t\t\t\t\t->limit(1);\n \n\t\t$result = $this->_db->fetchRow($select);\n return ($result == false) ? false : $result = $result;\n\n\t}", "function getCountry($code){\n\t\n\tglobal $dz;\n\t\n\tif(strlen($code)!=2){\n\t\t\n\t\t// Invalid input.\n\t\terror('field/invalid','country');\n\t\t\n\t}\n\t\n\t// Make sure it's uppercase:\n\t$code=strtoupper($code);\n\t\n\t// Get the row:\n\t$row=$dz->get_row('select country_id from countries where iso2=\"'.$code.'\"');\n\t\n\tif(!$row){\n\t\t\n\t\t// Country was not found.\n\t\terror('country/notfound');\n\t\t\n\t}\n\t\n\treturn $row['country_id'];\n}", "function getProfileID() {\n\t\treturn $this->_ProfileID;\n\t}", "public function get_profile($username = '')\n {\n\n\n if($username) $this->username = $username;\n\n $details = (Object) $this->user_details($this->username);\n\n $profile = $details->profile;\n\n $not_valid = !(!empty($profile) and FILE::isExist($profile,\"profile\"));\n\n if($not_valid) return;\n\n return $profile;\n\n\n }", "public function getCodeByID($code){\n\t\t\n\t\t$row = $this->fetchRow(\"`code` =\".$code);\n\t\n\t\tif(!$row) return false;\n\t\treturn $row->toArray();\n\t}", "public function get($code)\n\t{\n\t\t$result = $this->run('SELECT * FROM oauth_auth_codes WHERE auth_code = ?', [$code]);\n\t\tif (count($result) === 1) {\n\t\t\t$token = new AuthCodeEntity($this->server);\n\t\t\t$token->setId($result[0]['auth_code']);\n\t\t\t$token->setRedirectUri($result[0]['client_redirect_uri']);\n\t\t\t$token->setExpireTime($result[0]['expire_time']);\n\t\t\treturn $token;\n\t\t}\n\t\treturn null;\n\t}", "public function getCodeStatutPro() {\n return $this->codeStatutPro;\n }", "public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['id' => 'profile_id']);\n }", "public function getProfileImage()\n {\n if ($this instanceof \\humhub\\modules\\space\\models\\Space) {\n return new \\humhub\\libs\\ProfileImage($this->guid, 'default_space');\n }\n return new \\humhub\\libs\\ProfileImage($this->guid);\n }", "function getProfileName() {\n\t\treturn $this->_ProfileName;\n\t}", "public function getProfileId()\n {\n return $this->profile_id;\n }", "function profile ($user_id) {\n global $sql;\n $res = $sql->sql_select_array_query(\"SELECT * FROM `profile` WHERE user_id = '{$user_id}'\");\n return count($res) > 0 ? $res[0] : null;\n }", "public function getProfileId() : Uuid {\n\t\treturn ($this->profileId);\n\t}", "public function getCode($code)\n\t{\n\t\t$select = $this->_db->select()\t\n\t\t\t\t\t\t->from(array('mileage' => 'mileage'))\t\n\t\t\t\t\t ->where('mileage_code = ?', $code)\n\t\t\t\t\t ->limit(1);\n\n\t $result = $this->_db->fetchRow($select);\t\n return ($result == false) ? false : $result = $result;\t\t\t\t\t \n\t}", "function getProfile( $profile_id ) {\n\n // update cache if required\n if ( $this->last_profile_id != $profile_id ) {\n $this->last_profile_object = new WPLA_AmazonProfile( $profile_id );\n $this->last_profile_id = $profile_id;\n }\n\n return $this->last_profile_object;\n }", "public function getUsercode()\n {\n return $this->usercode;\n }", "public function getSource()\n {\n return 'user_profile';\n }", "public static function get_data_by_code( $code ) {\n\t\tglobal $wpdb;\n\t\t$query = 'select * from ' . self::TABLE_NAME . ' where code like \"' . $code . '\";';\n\t\t$results = $wpdb->get_results( $query, ARRAY_A );\n\n\t\tif ( is_array( $results ) && count( $results ) > 0 ) {\n\t\t\treturn $results[0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function getTechnicalUnit($code, $locale = null) {\r\n\t\t$cache =& $this->_getTechnicalUnitCache($locale);\r\n\t\treturn $cache->get($code);\r\n\t}", "public function getProfile()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getProfile() : null;\r\n }", "public function get_profile(array $where)\n\t{\n\t\t$data = $this->db->get_where($this->_table, $where)->result_array();\n\t\tif($data)\n\t\t{\n\t\t\treturn $data['0'];\n\t\t}\n\t}", "public function getProfilePicture()\n\t{\n\t\treturn $this->info['profile_picture'];\n\t}", "function getTypeByCode($code) {\n $conn = \\DB\\getConnection();\n\n // Run the query and get the user details\n $query = sprintf(\"SELECT *\n FROM PaymentTypes\n WHERE code = '%s'\",\n $conn->escape_string($code));\n\n $result = $conn->query($query);\n\n return $result;\n}", "public function findCountry($code)\n {\n\n $country = $this->em->getRepository('TTBundle:Airport')->findOneByAirportCode($code);\n\n return $country;\n }", "public function getDbProfileResult($token){\n\t\treturn $this->_profiles[$token];\n\t}", "public function getBillingProfileId();", "public static function checkCode($code)\n {\n return static::where('short_url', $code)\n ->first();\n }", "public function getByCode($code = '')\n {\n $promo = $this->promo->where('code', $code)->first();\n return $promo;\n }", "public function get_profile($pid){\n return $this->db->query(\"select PROFILE as profile, USER_ASSESS as user_assess, u.NAME as name from PERSON p left outer join USER u on p.USER_ASSESS_USER=u.UID where p.PID='$pid' \")->row();\n }", "public function getEncryptionProfileId();", "public function getProfile() {\n return $this->getGuardUser() ? $this->getGuardUser()->getProfile() : null;\n }", "function wpcom_vip_get_user_profile( $email_or_id ) {\n\n\tif ( is_numeric( $email_or_id ) ) {\n\t\t$user = get_user_by( 'id', $email_or_id );\n\t\tif ( ! $user )\n\t\t\treturn false;\n\n\t\t$email = $user->user_email;\n\t} elseif ( is_email( $email_or_id ) ) {\n\t\t$email = $email_or_id;\n\t} else {\n\t\t$user_login = sanitize_user( $email_or_id, true );\n\t\t$user = get_user_by( 'login', $user_login );\n\t\tif ( ! $user )\n\t\t\treturn;\n\n\t\t$email = $user->user_email;\n\t}\n\n\t$hashed_email = md5( strtolower( trim( $email ) ) );\n\t$profile_url = esc_url_raw( sprintf( '%s.gravatar.com/%s.php', ( is_ssl() ? 'https://secure' : 'http://www' ), $hashed_email ), array( 'http', 'https' ) );\n\n\t$profile = wpcom_vip_file_get_contents( $profile_url, 1, 900 );\n\tif ( $profile ) {\n\t\t$profile = unserialize( $profile );\n\n\t\tif ( is_array( $profile ) && ! empty( $profile['entry'] ) && is_array( $profile['entry'] ) ) {\n\t\t\t$profile = $profile['entry'][0];\n\t\t} else {\n\t\t\t$profile = false;\n\t\t}\n\t}\n\treturn $profile;\n}", "function getUserProfile()\n\t{\n\t\t// ask kakao api for user infos\n\t\t$data = $this->api->api( \"user/me\" ); \n \n\t\tif ( ! isset( $data->id ) || isset( $data->error ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = @ $data->id; \n\t\t$this->user->profile->displayName = @ $data->properties->nickname;\n\t\t$this->user->profile->photoURL = @ $data->properties->thumbnail_image;\n\n\t\treturn $this->user->profile;\n\t}", "public function getByCode($code) {\n\n\t\t$select = $this->_db->select()\n\t\t\t->from(array('participant' => 'participant'))\n\t\t\t->joinInner(array('account' => 'account'), 'account.account_code = participant.account_code')\n\t\t\t->joinLeft(array('media' => 'media'), \"media_item_type = 'PARTICIPANT' and media_item_code = participant.participant_code and media_primary = 1 and media_deleted = 0\", array('media_code', 'media_path', 'media_ext'))\n\t\t\t->where('account_deleted = 0 and account.account_code = ?', $this->_account)\n\t\t\t->where('participant.participant_code = ?', $code)\n\t\t\t->limit(1);\t\t\n\n\t\t$result = $this->_db->fetchRow($select);\n\t\treturn ($result == false) ? false : $result = $result;\t\t\n\t}", "public function get_test_by_code($code)\n\t{\n\t\treturn $this->db->get_where('test', array('code' => $code))->row();\n\t}", "function GetProfileDetails(){\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$this->user_id = $this->User_model->Get_User_ID_By_Token($this->user_auth_id); //Just Like a call to require ID of USER\n\t\t//Did this because the user_id might be set but above function just represents auth ID and sends to model to deliver real ID\n\t\t\n\t\t$this->db->select('firstname,lastname,auth_token,program_name,level,grad_year');\n\t\t$this->db->from('users');\n\t\t$this->db->join('programs', 'programs.program_id = users.program_id');\n\t\t$this->db->join('students', 'students.user_id = users.user_id');\n\t\t$this->db->where('users.user_id', $this->user_id);\n\t\t$query = $this->db->get();\n\t\t\n\t\t$results = $query->result_array();\n\t\t\n\t\treturn $results[0];\n\t}" ]
[ "0.6191323", "0.60606056", "0.6039571", "0.59973586", "0.59012353", "0.5871176", "0.5838389", "0.5836532", "0.58179116", "0.57636195", "0.5738602", "0.57368726", "0.57368726", "0.57368726", "0.5729843", "0.57101303", "0.56915766", "0.56413424", "0.56179297", "0.5615515", "0.55697554", "0.5531866", "0.55132353", "0.5502673", "0.5498177", "0.5477365", "0.5476884", "0.5476387", "0.5469288", "0.5466824", "0.54667926", "0.54625463", "0.5421001", "0.54084194", "0.5407896", "0.5388334", "0.53522825", "0.53468275", "0.5344036", "0.534171", "0.534171", "0.53098047", "0.52994746", "0.52959734", "0.52859664", "0.52692825", "0.5262618", "0.5249898", "0.5240502", "0.523731", "0.52323866", "0.52248347", "0.5219536", "0.5209289", "0.5209232", "0.5204763", "0.5203022", "0.52023095", "0.5194198", "0.51911396", "0.51889193", "0.5188455", "0.51854694", "0.51825446", "0.51676047", "0.5167234", "0.5165389", "0.51619893", "0.51549166", "0.5152498", "0.51511997", "0.51502204", "0.51492774", "0.51383024", "0.51369137", "0.51252085", "0.5120914", "0.51108134", "0.5109706", "0.51004547", "0.5099814", "0.5097524", "0.50963926", "0.50869113", "0.5086087", "0.5079247", "0.5077027", "0.5061143", "0.5053873", "0.505095", "0.50342506", "0.5030981", "0.5029018", "0.5026709", "0.5025757", "0.50204694", "0.50139266", "0.50090384", "0.50059354", "0.5000049" ]
0.6854
0
Get profile by country code (ISO).
public function getProfileByCountryCode($countryCode, $profileName = null, $storeId = null) { $countryCode = strtoupper($countryCode); $match = null; foreach (self::$_packageCodes as $code): $pack = $this->getProfileByPackageCode($code, $storeId); // Find the right package for the given country code. if ($pack->offsetExists('countryCodes') && $pack->offsetGet('countryCodes') instanceof ArrayObject ): if ($pack->offsetGet('countryCodes')->offsetExists($countryCode)): $match = $pack; endif; endif; endforeach; // Use BPI package while receiver country is not germany or europe. if (null === $match): return null; endif; // Get clean object. $profile = new ArrayObject(); $profile->offsetSet('code', $match->offsetGet('code')); $profile->offsetSet('weight', $match->offsetGet('weight')); $profile->offsetSet('enabled-profiles', $match->offsetGet('enabled-profiles')); // Unset unsupported shipment types. foreach ($match->offsetGet('enabled-profiles') as $shipment => $value): $profile->offsetGet('enabled-profiles')->offsetSet( $shipment, $match->offsetGet($shipment)); endforeach; // Set current profile id to result object. $partnerId = null; if (null !== $profileName): if (!in_array($profileName, self::$profiles)): throw new Dhl_Intraship_Model_Config_Exception(sprintf( 'profile "%s" is invalid.', $profileName)); endif; // Set partner id to the correct value, // if is enabled and in $profileName if ($profile->offsetGet('enabled-profiles')->offsetExists($profileName)): $partnerId = $profile->offsetGet('enabled-profiles') ->offsetGet($profileName); endif; endif; $profile->offsetSet('partnerId', $partnerId); // Unset match. unset($match); return $profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCountry($code){\n\t\n\tglobal $dz;\n\t\n\tif(strlen($code)!=2){\n\t\t\n\t\t// Invalid input.\n\t\terror('field/invalid','country');\n\t\t\n\t}\n\t\n\t// Make sure it's uppercase:\n\t$code=strtoupper($code);\n\t\n\t// Get the row:\n\t$row=$dz->get_row('select country_id from countries where iso2=\"'.$code.'\"');\n\t\n\tif(!$row){\n\t\t\n\t\t// Country was not found.\n\t\terror('country/notfound');\n\t\t\n\t}\n\t\n\treturn $row['country_id'];\n}", "public static function getCountryByCode($code){\n return Country::findOne([ 'code'=> $code]);\n }", "static function getCountryDetailsByCode($country_code) {\n return self::find()->where(['country_code' => $country_code])->one();\n }", "public function getCountry();", "public function getCountry();", "public function getCountry() {}", "public function getCountry() {}", "public function country()\r\n\t{\r\n\t\t$country = \\Shop\\Models\\Countries::fromCode( $this->country_isocode_2 );\r\n\r\n\t\treturn $country;\r\n\t}", "public function getCountry($codeCountry = null) {\n $pathFile = storage_path(\"/json/countries.json\");\n\n if(!File::exists($pathFile)) {\n return null;\n }\n\n $countries = File::get($pathFile);\n $file = (array)json_decode(File::get($pathFile));\n if ($codeCountry != \"\" && $codeCountry != null){\n return $file[$codeCountry];\n }\n\n return $file; // return all country is default\n\t}", "function country($code = null)\n{\n if (!$code) {\n return \\SumanIon\\CloudFlare::country() ?: 'US';\n }\n\n if (true === $code) {\n return country(\\SumanIon\\CloudFlare::country() ?: 'US');\n }\n\n try {\n return app('earth')->findOneByCode($code);\n } catch (\\Exception $ex) {\n return null;\n }\n}", "protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}", "public function countryCode();", "public function getCountryName();", "public function getCountryCode();", "function tep_get_country_iso_code_2($country_id) {\n\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "function tep_get_country_iso_code_2($country_id) {\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "function GetCountry()\n\t{\n\t\t$country = new Country();\n\t\treturn $country->Get($this->countryId);\n\t}", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "abstract public function countryISOCode();", "static function getCountryNameByCode($country_code) {\n $data = self::find()->select('country_name')->where(['country_code' => $country_code])->one();\n if ($data) {\n return $data->country_name;\n }\n return NULL;\n }", "public function getCountryCode(): string;", "public function findCountry($code)\n {\n\n $country = $this->em->getRepository('TTBundle:Airport')->findOneByAirportCode($code);\n\n return $country;\n }", "public function getCountry($country_code) {\n\t\t$SQL = 'SELECT country_name FROM country WHERE country_code=:country_code';\n\t\t$STMT = self::$_connection->prepare($SQL);\n\t\t$STMT->execute(['country_code'=>$country_code]);\n\t\treturn $STMT->fetch();\n\t}", "function getCountryRegion($country) {\n\treturn getDetailedTableInfo2(\"vl_countries\",\"lower(country)=lower('$country')\",\"region\");\n}", "public function getCountry()\n {\n return $this->getValueObject('country');\n }", "function getSpecificCountry() {\n $myModel = new My_Model();\n $countryName = \"Pakistan\";\n $whereArray = [\n \"country_name\" => $countryName\n ];\n $result = $myModel->select('countries', \"*\", $whereArray);\n if (count($result) === 1) {\n return $result = [\n \"message\" => \"countries list\",\n \"data\" => $result\n ];\n } else {\n return $resp = [\n \"message\" => \"no country available\",\n \"data\" => \"null\"\n ];\n }\n }", "function tep_get_countries_with_iso_codes($countries_id) {\n\treturn tep_get_countries($countries_id, true);\n}", "function getIdByCountryISO($iso_value)\n{\n\tif (!empty($iso_value))\n\t{\n\t\t$tbl = _DB_PREFIX_.'country';\n\t\t$field = 'iso_code';\n\t\tif (isset($iso_value->Code))\n\t\t\t$iso_value = $iso_value->Code;\n\t\tif (isset($iso_value) && !is_array($iso_value))\n\t\t{\n\t\t\t$iso_value = pSQL(trim($iso_value));\n\t\t\t$q = \"SELECT * from $tbl WHERE $field='$iso_value'\";\n\t\t\t$q = Db::getInstance()->ExecuteS($q);\n\t\t\t$iso_value = '';\n\t\t\t$iso_value = (isset($q[0]['id_country']) ? $q[0]['id_country'] : '');\n\t\t\treturn ($iso_value);\n\t\t}\n\t\treturn '';\n\t}\n}", "static function get_country($code) {\n $countries = self::get_countries();\n foreach($countries as $c) {\n if($c->code == $code || $c->code2l == $code) {\n return $c;\n }\n }\n return FALSE;\n }", "public function getCountry()\n {\n return $this->getParameter('country');\n }", "public function getCountry()\n {\n return parent::getValue('country');\n }", "function get_country_from_name( $country_name ) {\n\tglobal $wpdb;\n\n\t$field = 'name';\n\n\tif ( strlen( $country_name ) == 2 ) {\n\t\t$field = 'country';\n\t}\n\n\treturn $wpdb->get_row( $wpdb->prepare( \"\n\t\tSELECT\n\t\t\tcountry as country_short,\n\t\t\tname as country_long\n\t\tFROM countrycodes\n\t\tWHERE\n\t\t\t$field = %s\n\t\tLIMIT 1\",\n\t\t$country_name\n\t), 'ARRAY_A' );\n}", "public function getCountry() \n {\n return $this->country;\n }", "abstract public function country();", "public function country(): string\n {\n return $this->country;\n }", "public function getCurrency($codeCountry = null) {\n\t $pathFile = storage_path(\"/json/currencies.json\");\n\n\t if(!File::exists($pathFile)) {\n\t return null;\n\t }\n\n\t $countries = File::get($pathFile);\n\t $file = (array)json_decode(File::get($pathFile));\n\t if ($codeCountry){\n\t return $file[$codeCountry];\n\t }\n\n\t return $file;\n\t}", "private function getCountryByCode($code)\n {\n // Check if country exist in cache.\n if (array_key_exists($code, $this->countries)) {\n return $this->countries[$code];\n }\n // Fetch country.\n $country = $this->manager->getRepository(static::$countryEntityName)->findOneBy(['code' => $code]);\n if (!$country) {\n throw new \\Doctrine\\ORM\\EntityNotFoundException('code = ' . $code);\n }\n // Add country to cache.\n $this->countries[$code] = $country;\n\n return $country;\n }", "public function getUserCountry()\n {\n $fileName = $this->getDatabaseFile();\n\n $reader = new MaxMindReader($fileName);\n\n $ipAddress = $this->getUserIp();\n //$ipAddress = \"82.65.140.34\";\n\n $country = $reader->get($ipAddress);\n $reader->close();\n\n return $country ? $country['country']['iso_code'] : null;\n }", "public function getCountryInfo($countryId);", "public function getCountryNameDirectly()\r\n {\r\n\r\n $url_to_exch_code = \"https://freegeoip.net/json/\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country_name'])) {\r\n\r\n return $details['country_name'];\r\n\r\n } else {\r\n\r\n $url_to_exch_code = \"https://geoip.nekudo.com/api/json\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country']['name'])) {\r\n\r\n return $details['country']['name'];\r\n\r\n } else {\r\n\r\n return false;\r\n\r\n }\r\n }\r\n\r\n }", "public function getCountriesInfo();", "function tep_get_country_name($country_id) {\n\t$country_array = tep_get_countries($country_id);\n\treturn $country_array['countries_name'];\n}", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function country_details() {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'country_name' => 1,\n 'iso_country_code' => 1,\n 'telephone_code' => 1,\n 'currency_code' => 1,\n 'currency_symbol' => 1\n ],\n 'sort' => [\n 'country_name' => 1\n ]\n ];\n $res = $this->mongo_db->find(MDB_CSC, ['country_status' => 'A'], $options);\n\n return (!empty($res)) ? $res : array();\n }", "function getIdByCountryName($country)\n{\n\tif (!empty($country))\n\t{\n\t\tif (isset($country->Name))\n\t\t\t$country = $country->Name;\n\t\tif (is_string($country))\n\t\t{\n\t\t\t$iso = '';\n\t\t\t$tbl = _DB_PREFIX_.'country_lang';\n\t\t\t$country = pSQL(trim($country));\n\t\t\t$q = \"SELECT * from $tbl WHERE name='$country'\";\n\t\t\t$q = Db::getInstance()->ExecuteS($q);\n\t\t\tif (!empty($q))\n\t\t\t\t$iso = $q[0]['id_country'];\n\t\t\treturn $iso;\n\t\t}\n\t}\n\treturn '';\n}", "function getCountry()\n {\n global $warn;\n\n if ($this->country)\n return $this->country;\n else\n if (array_key_exists('cc', $this->extras))\n {\n $cc = $this->extras['cc'];\n $country = new Country(array('cc' => $cc));\n if ($country->isExisting())\n {\n $this->country = $country; // save\n return $this->country;\n }\n else\n {\n unset($this->extras['cc']);\n }\n }\n return null;\n }", "public function getSessionCountry()\n {\n return Mage::getSingleton('core/session')->getData($this->_sessionRequestCountryKey);\n }", "public function countryCode(): string\n {\n return $this->getData('CountryCodeISO3166A2');\n }", "function getCountry() {\r\r\n\t\treturn $this->country;\r\r\n\t}", "public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code);\n }\n if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) {\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n if (! $code) {\n if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) {\n return $_SERVER['HTTP_CF_IPCOUNTRY'];\n }\n $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry');\n if (! $code) {\n $address = self::get_remote_address();\n if (strlen($address) > 3) {\n $code = CloudFlareGeoIP::ip2country($address, true);\n }\n if (! $code) {\n $code = self::get_default_country_code();\n }\n if ('' === $code) {\n $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code');\n }\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n\n return $code;\n }", "public function getCountryCode(): ?string;", "public function getCountryCode(): string\n {\n return 'SK';\n }", "protected function getCountryByCode(string $code)\n {\n global $db;\n require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';\n $pays = new \\Ccountry($db);\n if ($pays->fetch(0, $code) > 0) {\n return $pays->id;\n }\n\n return false;\n }", "function get_country_short_name($id)\n{\n $CI =& get_instance();\n $CI->db->where('country_id', $id);\n $country = $CI->db->get('tblcountries')->row();\n if ($country) {\n return $country->iso2;\n }\n\n return '';\n}", "function getCountry($countryID) {\n\t//get the towns first\n\t$query=0;\n\t$query=mysqlquery(\"select distinct country from vl_countries where countryID='$countryID'\");\n\tif(mysqlnumrows($query)) {\n\t\treturn removeSpecialCharacters(mysqlresult($query,0,'country'));\n\t}\n}", "public function country()\n {\n return $this->hasOne('App\\Country','code','country_code');\n }", "public function sGetCountry($country)\n {\n if (empty($country)) {\n return false;\n }\n if (isset($this->cache['country'][$country])) {\n return $this->cache['country'][$country];\n }\n\n if (is_numeric($country)) {\n $sql = $this->db->quoteInto('c.id = ?', $country);\n } elseif (is_string($country)) {\n $sql = $this->db->quoteInto('c.countryiso = ?', $country);\n } else {\n return false;\n }\n\n $sql = \"\n SELECT c.id, c.id as countryID, countryname, countryiso,\n (SELECT name FROM s_core_countries_areas WHERE id = areaID ) AS countryarea,\n countryen, c.position, notice\n FROM s_core_countries c\n WHERE $sql\n \";\n\n return $this->cache['country'][$country] = $this->db->fetchRow($sql) ?: [];\n }", "public function getRegistrationCountry(): ?string;", "public function getCountry() : string\n {\n return $this->country;\n }", "public function getCountry(): CountryInterface;", "public static function getCountryNameFromAlpha2Code($code)\n\t{\n\t\ttry {\n\t\t\t$league = new ISO3166();\n\n\t\t\treturn $league->alpha2($code)['name'];\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\treturn $code;\n\t\t}\n\t}", "public function requestCountry();", "function country_flag($countryCode)\n {\n return CountryFlag::get($countryCode);\n }", "public static function getCountry(string $code): string\n {\n if (Str::contains($code, '_')) {\n $tab = explode('_', $code);\n\n return Str::lower($tab[1]);\n } elseif (Str::contains($code, '-')) {\n $tab = explode('-', $code);\n\n return Str::lower($tab[1]);\n }\n\n return config('contentful.default_country');\n }", "public function getCountry() :string\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->hasOne(Countries::className(), ['id' => 'country_id']);\n }", "function getTimeZoneByCountry($code) {\n return DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $code);\n }", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public static function getCountryNameFromCode($country_code) {\n $country_list = \\Drupal::service('country_manager')->getList();\n foreach ($country_list as $key => $value) {\n if ($key === $country_code) {\n return $value->__toString();\n }\n }\n }", "public function fcpoGetIdByCode($sCode) \n {\n $sQuery = \"SELECT oxid FROM oxcountry WHERE oxisoalpha2 = \" . oxDb::getDb()->quote($sCode);\n return $this->_oFcpoDb->GetOne($sQuery);\n }", "public static function getCountry(){\n $country = '';\n $ip = self::getClientIP();\n if ($ip != '') {\n $data = file_get_contents('http://freegeoip.net/json/' . $ip);\n $response = json_decode($data);\n $country = $response->country_code;\n }\n \n return $country;\n }", "function erp_get_country_name( $country ) {\n\n $load_cuntries_states = \\WeDevs\\ERP\\Countries::instance();\n $countries = $load_cuntries_states->countries;\n\n // Handle full country name\n if ( '-1' != $country ) {\n $full_country = ( isset( $countries[ $country ] ) ) ? $countries[ $country ] : $country;\n } else {\n $full_country = '—';\n }\n\n return $full_country;\n}", "public function getCountry($country_id) {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n $query = $db->query(\"SELECT * FROM \" . DB_PREFIX . \"country WHERE country_id = '\" . (int) $country_id . \"' AND status = '1'\");\n return $query->row;\n }", "public function getCountry()\n {\n return $this->hasOne(Country::className(), ['id' => 'country_id']);\n }", "public function country() {\n return $this->hasOne(Country::class);\n }", "public function country(): ?string\n {\n return $this->country;\n }", "public function findRegionFromCountry ( $country = '' ) {\n\n if(empty($country))\n return '';\n\n $return = array_keys($this->regionToCountry, strtoupper($country));\n\n if(!empty($return))\n return $return[0];\n else\n return '';\n }", "public function getNativeCountry()\n {\n return Wrapper\\World::country($this->getNativeLeagueId());\n }", "public function getcountryAttribute($country)\n {\n return array_search($country,BasicSiteRepository::getListOfCountries());\n }", "public function country_name($country)\n {\n $result = common_select_values('name', 'ad_countries', ' id = \"'.$country.'\"', 'row');\n return $result; \n }", "private function countryIso()\n {\n $cacheKey = 'country_abbrs';\n $ttl = config('priongeography.cache_ttl', 60*24);\n\n return $this->cache->remember($cacheKey, $ttl, function () {\n $countries = scandir(__DIR__.'/config/geography');\n $countries = str_replace(\".php\", \"\", $countries);\n unset($countries[0]);\n unset($countries[1]);\n\n return $countries;\n });\n }", "public function getCountry()\n {\n return $this->getParameter('billingCountry');\n }", "public function getCountry()\n {\n if (!array_key_exists('country', $this->userInfo)) {\n $this->getLocation();\n }\n\n return $this->getInfoVar('country');\n }", "public function getCountryName()\n {\n return $this->getValue('nb_icontact_prospect_country_name');\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }" ]
[ "0.7135824", "0.70702827", "0.6975982", "0.68790483", "0.68790483", "0.6849968", "0.6849968", "0.67715335", "0.6725829", "0.67166495", "0.65332305", "0.6527572", "0.6492366", "0.64686984", "0.64599586", "0.645154", "0.644688", "0.6444378", "0.64218014", "0.6404432", "0.63751304", "0.63749516", "0.63228154", "0.63181835", "0.631628", "0.628625", "0.6256618", "0.6221162", "0.6212141", "0.6208511", "0.62038136", "0.61655277", "0.6151013", "0.61487895", "0.614179", "0.6137353", "0.6125873", "0.6112611", "0.6086901", "0.6060155", "0.60585815", "0.60556877", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6055574", "0.6036753", "0.60326874", "0.6023458", "0.60189146", "0.6013199", "0.60094243", "0.5989375", "0.59761184", "0.5969352", "0.5966033", "0.59657294", "0.5957494", "0.5953314", "0.5932844", "0.59292156", "0.59202707", "0.59176874", "0.591726", "0.5916372", "0.5906931", "0.58957756", "0.5890101", "0.58899117", "0.58856106", "0.58844775", "0.58844775", "0.5864905", "0.5848056", "0.5832292", "0.583071", "0.5829889", "0.58241916", "0.5809599", "0.5796927", "0.57871073", "0.5786403", "0.5778787", "0.5768331", "0.5767412", "0.5750018", "0.5732424", "0.5728603", "0.5725438", "0.5725438" ]
0.6683293
10
Get profiles by country code (ISO).
public function getShipmentTypes($countryCode) { $countryCode = strtoupper($countryCode); return $this->getProfileByCountryCode($countryCode) ->offsetGet('enabled-profiles'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tep_get_countries_with_iso_codes($countries_id) {\n\treturn tep_get_countries($countries_id, true);\n}", "public function getCountry();", "public function getCountry();", "public static function getCountryByCode($code){\n return Country::findOne([ 'code'=> $code]);\n }", "public function getCountriesInfo();", "public function getProfileByCountryCode($countryCode, $profileName = null, $storeId = null)\n {\n $countryCode = strtoupper($countryCode);\n $match = null;\n foreach (self::$_packageCodes as $code):\n $pack = $this->getProfileByPackageCode($code, $storeId);\n // Find the right package for the given country code.\n if ($pack->offsetExists('countryCodes') &&\n $pack->offsetGet('countryCodes') instanceof ArrayObject\n ):\n if ($pack->offsetGet('countryCodes')->offsetExists($countryCode)):\n $match = $pack;\n endif;\n endif;\n endforeach;\n // Use BPI package while receiver country is not germany or europe.\n if (null === $match):\n return null;\n endif;\n // Get clean object.\n $profile = new ArrayObject();\n $profile->offsetSet('code', $match->offsetGet('code'));\n $profile->offsetSet('weight', $match->offsetGet('weight'));\n $profile->offsetSet('enabled-profiles',\n $match->offsetGet('enabled-profiles'));\n // Unset unsupported shipment types.\n foreach ($match->offsetGet('enabled-profiles') as $shipment => $value):\n $profile->offsetGet('enabled-profiles')->offsetSet(\n $shipment, $match->offsetGet($shipment));\n endforeach;\n // Set current profile id to result object.\n $partnerId = null;\n if (null !== $profileName):\n if (!in_array($profileName, self::$profiles)):\n throw new Dhl_Intraship_Model_Config_Exception(sprintf(\n 'profile \"%s\" is invalid.', $profileName));\n endif;\n // Set partner id to the correct value,\n // if is enabled and in $profileName\n if ($profile->offsetGet('enabled-profiles')->offsetExists($profileName)):\n $partnerId = $profile->offsetGet('enabled-profiles')\n ->offsetGet($profileName);\n endif;\n endif;\n $profile->offsetSet('partnerId', $partnerId);\n // Unset match.\n unset($match);\n return $profile;\n }", "function getCountry($code){\n\t\n\tglobal $dz;\n\t\n\tif(strlen($code)!=2){\n\t\t\n\t\t// Invalid input.\n\t\terror('field/invalid','country');\n\t\t\n\t}\n\t\n\t// Make sure it's uppercase:\n\t$code=strtoupper($code);\n\t\n\t// Get the row:\n\t$row=$dz->get_row('select country_id from countries where iso2=\"'.$code.'\"');\n\t\n\tif(!$row){\n\t\t\n\t\t// Country was not found.\n\t\terror('country/notfound');\n\t\t\n\t}\n\t\n\treturn $row['country_id'];\n}", "static function getCountryDetailsByCode($country_code) {\n return self::find()->where(['country_code' => $country_code])->one();\n }", "public function getCountry() {}", "public function getCountry() {}", "public function country_details() {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'country_name' => 1,\n 'iso_country_code' => 1,\n 'telephone_code' => 1,\n 'currency_code' => 1,\n 'currency_symbol' => 1\n ],\n 'sort' => [\n 'country_name' => 1\n ]\n ];\n $res = $this->mongo_db->find(MDB_CSC, ['country_status' => 'A'], $options);\n\n return (!empty($res)) ? $res : array();\n }", "function tep_get_countries($countries_id = '', $with_iso_codes = false) {\n\t$countries_array = array();\n\tif (tep_not_null($countries_id)) {\n\t\tif ($with_iso_codes == true) {\n\t\t\t$countries = tep_db_query(\"select countries_name, countries_iso_code_2, countries_iso_code_3 from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$countries_id . \"' order by countries_name\");\n\t\t\t$countries_values = tep_db_fetch_array($countries);\n\t\t\t$countries_array = array('countries_name' => $countries_values['countries_name'],\n\t\t\t\t\t\t\t\t\t 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],\n\t\t\t\t\t\t\t\t\t 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);\n\t\t} else {\n\t\t\t$countries = tep_db_query(\"select countries_name from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$countries_id . \"'\");\n\t\t\t$countries_values = tep_db_fetch_array($countries);\n\t\t\t$countries_array = array('countries_name' => $countries_values['countries_name']);\n\t\t}\n\t} else {\n\t\t$countries = tep_db_query(\"select countries_id, countries_name from \" . TABLE_COUNTRIES . \" order by countries_name\");\n\t\twhile ($countries_values = tep_db_fetch_array($countries)) {\n\t\t\t$countries_array[] = array('countries_id' => $countries_values['countries_id'],\n\t\t\t\t\t\t\t\t\t 'countries_name' => $countries_values['countries_name']);\n\t\t}\n\t}\n\treturn $countries_array;\n}", "abstract public function countryISOCode();", "public function getCountry($codeCountry = null) {\n $pathFile = storage_path(\"/json/countries.json\");\n\n if(!File::exists($pathFile)) {\n return null;\n }\n\n $countries = File::get($pathFile);\n $file = (array)json_decode(File::get($pathFile));\n if ($codeCountry != \"\" && $codeCountry != null){\n return $file[$codeCountry];\n }\n\n return $file; // return all country is default\n\t}", "public function get_country_list() \n\t{\n\t\treturn $this->db->select('num_code')\n\t\t->select('country_name')\n\t\t->select('num_code')\n\t\t->from('system_iso3166_l10n')\n\t\t->order_by('country_name', 'ASC')\t\n\t\t->get()->result();\n\t}", "public function countryCode();", "public function getCountries();", "private function countryIso()\n {\n $cacheKey = 'country_abbrs';\n $ttl = config('priongeography.cache_ttl', 60*24);\n\n return $this->cache->remember($cacheKey, $ttl, function () {\n $countries = scandir(__DIR__.'/config/geography');\n $countries = str_replace(\".php\", \"\", $countries);\n unset($countries[0]);\n unset($countries[1]);\n\n return $countries;\n });\n }", "public function country()\r\n\t{\r\n\t\t$country = \\Shop\\Models\\Countries::fromCode( $this->country_isocode_2 );\r\n\r\n\t\treturn $country;\r\n\t}", "public function getCountryName();", "function country($code = null)\n{\n if (!$code) {\n return \\SumanIon\\CloudFlare::country() ?: 'US';\n }\n\n if (true === $code) {\n return country(\\SumanIon\\CloudFlare::country() ?: 'US');\n }\n\n try {\n return app('earth')->findOneByCode($code);\n } catch (\\Exception $ex) {\n return null;\n }\n}", "function _get_countries($iso=false, $code=null, $limit=null) \n {\n\n $cc = array(\n 'US' => \t'United States',\n 'CA' => \t'Canada',\n 'AF' => \t'Afghanistan',\n 'AX' => \t'Åland Islands',\n 'AL' => \t'Albania',\n 'DZ' => \t'Algeria',\n 'AS' => \t'American Samoa',\n 'AD' => \t'Andorra',\n 'AO' => \t'Angola',\n 'AI' => \t'Anguilla',\n 'AG' => \t'Antigua and Barbuda',\n 'AR' => \t'Argentina',\n 'AM' => \t'Armenia',\n 'AW' => \t'Aruba',\n 'AU' => \t'Australia',\n 'AT' => \t'Austria',\n 'AZ' => \t'Azerbaijan',\n 'BS' => \t'Bahamas',\n 'BH' => \t'Bahrain',\n 'BD' => \t'Bangladesh',\n 'BB' => \t'Barbados',\n 'BY' => \t'Belarus',\n 'BE' => \t'Belgium',\n 'BZ' => \t'Belize',\n 'BJ' => \t'Benin',\n 'BM' => \t'Bermuda',\n 'BT' => \t'Bhutan',\n 'BO' => \t'Bolivia',\n 'BA' => \t'Bosnia and Herzegovina',\n 'BW' => \t'Botswana',\n 'BR' => \t'Brazil',\n 'IO' => \t'British Indian Ocean Territory',\n 'BN' => \t'Brunei Darussalam',\n 'BG' => \t'Bulgaria',\n 'BF' => \t'Burkina Faso',\n 'BI' => \t'Burundi',\n 'KH' => \t'Cambodia',\n 'CM' => \t'Cameroon',\n 'CA' => \t'Canada',\n 'CV' => \t'Cape Verde',\n 'KY' => \t'Cayman Islands',\n 'CF' => \t'Central African Republic',\n 'TD' => \t'Chad',\n 'CL' => \t'Chile',\n 'CN' => \t'China, People\\'s Republic of',\n 'CX' => \t'Christmas Island',\n 'CC' => \t'Cocos (Keeling) Islands',\n 'CO' => \t'Colombia',\n 'KM' => \t'Comoros',\n 'CD' => \t'Congo',\n 'CK' => \t'Cook Islands',\n 'CR' => \t'Costa Rica',\n 'CI' => \t'Côte d\\'Ivoire',\n 'HR' => \t'Croatia',\n 'CU' => \t'Cuba',\n 'CY' => \t'Cyprus',\n 'CZ' => \t'Czech Republic',\n 'DK' => \t'Denmark',\n 'DJ' => \t'Djibouti',\n 'DM' => \t'Dominica',\n 'DO' => \t'Dominican Republic',\n 'EC' => \t'Ecuador',\n 'EG' => \t'Egypt',\n 'SV' => \t'El Salvador',\n 'GQ' => \t'Equatorial Guinea',\n 'ER' => \t'Eritrea',\n 'EE' => \t'Estonia',\n 'ET' => \t'Ethiopia',\n 'FK' => \t'Falkland Islands',\n 'FO' => \t'Faroe Islands',\n 'FJ' => \t'Fiji',\n 'FI' => \t'Finland',\n 'FR' => \t'France',\n 'GF' => \t'French Guiana',\n 'PF' => \t'French Polynesia',\n 'TF' => \t'French Southern Territories',\n 'GA' => \t'Gabon',\n 'GM' => \t'Gambia',\n 'GE' => \t'Georgia',\n 'DE' => \t'Germany',\n 'GH' => \t'Ghana',\n 'GI' => \t'Gibraltar',\n 'GR' => \t'Greece',\n 'GL' => \t'Greenland',\n 'GD' => \t'Grenada',\n 'GP' => \t'Guadeloupe',\n 'GU' => \t'Guam',\n 'GT' => \t'Guatemala',\n 'GN' => \t'Guinea',\n 'GW' => \t'Guinea-Bissau',\n 'GY' => \t'Guyana',\n 'HT' => \t'Haiti',\n 'HN' => \t'Honduras',\n 'HK' => \t'Hong Kong',\n 'HU' => \t'Hungary',\n 'IS' => \t'Iceland',\n 'IN' => \t'India',\n 'ID' => \t'Indonesia',\n 'IR' => \t'Iran',\n 'IQ' => \t'Iraq',\n 'IE' => \t'Ireland',\n 'IL' => \t'Israel',\n 'IT' => \t'Italy',\n 'JM' => \t'Jamaica',\n 'JP' => \t'Japan',\n 'JO' => \t'Jordan',\n 'KZ' => \t'Kazakhstan',\n 'KE' => \t'Kenya',\n 'KI' => \t'Kiribati',\n 'KP' => \t'Korea, DPR',\n 'KR' => \t'Korea, Republic of',\n 'KW' => \t'Kuwait',\n 'KG' => \t'Kyrgyzstan',\n 'LA' => \t'Lao People\\'s Democratic Republic',\n 'LV' => \t'Latvia',\n 'LB' => \t'Lebanon',\n 'LS' => \t'Lesotho',\n 'LR' => \t'Liberia',\n 'LY' => \t'Libyan Arab Jamahiriya',\n 'LI' => \t'Liechtenstein',\n 'LT' => \t'Lithuania',\n 'LU' => \t'Luxembourg',\n 'MO' => \t'Macao',\n 'MK' => \t'Macedonia',\n 'MG' => \t'Madagascar',\n 'MW' => \t'Malawi',\n 'MY' => \t'Malaysia',\n 'MV' => \t'Maldives',\n 'ML' => \t'Mali',\n 'MT' => \t'Malta',\n 'MH' => \t'Marshall Islands',\n 'MQ' => \t'Martinique',\n 'MR' => \t'Mauritania',\n 'MU' => \t'Mauritius',\n 'YT' => \t'Mayotte',\n 'MX' => \t'Mexico',\n 'FM' => \t'Micronesia',\n 'MD' => \t'Moldova',\n 'MC' => \t'Monaco',\n 'MN' => \t'Mongolia',\n 'MS' => \t'Montserrat',\n 'MA' => \t'Morocco',\n 'MZ' => \t'Mozambique',\n 'MM' => \t'Myanmar',\n 'NA' => \t'Namibia',\n 'NR' => \t'Nauru',\n 'NP' => \t'Nepal',\n 'NL' => \t'Netherlands',\n 'AN' => \t'Netherlands Antilles',\n 'NC' => \t'New Caledonia',\n 'NZ' => \t'New Zealand',\n 'NI' => \t'Nicaragua',\n 'NE' => \t'Niger',\n 'NG' => \t'Nigeria',\n 'NU' => \t'Niue',\n 'NF' => \t'Norfolk Island',\n 'MP' => \t'Northern Mariana Islands',\n 'NO' => \t'Norway',\n 'OM' => \t'Oman',\n 'PK' => \t'Pakistan',\n 'PW' => \t'Palau',\n 'PS' => \t'Palestinian Territory, Occupied',\n 'PA' => \t'Panama',\n 'PG' => \t'Papua New Guinea',\n 'PY' => \t'Paraguay',\n 'PE' => \t'Peru',\n 'PH' => \t'Philippines',\n 'PN' => \t'Pitcairn',\n 'PL' => \t'Poland',\n 'PT' => \t'Portugal',\n 'PR' => \t'Puerto Rico',\n 'QA' => \t'Qatar',\n 'RE' => \t'Réunion',\n 'RO' => \t'Romania',\n 'RU' => \t'Russian Federation',\n 'RW' => \t'Rwanda',\n 'SH' => \t'Saint Helena',\n 'KN' => \t'Saint Kitts and Nevis',\n 'LC' => \t'Saint Lucia',\n 'PM' => \t'Saint-Pierre and Miquelon',\n 'VC' => \t'Saint Vincent and the Grenadines',\n 'WS' => \t'Samoa',\n 'SM' => \t'San Marino',\n 'ST' => \t'São Tomé and Príncipe',\n 'SA' => \t'Saudi Arabia',\n 'SN' => \t'Senegal',\n 'CS' => \t'Serbia and Montenegro',\n 'SC' => \t'Seychelles',\n 'SL' => \t'Sierra Leone',\n 'SG' => \t'Singapore',\n 'SK' => \t'Slovakia',\n 'SI' => \t'Slovenia',\n 'SB' => \t'Solomon Islands',\n 'SO' => \t'Somalia',\n 'ZA' => \t'South Africa',\n 'ES' => \t'Spain',\n 'LK' => \t'Sri Lanka',\n 'SD' => \t'Sudan',\n 'SR' => \t'Suriname',\n 'SJ' => \t'Svalbard and Jan Mayen',\n 'SZ' => \t'Swaziland',\n 'SE' => \t'Sweden',\n 'CH' => \t'Switzerland',\n 'SY' => \t'Syrian Arab Republic',\n 'TW' => \t'Taiwan',\n 'TJ' => \t'Tajikistan',\n 'TZ' => \t'Tanzania',\n 'TH' => \t'Thailand',\n 'TL' => \t'Timor-Leste',\n 'TG' => \t'Togo',\n 'TK' => \t'Tokelau',\n 'TO' => \t'Tonga',\n 'TT' => \t'Trinidad and Tobago',\n 'TN' => \t'Tunisia',\n 'TR' => \t'Turkey',\n 'TM' => \t'Turkmenistan',\n 'TC' => \t'Turks and Caicos Islands',\n 'TV' => \t'Tuvalu',\n 'UG' => \t'Uganda',\n 'UA' => \t'Ukraine',\n 'AE' => \t'United Arab Emirates',\n 'GB' => \t'United Kingdom',\n 'US' => \t'United States',\n 'UY' => \t'Uruguay',\n 'UZ' => \t'Uzbekistan',\n 'VU' => \t'Vanuatu',\n 'VA' => \t'Vatican City State',\n 'VE' => \t'Venezuela',\n 'VN' => \t'Viet Nam',\n 'VG' => \t'Virgin Islands, British',\n 'VI' => \t'Virgin Islands, U.S.',\n 'WF' => \t'Wallis and Futuna',\n 'EH' => \t'Western Sahara',\n 'YE' => \t'Yemen',\n 'ZM' => \t'Zambia',\n 'ZW' => \t'Zimbabwe',);\n\n if ($limit && is_array($limit)) {\n foreach (array_keys($cc) as $iso) {\n if (!in_array($iso, $limit)) {\n unset($cc[$iso]);\n }\n }\n }\n\n if (!$iso) {\n return array_values($cc);\n }\n elseif ($code) {\n return (isset($cc[$code]))? $cc[$code] : null;\n }\n else {\n return $cc;\n }\n }", "function getSpecificCountry() {\n $myModel = new My_Model();\n $countryName = \"Pakistan\";\n $whereArray = [\n \"country_name\" => $countryName\n ];\n $result = $myModel->select('countries', \"*\", $whereArray);\n if (count($result) === 1) {\n return $result = [\n \"message\" => \"countries list\",\n \"data\" => $result\n ];\n } else {\n return $resp = [\n \"message\" => \"no country available\",\n \"data\" => \"null\"\n ];\n }\n }", "function tep_get_country_iso_code_2($country_id) {\n\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "function tep_get_country_iso_code_2($country_id) {\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "abstract public function country();", "function sbs_get_countries($countries_id = '', $with_iso_codes = false) {\n $countries_array = array();\n\n if ($countries_id) {\n\n if ($with_iso_codes) {\n $countries = tep_db_query(\"select countries_name, countries_iso_code_2, countries_iso_code_3 from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $countries_id . \"' order by countries_name\");\n $countries_values = tep_db_fetch_array($countries);\n $countries_array = array('countries_name' => $countries_values['countries_name'],\n 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],\n 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);\n } else {\n $countries = tep_db_query(\"select countries_name from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $countries_id . \"'\");\n $countries_values = tep_db_fetch_array($countries);\n $countries_array = array('countries_name' => $countries_values['countries_name']);\n }\n\n } else {\n\n $countries = tep_db_query(\"select countries_id, countries_name from \" . TABLE_COUNTRIES . \" order by countries_name\");\n\n while ($countries_values = tep_db_fetch_array($countries)) {\n\n $countries_array[] = array('countries_id' => $countries_values['countries_id'],\n 'countries_name' => $countries_values['countries_name']);\n }\n }\n\n return $countries_array;\n }", "public function getCountryList()\n {\n return $this->call('country.list');\n }", "function getTimeZoneByCountry($code) {\n return DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $code);\n }", "public static function getCountries()\n\t{\n\t\t$country[\"AFG\"] = Array(\"iso2\" => \"AF\", \"name\" => \"Afghanistan, Islamic Republic \");\n\t\t$country[\"ALA\"] = Array(\"iso2\" => \"AX\", \"name\" => \"Åland Islands\");\n\t\t$country[\"ALB\"] = Array(\"iso2\" => \"AL\", \"name\" => \"Albania, Republic of\");\n\t\t$country[\"DZA\"] = Array(\"iso2\" => \"DZ\", \"name\" => \"Algeria, People's Democratic Republic\");\n\t\t$country[\"ASM\"] = Array(\"iso2\" => \"AS\", \"name\" => \"American Samoa\");\n\t\t$country[\"AND\"] = Array(\"iso2\" => \"AD\", \"name\" => \"Andorra, Principality of\");\n\t\t$country[\"AGO\"] = Array(\"iso2\" => \"AO\", \"name\" => \"Angola, Republic of\");\n\t\t$country[\"AIA\"] = Array(\"iso2\" => \"AI\", \"name\" => \"Anguilla\");\n\t\t$country[\"ATA\"] = Array(\"iso2\" => \"AQ\", \"name\" => \"Antarctica (the territory Sout\");\n\t\t$country[\"ATG\"] = Array(\"iso2\" => \"AG\", \"name\" => \"Antigua and Barbuda\");\n\t\t$country[\"ARG\"] = Array(\"iso2\" => \"AR\", \"name\" => \"Argentina, Argentine Republic\");\n\t\t$country[\"ARM\"] = Array(\"iso2\" => \"AM\", \"name\" => \"Armenia, Republic of\");\n\t\t$country[\"ABW\"] = Array(\"iso2\" => \"AW\", \"name\" => \"Aruba\");\n\t\t$country[\"AUS\"] = Array(\"iso2\" => \"AU\", \"name\" => \"Australia, Commonwealth of\");\n\t\t$country[\"AUT\"] = Array(\"iso2\" => \"AT\", \"name\" => \"Austria, Republic of\");\n\t\t$country[\"AZE\"] = Array(\"iso2\" => \"AZ\", \"name\" => \"Azerbaijan, Republic of\");\n\t\t$country[\"BHS\"] = Array(\"iso2\" => \"BS\", \"name\" => \"Bahamas, Commonwealth of the\");\n\t\t$country[\"BHR\"] = Array(\"iso2\" => \"BH\", \"name\" => \"Bahrain, Kingdom of\");\n\t\t$country[\"BGD\"] = Array(\"iso2\" => \"BD\", \"name\" => \"Bangladesh, People's Republic \");\n\t\t$country[\"BRB\"] = Array(\"iso2\" => \"BB\", \"name\" => \"Barbados\");\n\t\t$country[\"BLR\"] = Array(\"iso2\" => \"BY\", \"name\" => \"Belarus, Republic of\");\n\t\t$country[\"BEL\"] = Array(\"iso2\" => \"BE\", \"name\" => \"Belgium, Kingdom of\");\n\t\t$country[\"BLZ\"] = Array(\"iso2\" => \"BZ\", \"name\" => \"Belize\");\n\t\t$country[\"BEN\"] = Array(\"iso2\" => \"BJ\", \"name\" => \"Benin, Republic of\");\n\t\t$country[\"BMU\"] = Array(\"iso2\" => \"BM\", \"name\" => \"Bermuda\");\n\t\t$country[\"BTN\"] = Array(\"iso2\" => \"BT\", \"name\" => \"Bhutan, Kingdom of\");\n\t\t$country[\"BOL\"] = Array(\"iso2\" => \"BO\", \"name\" => \"Bolivia, Republic of\");\n\t\t$country[\"BIH\"] = Array(\"iso2\" => \"BA\", \"name\" => \"Bosnia and Herzegovina\");\n\t\t$country[\"BWA\"] = Array(\"iso2\" => \"BW\", \"name\" => \"Botswana, Republic of\");\n\t\t$country[\"BVT\"] = Array(\"iso2\" => \"BV\", \"name\" => \"Bouvet Island (Bouvetoya)\");\n\t\t$country[\"BRA\"] = Array(\"iso2\" => \"BR\", \"name\" => \"Brazil, Federative Republic of\");\n\t\t$country[\"IOT\"] = Array(\"iso2\" => \"IO\", \"name\" => \"British Indian Ocean Territory\");\n\t\t$country[\"VGB\"] = Array(\"iso2\" => \"VG\", \"name\" => \"British Virgin Islands\");\n\t\t$country[\"BRN\"] = Array(\"iso2\" => \"BN\", \"name\" => \"Brunei Darussalam\");\n\t\t$country[\"BGR\"] = Array(\"iso2\" => \"BG\", \"name\" => \"Bulgaria, Republic of\");\n\t\t$country[\"BFA\"] = Array(\"iso2\" => \"BF\", \"name\" => \"Burkina Faso\");\n\t\t$country[\"BDI\"] = Array(\"iso2\" => \"BI\", \"name\" => \"Burundi, Republic of\");\n\t\t$country[\"KHM\"] = Array(\"iso2\" => \"KH\", \"name\" => \"Cambodia, Kingdom of\");\n\t\t$country[\"CMR\"] = Array(\"iso2\" => \"CM\", \"name\" => \"Cameroon, Republic of\");\n\t\t$country[\"CAN\"] = Array(\"iso2\" => \"CA\", \"name\" => \"Canada\");\n\t\t$country[\"CPV\"] = Array(\"iso2\" => \"CV\", \"name\" => \"Cape Verde, Republic of\");\n\t\t$country[\"CYM\"] = Array(\"iso2\" => \"KY\", \"name\" => \"Cayman Islands\");\n\t\t$country[\"CAF\"] = Array(\"iso2\" => \"CF\", \"name\" => \"Central African Republic\");\n\t\t$country[\"TCD\"] = Array(\"iso2\" => \"TD\", \"name\" => \"Chad, Republic of\");\n\t\t$country[\"CHL\"] = Array(\"iso2\" => \"CL\", \"name\" => \"Chile, Republic of\");\n\t\t$country[\"CHN\"] = Array(\"iso2\" => \"CN\", \"name\" => \"China, People's Republic of\");\n\t\t$country[\"CXR\"] = Array(\"iso2\" => \"CX\", \"name\" => \"Christmas Island\");\n\t\t$country[\"CCK\"] = Array(\"iso2\" => \"CC\", \"name\" => \"Cocos (Keeling) Islands\");\n\t\t$country[\"COL\"] = Array(\"iso2\" => \"CO\", \"name\" => \"Colombia, Republic of\");\n\t\t$country[\"COM\"] = Array(\"iso2\" => \"KM\", \"name\" => \"Comoros, Union of the\");\n\t\t$country[\"COD\"] = Array(\"iso2\" => \"CD\", \"name\" => \"Congo, Democratic Republic of \");\n\t\t$country[\"COG\"] = Array(\"iso2\" => \"CG\", \"name\" => \"Congo, Republic of the\");\n\t\t$country[\"COK\"] = Array(\"iso2\" => \"CK\", \"name\" => \"Cook Islands\");\n\t\t$country[\"CRI\"] = Array(\"iso2\" => \"CR\", \"name\" => \"Costa Rica, Republic of\");\n\t\t$country[\"CIV\"] = Array(\"iso2\" => \"CI\", \"name\" => \"Cote d'Ivoire, Republic of\");\n\t\t$country[\"HRV\"] = Array(\"iso2\" => \"HR\", \"name\" => \"Croatia, Republic of\");\n\t\t$country[\"CUB\"] = Array(\"iso2\" => \"CU\", \"name\" => \"Cuba, Republic of\");\n\t\t$country[\"CYP\"] = Array(\"iso2\" => \"CY\", \"name\" => \"Cyprus, Republic of\");\n\t\t$country[\"CZE\"] = Array(\"iso2\" => \"CZ\", \"name\" => \"Czech Republic\");\n\t\t$country[\"DNK\"] = Array(\"iso2\" => \"DK\", \"name\" => \"Denmark, Kingdom of\");\n\t\t$country[\"DJI\"] = Array(\"iso2\" => \"DJ\", \"name\" => \"Djibouti, Republic of\");\n\t\t$country[\"DMA\"] = Array(\"iso2\" => \"DM\", \"name\" => \"Dominica, Commonwealth of\");\n\t\t$country[\"DOM\"] = Array(\"iso2\" => \"DO\", \"name\" => \"Dominican Republic\");\n\t\t$country[\"ECU\"] = Array(\"iso2\" => \"EC\", \"name\" => \"Ecuador, Republic of\");\n\t\t$country[\"EGY\"] = Array(\"iso2\" => \"EG\", \"name\" => \"Egypt, Arab Republic of\");\n\t\t$country[\"SLV\"] = Array(\"iso2\" => \"SV\", \"name\" => \"El Salvador, Republic of\");\n\t\t$country[\"GNQ\"] = Array(\"iso2\" => \"GQ\", \"name\" => \"Equatorial Guinea, Republic of\");\n\t\t$country[\"ERI\"] = Array(\"iso2\" => \"ER\", \"name\" => \"Eritrea, State of\");\n\t\t$country[\"EST\"] = Array(\"iso2\" => \"EE\", \"name\" => \"Estonia, Republic of\");\n\t\t$country[\"ETH\"] = Array(\"iso2\" => \"ET\", \"name\" => \"Ethiopia, Federal Democratic R\");\n\t\t$country[\"FRO\"] = Array(\"iso2\" => \"FO\", \"name\" => \"Faroe Islands\");\n\t\t$country[\"FLK\"] = Array(\"iso2\" => \"FK\", \"name\" => \"Falkland Islands (Malvinas)\");\n\t\t$country[\"FJI\"] = Array(\"iso2\" => \"FJ\", \"name\" => \"Fiji, Republic of the Fiji Isl\");\n\t\t$country[\"FIN\"] = Array(\"iso2\" => \"FI\", \"name\" => \"Finland, Republic of\");\n\t\t$country[\"FRA\"] = Array(\"iso2\" => \"FR\", \"name\" => \"France, French Republic\");\n\t\t$country[\"GUF\"] = Array(\"iso2\" => \"GF\", \"name\" => \"French Guiana\");\n\t\t$country[\"PYF\"] = Array(\"iso2\" => \"PF\", \"name\" => \"French Polynesia\");\n\t\t$country[\"ATF\"] = Array(\"iso2\" => \"TF\", \"name\" => \"French Southern Territories\");\n\t\t$country[\"GAB\"] = Array(\"iso2\" => \"GA\", \"name\" => \"Gabon, Gabonese Republic\");\n\t\t$country[\"GMB\"] = Array(\"iso2\" => \"GM\", \"name\" => \"Gambia, Republic of the\");\n\t\t$country[\"GEO\"] = Array(\"iso2\" => \"GE\", \"name\" => \"Georgia\");\n\t\t$country[\"DEU\"] = Array(\"iso2\" => \"DE\", \"name\" => \"Germany, Federal Republic of\");\n\t\t$country[\"GHA\"] = Array(\"iso2\" => \"GH\", \"name\" => \"Ghana, Republic of\");\n\t\t$country[\"GIB\"] = Array(\"iso2\" => \"GI\", \"name\" => \"Gibraltar\");\n\t\t$country[\"GRC\"] = Array(\"iso2\" => \"GR\", \"name\" => \"Greece, Hellenic Republic\");\n\t\t$country[\"GRL\"] = Array(\"iso2\" => \"GL\", \"name\" => \"Greenland\");\n\t\t$country[\"GRD\"] = Array(\"iso2\" => \"GD\", \"name\" => \"Grenada\");\n\t\t$country[\"GLP\"] = Array(\"iso2\" => \"GP\", \"name\" => \"Guadeloupe\");\n\t\t$country[\"GUM\"] = Array(\"iso2\" => \"GU\", \"name\" => \"Guam\");\n\t\t$country[\"GTM\"] = Array(\"iso2\" => \"GT\", \"name\" => \"Guatemala, Republic of\");\n\t\t$country[\"GGY\"] = Array(\"iso2\" => \"GG\", \"name\" => \"Guernsey, Bailiwick of\");\n\t\t$country[\"GIN\"] = Array(\"iso2\" => \"GN\", \"name\" => \"Guinea, Republic of\");\n\t\t$country[\"GNB\"] = Array(\"iso2\" => \"GW\", \"name\" => \"Guinea-Bissau, Republic of\");\n\t\t$country[\"GUY\"] = Array(\"iso2\" => \"GY\", \"name\" => \"Guyana, Co-operative Republic \");\n\t\t$country[\"HTI\"] = Array(\"iso2\" => \"HT\", \"name\" => \"Haiti, Republic of\");\n\t\t$country[\"HMD\"] = Array(\"iso2\" => \"HM\", \"name\" => \"Heard Island and McDonald Isla\");\n\t\t$country[\"VAT\"] = Array(\"iso2\" => \"VA\", \"name\" => \"Holy See (Vatican City State)\");\n\t\t$country[\"HND\"] = Array(\"iso2\" => \"HN\", \"name\" => \"Honduras, Republic of\");\n\t\t$country[\"HKG\"] = Array(\"iso2\" => \"HK\", \"name\" => \"Hong Kong, Special Administrat\");\n\t\t$country[\"HUN\"] = Array(\"iso2\" => \"HU\", \"name\" => \"Hungary, Republic of\");\n\t\t$country[\"ISL\"] = Array(\"iso2\" => \"IS\", \"name\" => \"Iceland, Republic of\");\n\t\t$country[\"IND\"] = Array(\"iso2\" => \"IN\", \"name\" => \"India, Republic of\");\n\t\t$country[\"IDN\"] = Array(\"iso2\" => \"ID\", \"name\" => \"Indonesia, Republic of\");\n\t\t$country[\"IRN\"] = Array(\"iso2\" => \"IR\", \"name\" => \"Iran, Islamic Republic of\");\n\t\t$country[\"IRQ\"] = Array(\"iso2\" => \"IQ\", \"name\" => \"Iraq, Republic of\");\n\t\t$country[\"IRL\"] = Array(\"iso2\" => \"IE\", \"name\" => \"Ireland\");\n\t\t$country[\"IMN\"] = Array(\"iso2\" => \"IM\", \"name\" => \"Isle of Man\");\n\t\t$country[\"ISR\"] = Array(\"iso2\" => \"IL\", \"name\" => \"Israel, State of\");\n\t\t$country[\"ITA\"] = Array(\"iso2\" => \"IT\", \"name\" => \"Italy, Italian Republic\");\n\t\t$country[\"JAM\"] = Array(\"iso2\" => \"JM\", \"name\" => \"Jamaica\");\n\t\t$country[\"JPN\"] = Array(\"iso2\" => \"JP\", \"name\" => \"Japan\");\n\t\t$country[\"JEY\"] = Array(\"iso2\" => \"JE\", \"name\" => \"Jersey, Bailiwick of\");\n\t\t$country[\"JOR\"] = Array(\"iso2\" => \"JO\", \"name\" => \"Jordan, Hashemite Kingdom of\");\n\t\t$country[\"KAZ\"] = Array(\"iso2\" => \"KZ\", \"name\" => \"Kazakhstan, Republic of\");\n\t\t$country[\"KEN\"] = Array(\"iso2\" => \"KE\", \"name\" => \"Kenya, Republic of\");\n\t\t$country[\"KIR\"] = Array(\"iso2\" => \"KI\", \"name\" => \"Kiribati, Republic of\");\n\t\t$country[\"PRK\"] = Array(\"iso2\" => \"KP\", \"name\" => \"Korea, Democratic People's Rep\");\n\t\t$country[\"KOR\"] = Array(\"iso2\" => \"KR\", \"name\" => \"Korea, Republic of\");\n\t\t$country[\"KWT\"] = Array(\"iso2\" => \"KW\", \"name\" => \"Kuwait, State of\");\n\t\t$country[\"KGZ\"] = Array(\"iso2\" => \"KG\", \"name\" => \"Kyrgyz Republic\");\n\t\t$country[\"LAO\"] = Array(\"iso2\" => \"LA\", \"name\" => \"Lao People's Democratic Republ\");\n\t\t$country[\"LVA\"] = Array(\"iso2\" => \"LV\", \"name\" => \"Latvia, Republic of\");\n\t\t$country[\"LBN\"] = Array(\"iso2\" => \"LB\", \"name\" => \"Lebanon, Lebanese Republic\");\n\t\t$country[\"LSO\"] = Array(\"iso2\" => \"LS\", \"name\" => \"Lesotho, Kingdom of\");\n\t\t$country[\"LBR\"] = Array(\"iso2\" => \"LR\", \"name\" => \"Liberia, Republic of\");\n\t\t$country[\"LBY\"] = Array(\"iso2\" => \"LY\", \"name\" => \"Libyan Arab Jamahiriya\");\n\t\t$country[\"LIE\"] = Array(\"iso2\" => \"LI\", \"name\" => \"Liechtenstein, Principality of\");\n\t\t$country[\"LTU\"] = Array(\"iso2\" => \"LT\", \"name\" => \"Lithuania, Republic of\");\n\t\t$country[\"LUX\"] = Array(\"iso2\" => \"LU\", \"name\" => \"Luxembourg, Grand Duchy of\");\n\t\t$country[\"MAC\"] = Array(\"iso2\" => \"MO\", \"name\" => \"Macao, Special Administrative \");\n\t\t$country[\"MKD\"] = Array(\"iso2\" => \"MK\", \"name\" => \"Macedonia, the former Yugoslav\");\n\t\t$country[\"MDG\"] = Array(\"iso2\" => \"MG\", \"name\" => \"Madagascar, Republic of\");\n\t\t$country[\"MWI\"] = Array(\"iso2\" => \"MW\", \"name\" => \"Malawi, Republic of\");\n\t\t$country[\"MYS\"] = Array(\"iso2\" => \"MY\", \"name\" => \"Malaysia\");\n\t\t$country[\"MDV\"] = Array(\"iso2\" => \"MV\", \"name\" => \"Maldives, Republic of\");\n\t\t$country[\"MLI\"] = Array(\"iso2\" => \"ML\", \"name\" => \"Mali, Republic of\");\n\t\t$country[\"MLT\"] = Array(\"iso2\" => \"MT\", \"name\" => \"Malta, Republic of\");\n\t\t$country[\"MHL\"] = Array(\"iso2\" => \"MH\", \"name\" => \"Marshall Islands, Republic of \");\n\t\t$country[\"MTQ\"] = Array(\"iso2\" => \"MQ\", \"name\" => \"Martinique\");\n\t\t$country[\"MRT\"] = Array(\"iso2\" => \"MR\", \"name\" => \"Mauritania, Islamic Republic o\");\n\t\t$country[\"MUS\"] = Array(\"iso2\" => \"MU\", \"name\" => \"Mauritius, Republic of\");\n\t\t$country[\"MYT\"] = Array(\"iso2\" => \"YT\", \"name\" => \"Mayotte\");\n\t\t$country[\"MEX\"] = Array(\"iso2\" => \"MX\", \"name\" => \"Mexico, United Mexican States\");\n\t\t$country[\"FSM\"] = Array(\"iso2\" => \"FM\", \"name\" => \"Micronesia, Federated States o\");\n\t\t$country[\"MDA\"] = Array(\"iso2\" => \"MD\", \"name\" => \"Moldova, Republic of\");\n\t\t$country[\"MCO\"] = Array(\"iso2\" => \"MC\", \"name\" => \"Monaco, Principality of\");\n\t\t$country[\"MNG\"] = Array(\"iso2\" => \"MN\", \"name\" => \"Mongolia\");\n\t\t$country[\"MNE\"] = Array(\"iso2\" => \"ME\", \"name\" => \"Montenegro, Republic of\");\n\t\t$country[\"MSR\"] = Array(\"iso2\" => \"MS\", \"name\" => \"Montserrat\");\n\t\t$country[\"MAR\"] = Array(\"iso2\" => \"MA\", \"name\" => \"Morocco, Kingdom of\");\n\t\t$country[\"MOZ\"] = Array(\"iso2\" => \"MZ\", \"name\" => \"Mozambique, Republic of\");\n\t\t$country[\"MMR\"] = Array(\"iso2\" => \"MM\", \"name\" => \"Myanmar, Union of\");\n\t\t$country[\"NAM\"] = Array(\"iso2\" => \"NA\", \"name\" => \"Namibia, Republic of\");\n\t\t$country[\"NRU\"] = Array(\"iso2\" => \"NR\", \"name\" => \"Nauru, Republic of\");\n\t\t$country[\"NPL\"] = Array(\"iso2\" => \"NP\", \"name\" => \"Nepal, State of\");\n\t\t$country[\"ANT\"] = Array(\"iso2\" => \"AN\", \"name\" => \"Netherlands Antilles\");\n\t\t$country[\"NLD\"] = Array(\"iso2\" => \"NL\", \"name\" => \"Netherlands, Kingdom of the\");\n\t\t$country[\"NCL\"] = Array(\"iso2\" => \"NC\", \"name\" => \"New Caledonia\");\n\t\t$country[\"NZL\"] = Array(\"iso2\" => \"NZ\", \"name\" => \"New Zealand\");\n\t\t$country[\"NIC\"] = Array(\"iso2\" => \"NI\", \"name\" => \"Nicaragua, Republic of\");\n\t\t$country[\"NER\"] = Array(\"iso2\" => \"NE\", \"name\" => \"Niger, Republic of\");\n\t\t$country[\"NGA\"] = Array(\"iso2\" => \"NG\", \"name\" => \"Nigeria, Federal Republic of\");\n\t\t$country[\"NIU\"] = Array(\"iso2\" => \"NU\", \"name\" => \"Niue\");\n\t\t$country[\"NFK\"] = Array(\"iso2\" => \"NF\", \"name\" => \"Norfolk Island\");\n\t\t$country[\"MNP\"] = Array(\"iso2\" => \"MP\", \"name\" => \"Northern Mariana Islands, Comm\");\n\t\t$country[\"NOR\"] = Array(\"iso2\" => \"NO\", \"name\" => \"Norway, Kingdom of\");\n\t\t$country[\"OMN\"] = Array(\"iso2\" => \"OM\", \"name\" => \"Oman, Sultanate of\");\n\t\t$country[\"PAK\"] = Array(\"iso2\" => \"PK\", \"name\" => \"Pakistan, Islamic Republic of\");\n\t\t$country[\"PLW\"] = Array(\"iso2\" => \"PW\", \"name\" => \"Palau, Republic of\");\n\t\t$country[\"PSE\"] = Array(\"iso2\" => \"PS\", \"name\" => \"Palestinian Territory, Occupie\");\n\t\t$country[\"PAN\"] = Array(\"iso2\" => \"PA\", \"name\" => \"Panama, Republic of\");\n\t\t$country[\"PNG\"] = Array(\"iso2\" => \"PG\", \"name\" => \"Papua New Guinea, Independent \");\n\t\t$country[\"PRY\"] = Array(\"iso2\" => \"PY\", \"name\" => \"Paraguay, Republic of\");\n\t\t$country[\"PER\"] = Array(\"iso2\" => \"PE\", \"name\" => \"Peru, Republic of\");\n\t\t$country[\"PHL\"] = Array(\"iso2\" => \"PH\", \"name\" => \"Philippines, Republic of the\");\n\t\t$country[\"PCN\"] = Array(\"iso2\" => \"PN\", \"name\" => \"Pitcairn Islands\");\n\t\t$country[\"POL\"] = Array(\"iso2\" => \"PL\", \"name\" => \"Poland, Republic of\");\n\t\t$country[\"PRT\"] = Array(\"iso2\" => \"PT\", \"name\" => \"Portugal, Portuguese Republic\");\n\t\t$country[\"PRI\"] = Array(\"iso2\" => \"PR\", \"name\" => \"Puerto Rico, Commonwealth of\");\n\t\t$country[\"QAT\"] = Array(\"iso2\" => \"QA\", \"name\" => \"Qatar, State of\");\n\t\t$country[\"REU\"] = Array(\"iso2\" => \"RE\", \"name\" => \"Reunion\");\n\t\t$country[\"ROU\"] = Array(\"iso2\" => \"RO\", \"name\" => \"Romania\");\n\t\t$country[\"RUS\"] = Array(\"iso2\" => \"RU\", \"name\" => \"Russian Federation\");\n\t\t$country[\"RWA\"] = Array(\"iso2\" => \"RW\", \"name\" => \"Rwanda, Republic of\");\n\t\t$country[\"BLM\"] = Array(\"iso2\" => \"BL\", \"name\" => \"Saint Barthelemy\");\n\t\t$country[\"SHN\"] = Array(\"iso2\" => \"SH\", \"name\" => \"Saint Helena\");\n\t\t$country[\"KNA\"] = Array(\"iso2\" => \"KN\", \"name\" => \"Saint Kitts and Nevis, Federat\");\n\t\t$country[\"LCA\"] = Array(\"iso2\" => \"LC\", \"name\" => \"Saint Lucia\");\n\t\t$country[\"MAF\"] = Array(\"iso2\" => \"MF\", \"name\" => \"Saint Martin\");\n\t\t$country[\"SPM\"] = Array(\"iso2\" => \"PM\", \"name\" => \"Saint Pierre and Miquelon\");\n\t\t$country[\"VCT\"] = Array(\"iso2\" => \"VC\", \"name\" => \"Saint Vincent and the Grenadin\");\n\t\t$country[\"WSM\"] = Array(\"iso2\" => \"WS\", \"name\" => \"Samoa, Independent State of\");\n\t\t$country[\"SMR\"] = Array(\"iso2\" => \"SM\", \"name\" => \"San Marino, Republic of\");\n\t\t$country[\"STP\"] = Array(\"iso2\" => \"ST\", \"name\" => \"Sao Tome and Principe, Democra\");\n\t\t$country[\"SAU\"] = Array(\"iso2\" => \"SA\", \"name\" => \"Saudi Arabia, Kingdom of\");\n\t\t$country[\"SEN\"] = Array(\"iso2\" => \"SN\", \"name\" => \"Senegal, Republic of\");\n\t\t$country[\"SRB\"] = Array(\"iso2\" => \"RS\", \"name\" => \"Serbia, Republic of\");\n\t\t$country[\"SYC\"] = Array(\"iso2\" => \"SC\", \"name\" => \"Seychelles, Republic of\");\n\t\t$country[\"SLE\"] = Array(\"iso2\" => \"SL\", \"name\" => \"Sierra Leone, Republic of\");\n\t\t$country[\"SGP\"] = Array(\"iso2\" => \"SG\", \"name\" => \"Singapore, Republic of\");\n\t\t$country[\"SVK\"] = Array(\"iso2\" => \"SK\", \"name\" => \"Slovakia (Slovak Republic)\");\n\t\t$country[\"SVN\"] = Array(\"iso2\" => \"SI\", \"name\" => \"Slovenia, Republic of\");\n\t\t$country[\"SLB\"] = Array(\"iso2\" => \"SB\", \"name\" => \"Solomon Islands\");\n\t\t$country[\"SOM\"] = Array(\"iso2\" => \"SO\", \"name\" => \"Somalia, Somali Republic\");\n\t\t$country[\"ZAF\"] = Array(\"iso2\" => \"ZA\", \"name\" => \"South Africa, Republic of\");\n\t\t$country[\"SGS\"] = Array(\"iso2\" => \"GS\", \"name\" => \"South Georgia and the South Sa\");\n\t\t$country[\"ESP\"] = Array(\"iso2\" => \"ES\", \"name\" => \"Spain, Kingdom of\");\n\t\t$country[\"LKA\"] = Array(\"iso2\" => \"LK\", \"name\" => \"Sri Lanka, Democratic Socialis\");\n\t\t$country[\"SDN\"] = Array(\"iso2\" => \"SD\", \"name\" => \"Sudan, Republic of\");\n\t\t$country[\"SUR\"] = Array(\"iso2\" => \"SR\", \"name\" => \"Suriname, Republic of\");\n\t\t$country[\"SJM\"] = Array(\"iso2\" => \"SJ\", \"name\" => \"Svalbard & Jan Mayen Islands\");\n\t\t$country[\"SWZ\"] = Array(\"iso2\" => \"SZ\", \"name\" => \"Swaziland, Kingdom of\");\n\t\t$country[\"SWE\"] = Array(\"iso2\" => \"SE\", \"name\" => \"Sweden, Kingdom of\");\n\t\t$country[\"CHE\"] = Array(\"iso2\" => \"CH\", \"name\" => \"Switzerland, Swiss Confederati\");\n\t\t$country[\"SYR\"] = Array(\"iso2\" => \"SY\", \"name\" => \"Syrian Arab Republic\");\n\t\t$country[\"TWN\"] = Array(\"iso2\" => \"TW\", \"name\" => \"Taiwan\");\n\t\t$country[\"TJK\"] = Array(\"iso2\" => \"TJ\", \"name\" => \"Tajikistan, Republic of\");\n\t\t$country[\"TZA\"] = Array(\"iso2\" => \"TZ\", \"name\" => \"Tanzania, United Republic of\");\n\t\t$country[\"THA\"] = Array(\"iso2\" => \"TH\", \"name\" => \"Thailand, Kingdom of\");\n\t\t$country[\"TLS\"] = Array(\"iso2\" => \"TL\", \"name\" => \"Timor-Leste, Democratic Republ\");\n\t\t$country[\"TGO\"] = Array(\"iso2\" => \"TG\", \"name\" => \"Togo, Togolese Republic\");\n\t\t$country[\"TKL\"] = Array(\"iso2\" => \"TK\", \"name\" => \"Tokelau\");\n\t\t$country[\"TON\"] = Array(\"iso2\" => \"TO\", \"name\" => \"Tonga, Kingdom of\");\n\t\t$country[\"TTO\"] = Array(\"iso2\" => \"TT\", \"name\" => \"Trinidad and Tobago, Republic \");\n\t\t$country[\"TUN\"] = Array(\"iso2\" => \"TN\", \"name\" => \"Tunisia, Tunisian Republic\");\n\t\t$country[\"TUR\"] = Array(\"iso2\" => \"TR\", \"name\" => \"Turkey, Republic of\");\n\t\t$country[\"TKM\"] = Array(\"iso2\" => \"TM\", \"name\" => \"Turkmenistan\");\n\t\t$country[\"TCA\"] = Array(\"iso2\" => \"TC\", \"name\" => \"Turks and Caicos Islands\");\n\t\t$country[\"TUV\"] = Array(\"iso2\" => \"TV\", \"name\" => \"Tuvalu\");\n\t\t$country[\"UGA\"] = Array(\"iso2\" => \"UG\", \"name\" => \"Uganda, Republic of\");\n\t\t$country[\"UKR\"] = Array(\"iso2\" => \"UA\", \"name\" => \"Ukraine\");\n\t\t$country[\"ARE\"] = Array(\"iso2\" => \"AE\", \"name\" => \"United Arab Emirates\");\n\t\t$country[\"GBR\"] = Array(\"iso2\" => \"GB\", \"name\" => \"United Kingdom of Great Britain\");\n\t\t$country[\"USA\"] = Array(\"iso2\" => \"US\", \"name\" => \"United States of America\");\n\t\t$country[\"UMI\"] = Array(\"iso2\" => \"UM\", \"name\" => \"United States Minor Outlying I\");\n\t\t$country[\"VIR\"] = Array(\"iso2\" => \"VI\", \"name\" => \"United States Virgin Islands\");\n\t\t$country[\"URY\"] = Array(\"iso2\" => \"UY\", \"name\" => \"Uruguay, Eastern Republic of\");\n\t\t$country[\"UZB\"] = Array(\"iso2\" => \"UZ\", \"name\" => \"Uzbekistan, Republic of\");\n\t\t$country[\"VUT\"] = Array(\"iso2\" => \"VU\", \"name\" => \"Vanuatu, Republic of\");\n\t\t$country[\"VEN\"] = Array(\"iso2\" => \"VE\", \"name\" => \"Venezuela, Bolivarian Republic\");\n\t\t$country[\"VNM\"] = Array(\"iso2\" => \"VN\", \"name\" => \"Vietnam, Socialist Republic of\");\n\t\t$country[\"WLF\"] = Array(\"iso2\" => \"WF\", \"name\" => \"Wallis and Futuna\");\n\t\t$country[\"ESH\"] = Array(\"iso2\" => \"EH\", \"name\" => \"Western Sahara\");\n\t\t$country[\"YEM\"] = Array(\"iso2\" => \"YE\", \"name\" => \"Yemen\");\n\t\t$country[\"ZMB\"] = Array(\"iso2\" => \"ZM\", \"name\" => \"Zambia, Republic of\");\n\t\t$country[\"ZWE\"] = Array(\"iso2\" => \"ZW\", \"name\" => \"Zimbabwe, Republic of\");\n\t\t$country[\"0\"] = Array(\"iso2\" => \"0\", \"name\" => \"NO VALID COUNTRY\");\n\n\t\treturn $country;\n\t}", "public function get_regions($country_code)\n\t{\n\t\t$query = \"SELECT `country`, `region`, `name` FROM `regions` WHERE `country` = '\".$country_code.\"' ORDER BY CASE WHEN `region` = '\".NO_REGION.\"' THEN 1 ELSE 0 END, `region`\";\n\t\t$result = $this->db->query($query);\n\t\tif ($result->num_rows() > 0 ) \n\t\t\treturn $result->result();\n\t\treturn false;\n\t}", "public function getCountryInfo($countryId);", "function getCountryRegion($country) {\n\treturn getDetailedTableInfo2(\"vl_countries\",\"lower(country)=lower('$country')\",\"region\");\n}", "function getStatesProv($country = null) {\n $stpr = [];\n $data = getDataCsv('states.csv');\n\n if (($data) && is_array($data) && ($country)) {\n foreach ($data as $row) {\n if ($country === $row[0]) {\n $stpr[] = $row[1];\n }\n }\n sort($stpr);\n }\n\n return $stpr;\n}", "public function getAllCountryCodes() {\n\t\t$filter = new Filters\\Misc\\CountryCode();\n\t\treturn $filter->query->find();\n\t}", "function countryList()\n {\n $arrClms = array(\n 'country_id',\n 'name',\n );\n $varOrderBy = 'name ASC ';\n $arrRes = $this->select(TABLE_COUNTRY, $arrClms);\n //pre($arrRes);\n return $arrRes;\n }", "function getSiteCountries() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_COUNTRIES . \" WHERE status='1' ORDER BY country_name\");\n\n return $data;\n }", "public function getCountryCode();", "function getIdByCountryISO($iso_value)\n{\n\tif (!empty($iso_value))\n\t{\n\t\t$tbl = _DB_PREFIX_.'country';\n\t\t$field = 'iso_code';\n\t\tif (isset($iso_value->Code))\n\t\t\t$iso_value = $iso_value->Code;\n\t\tif (isset($iso_value) && !is_array($iso_value))\n\t\t{\n\t\t\t$iso_value = pSQL(trim($iso_value));\n\t\t\t$q = \"SELECT * from $tbl WHERE $field='$iso_value'\";\n\t\t\t$q = Db::getInstance()->ExecuteS($q);\n\t\t\t$iso_value = '';\n\t\t\t$iso_value = (isset($q[0]['id_country']) ? $q[0]['id_country'] : '');\n\t\t\treturn ($iso_value);\n\t\t}\n\t\treturn '';\n\t}\n}", "protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}", "public function getListCountry()\n\t{\n\t\t$params = [\n\t\t\t'verify' => false,\n\t\t\t'query' => [\n\t\t\t\t'output' => Config::get( 'response.format' )\n\t\t\t]\n\t\t];\n\n\t\t$baseUrl = sprintf( Config::get( 'endpoints.base_url' ), Config::get( 'settings.api' ) ) . Config::get( 'endpoints.general_list_country' );\n\n\t\ttry {\n\t\t\t$response = parent::send( 'GET', $baseUrl, $params );\n\t\t} catch (TiketException $e) {\n\t\t\tthrow parent::convertException( $e );\n\t\t}\n\n\t\treturn $response;\n\t}", "function country_list()\t{\r\n\t\t$list = array(\r\n\t\t\t'AF' => 'Afghanistan',\r\n\t\t\t'AX' => 'Aland Island (Finland)',\r\n\t\t\t'AL' => 'Albania',\r\n\t\t\t'DZ' => 'Algeria',\r\n\t\t\t'AD' => 'Andorra',\r\n\t\t\t'AO' => 'Angola',\r\n\t\t\t'AI' => 'Anguilla',\r\n\t\t\t'AG' => 'Antigua and Barbuda',\r\n\t\t\t'AR' => 'Argentina',\r\n\t\t\t'AM' => 'Armenia',\r\n\t\t\t'AW' => 'Aruba',\r\n\t\t\t'AU' => 'Australia',\r\n\t\t\t'AT' => 'Austria',\r\n\t\t\t'AZ' => 'Azerbaijan',\r\n\t\t\t'BS' => 'Bahamas',\r\n\t\t\t'BH' => 'Bahrain',\r\n\t\t\t'BD' => 'Bangladesh',\r\n\t\t\t'BB' => 'Barbados',\r\n\t\t\t'BY' => 'Belarus',\r\n\t\t\t'BE' => 'Belgium',\r\n\t\t\t'BZ' => 'Belize',\r\n\t\t\t'BJ' => 'Benin',\r\n\t\t\t'BM' => 'Bermuda',\r\n\t\t\t'BT' => 'Bhutan',\r\n\t\t\t'BO' => 'Bolivia',\r\n\t\t\t'BQ' => 'Bonaire (Netherlands Antilles)',\r\n\t\t\t'BA' => 'Bosnia-Herzegovina',\r\n\t\t\t'BW' => 'Botswana',\r\n\t\t\t'BR' => 'Brazil',\r\n\t\t\t'VG' => 'British Virgin Islands',\r\n\t\t\t'BN' => 'Brunei Darussalam',\r\n\t\t\t'BG' => 'Bulgaria',\r\n\t\t\t'BF' => 'Burkina Faso',\r\n\t\t\t'MM' => 'Burma',\r\n\t\t\t'BI' => 'Burundi',\r\n\t\t\t'KH' => 'Cambodia',\r\n\t\t\t'CM' => 'Cameroon',\r\n\t\t\t'CA' => 'Canada',\r\n\t\t\t'CV' => 'Cape Verde',\r\n\t\t\t'KY' => 'Cayman Islands',\r\n\t\t\t'CF' => 'Central African Republic',\r\n\t\t\t'TD' => 'Chad',\r\n\t\t\t'CL' => 'Chile',\r\n\t\t\t'CN' => 'China',\r\n\t\t\t'CX' => 'Christmas Island (Australia)',\r\n\t\t\t'CC' => 'Cocos Island (Australia)',\r\n\t\t\t'CO' => 'Colombia',\r\n\t\t\t'KM' => 'Comoros',\r\n\t\t\t'CG' => 'Congo, Republic of the',\r\n\t\t\t'CD' => 'Congo, Democratic Republic of the',\r\n\t\t\t'CK' => 'Cook Islands (New Zealand)',\r\n\t\t\t'CR' => 'Costa Rica',\r\n\t\t\t'CI' => 'Cote d\\'Ivoire',\r\n\t\t\t'HR' => 'Croatia',\r\n\t\t\t'CU' => 'Cuba',\r\n\t\t\t'CW' => 'Curacao (Netherlands Antilles)',\r\n\t\t\t'CY' => 'Cyprus',\r\n\t\t\t'CZ' => 'Czech Republic',\r\n\t\t\t'DK' => 'Denmark',\r\n\t\t\t'DJ' => 'Djibouti',\r\n\t\t\t'DM' => 'Dominica',\r\n\t\t\t'DO' => 'Dominican Republic',\r\n\t\t\t'TL' => 'East Timor (Indonesia)',\r\n\t\t\t'EC' => 'Ecuador',\r\n\t\t\t'EG' => 'Egypt',\r\n\t\t\t'SV' => 'El Salvador',\r\n\t\t\t'GQ' => 'Equatorial Guinea',\r\n\t\t\t'ER' => 'Eritrea',\r\n\t\t\t'EE' => 'Estonia',\r\n\t\t\t'ET' => 'Ethiopia',\r\n\t\t\t'FK' => 'Falkland Islands',\r\n\t\t\t'FO' => 'Faroe Islands',\r\n\t\t\t'FJ' => 'Fiji',\r\n\t\t\t'FI' => 'Finland',\r\n\t\t\t'FR' => 'France',\r\n\t\t\t'GF' => 'French Guiana',\r\n\t\t\t'PF' => 'French Polynesia',\r\n\t\t\t'GA' => 'Gabon',\r\n\t\t\t'GM' => 'Gambia',\r\n\t\t\t'GE' => 'Georgia, Republic of',\r\n\t\t\t'DE' => 'Germany',\r\n\t\t\t'GH' => 'Ghana',\r\n\t\t\t'GI' => 'Gibraltar',\r\n\t\t\t'GB' => 'Great Britain and Northern Ireland',\r\n\t\t\t'GR' => 'Greece',\r\n\t\t\t'GL' => 'Greenland',\r\n\t\t\t'GD' => 'Grenada',\r\n\t\t\t'GP' => 'Guadeloupe',\r\n\t\t\t'GT' => 'Guatemala',\r\n\t\t\t'GG' => 'Guernsey',\r\n\t\t\t'GN' => 'Guinea',\r\n\t\t\t'GW' => 'Guinea-Bissau',\r\n\t\t\t'GY' => 'Guyana',\r\n\t\t\t'HT' => 'Haiti',\r\n\t\t\t'HN' => 'Honduras',\r\n\t\t\t'HK' => 'Hong Kong',\r\n\t\t\t'HU' => 'Hungary',\r\n\t\t\t'IS' => 'Iceland',\r\n\t\t\t'IN' => 'India',\r\n\t\t\t'ID' => 'Indonesia',\r\n\t\t\t'IR' => 'Iran',\r\n\t\t\t'IQ' => 'Iraq',\r\n\t\t\t'IE' => 'Ireland',\r\n\t\t\t'IM' => 'Isle of Man (Great Britain and Northern Ireland)',\r\n\t\t\t'IL' => 'Israel',\r\n\t\t\t'IT' => 'Italy',\r\n\t\t\t'JM' => 'Jamaica',\r\n\t\t\t'JP' => 'Japan',\r\n\t\t\t'JE' => 'Jersey (Channel Islands) (Great Britain and Northern Ireland)',\r\n\t\t\t'JO' => 'Jordan',\r\n\t\t\t'KZ' => 'Kazakhstan',\r\n\t\t\t'KE' => 'Kenya',\r\n\t\t\t'KI' => 'Kiribati',\r\n\t\t\t'KW' => 'Kuwait',\r\n\t\t\t'KG' => 'Kyrgyzstan',\r\n\t\t\t'LA' => 'Laos',\r\n\t\t\t'LV' => 'Latvia',\r\n\t\t\t'LB' => 'Lebanon',\r\n\t\t\t'LS' => 'Lesotho',\r\n\t\t\t'LR' => 'Liberia',\r\n\t\t\t'LY' => 'Libya',\r\n\t\t\t'LI' => 'Liechtenstein',\r\n\t\t\t'LT' => 'Lithuania',\r\n\t\t\t'LU' => 'Luxembourg',\r\n\t\t\t'MO' => 'Macao',\r\n\t\t\t'MK' => 'Macedonia, Republic of',\r\n\t\t\t'MG' => 'Madagascar',\r\n\t\t\t'MW' => 'Malawi',\r\n\t\t\t'MY' => 'Malaysia',\r\n\t\t\t'MV' => 'Maldives',\r\n\t\t\t'ML' => 'Mali',\r\n\t\t\t'MT' => 'Malta',\r\n\t\t\t'MQ' => 'Martinique',\r\n\t\t\t'MR' => 'Mauritania',\r\n\t\t\t'MU' => 'Mauritius',\r\n\t\t\t'YT' => 'Mayotte (France)',\r\n\t\t\t'MX' => 'Mexico',\r\n\t\t\t'MD' => 'Moldova',\r\n\t\t\t'MC' => 'Monaco (France)',\r\n\t\t\t'MN' => 'Mongolia',\r\n\t\t\t'ME' => 'Montenegro',\r\n\t\t\t'MS' => 'Montserrat',\r\n\t\t\t'MA' => 'Morocco',\r\n\t\t\t'MZ' => 'Mozambique',\r\n\t\t\t'NA' => 'Namibia',\r\n\t\t\t'NR' => 'Nauru',\r\n\t\t\t'NP' => 'Nepal',\r\n\t\t\t'NL' => 'Netherlands',\r\n\t\t\t'AN' => 'Netherlands Antilles',\r\n\t\t\t'NC' => 'New Caledonia',\r\n\t\t\t'NZ' => 'New Zealand',\r\n\t\t\t'NI' => 'Nicaragua',\r\n\t\t\t'NE' => 'Niger',\r\n\t\t\t'NG' => 'Nigeria',\r\n\t\t\t'NU' => 'Niue',\r\n\t\t\t'NF' => 'Norfolk Island',\r\n\t\t\t'KP' => 'North Korea (Korea, Democratic People\\'s Republic of)',\r\n\t\t\t'NO' => 'Norway',\r\n\t\t\t'OM' => 'Oman',\r\n\t\t\t'PK' => 'Pakistan',\r\n\t\t\t'PA' => 'Panama',\r\n\t\t\t'PG' => 'Papua New Guinea',\r\n\t\t\t'PY' => 'Paraguay',\r\n\t\t\t'PE' => 'Peru',\r\n\t\t\t'PH' => 'Philippines',\r\n\t\t\t'PN' => 'Pitcairn Island',\r\n\t\t\t'PL' => 'Poland',\r\n\t\t\t'PT' => 'Portugal',\r\n\t\t\t'QA' => 'Qatar',\r\n\t\t\t'RE' => 'Reunion',\r\n\t\t\t'RO' => 'Romania',\r\n\t\t\t'RU' => 'Russia',\r\n\t\t\t'RW' => 'Rwanda',\r\n\t\t\t'BL' => 'Saint Barthelemy (Guadeloupe)',\r\n\t\t\t'SH' => 'Saint Helena',\r\n\t\t\t'KN' => 'Saint Kitts (Saint Christopher and Nevis)',\r\n\t\t\t'LC' => 'Saint Lucia',\r\n\t\t\t'MF' => 'Saint Martin (French) (Guadeloupe)',\r\n\t\t\t'PM' => 'Saint Pierre and Miquelon',\r\n\t\t\t'VC' => 'Saint Vincent and the Grenadines',\r\n\t\t\t'SM' => 'San Marino',\r\n\t\t\t'ST' => 'Sao Tome and Principe',\r\n\t\t\t'SA' => 'Saudi Arabia',\r\n\t\t\t'SN' => 'Senegal',\r\n\t\t\t'RS' =>\t'Serbia, Republic of',\r\n\t\t\t'SC' => 'Seychelles',\r\n\t\t\t'SL' => 'Sierra Leone',\r\n\t\t\t'SG' => 'Singapore',\r\n\t\t\t'SX' => 'Saint Maarten (Dutch) (Netherlands Antilles)',\r\n\t\t\t'SK' => 'Slovak Republic',\r\n\t\t\t'SI' => 'Slovenia',\r\n\t\t\t'SB' => 'Solomon Islands',\r\n\t\t\t'SO' => 'Somalia',\r\n\t\t\t'ZA' => 'South Africa',\r\n\t\t\t'GS' => 'South Georgia (Falkland Islands)',\r\n\t\t\t'KR' => 'South Korea (Korea, Republic of)',\r\n\t\t\t'SS' => 'Sudan', // South Sudan, not listed separately from Sudan by USPS\r\n\t\t\t'ES' => 'Spain',\r\n\t\t\t'LK' => 'Sri Lanka',\r\n\t\t\t'SD' => 'Sudan',\r\n\t\t\t'SR' => 'Suriname',\r\n\t\t\t'SZ' => 'Swaziland',\r\n\t\t\t'SE' => 'Sweden',\r\n\t\t\t'CH' => 'Switzerland',\r\n\t\t\t'SY' => 'Syrian Arab Republic',\r\n\t\t\t'TW' => 'Taiwan',\r\n\t\t\t'TJ' => 'Tajikistan',\r\n\t\t\t'TZ' => 'Tanzania',\r\n\t\t\t'TH' => 'Thailand',\r\n\t\t\t'TG' => 'Togo',\r\n\t\t\t'TK' => 'Tokelau (Union Group) (Western Samoa)',\r\n\t\t\t'TO' => 'Tonga',\r\n\t\t\t'TT' => 'Trinidad and Tobago',\r\n\t\t\t'TN' => 'Tunisia',\r\n\t\t\t'TR' => 'Turkey',\r\n\t\t\t'TM' => 'Turkmenistan',\r\n\t\t\t'TC' => 'Turks and Caicos Islands',\r\n\t\t\t'TV' => 'Tuvalu',\r\n\t\t\t'UG' => 'Uganda',\r\n\t\t\t'UA' => 'Ukraine',\r\n\t\t\t'AE' => 'United Arab Emirates',\r\n\t\t\t'UY' => 'Uruguay',\r\n\t\t\t'UZ' => 'Uzbekistan',\r\n\t\t\t'VU' => 'Vanuatu',\r\n\t\t\t'VA' => 'Vatican City',\r\n\t\t\t'VE' => 'Venezuela',\r\n\t\t\t'VN' => 'Vietnam',\r\n\t\t\t'WF' => 'Wallis and Futuna Islands',\r\n\t\t\t'WS' => 'Western Samoa',\r\n\t\t\t'YE' => 'Yemen',\r\n\t\t\t'ZM' => 'Zambia',\r\n\t\t\t'ZW' => 'Zimbabwe');\r\n\t\treturn $list;\r\n\t}", "public function countries(): array\n {\n return $this->client->get(\"country\");\n }", "public function getCountriesPerRegion();", "public function getCountry(){\n\t\n\t\tif(!isset($_SESSION['country_list'])){\n\t\t\t$country = $this->getData(\"select id,country,currency,flag,is_active,contact_email,address from country order by id\");\n\t\t\tforeach ($country as $k => $countrys) {\n\t\t\t\t$_SESSION['country_list'][$countrys['id']]=['id' => $countrys['id'],'country' => $countrys['country'], 'currency' => $countrys['currency'], 'flag'=>$countrys['flag'], 'is_active' => $countrys['is_active'], 'contact_email' => $countrys['contact_email'], 'address' => $countrys['address'] ];\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function get_country_combo($countryCode)\n {\n $output = '';\n $query = $this->db->query('select * from country_dd');\n foreach($query->result() as $row)\n {\n $output .= '<option value=\"' . $row->id . '\"';\n if($row->id==$countryCode){\n $output .= ' selected';\n }\n $output .= '>' . $row->name . '</option>';\n }\n return $output;\n }", "function get_state_options_by_country($country) {\r\n\r\n /* $states = [\"India\" =>[ \"Tamil Nadu\",\"Kerala\", \"Andra Pradesh\" , \"Telungana\", \"Karnataka\"]];\r\n $options = $states[$country]; \r\n\treturn $options; */\r\n}", "function getCountryList($options = array()) {\n\t\t$local_country_data = array();\n\t\t$where = array();\n\n\t\t# possible options of filtering\n\t\tif (!empty($options['country_id']))\n\t\t$where[] = \"id = \".$options['country_id'];\n\n\t\t# build SQL request\n\t\t$_sql = \"SELECT `id`, `iso2`, `iso3`, `name`\n\t\t\t\tFROM `%s` %s ORDER BY `name` ASC\";\n\t\t$sql = sprintf($_sql,\n\t\t$this->country_table,\n\t\t!empty($where) ? \"WHERE \".implode(\" AND \", $where) : \"\"\n\t\t);\n\t\t$result = mysql_query($sql);\n\n\t\twhile ($_city = mysql_fetch_assoc($result)) {\n\t\t\t$this->country_data[$_city['id']] = array (\n\t\t\t'id'\t=> $_city['id'],\n\t\t\t'iso2'\t=> $_city['iso2'],\n\t\t\t'iso3'\t=> $_city['iso3'],\n\t\t\t'name'\t=> $_city['name'],\n\t\t\t);\n\t\t\t$local_country_data[] = $this->country_data[$_city['id']];\n\t\t}\n\n\t\treturn $local_country_data;\n\t}", "public function countryList(){\n $response['status'] = \"false\"; \n $response['message'] = \"Invalid request.\"; \n \n $country = Country::getCountries();\n if(!empty($country)){\n $response['status'] = \"true\"; \n $response['message'] = \"Country data.\"; \n $response['data'] = $country; \n }\n $this->response($response);\n \n }", "public function country_list()\n {\n $result = common_select_values('id, name', 'ad_countries', '', 'result');\n return $result; \n }", "public function findListByCountryCode($countryCode) {\n $conditions = [];\n\n $conditions['country_code'] = $countryCode;\n// $conditions['status'] = 1;\n\n $arr_result = array();\n $lang_code = CakeSession::read('lang_code');\n if (empty($lang_code)) {\n $lang_code = Configure::read('S.Lang_code_default');\n }\n if (empty($countryCode)) {\n return array();\n }\n\n $list_data = $this->find('all', ['conditions' => $conditions, 'order' => ['order' => 'ASC', 'name' => 'ASC']]);\n\n if (count($list_data) > 0) {\n foreach ($list_data as $key => $item) {\n if (!empty($item['Region'][$lang_code])) {\n $arr_result[$item['Region']['id']] = $item['Region'][$lang_code]['name'];\n }\n }\n return $arr_result;\n }else{\n return array();\n }\n }", "public function findCountry($code)\n {\n\n $country = $this->em->getRepository('TTBundle:Airport')->findOneByAirportCode($code);\n\n return $country;\n }", "public function getCountriesByCode($countryCode)\n\t{\n\t\treturn is_array($this->codeToCountries[$countryCode]) ? $this->codeToCountries[$countryCode] : array();\n\t}", "function GetCountries () {\n\t\t$this->db->order_by('name','ASC');\n\t\t$result = $this->db->get('countries');\n\n\t\t$countries = array();\n\t\tforeach ($result->result_array() as $country) {\n\t\t\t$countries[] = array(\n\t\t\t\t\t\t\t'iso2' => $country['iso2'],\n\t\t\t\t\t\t\t'name' => $country['name']\n\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn $countries;\n\t}", "function get_country_from_name( $country_name ) {\n\tglobal $wpdb;\n\n\t$field = 'name';\n\n\tif ( strlen( $country_name ) == 2 ) {\n\t\t$field = 'country';\n\t}\n\n\treturn $wpdb->get_row( $wpdb->prepare( \"\n\t\tSELECT\n\t\t\tcountry as country_short,\n\t\t\tname as country_long\n\t\tFROM countrycodes\n\t\tWHERE\n\t\t\t$field = %s\n\t\tLIMIT 1\",\n\t\t$country_name\n\t), 'ARRAY_A' );\n}", "public function countryList(){\n $sorted = $this->country->select('id','country_name')->get()->sortBy('country_name');\n return $sorted->values()->all();\n }", "public function select_list_code()\n\t{\n\t\treturn ORM::factory('country')->select_list('iso_code','name');\n\t}", "function tep_get_country_name($country_id) {\n\t$country_array = tep_get_countries($country_id);\n\treturn $country_array['countries_name'];\n}", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "static function getCountryNameByCode($country_code) {\n $data = self::find()->select('country_name')->where(['country_code' => $country_code])->one();\n if ($data) {\n return $data->country_name;\n }\n return NULL;\n }", "static function get_country($code) {\n $countries = self::get_countries();\n foreach($countries as $c) {\n if($c->code == $code || $c->code2l == $code) {\n return $c;\n }\n }\n return FALSE;\n }", "static function get_countries() {\n static $ret = array();\n if(empty($ret)) {\n global $wpdb;\n $ret = $wpdb->get_results('SELECT * FROM ai_country ORDER BY name', OBJECT_K);\n }\n return $ret;\n }", "public function getByCommerceCountry()\r\n\t{\r\n\t\ttry {\r\n\t\t\t$post = $this->sanitize->inputParams(true);\r\n\t\t\t\r\n\t\t\tif ( empty((array)$post) )\r\n\t\t\t\tthrow new Exception('Missing required parameters', 422);\r\n\t\t\t\r\n\t\t\t$types = $this->payment_type_model->findByCommerceAndCountry(\r\n\t\t\t\t$post->commerceCode, $post->countryAlpha2\r\n\t\t\t);\r\n\r\n\t\t\tif( is_null($types) ) \r\n\t\t\t\tthrow new Exception('Empty Types', 404);\r\n\t\t\r\n\t\t\t$response = $this->sanitize->successResponse(['paymentTypes' => $types]);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tlog_message(\"error\", __METHOD__ . \"(\".$e->getCode().\") -> \".$e->getMessage());\r\n\t\t\t$response = $this->sanitize->errorResponse($e->getCode(), $e->getMessage());\r\n\t\t}\r\n\r\n\t\t$this->sanitize->jsonResponse($response);\r\n\t}", "public function getCountryCode(): string;", "function getCountries($type, $query, $countriesParams) {\n if ($type === 'alpha' && (strLen($query) > 3 || strLen($query) < 2)) {\n echo json_encode(['error' => 'Country codes must be 2-3 characters long']);\n return;\n }\n $client = new Client(['base_uri' => 'https://restcountries.eu/rest/v2/', 'http_errors' => false]);\n $response = $client->request('GET', \"$type/$query\", [\n 'query' => $countriesParams\n ]);\n if ($response->getStatusCode() == 404) {\n echo json_encode(['error' => 'No results found']);\n return;\n }\n $response = json_decode($response->getBody());\n returnCountries((array)$response);\n}", "public function requestCountry();", "function getCountryISO($search)\n{\n // pull the countries array from a different file\n $countries = include \"../app/includes/countries_array.php\";\n\n // uppercase the first letter of the searched query\n $input = ucwords($search);\n\n // find all matching results\n $input = preg_quote($input, '~');\n $result = preg_grep(\"~$input~\", $countries);\n\n // if any results were found then return their ISOs, otherwise put search value in array\n return count($result) ? array_keys($result) : [$search];\n}", "public function getInstitutionsByCountry($id);", "function CountriesList()\n\t{\t$countries = array();\n\t\t$adminuser = new AdminUser((int)$_SESSION[SITE_NAME][\"auserid\"]);\n\t\t\n\t\t$sql = \"SELECT countries.ccode, countries.shortname, IF(toplist > 0, 0, 1) AS istoplist FROM countries ORDER BY istoplist, toplist, shortname\";\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$countries[$row[\"ccode\"]] = $row[\"shortname\"];\n\t\t\t}\n\t\t}\n\t\treturn $countries;\n\t}", "function get_country() {\n $sql = \"Select * FROM country\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getCountryList() {\n $result = array();\n $collection = Mage::getModel('directory/country')->getCollection();\n foreach ($collection as $country) {\n $cid = $country->getId();\n $cname = $country->getName();\n $result[$cid] = $cname;\n }\n return $result;\n }", "public function country_options()\n\t{\n\t\t$countries = ee()->db\n\t\t\t\t->where('enabled', 1)\n\t\t\t\t->get('store_countries');\n\n\t\t$output = '<option value=\"\">--Select Country--</option>' . \"\\n\";\n\n\t\tforeach($countries->result() as $country)\n\t\t{\n\t\t\tif($country->code == ee()->TMPL->fetch_param('country_code'))\n\t\t\t{\n\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$selected = '';\n\t\t\t}\n\n\t\t\t$output .= '<option value=\"' . $country->code . '\"' . $selected . ' >' . $country->name . '</option>' . \"\\n\";\n\n\t\t}\t\t\n\n\t\treturn $output;\n\t}", "function displayAvailableCountries() {\n $db = dbConnect();\n $countries = dbGetAllCountries($db); // Récupération des pays\n\n // Création d'une ligne par pays avec comme value le code ISO et comme texte le nom du pays\n foreach($countries as $country) {\n echo \"<option value='\" . $country->getIso_code() . \"'>\" . $country->getName() . \"</option>\";\n }\n }", "function GetCountry()\n\t{\n\t\t$country = new Country();\n\t\treturn $country->Get($this->countryId);\n\t}", "public function country_name($country)\n {\n $result = common_select_values('name', 'ad_countries', ' id = \"'.$country.'\"', 'row');\n return $result; \n }", "function get_country_list()\n\t{\n\t\t$query = \"SELECT `id`, `country` FROM `countries` ORDER BY CASE WHEN `id` = '\".OTHER_COUNTRY.\"' THEN 1 ELSE 0 END, `country`\";\n\t\t$result = $this->db->query($query);\n\t\tif ($result->num_rows() > 0 ) \n\t\t\treturn $result->result();\n\t\treturn false;\n\t}", "public function getCountry($country_code) {\n\t\t$SQL = 'SELECT country_name FROM country WHERE country_code=:country_code';\n\t\t$STMT = self::$_connection->prepare($SQL);\n\t\t$STMT->execute(['country_code'=>$country_code]);\n\t\treturn $STMT->fetch();\n\t}", "function GetCountries()\n\t{\n\t\t$result = $this->sendRequest(\"GetCountries\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public static function findByCountry($country)\n {\n $country = strtoupper($country);\n\n if (!preg_match('/^[A-Z]{2}$/', $country)) {\n throw new InvalidArgumentException('Invalid/malformed 2-letter country code (expecting ISO 3166 ALPHA-2)');\n }\n\n $r = array();\n\n foreach (self::$library as $iata => $a) {\n if ($a['country'] == $country) {\n $r[$iata] = Airport::createFromArray($a);\n }\n }\n\n return $r;\n }", "function get_countries_array() {\n include(PMDROOT.'/includes/country_codes.php');\n $countries = array();\n foreach($country_codes AS $code=>$country) {\n $countries[$country] = $country;\n }\n unset($country_codes,$code,$country);\n return $countries;\n}", "public function GetCountries(){\n try {\n \n // $country=new Countries();\n $countries=Countries::model()->GetCountries();\n return $countries;\n \n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:GetCountries::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n }", "public function getCountries()\n {\n return \"/V1/directory/countries\";\n }", "function getAllCountries() {\n $myModel = new My_Model();\n $result = $myModel->select('countries', \"*\", null);\n if (count($result) > 1) {\n return $result = [\n \"message\" => \"countries list\",\n \"data\" => $result\n ];\n } else {\n return $resp = [\n \"message\" => \"no country available\",\n \"data\" => \"null\"\n ];\n }\n }", "public function getAllCountries() {\n return $this->_countries->pluck ( 'name', 'code','id','flag');\n }", "public function getCountry()\n {\n return $this->getParameter('country');\n }", "function getCountry($countryID) {\n\t//get the towns first\n\t$query=0;\n\t$query=mysqlquery(\"select distinct country from vl_countries where countryID='$countryID'\");\n\tif(mysqlnumrows($query)) {\n\t\treturn removeSpecialCharacters(mysqlresult($query,0,'country'));\n\t}\n}", "function tep_get_country_zones($country_id) {\n $zones_array = array();\n\n $Qzones = Registry::get('Db')->get('zones', [\n 'zone_id',\n 'zone_name'\n ], [\n 'zone_country_id' => (int)$country_id\n ], 'zone_name');\n\n while ($Qzones->fetch()) {\n $zones_array[] = [\n 'id' => $Qzones->valueInt('zone_id'),\n 'text' => $Qzones->value('zone_name')\n ];\n }\n\n return $zones_array;\n }", "public function getCurrency($codeCountry = null) {\n\t $pathFile = storage_path(\"/json/currencies.json\");\n\n\t if(!File::exists($pathFile)) {\n\t return null;\n\t }\n\n\t $countries = File::get($pathFile);\n\t $file = (array)json_decode(File::get($pathFile));\n\t if ($codeCountry){\n\t return $file[$codeCountry];\n\t }\n\n\t return $file;\n\t}", "public function getCountrylist()\n {\n $cachePool = new FilesystemAdapter('', 0, \"cache\");\n \n if ($cachePool->hasItem('countries')) {\n $countries = $cachePool->getItem('countries')->get();\n } else {\n $countries = $this->client->request(\n 'GET',\n 'https://kayaposoft.com/enrico/json/v2.0?action=getSupportedCountries'\n )->toArray();\n $countriesCache = $cachePool->getItem('countries');\n \n if (!$countriesCache->isHit()) {\n $countriesCache->set($countries);\n $countriesCache->expiresAfter(60*60*24);\n $cachePool->save($countriesCache);\n }\n }\n\n return $countries;\n }", "function country_flag($countryCode)\n {\n return CountryFlag::get($countryCode);\n }", "public function listCountries() {\r\n\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT DISTINCT c.countries_id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tc.countries_name,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tc.countries_iso_code_2,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCASE WHEN z.zone_id > 0 THEN 'true' ELSE 'false' END AS zone\r\n\t\t\t\t\t\t\t\t\t\tFROM bs_countries c\r\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN bs_zones z ON (c.countries_iso_code_2 = z.countries_id)\r\n\t\t\t\t\t\t\t\t\t\tGROUP BY c.countries_id\r\n\t\t\t\t\t\t\t\t\t\tORDER BY c.countries_id\");\r\n\t\t\t$sql->execute();\r\n\r\n\t\t\twhile ($row = $sql->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\t\t$results[] = $row;\r\n\t\t\t}\r\n\r\n\t\t\treturn $results;\r\n\t\t}", "public function getCountry()\n {\n return parent::getValue('country');\n }", "function outputCountriesList() {\r\n $countries = new CountryCollection();\r\n $countries->loadCollection();\r\n \r\n $result = $countries->getArray();\r\n\t\r\n for($i=0;$i<$countries->getCount();$i++){\r\n\t\t echo '<option value=\"'. $result[$i]->getISO(). '\">' . $result[$i]->getCountryName() . '</option>';\r\n\t}\r\n}", "public function getCountryNameDirectly()\r\n {\r\n\r\n $url_to_exch_code = \"https://freegeoip.net/json/\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country_name'])) {\r\n\r\n return $details['country_name'];\r\n\r\n } else {\r\n\r\n $url_to_exch_code = \"https://geoip.nekudo.com/api/json\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country']['name'])) {\r\n\r\n return $details['country']['name'];\r\n\r\n } else {\r\n\r\n return false;\r\n\r\n }\r\n }\r\n\r\n }", "public function getCountryBasedContinentAction()\n {\n $continent = $this->getRequest()->getParam(\"continent_name\"); \n $countryList = array(); \n $storeCol = Mage::getModel('archana_storelocator/storelocator')->getCollection()\n ->addFieldToFilter('continent', $continent); \n $storeCol->getSelect()->group('country');\n $html = '<select name=\"country\" id=\"country\">\n\t\t\t<option value=\"\"> -- Please Select -- </option>';\n foreach ($storeCol as $_country) {\n $countryCode= $_country->getCountry();\n $country = Mage::helper('archana_storelocator')->getCountryNameByCode($countryCode);\n $html .= '<option value=\"' . $countryCode . '\">' . $country . '</option>';\n }\n $html.='</select>'; \n echo $html; \n }", "public function getCountry() \n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->getValueObject('country');\n }", "public function countryOptionList();", "function getcountries_get(){\n\n $from = 'countries';\n $where = array();\n $select = '*';\n $records = 2;\n\n $countries = $this->base_model->getCommon($from, $where, $select, $records);\n\n if ($countries) {\n \n $response = array(\n 'status' => TRUE,\n 'message' => 'Countries found successfully.',\n 'result' => $countries);\n\n $this->set_response($response, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code \n }else{\n $response = array(\n 'status' => FALSE,\n 'message' => 'Country not found.');\n $this->response($response, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }", "public static function getCountryList(){\n return Country::find()\n ->orderBy(['name'=>SORT_ASC])\n ->all();\n }", "public function country()\n {\n return $this->hasOne('App\\Country','code','country_code');\n }" ]
[ "0.6615606", "0.6466614", "0.6466614", "0.6458921", "0.644995", "0.6408251", "0.6406459", "0.639303", "0.63832396", "0.63832396", "0.6351012", "0.63088554", "0.62889147", "0.6274594", "0.6207131", "0.61594737", "0.61583364", "0.6141265", "0.61334497", "0.61232644", "0.61192715", "0.610064", "0.6066471", "0.6062393", "0.6047575", "0.6034084", "0.6027049", "0.5993075", "0.5972473", "0.5955749", "0.59406555", "0.593557", "0.5923846", "0.5920761", "0.5915219", "0.5914495", "0.5871171", "0.5847499", "0.5844504", "0.5840708", "0.58350575", "0.5833998", "0.58277005", "0.58104116", "0.5806332", "0.580616", "0.5806037", "0.57989013", "0.57953626", "0.57899845", "0.57891554", "0.5785318", "0.57815826", "0.57644784", "0.57635814", "0.5753876", "0.5737888", "0.5736786", "0.5731042", "0.5728817", "0.5726251", "0.57183653", "0.57177985", "0.57141453", "0.5710753", "0.57086414", "0.5706027", "0.5699536", "0.5698077", "0.5689583", "0.567972", "0.5670535", "0.5661918", "0.56612504", "0.5659614", "0.565908", "0.5649241", "0.563618", "0.56312567", "0.562778", "0.56197995", "0.56158775", "0.560343", "0.55929846", "0.5590986", "0.5581237", "0.55807185", "0.5577193", "0.55759156", "0.55723816", "0.55627406", "0.55617195", "0.55613923", "0.55568653", "0.5549182", "0.5545661", "0.5543415", "0.55354923", "0.55204475", "0.5505332", "0.54886955" ]
0.0
-1
Get URL to DHL backend.
public function getBackendUrl($store = null) { $url = $this->getConfig('url/login_production'); if (true === $this->isTestmode($store)) { $url = $this->getConfig('url/login_test'); } return $url .'?'. $this->getBackendUrlParams($store); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildBackendUri() {}", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "public function getUrl() {\n\t\t$this->getRublon()->log(__METHOD__);\n\t\treturn $this->getRublon()->getAPIDomain() .\n\t\t\tself::URL_PATH_CODE .\n\t\t\turlencode($this->getUrlParamsString());\n\t}", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getUrl()\n {\n $url = $params = '';\n $url .= $this->getProtocol() . '://' . self::EBAY_HOST . self::EBAY_URI . '?';\n foreach ($this->getParams() as $name => $value) {\n $params .= '&' . $name . '=' . urlencode($value);\n }\n\n return $url . substr($params, 1);\n }", "private function getServiceUrl()\n {\n $store = $this->storeRepository->getById($this->storeManager->getStore()->getId());\n return $this->url->getUrl(\n $this->service . \"/\" . $store->getCode() . \"/\" . $this->version\n );\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public function getURL();", "public function getURL();", "public function getURL ();", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public abstract function getURL();", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }", "public function getEndpoint() {\n return Mage::helper(\"cloudiq_core/config\")->getCloudiqApiUrl();\n }", "public function getUrl()\n {\n return $this->createUrl();\n }", "public function get_url();", "public function getURL() {\n\t\treturn $this->selectedEndpoint['url'];\t\n\t}", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "protected function _getUrl()\n {\n $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n\n $protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;\n\n $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);\n\n return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n }", "public function get_url()\n {\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public static function getThisUrl() {}", "protected function _getURL()\n {\n $s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n\n $protocol = substr(\n strtolower($_SERVER[\"SERVER_PROTOCOL\"]), 0, strpos(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\")\n ) . $s;\n\n $port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\n return $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\n }", "static function URL ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn NULL;\n\t\t\treturn (self::Protocol().\"://\".self::ServerName().self::PortReadable().self::RequestURI());\n\t\t}", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function get_url()\r\n\t{\r\n\t\treturn $this->dropin_url;\r\n\t}", "public function getURL()\n\t{\n $url = $this->_internal_request->get_normalized_http_url();\n \n if ( $this->getMethod() == KHttpRequest::GET ) \n {\n $url = $this->_internal_request->to_url();\n }\n \n\t\treturn $url;\n\t}", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function buildFrontendUri() {}", "abstract public function getCallUrl();", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public function getUrl()\n {\n return $this->apiUrl;\n }", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl()\n {\n return $this->scheme . '://' . $this->host . ':' . $this->port . '/' . trim($this->path, '/');\n }", "private static function get_endpoint() {\n\t\treturn tvd_get_service_endpoint() . '/pdf-from-url';\n\t}", "public function getUrl(): string\n {\n $query = $this->getQuery();\n return\n $this->getScheme() .\n '://' .\n $this->getHostAndPort() .\n $this->getRoot() .\n $this->getPath() .\n (!empty($query) ? '?' . http_build_query($query) : '');\n }", "public function getServerUrl() {\n return $this->conn->getServerUrl();\n }", "public function\n\tGetURL():\n\t?String {\n\n\t\treturn sprintf(\n\t\t\t'%s://%s%s%s',\n\t\t\t$this->GetProtocol(),\n\t\t\t$this->GetFullDomain(),\n\t\t\t(($this->GetPath() === '/index')?\n\t\t\t\t('/'):\n\t\t\t\t($this->GetPath())\n\t\t\t),\n\t\t\t((count($this->Query) >= 1)?\n\t\t\t\t($this->QueryCooker($this->Query)):\n\t\t\t\t(''))\n\t\t);\n\t}", "public function getWsdlUrl() {}", "public function url() \n\t{\n\t\treturn static::protocol().'://'.static::host().$this->server('REQUEST_URI', '/' );\n\t}", "abstract protected function getElisServiceUrl();", "public function getUrl(): string\n {\n return self::URL;\n }", "public static function url(): string\n\t{\n\t\treturn static::$url;\n\t}", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getUrl()\n {\n $httpRequest = $this->httpClient->get($this->getEndpoint() . '?' . http_build_query($this->getData(), '', '&'));\n return $httpRequest->getUrl();\n }", "function getUrl() {\n\t\t$url = @( $_SERVER[\"HTTPS\"] != 'on' ) ? 'http://'.$_SERVER[\"SERVER_NAME\"] : 'https://'.$_SERVER[\"SERVER_NAME\"];\n\t\t$url .= ( $_SERVER[\"SERVER_PORT\"] !== 80 ) ? \":\".$_SERVER[\"SERVER_PORT\"] : \"\";\n\t\t$url .= $_SERVER[\"REQUEST_URI\"];\n\t\treturn $url;\n\t}", "public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }", "public function getURL()\n {\n return Config::get('URL') . 'auth/unl/';\n }", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function getInstanceUrl(): string\n {\n return $this->instanceUrl;\n }", "public function getGetUrl()\n {\n $scheme = empty($this->rowUrl[\"scheme\"]) ? \"http://\" : $this->rowUrl[\"scheme\"] . \"://\";\n\n $user = empty($this->rowUrl[\"user\"]) ? \"\" : $this->rowUrl[\"user\"];\n $pass = empty($this->rowUrl[\"pass\"]) ? \"\" : $this->rowUrl[\"pass\"];\n\n if (!empty($pass)) $user .= \":\";\n if (!empty($user) || !empty($pass)) $pass .= \"@\";\n\n $host = $this->rowUrl[\"host\"];\n $port = empty($this->rowUrl[\"port\"]) ? \"\" : \":\" . $this->rowUrl[\"port\"];\n\n $path = empty($this->rowUrl[\"path\"]) ? \"\" : $this->rowUrl[\"path\"];\n\n $urlquery = \"\";\n if (count($this->getParams) > 0)\n {\n $urlquery = \"?\" . http_build_query($this->getParams);\n }\n return $scheme . $user . $pass . $host . $port . $path . $urlquery;\n }", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "protected function url()\n\t{\n\t\treturn new \\Jstewmc\\Url\\Url('http://localhost:8000');\n\t}", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "public function getEndpointUrl()\n {\n if (empty($this->endpointUrl)) {\n $this->endpointUrl = \\TiTravel\\Constants::API_LIVE_ENDPOINT;\n }\n return \"{$this->endpointUrl}&\".$this->getCredentialsUrlParams().'&action=';\n }", "public function getUrl()\n {\n return $this->url_format;\n }", "private function getQueryUrl(): string\n {\n return $this->getBaseUrl() . 'query';\n }", "public function getUrl()\n {\n return $this->_urlBuilder->getUrl();\n }", "private function Get_URL()\n {\n $url = $this->CURL->GET_SERVER_URL();\n $download_url = $url.\"/application/download/download.php\";\n $view_url = $url.\"/application/pdf/view.php\";\n $this->DOWNLOAD_URL = $download_url;\n $this->VIEW_URL = $view_url;\n }", "public function url(): string;", "public function getRemoteUrl();", "public function getUrl()\n {\n $uri = $this->getHost();\n\n $server = provider::access('server');\n\n if ($server->isExist('PHP_SELF') && $server->isExist('REQUEST_URI') && $server->isValid('REQUEST_URI', validate::T_PRINTABLE)) {\n // for 'good' servers\n $uri .= $server->getValue('REQUEST_URI');\n } else {\n // for IIS\n if ($server->isValid('SCRIPT_NAME', validate::T_PRINTABLE)) {\n $uri .= $server->getValue('SCRIPT_NAME');\n }\n\n if ($server->isValid('QUERY_STRING', validate::T_PRINTABLE)) {\n $uri .= '?' . $server->getValue('QUERY_STRING');\n }\n }\n\n return $uri;\n }", "public function getUrl() {\n\t\treturn sprintf(self::ENDPOINT, $this->_account);\n\t}", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "function get_url()\n {\n }", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function getApiUrl() \n {\n return ( $this->getSSL() ? 'https://' : 'http://' ) . $this->_api_url;\n }", "public function getUrl() {\n return $this->_gatewayRedirect->getUrl ();\n }", "public function GetUrlForSelf(): string\n {\n $host_base = Config::get('app.url');\n return \"{$host_base}/test/{$this->id}\";\n }", "protected function getUrl(): string\n {\n return $this->url;\n }", "public function getUrl() {\n if ($this->hasUrl()) {\n return $this->_getData('url');\n }\n $uri = $this->getUrlKey() . $this->getUrlSuffix();\n return $this->_getUrl($uri);\n }", "public static function getBaseUrl()\n\t{\n\t\tlist($host, $address, $port, $ssl) = MHTTPD::getServerInfo();\n\t\t$url = $ssl ? 'https://' : 'http://';\n\t\t$url .= $host.':'.$port;\n\t\treturn $url;\n\t}", "public static function getURL() {\n $url = self::getHost() . $_SERVER['REQUEST_URI'];\n return $url;\n }", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "function _getHellaspayUrl($method) {\r\n\r\n\t\t$url = $method->hellaspay_production == '1' ? $method->hellaspay_production_url : $method->hellaspay_test_url;\r\n\r\n\t\treturn $url;\r\n\t}", "public static function getBaseGatewayUrl()\n {\n $url = Configuration::getGlobalValue(PostFinanceCheckoutBasemodule::CK_BASE_URL);\n\n if ($url) {\n return rtrim($url, '/');\n }\n return 'https://app-wallee.com';\n }", "public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }", "public function getUrl() {\r\n\t}", "public function url(){\n $protocol = \"http://\";\n if ( !empty( $_SERVER['HTTPS'] ) ) {\n $protocol = \"https://\";\n }\n $url = $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n return $url;\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public function getUrl()\r\n\t{\r\n\t\treturn $this->url;\r\n\t}", "static public function getURL() {\n\t\treturn self::$url;\n\t}", "public function getServerUrl()\n { \n return $this->_shoptimallyDomain;\n }", "public function getMagentoConnectUrl() {\n\t\treturn Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'downloader/';\n\t}", "public function getUrl(): string {\n\t\treturn $this->_url;\n\t}", "public function get_url()\n {\n return $this->url;\n }", "public function getBaseUrl() {\n\t\treturn 'https://nextcloud.com';\n\t}" ]
[ "0.69210416", "0.6763063", "0.67624384", "0.6733926", "0.6671333", "0.66549116", "0.6622839", "0.6618206", "0.6618206", "0.65929484", "0.6585194", "0.65847343", "0.65831673", "0.65613675", "0.647551", "0.6462202", "0.64491826", "0.6438126", "0.6401041", "0.63978016", "0.63933223", "0.6375335", "0.6372988", "0.6368297", "0.6359519", "0.635215", "0.6351613", "0.63401216", "0.633759", "0.630991", "0.6286762", "0.6283385", "0.6278566", "0.62602365", "0.62536836", "0.62495035", "0.6243078", "0.6243078", "0.6243078", "0.6237007", "0.6233549", "0.62310165", "0.6225465", "0.62094426", "0.6209141", "0.620606", "0.6197201", "0.6192661", "0.619199", "0.6183507", "0.61720014", "0.6156657", "0.6152022", "0.6146135", "0.6141742", "0.6128262", "0.61281186", "0.61266273", "0.61266273", "0.61266273", "0.61266273", "0.61266273", "0.61266273", "0.61266273", "0.61266273", "0.61250174", "0.6118298", "0.6109047", "0.61080134", "0.6103682", "0.6099864", "0.6099682", "0.60947406", "0.6093931", "0.608892", "0.60864073", "0.6080728", "0.6077847", "0.6075065", "0.6075065", "0.6071371", "0.60661477", "0.6060736", "0.6059378", "0.6059142", "0.60541236", "0.60452086", "0.6044676", "0.6034228", "0.60309166", "0.6027697", "0.6022779", "0.6021954", "0.6016354", "0.6013542", "0.59993035", "0.59990245", "0.59966546", "0.59926224", "0.59882545", "0.5984343" ]
0.0
-1
return params for backend url
protected function getBackendUrlParams($store) { $params = array( 'login' => $this->getAccountUser($store), 'pwd' => $this->getAccountSignature($store), 'LANGUAGE'=> self::DEFAULT_INTRASHIP_LANGUAGE ); return http_build_query($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_url_params()\n {\n }", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "private function getParamsUrlFormat() {\n $urlParams = \"\";\n\n if ($this->getMethod() == 'GET') {\n $urlParams .= ($this->getPaging()) ? \n \"?_paging=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_return_as_object=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_max_results=\" . $this->getMaxResults() : \n \"\";\n }\n\n if ($this->getMethod() == 'POST') {\n $function = $this->getFuction();\n $urlParams .= (isset($function) and $function != \"\") ?\n \"?_function=\" . $this->getFuction() :\n \"\";\n }\n\n return $urlParams;\n }", "public function getUrlParameters() {\n\t\t$parameters = $this->parameters;\n\t\tif ($this->profile) {\n\t\t\t$parameters['profile'] = $this->profile;\n\t\t}\n\t\treturn $parameters;\n\t}", "public function get_query_params()\n {\n }", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "protected function _getUrlParams()\n {\n return array(\n '_store' => $this->getStore(),\n '_store_to_url' => true\n );\n }", "public function getQueryParams() {}", "public function queryParams();", "public function getRequestParams();", "public function getParameters()\n {\n $parameters = \"\";\n \n foreach($this->params as $param => $value)\n {\n $parameters .= urlencode($param.\"=\".$value).\";\"; \n }\n \n $parameters = trim($parameters, \";\");\n \n return($parameters);\n }", "private function getParameters()\n {\n $inputParametersStr = \"\";\n\n foreach ($_GET as $key => $input) {\n\n if(empty($input)){\n continue ; //ignore empty field \n }\n $inputParametersStr .= \"$key=\" . urlencode($input) . \"&\"; // convert string into url syntax.\n\n }\n $inputParametersStr = trim($inputParametersStr, '&'); // separate parameters by \"&\" .\n\n return $inputParametersStr ;\n }", "private function _getUrlParamsForFormAction() {\n\n $param = $this->params()->fromRoute('param');\n $param2 = $this->params()->fromRoute('param2');\n $value = $this->params()->fromRoute('value', 0);\n $value2 = $this->params()->fromRoute('value2', 0);\n\n $params = array(\n 'productId' => 0,\n 'categoryId' => 0,\n 'parentId' => 0\n );\n\n// $productId = $categoryId = null;\n// if ($param == \"product\") {\n// $productId = $value;\n// $categoryId = $value2;\n// } else if ($param == \"category\") {\n// $productId = $value2;\n// $categoryId = $value;\n// }\n\n switch ($param) {\n case 'product':\n $params['productId'] = $value;\n $params['categoryId'] = $value2;\n break;\n case 'category':\n $params['productId'] = $value2;\n $params['categoryId'] = $value;\n break;\n case 'parent':\n $params['parentId'] = $value;\n break;\n default:\n break;\n }\n\n return $params;\n }", "public function getUrlParams()\n {\n\n if ($this->gc_publish_all_albums != 1)\n {\n if (!unserialize($this->gc_publish_albums))\n {\n return;\n }\n }\n\n if (\\Input::get('items'))\n {\n //aktueller Albumalias\n $this->strAlbumalias = \\Input::get('items');\n\n //Authentifizierung bei vor Zugriff geschützten Alben, dh. der Benutzer bekommt, wenn nicht berechtigt, nur das Albumvorschaubild zu sehen.\n $this->authenticate($this->strAlbumalias);\n\n //fuer jw_imagerotator ajax-requests\n if (\\Input::get('jw_imagerotator'))\n {\n return;\n }\n }\n\n //wenn nur ein Album ausgewaehlt wurde und Weiterleitung in den Inhaltselementeinstellungen aktiviert wurde, wird weitergeleitet\n if ($this->doRedirectOnSingleAlbum())\n {\n $arrAlbId = unserialize($this->gc_publish_albums);\n if ($this->gc_publish_all_albums)\n {\n //if all albums are selected\n $objAlbum = $this->Database->prepare('SELECT alias FROM tl_gallery_creator_albums WHERE published=?')\n ->execute('1');\n }\n else\n {\n $objAlbum = $this->Database->prepare('SELECT alias FROM tl_gallery_creator_albums WHERE id=?')\n ->execute($arrAlbId[0]);\n }\n\n //Authentifizierung bei vor Zugriff geschützten Alben, dh. der Benutzer bekommt, wenn nicht berechtigt, nur das Albumvorschaubild zu sehen.\n $this->authenticate($objAlbum->alias);\n\n \\Input::setGet('items', $objAlbum->alias);\n $this->strAlbumalias = $objAlbum->alias;\n }\n\n // Get the Album Id\n if (\\Input::get('items'))\n {\n $objAlbum = \\GalleryCreatorAlbumsModel::findByAlias($this->strAlbumalias);\n if ($objAlbum !== null)\n {\n $this->intAlbumId = $objAlbum->id;\n $this->DETAIL_VIEW = true;\n }\n }\n }", "public function url_parameters()\n {\n return $this->_params;\n }", "function getParams()\n {\n }", "public function getURLQuery() {\n\t\t$query = array();\n\t\tif (Request::getGET('key')) {\n\t\t\t$query['key'] = Request::getGET('key');\n\t\t}\n\t\treturn $query;\n\t}", "public function getAdditionalParams()\n {\n return oxRegistry::get(\"oxUtilsUrl\")->processUrl('', false);\n }", "function getParams()\n {\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParams() {}", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getUrlParams() {\n\t\t\n\t\t$consumerParams = $this->getConsumerParams();\n\t\t$params = array();\n\t\t\n\t\tif (!empty($consumerParams)) {\n\t\t\t$wrapper = RublonSignatureWrapper::wrap(\n\t\t\t\t$this->getRublon()->getSecretKey(),\n\t\t\t\t$consumerParams\n\t\t\t);\n\t\t\t$params[self::FIELD_CONSUMER_PARAMS] = $wrapper;\n\t\t}\n\t\t\n\t\treturn $params;\n\t\t\n\t}", "public function get_url_get_parameters() {\r\n\t\treturn $this->url_get_parameters;\r\n\t}", "public function getParamsForUrl()\n {\n return array(\n 'restaurant_slug' => $this->getRestaurant()->getSlug(),\n 'locality_slug' => $this->getRestaurant()->getLocality()->getSlug(),\n 'country_slug' => $this->getRestaurant()->getCountry()->getSlug(),\n 'dish_slug' => $this->getSlug()\n );\n }", "public function getStoredQueryParams();", "protected function _getAddUrlParams()\n {\n if ($this->getListType() == \"search\") {\n return $this->getDynUrlParams();\n }\n }", "private function getUrl() {\n $parameters = array();\n $url = parse_url($_SERVER['REQUEST_URI']);\n foreach (explode(\"/\", $url['path']) as $p)\n if ($p != '')\n $parameters[] = $p;\n\n return $parameters;\n }", "public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }", "public function buildBackendUri() {}", "public function getServerParams() {}", "public static function getURLParams()\n\t{\n\t\t$params = [];\n\t\t$urlParams = self::getAllURLParams();\n\t\tfor ($i = contrlPos + 2; $i < count($urlParams); $i++) {\n\t\t\t$params[] = $urlParams[$i];\n\t\t}\n\t\treturn $params;\n\t}", "public function getParams()\n {\n $params = explode('/', $this->getPath());\n array_shift($params);\n return $params;\n }", "function _load_get_params(&$app, &$c) {\n\t\t$params =& $c->param('app.view_http.request.params');\n\t\tif (is_array($params)) {\n\t\t\tforeach($params as $p_name => $p_value) {\n\t\t\t\t$this->_http->addQueryString($p_name, $p_value);\n\t\t\t}\n\t\t}\n\t}", "final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }", "protected function getHttpParameters() {\n $glue = '&';\n $htmlParams = '';\n\n $parameters = $this->getParameters();\n foreach ($parameters as $name => $value) {\n $htmlParams .= $name . '=' . str_replace(' ', '+', $value) . $glue;\n }\n\n return substr($htmlParams, 0, -strlen($glue));\n }", "public static function params()\n\t{\n\t\treturn self::$router->getParams();\n\t}", "public function getUrlParameters()\n {\n return $this->urlParameters;\n }", "private static function getGetParams()\n\t{\n\t\treturn $_GET;\n\t}", "protected function getQueryParams() {\n\t\treturn $this->request->getQueryParams();\n\t}", "public function getUrlParameters()\n {\n // TODO: Implement getUrlParameters() method.\n }", "abstract public function getAuthUrlComponents();", "function getParams()\n{\n $queryParams = array();\n $params = filter_input_array(INPUT_GET);\n if ($params) {\n foreach (array('page', 'pageSize', 'orderBy', 'fields', 'searchId') as $term) {\n if (filter_input(INPUT_GET, $term)) {\n $queryParams[$term] = filter_input(INPUT_GET, $term);\n unset($params[$term]);\n }\n }\n \n $queryParams['filter'] = http_build_query($params, null, ':');\n }\n \n return $queryParams;\n}", "static function getParams(){\n\t\t\tif (count(self::$query)>0){\n\t\t\t\t//comprovar si és parell\n\t\t\t\tif((count(self::$query)%2)==0){\n\t\t\t\t\tCoder::codear(self::$query);\n\t\t\t\t\treturn self::$query;\n\n\t\t\t\t}else{\n\t\t\t\t\techo 'ERROR in params array';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "protected function getUrlParameters() {\n return $this->getAttributes();\n }", "protected function queryParameters()\n {\n return [\n 'app_id' => $this->accessKey,\n 'base' => $this->defaultCurrency,\n 'symbols' => collect($this->currencies())->implode(','),\n ];\n }", "public function getServerParams()\n {\n }", "public function getRouteParams();", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getParams(): array;", "public function urlArguments()\n {\n return [\n 'id' => $this->id,\n ];\n }", "public function get_params() {\n\t\treturn $this->params;\n\t}", "private function getQueryParams (): array\r\n {\r\n return $_GET;\r\n }", "public function getRequest()\r\n {\r\n return http_build_query($this->_params);\r\n }", "function current_request_with_params($params) {\n\t\t$all_params = $_GET;\n\t\tforeach ($params as $key => $value) {\n\t\t\t$all_params[$key] = $value;\n\t\t}\n\t\t$request = $_SERVER['REQUEST_URI'];\n\t\t$query = $_SERVER['QUERY_STRING'];\n\t\tif (strlen($query)) {\n\t\t\t$request = str_replace( $query, \"\", $request);\n\t\t}\n\t\t$sep = \"\";\n\t\tforeach ($all_params as $key => $value) {\n\t\t\t$request = $request . $sep;\n\t\t\t$sep = '&';\n\t\t\t$request = $request . $key . \"=\" . $value;\n\t\t}\n\n\t\treturn $request;\n\t}", "public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }", "public function getQueryParameters(): array;", "function getQueryParams()\n {\n $queryString = $_SERVER['QUERY_STRING'];\n $queryArray = explode('&', $queryString);\n $response = array();\n foreach ($queryArray as $query) {\n $query = explode('=', $query);\n $response[$query[0]] = $query[1];\n }\n return $response;\n }", "function getRouteParameters();", "private function getQueryString() : string\n {\n return http_build_query($this->parameters);\n }", "public function makeHTTPParameters()\n { \n $b =\"&\";\n $b.=\"label=\".$this->label.\"&\";\n $b.=\"isni=\".$this->isni.\"&\";\n $b.=\"edits_pending=\".$this->edits_pending.\"&\";\n $b.=\"created=\".$this->created.\"&\";\n return($b);\n\n\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "function get_params() {\r\n global $action;\r\n global $cur;\r\n\r\n // If action isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"action\"])) {\r\n $action = $_GET[\"action\"];\r\n } else {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // If cur isn't set, return a 2000 error, otherwise save it in a variable\r\n if (isset($_GET[\"cur\"])) {\r\n $cur = $_GET[\"cur\"];\r\n } else {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Check if the action is post, put or del otherwise throw a 2000 error\r\n $actions = [\"post\", \"put\", \"del\"]; \r\n if (!in_array($action, $actions)) {\r\n throw_error(2000, \"Action not recognized or is missing\");\r\n }\r\n // Check the format of the cur and throw a 2100 error if it is incorrect\r\n if (strlen($cur) != 3 || is_numeric($cur)) {\r\n throw_error(2100, \"Currency code in wrong format or is missing\");\r\n }\r\n\r\n // Cannot update the base currency so throw a 2400 error\r\n if (strtoupper($cur) == \"GBP\") {\r\n throw_error(2400, \"Cannot update base currency\");\r\n }\r\n }", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "public function getActionParams()\n\t{\n static $params = null;\n if($params === null)\n {\n if(isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'json'))\n $params = (array)CJSON::decode(Yii::app()->request->getRawBody());\n else\n {\n if($_SERVER['REQUEST_METHOD'] == 'GET')\n $params = $_GET;\n elseif($_SERVER['REQUEST_METHOD'] == 'POST')\n $params = $_POST;\n else\n $params = Yii::app()->request->getRestParams();\n }\n\n if(isset($_GET['id']))\n $params = array_merge(array('id' => $_GET['id']), $params);\n $_REQUEST = $params;\n }\n return $params;\n\t}", "public function getQueryStrParams ()\n {\n return $this->getParams(\"string\");\n }", "private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }", "public function queryString();", "protected function getUrlParamsString() {\n\t\treturn base64_encode(json_encode($this->getUrlParams()));\n\t}", "protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }", "public function getQueryString() {\n\t\t\n\t}", "protected function queryParameters()\n {\n return [\n 'access_key' => $this->accessKey,\n 'base' => $this->defaultCurrency,\n 'symbols' => implode(',', $this->currencies()),\n ];\n }", "function tep_get_all_get_params($exclude_array = '') {\n\tglobal $HTTP_GET_VARS;\n\tif (!is_array($exclude_array)) $exclude_array = array();\n\t$get_url = '';\n\tif (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {\n\t\treset($HTTP_GET_VARS);\n\t\twhile (list($key, $value) = each($HTTP_GET_VARS)) {\n\t\t\tif ( (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {\n\t\t\t\t$get_url .= rawurlencode(stripslashes($key)) . '=' . rawurlencode(stripslashes($value)) . '&';\n\t\t\t}\n\t\t}\n\t}\n\treturn $get_url;\n}", "public function getQueryParams()\n {\n $query = $this->getUrl(true)->getQuery();\n $params = [];\n if ($query) {\n parse_str($query, $params);\n }\n return array_merge($params, $this->queryParams);\n }", "public function get_json_params()\n {\n }", "public static function getParams()\n\t{\n\t\t$params = self::getPostParams();\n\t\tif ($params) {\n\t\t\treturn $params;\n\t\t}\n\t\t$params = self::getURLParams();\n\t\tif ($params) {\n\t\t\treturn $params;\n\t\t}\n\t\treturn self::getGetParams();\n\t}", "function getParams() {\n\t\treturn $this->params;\n\t}", "public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public static function queryParam($params='') {\n\t\t$url =''; // Added because PHP giving silent error of undefined variable\n\t\tforeach ($params as $key => $value) {\n\t\t\t$url .='&'.$key.'='.urlencode($value);\n\t\t}\n\t\treturn $url;\n\t}", "public function getEndpointParams(){\n\t\t#Explode current endpoint into parts\n\t\t$currentEndpointParts = explode(\"/\", $this->endpointURL);\n\t\t#Iterate\n\t\tforeach ($this->availableEndpoints as $endpointItem) {\n\t\t\t#Explode the possible endpoint match\n\t\t\t$itemParts = explode(\"/\", $endpointItem);\n\t\t\t#Check if count parts match, skip otherwise\n\t\t\tif(count($currentEndpointParts) != count($itemParts)) continue;\n\t\t\t#Prepare parts match flag\n\t\t\t$partsMatched = true;\n\t\t\t#Prepare resulting associative array\n\t\t\t$returnArray = [];\n\t\t\t#Check for each part\n\t\t\tforeach ($itemParts as $partIDX => $partTag) {\n\t\t\t\t#Flag to check if part is argument\n\t\t\t\t$partIsArg = preg_match(\"/^{[a-zA-Z0-9_-]+}$/\", $partTag);\n\t\t\t\t#Update flag\n\t\t\t\t$partsMatched = $partsMatched && ($partIsArg ? 1 : ($partTag == $currentEndpointParts[$partIDX]));\n\t\t\t\t#Skip next checks if didn't matched\n\t\t\t\tif(!$partsMatched) break;\n\t\t\t\t#Insert into result\n\t\t\t\t$returnArray[str_replace([\"{\",\"}\"], \"\", $partTag)] = $currentEndpointParts[$partIDX];\n\t\t\t}\n\t\t\t#If matched return item data (an associative array with the named endpoint parts being the keys and the requested endpoint parts being the values)\n\t\t\tif($partsMatched) return $returnArray;\n\t\t}\n\t\t#Fallback return empty\n\t\treturn [];\n\t}", "public function get_query_args()\n {\n }", "public function get_query_args()\n {\n }", "public function get_query_args()\n {\n }", "public function get_query_args()\n {\n }", "public function getParams(){\n return $this->params;\n }", "public function asUrlParam()\n {\n return http_build_query([\n 'startDate' => $this->startDate,\n 'startWeight' => $this->startWeight,\n 'weight' => $this->weight,\n ]);\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function get_requestUrlExParams()\n {\n return $this->requestUrlExParams;\n }" ]
[ "0.735974", "0.7276264", "0.7175902", "0.6839948", "0.6797744", "0.6700997", "0.669639", "0.6686571", "0.6686517", "0.6662519", "0.6636254", "0.6627931", "0.6594784", "0.65609044", "0.65454626", "0.65325505", "0.6524946", "0.6498709", "0.6497084", "0.64862615", "0.64862615", "0.64585954", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.64527386", "0.6431564", "0.6425933", "0.6404589", "0.6395049", "0.6362074", "0.6360525", "0.6340541", "0.6337503", "0.6309968", "0.6302175", "0.62773913", "0.62681526", "0.6263737", "0.6241982", "0.62192476", "0.6211048", "0.62007767", "0.619333", "0.619083", "0.6185017", "0.61522704", "0.6137636", "0.61334115", "0.6113173", "0.610814", "0.6092654", "0.6085747", "0.6069074", "0.6064958", "0.6058456", "0.60542727", "0.6046559", "0.60426056", "0.60192627", "0.60155016", "0.6013345", "0.597979", "0.59782976", "0.59781796", "0.597011", "0.5963445", "0.5959845", "0.5959007", "0.59458584", "0.59429586", "0.59420156", "0.5941772", "0.5930472", "0.59286577", "0.59231144", "0.5908542", "0.5904511", "0.5904481", "0.5882356", "0.58767587", "0.5873909", "0.5869186", "0.58672214", "0.58610827", "0.58608425", "0.5851009", "0.5851009", "0.5851009", "0.5851009", "0.5849302", "0.58470917", "0.5846771", "0.58410954" ]
0.7415849
0
Obtain the Intraship web service endpoint. $param mixed $store
public function getWebserviceEndpoint($store = null, $production = null) { if (false === $production) { return $this->getConfig('url/endpoint_sandbox', $store); } if (true === $production) { return $this->getConfig('url/endpoint_production', $store); } // production parameter not given, check test mode setting if ($this->isTestmode($store)) { return $this->getConfig('url/endpoint_sandbox', $store); } return $this->getConfig('url/endpoint_production', $store); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEndpoint();", "public function getEndpoint();", "public function getEndpoint();", "abstract protected function getEndpoint($ip);", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "protected function getEndpoint()\n {\n return 'IntraLibrary-XSearch';\n }", "public function website($store = null);", "public function getEndpoint($resource_type_id, $safe=TRUE, $skip_cache=FALSE);", "protected function getEndpoint() {\n $endpoint = isset($this->options['store_endpoint']) ? $this->options['store_endpoint'] : $this->options['store_key'] . '.' . BenchmarkArchiverAzure::DEFAULT_AZURE_ENDPOINT_PREFIX;\n if (!preg_match('/^http/', $endpoint)) $endpoint = isset($this->options['store_insecure']) && $this->options['store_insecure'] ? 'http://' : 'https://' . $endpoint;\n\n return $endpoint;\n }", "protected function endpoint($type) {\n\n // Get the endpoint from the parent.\n $endpoint = parent::endpoint($type);\n\n // For get and set calls, we append \"properties\" to the endpoint.\n if ($this->id && in_array($type, array('get', 'set'))) {\n $endpoint .= '/properties';\n }\n\n // Return the endpoint.\n return $endpoint;\n }", "public function getApiEndpoint();", "public function getUrlSOAP(){\r\n\t\treturn $this->soap;\r\n\t}", "public function get($store)\n {\n // TODO: Implement get() method.\n }", "public static function endpoint() {\n\t\treturn ( self::$_cache['environment'] == 'sandbox' ) ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp';\n\t}", "public function getEndpoint()\n {\n return 'http://gw.api.alibaba.com/openapi/param2/2/portals.open/';\n }", "public function indexAction() : object\n {\n $title = \"IP Geo\";\n $page = $this->di->get(\"page\");\n\n // $ip = $_SERVER['HTTP_CLIENT_IP'];\n // $client_ip = $_SERVER['REMOTE_ADDR'] ?? \"127.0.0.1\";\n $client_ip = $this->di->get(\"request\")->getServer(\"REMOTE_ADDR\", \"127.0.0.1\");\n\n \n\n // $module = new IpModule();\n\n // $info = $module->getGeoInfo($ip);\n\n // $info = $_SERVER;\n\n // $ip = $this->di->session->get(\"ip\") ?? null;\n // $result = $this->di->session->get(\"result\") ?? null;\n // $hostname = $this->di->session->get(\"hostname\") ?? null;\n\n\n// http://api.ipstack.com/158.174.140.127?access_key=ceb8dbb476fc421d779317551864704e\n\n// echo 'User IP - '.$_SERVER['REMOTE_ADDR'];\n\n $data = [\n \"client_ip\" => $client_ip,\n // \"result\" => $result,\n // \"hostname\" => $hostname\n ];\n\n $page->add(\"ip/geo\", $data);\n // $page->add(\"ip/validate\");\n\n return $page->render([\n \"title\" => $title\n ]);\n }", "public static function endpoint(){\n\n return config('alpaca.live_mode') ? config('alpaca.live_endpoint') : config('alpaca.paper_endpoint');\n }", "private function getEndpointUrl($region)\n {\n $endpoints = new Endpoints();\n return $endpoints->getAddStoreEndpoint($region);\n }", "public function indexActionGet() : object\n {\n $title = \"IP Check tool\";\n\n $page = $this->di->get(\"page\");\n\n $page->add(\"ip/form\", []);\n\n return $page->render([\n \"title\" => $title,\n ]);\n }", "public function getEndpoint() {\n\t\treturn \"http://vamps.tw.rpi.edu/virtuoso/sparql\";\n\t}", "public function getEndpoint(): string\n {\n return $this->endpoint;\n }", "public function ipnAction() {\n $paymentService = $this->get('e2w_payment_service');\n $paymentService->ipnRequest($this->get('request')->request);\n die();\n }", "public function index(Store $store)\n {\n return redirect()->route('stores.show', $store);\n }", "protected function getEndpoint()\n {\n return\n 'https://secure.na.tnspayments.com/api/rest/version/' . self::TNSPAY_API_VERSION_NUMBER .\n '/merchant/' . $this->getMerchantId() .\n '/order/' . $this->getTransactionId() .\n '/transaction/' . $this->getTransactionId();\n }", "public function getServiceEndpoint()\r\n {\r\n // return static::SERVICE_TESTING_URL;\r\n return static::SERVICE_PRODUCTION_URL;\r\n }", "function getServiceAddress();", "abstract protected function getElisServiceUrl();", "private function GetEndpoint($endpoint, $server = NULL, $params = NULL) {\n $endpoint = UrlUtils::AddParamsToUrl($endpoint, $params);\n if (!empty($server)) {\n $endpoint = UrlUtils::ReplaceServerInUrl($endpoint, $server);\n }\n return $endpoint;\n }", "private function getServiceUrl()\n {\n $store = $this->storeRepository->getById($this->storeManager->getStore()->getId());\n return $this->url->getUrl(\n $this->service . \"/\" . $store->getCode() . \"/\" . $this->version\n );\n }", "public function getEndpoint() \n {\n return $this->endpoint;\n }", "private function GetEndpoint($endpoint, $params = NULL) {\n $endpoint = UrlUtils::AddParamsToUrl($endpoint, $params);\n if (!empty($this->server)) {\n $endpoint = UrlUtils::ReplaceServerInUrl($endpoint, $this->server);\n }\n return $endpoint;\n }", "public function getEndpoint() {\n return $this->endpoint;\n }", "public function setStoreId($store);", "public function apiGetRequest($endpoint);", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "private function endpoint( $endpoint )\n {\n return ($this->api) ?\n vsprintf(\"%s/%s\",[$this->api_prefix, trim($endpoint,\"/\")]) :\n $endpoint;\n }", "public function getStoreInfo( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getSingleStoreDetail( $params );\n }else{\n return $this->starrtecPosApiHandler->getSingleStoreDetail( $params );\n }//..... end if-else() .....//\n }", "public function edit(Store $store)\n {\n //\n }", "public function edit(Store $store)\n {\n //\n }", "function getValue(DataStore $p_store)\n {\n $l_data=[];\n foreach($this->parameters as $l_name=>$l_parameter){\n $l_data[$l_name]=$l_parameter->getValue($p_store);\n }\n $l_route=$this->route->getValue($p_store);\n return route($l_route,$l_data);\n }", "public function IpnAction()\n {\n $this->log(\"----------- IPN request validation ------------\");\n if (!$this->getRequest()->isPost()) {\n $this->log(\"skip none POST requests\");\n return $this->returnForbidden();\n }\n $ip = long2ip(Mage::helper('core/http')->getRemoteAddr(true));\n $this->log(\"Start IPN request validation\");\n $this->log(\"IP Address of the sender {$ip}\");\n\n /* start to validate the signature */\n $request = $this->getRequest();\n $payload = $request->getRawBody();\n $public_key = $request->getHeader(\"API-Key\");\n $nonce = $request->getHeader(\"API-Nonce\");\n $request_signature = $request->getHeader(\"API-Sign\");\n //$this->log(\"API-KEY:{$public_key}\");\n //$this->log(\"API-Nonce:{$nonce}\");\n //$this->log(\"API-Sign:{$request_signature}\");\n $this->log(\"Received payload: \" . $payload);\n\n if (!$public_key || !$nonce || !$request_signature || !$payload) {\n $this->log(\"Credentials missing. Exiting.\");\n return $this->returnForbidden();\n }\n\n $private_key = Mage::helper('core')->decrypt(\n Mage::getModel(\"bitcoin/bitcoin\")->getConfiguration(\"private_key\")\n );\n $url = Mage::helper('core/url')->getCurrentUrl();\n $this->log(\"CURRENT IPN URL IS : \" .$url);\n\n $message = $nonce . $url . $payload;\n $current_signature = hash_hmac(\"sha256\", $message, $private_key, false);\n $this->log(\"Calculated signature: \" . $current_signature);\n\n if ($request_signature <> $current_signature) {\n $this->log(\"IPN VALIDATION FAILED\");\n $this->log(\"Returning 'page not found'\");\n $this->log(\"Your payment data is still safe\");\n $this->log(\"----------- IPN request processing will be skipped -----------\");\n return $this->returnForbidden();\n }\n $this->log(\"IPN signature validation succeeded\");\n /* end of validate the signature */\n /* by this the request has passed validation */\n try {\n /* need to check the ip address of the source from a whitelist list of ips , otherwise this might be used illegaly to update orders */\n $this->log(\"----------- IPN request processing ------------\");\n $id = base64_decode($this->getRequest()->getParam(\"id\"));\n //$data = file_get_contents('php://input');\n $body = json_decode($payload, true);\n //$this->log(\"current Id is: {$id}\");\n $this->log(\"Received payload: \" . $payload, $body[\"id\"]);\n $url = $body[\"url\"];\n $invoice_id = $body[\"id\"];\n /* simple validation check | might be changed later */\n $collection = Mage::getModel(\"bitcoin/ipn\")\n ->getCollection()\n ->getSelect()\n ->where(\"quote_id = ? OR order_id = ?\", $id)\n ->where(\"invoice_id =?\", $invoice_id);\n $yellow_log = $collection->query()->fetchAll();\n $from_order = $from_quote = false;\n if (count($yellow_log) == 1) {\n if ($yellow_log[0][\"quote_id\"] === $id) {\n $from_quote = true;\n $from_order = false;\n //$this->log(\"its a quote\", $body[\"id\"]);\n } elseif ($yellow_log[0][\"order_id\"] === $id) {\n $from_quote = false;\n $from_order = true;\n //$this->log(\"its an order\", $body[\"id\"]);\n }\n } else {\n $this->log(\"URL validation failed: {$url}\");\n $this->log(\"----------- IPN request processing will be skipped -----------\", $body[\"id\"]);\n return $this->_forward(\"no-route\");\n }\n if ($from_order) {\n $order = Mage::getModel('sales/order')->load($id);\n }\n if ($from_quote) {\n $order = Mage::getModel('sales/order')->load($id, \"quote_id\");\n }\n /* skip quote + authorizing state because the order hasn't been placed yet */\n if ($from_quote && $body[\"status\"] === \"authorizing\") {\n $this->log(\n \"Quote id {$id} will be skipped because the order hasn't been placed yet. IPN status: {$body[\"status\"]}\",\n $body[\"id\"]\n );\n echo json_encode(array(\"message\" => \"skipped\"));\n $this->log(\"----------- IPN request processing will be skipped -----------\", $body[\"id\"]);\n return;\n }\n if ($order->getPayment() instanceof Yellow_Bitcoin_Model_Bitcoin) {\n $payment = $order->getPayment()->getMethodInstance();\n if (!$order || $payment->getCode() <> \"bitcoin\" || $order->getState() <> Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW\n ) {\n $this->log(\"Either this order is not paid via Yellow, or it has an unallowed state\", $body[\"id\"]);\n $this->log(\"----------- IPN request processing will be skipped -----------\", $body[\"id\"]);\n return $this->_forward(\"no-route\");\n }\n }\n $this->log(\" invoice status : {$body[\"status\"]}\", $body[\"id\"]);\n switch ($body['status']) {\n case 'paid':\n $status = Mage::getModel(\"bitcoin/bitcoin\")->getSuccessStatus();\n $status_message = \"Payment confirmation received. Invoice Id: \" . $body['id']; // $invoice[\"message\"];\n $commentHistory = $order->addStatusHistoryComment($status_message,$status);\n $commentHistory->setIsVisibleOnFront(1);\n $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);\n $order->sendNewOrderEmail();\n $order->save();\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsPaid($body[\"id\"]);\n /* create an invoice */\n $invoiceModel = Mage::getModel('sales/order_invoice_api');\n $invoice_id = $invoiceModel->create($order->getIncrementId(), array());\n $invoiceModel->capture($invoice_id);\n $this->log(\"Magento Invoice created!\", $body[\"id\"]);\n break;\n case 'reissue':\n $status = Mage::getModel(\"bitcoin/bitcoin\")->getSuccessStatus(); /// this must bn changed when we had reissue / renew payment ready\n $status_message = \"Client re-issued the invoice. Invoice Id: \" . $body['id']; // $invoice[\"message\"];\n $commentHistory = $order->addStatusHistoryComment($status_message,$status);\n $commentHistory->setIsVisibleOnFront(1);\n $order->save();\n break;\n case 'partial':\n $status = Mage::getModel(\"bitcoin/bitcoin\")->getSuccessStatus(); /// this must bn changed when we had partial payment ready\n $status_message = \"Client made a partial payment. Invoice Id: \" . $body['id']; // $invoice[\"message\"];\n $commentHistory = $order->addStatusHistoryComment($status_message,$status);\n $commentHistory->setIsVisibleOnFront(1);\n $order->save();\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsPartial($body[\"id\"]);\n break;\n case 'failed':\n case 'invalid':\n $status = Mage::getModel(\"bitcoin/bitcoin\")->getFailedStatus();\n $status_message = \"Client failed to pay. Invoice Id: \" . $body['id']; // $invoice[\"message\"];\n $commentHistory = $order->addStatusHistoryComment($status_message,$status);\n $commentHistory->setIsVisibleOnFront(1);\n $order->setState(Mage_Sales_Model_Order::STATE_HOLDED);\n $order->cancel();\n $order->save();\n break;\n /// its just a new invoice | authorizing , I will never expect a post with new status , though I had created the block of it\n case 'authorizing':\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsAuthorizing($body[\"id\"]);\n break;\n case 'expired':\n /* this to update the ipn table when invoice expired */\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsExpired($body[\"id\"]);\n break;\n case 'refund_owed':\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsRefundOwed($body[\"id\"]);\n break;\n case 'refund_requested':\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsRefundRequested($body[\"id\"]);\n break;\n case 'refund_paid':\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsRefundPaid($body[\"id\"]);\n break;\n case 'new':\n default:\n /// @todo : we need to log here\n break;\n }\n echo json_encode(array(\"message\" => \"done\"));\n $this->log(\"----------- IPN request processing complete -----------\", $body[\"id\"]);\n\n } catch (\\Exception $e) {\n $this->log(\"EXCEPTION:\" . $e->getMessage . \"|\" . $e->getLine(), $body[\"id\"]);\n }\n }", "public function show(IP $iP, Request $request)\n {\n // Save client's IP address to the database\n $clientIP = new IP;\n $clientIP->IPAddress = $request->ip();\n $clientIP->save();\n // Return the client's IP address\n echo json_encode([\"IPAddress\"=> $request->ip()]);\n }", "public function show(Store $store)\n {\n //\n }", "public function show(Store $store)\n {\n //\n }", "public function show(Store $store)\n {\n //\n }", "public function getEndpoint() {\n return Mage::helper(\"cloudiq_core/config\")->getCloudiqApiUrl();\n }", "private function type($type) {\n\t\t$t = $this->api_map[$type];\n\t\t$t[\"url\"] = $this->get(\"store_url\") . $t[\"url\"] . \"?api_key=\".$this->get(\"api_key\");\n\t\treturn $t;\n\t}", "public function getStoreId()\n {\n return $this->getRequest()->getParam('store_id');\n }", "private static function get_endpoint() {\n\t\treturn tvd_get_service_endpoint() . '/pdf-from-url';\n\t}", "public function testIndexActionGetLocalIp()\n {\n $request = $this->di->get(\"request\");\n $request->setGet(\"ip\", \"10.0.0.1\");\n\n\n $res = $this->controller->indexActionGet();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertContains(\"Ingen väderinformation tillgänglig\", $body);\n }", "function get_client_ip($uri = '', $protocol = NULL)\n\t{\n\t\treturn get_instance()->config->site_url($uri, $protocol);\n\t}", "public function add_store($store)\n {\n }", "public function getUrlWebService() {\r\n\r\n if(strstr($_SERVER['HTTP_HOST'], 'hom1')) {\r\n $valregoid = 6;\r\n $valtpvoid = 3;\r\n }\r\n elseif(strstr($_SERVER['HTTP_HOST'], 'intranet')) {\r\n $valregoid = 7;\r\n $valtpvoid = 3;\r\n }\r\n else {\r\n $valregoid = 6;\r\n $valtpvoid = 3;\r\n }\r\n\r\n $sql = \"\r\n SELECT \r\n valvalor\r\n FROM\r\n valor\r\n WHERE\r\n valregoid = $valregoid\r\n AND \r\n valtpvoid = $valtpvoid\";\r\n\r\n $result = $this->_fetchAssoc(pg_query($this->_adapter, $sql));\r\n\r\n return $result['valvalor']; \r\n }", "public function getByUuid(string $storeUuid): StoreIntegrationInterface;", "function df_store_url($s, $type) {return df_store($s)->getBaseUrl($type);}", "public function get($endpoint = '', $query=[], $body='');", "private static function getEndPoint() : string\n {\n return self::$endpoints[self::$selectedEndpoint];\n }", "public function getEndPoint(): string\n {\n return $this->endpoint;\n }", "public function getStoreId();", "public function getStoreId();", "public function getStoreId();", "public function getNotifyUrl($storeId = null)\n {\n return $this->_getUrl('paypal/ipn', $storeId);\n }", "public function transactionFormGetActionURI ();", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function indexAction() : object\n {\n $title = \"IP\";\n\n $page = $this->di->get(\"page\");\n\n $page->add(\"json/verify\");\n\n return $page->render([\n \"title\" => $title,\n ]);\n }", "protected function getBackendUrlParams($store)\n {\n $params = array(\n 'login' => $this->getAccountUser($store),\n 'pwd' => $this->getAccountSignature($store),\n 'LANGUAGE'=> self::DEFAULT_INTRASHIP_LANGUAGE\n );\n return http_build_query($params);\n }", "function queryURL($xri, $service_type = null)\n {\n $qxri = substr(Auth_Yadis_toURINormal($xri), 6);\n $hxri = $this->proxy_url . $qxri;\n $args = array(\n '_xrd_r' => 'application/xrds+xml'\n );\n\n if ($service_type) {\n $args['_xrd_t'] = $service_type;\n } else {\n // Don't perform service endpoint selection.\n $args['_xrd_r'] .= ';sep=false';\n }\n\n $query = Auth_Yadis_XRIAppendArgs($hxri, $args);\n return $query;\n }", "public function getIpInfo()\n {\n $this->checkAjaxToken();\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('Ztools::', '::', ACCESS_OVERVIEW));\n\n $ip_adr = $this->request->request->get('ip_adr', '');\n $alert = '';\n $content = '';\n \n if (!$ip_adr) {\n $alert .= $this->__('No IP passed.');\n } else {\n ob_start();\n $serviceName = 'ipinfo.io';\n $serviceLinks = 'http://ipinfo.io/' . $ip_adr; // to pass to tpl for visiting site\n @readfile('http://ipinfo.io/' . $ip_adr . '/json');\n $json = ob_get_contents();\n ob_end_clean();\n if ($json) {\n try {\n $item = json_decode($json, true);\n if (false) {\n ob_start();\n pr($item);\n $content .= ob_get_contents();\n ob_end_clean();\n } else {\n if (is_array($item)) {\n // Standardize output\n $item_s = array();\n $item_s['ip'] = isset($item['ip']) ? $item['ip'] : '';\n $item_s['hostname'] = isset($item['hostname']) ? $item['hostname'] : '';\n $item_s['city'] = isset($item['city']) ? $item['city'] : '';\n $item_s['region'] = isset($item['region']) ? $item['region'] : '';\n $item_s['country_code'] = isset($item['country']) ? $item['country'] : '';\n $item_s['country_name'] = (isset($item['country']) && $item['country']) ? ZLanguage::getCountryName($item['country']) : '';\n $item_s['latitude'] = '';\n $item_s['longitude'] = '';\n if (isset($item['loc']) && $item['loc']) {\n $aLatLong = explode(',', $item['loc']);\n if (is_array($aLatLong)) {\n $item_s['latitude'] = $aLatLong[0];\n $item_s['longitude'] = $aLatLong[1];\n }\n }\n $item_s['org'] = isset($item['org']) ? $item['org'] : '';\n // Generate output\n Zikula_AbstractController::configureView();\n $this->view->assign('item', $item_s);\n $this->view->assign('serviceName', $serviceName);\n $this->view->assign('serviceLinks', $serviceLinks);\n $content .= $this->view->fetch('admin/ipinfo.tpl');\n }\n }\n } catch (Exception $e) {\n $content .= $e->getMessage();\n } \n } else {\n $alert .= $this->__f('Could not get info.');\n }\n }\n\n return new Zikula_Response_Ajax(array('ip' => $ip_adr, 'content' => $content, 'alert' => $alert));\n }", "public function pullAPI($storeNumber, $start, $end) {\n\t\t$data = array(\n\t\t\t'ShortCode' => $storeNumber,\n\t\t\t'StartDate' => $start,\n\t\t\t'EndDate' => $end,\n\t\t\t'OffSetValue' => \"0\"\n\t\t);\n\n\t\t$data = json_encode($data);\n\t\t$url = 'https://api.safaricom.co.ke/pulltransactions/v1/query';\n\n\t\treturn $this->submitRequest($url, $data);\n\t}", "function serviceUrl($serviceId, $type='ajax', $params = array( ), $ampersand='&') {\n $params['SID'] = $serviceId;\n // receive simplified result in case of AJAX. There is no error info in result.\n if ($type == 'ajax.full')\n $type = 'ajax';\n elseif ($type == 'ajax.text') {\n $type = 'ajax';\n $params['FORMAT'] = 'text';\n }elseif ($type == 'ajax') {\n $type = 'ajax';\n $params['SIMPLIFIED'] = 1;\n }\n \n return url('/Core/service/'.$type, $params, $ampersand);\n}", "public function getEndpoint()\n {\n if ($this->merchant_id) {\n return $this->endpoint.\"/{$this->merchant_id}\";\n }\n\n return $this->endpoint;\n }", "public function testIndexActionGetNoIp()\n {\n $request = $this->di->get(\"request\");\n $request->setGet(\"ip\", \"\");\n\n\n $res = $this->controller->indexActionGet();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertNotContains(\"is not a valid IP\", $body);\n }", "public function user($store = null);", "public function getEndpoints($safe=TRUE, $skip_cache=FALSE);", "public function index( Store $store ) : JsonResponse\n {\n return $this -> theRepository -> index( $store );\n }", "public function get(string $service = '');", "abstract protected function getService();", "public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }", "function add_endpoint_trigger( $vars ) {\n\t\t$vars[] = 'pt_endpoint';\n\t\t$vars[] = 'ptgetinfo';\n\t\treturn $vars;\n\n\t}", "public function get($endpoint, array $options = []);", "public static function getBaseEndpoint()\n {\n return self::$base_endpoint;\n }", "public function url()\n {\n return '/services';\n }", "public function getWebService()\n {\n return $this->webService;\n }", "private function getRefreshedEndpoint() {\n $this->endpoint = $this->profile->getHttpProfile()->getEndpoint();\n if ($this->endpoint === null) {\n $this->endpoint = $this->service.\".\".$this->profile->getHttpProfile()->getRootDomain();\n }\n return $this->endpoint;\n }", "public function index(Request $request,Store $store_model)\n {\n $store_verify = 3;\n // 店铺名称\n if(empty($request->store_name)){\n $store_model->where('store_name','like','%'.$request->store_name.'%');\n }\n // 申请公司名称\n if(empty($request->store_company_name)){\n $store_model->where('store_company_name','like','%'.$request->store_company_name.'%');\n }\n // 审核状态\n if(isset($request->store_verify)){\n $store_verify = $request->store_verify;\n }\n $list = new StoreCollection($store_model->where('store_verify',$store_verify)->orderBy('id','desc')->paginate($request->per_page??30));\n return $this->success($list);\n }", "function endpoint_trigger_check() {\n\t\tif ( intval( get_query_var( 'pt_endpoint' ) ) == 1 ) {\n\t\t\t//do our plugin endpoint code\n\t\t\tob_start();\n\t\t\t$this->process_request();\n\t\t\texit();\n\t\t}\n\t}", "public function getResourceEndpoint(): string\r\n {\r\n return \"/v1/user/\" . $this->userIdentifier . \"/monetary-account/\" . $this->monetaryAccountId . \"/request-inquiry\";\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}", "public function getWebservice()\n {\n return $this->webservice;\n }", "public function getIssueEndpointUrl(IssueWrapper $issue)\n {\n\n }", "public function getPostalServices()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Postal Service (Linnworks API)');\n\t\t}", "public function getBaseSoapUrl()\n {\n return $this->parameters['hipay.baseSoapUrl'];\n }" ]
[ "0.57673305", "0.57673305", "0.57673305", "0.57421285", "0.5580998", "0.5580998", "0.5580998", "0.5580998", "0.53520745", "0.5289357", "0.51348364", "0.5115903", "0.5087491", "0.506909", "0.5061478", "0.50553876", "0.50403607", "0.4959023", "0.49221715", "0.489617", "0.48948592", "0.4885254", "0.48685881", "0.48639947", "0.48491222", "0.48080388", "0.4785484", "0.4778967", "0.47583094", "0.47482827", "0.47285295", "0.47237372", "0.47177997", "0.4701027", "0.46826628", "0.46659783", "0.46629116", "0.4661478", "0.4661478", "0.4661478", "0.4661478", "0.4661478", "0.4661478", "0.46372622", "0.4635457", "0.46287903", "0.46287903", "0.46283057", "0.46198693", "0.4608947", "0.4608252", "0.4608252", "0.4608252", "0.46015114", "0.45915455", "0.45706064", "0.45654312", "0.4554926", "0.45435566", "0.4513159", "0.45117044", "0.45048636", "0.45019782", "0.4498777", "0.44915673", "0.44860208", "0.44778317", "0.44778317", "0.44778317", "0.44579288", "0.4453315", "0.44458792", "0.44399887", "0.4429947", "0.44266817", "0.4416569", "0.44081149", "0.4406546", "0.43961987", "0.43954816", "0.43936166", "0.43777463", "0.43636385", "0.4361723", "0.43546584", "0.43525428", "0.43435603", "0.43397805", "0.4338183", "0.43379724", "0.43306264", "0.43303728", "0.4329506", "0.43261647", "0.4322522", "0.4319457", "0.4318594", "0.4316988", "0.4306259", "0.43055692" ]
0.4980921
17
Obtain application wide HTTP Basic auth credentials (username)
public function getWebserviceAuthUsername() { return $this->getConfig('webservice/auth_username'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public function getBasicAuth()\n {\n return $this->basicAuth;\n }", "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public function getBasicAuthUsername() {\n\t\treturn $this->selectedEndpoint['basic_auth_username'];\n\t}", "protected function parseBasic()\n {\n return [\n 'username' => input()->server('PHP_AUTH_USER'),\n 'password' => input()->server('PHP_AUTH_PW'),\n ];\n }", "function _set_basic_auth(&$app, &$c) {\n\t\t$u = $c->param('app.view_http.request.auth.username');\n\t\t$p = $c->param('app.view_http.request.auth.password');\n\t\tif ($u && $p)\n\t\t\t$this->_http->setBasicAuth($u, $p);\n\t}", "function http_auth_headers() {\n\t\tif($this->http_user || $this->http_pass):\n\t\t\t$this->http_headers_add('Authorization', \" Basic \".base64_encode($this->http_user . \":\" . $this->http_pass));\n\t\tendif;\n\t}", "public function testBasicGET_withBasicAuth()\n\t{\n\t\t$Request = new Request(new URL('http://user:password@' . self::TESTHOST . '/basicAuth.php'), null, null, $this->_getDefaultOptions());\n\n\t\t// Return the body as StringValue\n\t\t$result = $Request->getResponseAs(new StringValue());\n\t\t$this->assertEquals('OK', $result);\n\n\t\t$Request = new Request(new URL('http://user:WRONGpassword@' . self::TESTHOST . '/basicAuth.php'));\n\n\t\t// Return the body as StringValue\n\t\t$result = $Request->getResponseAs(new StringValue());\n\t\t$this->assertEquals('Unknown password/user', $result);\n\n\t}", "public function prepareBasicAuth()\n {\n $authString = base64_encode( $this->options['username'] . ':' . $this->options['password'] );\n\n $this->options['headers']['Authorization'] = \"Basic {$authString}\";\n }", "private function getCredentials()\n {\n $basic = base64_encode(Settings::$username . ':' . Settings::$password);\n// $basic = base64_encode($this->user_id . ':' . $this->password);\n return $basic;\n }", "public function getBasicAuthPassword() {\n\t\treturn $this->selectedEndpoint['basic_auth_password'];\n\t}", "function set_auth_basic($username, $password)\n {\n \\Mutex::lock($this->mutex);\n $this->auth_basic_user = $username;\n $this->auth_basic_pass = $password;\n \\Mutex::unlock($this->mutex);\n }", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "function wp_populate_basic_auth_from_authorization_header()\n {\n }", "function http_require_auth() {\n\theader('WWW-Authenticate: Basic realm=\"HTTP Authentication System\"');\n\theader('HTTP/1.0 401 Unauthorized');\n\techo \"You must enter a valid login ID and password to access this resource\\n\";\n\texit;\n}", "public function require_http_basic_auth() {\n\t\t// If authentication data was sent\n\t\tif ( is_null( $this->get_php_auth()->username ) || is_null( $this->get_php_auth()->password ) ) {\n\t\t\tthrow new HTTPBasicUnauthorized();\n\t\t}\n\n\t\treturn true;\n\t}", "function authenticate() {\n //this would be for hard-coded username/password, sometimes useful if you \n //don't have a database\n //echo $_SERVER[\"PHP_AUTH_USER\"] . \"<BR>\";\n if ((isset($_SERVER[\"PHP_AUTH_USER\"]) && ($_SERVER['PHP_AUTH_USER'] == 'client') &&\n isset($_SERVER['PHP_AUTH_PW']) && ($_SERVER[\"PHP_AUTH_PW\"] == 'secret'))) {\n header('HTTP/1.0 200 OK'); //all is good!\n } else {\n -\n //don't let them in!\n header('WWW-Authenticate: Basic realm=\"Test Authentication System\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"You must enter a valid login ID and password to access this resource\\n\";\n }\n exit; //stop execution of the program so we don't get any more errors\n}", "private function promptBasic() {\n $this->debugPrint('Prompting user (BASIC)...');\n\n\n header(\"WWW-Authenticate: Basic realm=\\\"{$this->realm}\\\"\");\n header('HTTP/1.0 401 Unauthorized');\n\n /* This is sent if the user cancels */\n if ($this->redirect_on_failure) {\n echo <<<EOF\n <html>\n <meta http-equiv=\"refresh\" content=\"0; url={$this->redirect_on_failure_url}?error=1\" />\n <body><h2>{$this->fail_text}</h2></body>\n </html>\nEOF;\n } else {\n echo \"<html><body><h2>{$this->fail_text}</h2></body></html>\";\n }\n exit();\n }", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpOpenSIPsException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = array();\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }", "public function getAuthorizationBasic()\n {\n if ( ! empty($this->key) && ! empty($this->secret)) {\n $key = rawurlencode($this->key);\n $secret = rawurlencode($this->secret);\n\n return 'Basic ' . base64_encode($key . ':' . $secret);\n }\n\n return false;\n }", "private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpSIPException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }", "function setCredentials( $username, $password )\r\n\t{\r\n\t\t$hdrvalue = base64_encode( \"$username:$password\" );\r\n\t\t$this->addHeader( \"Authorization\", \"Basic $hdrvalue\" );\r\n\t}", "public function GetAllowBasicAuth () {\n\t\treturn $this->allowBasicAuth;\n\t}", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "public function authentication_header() {\n return 'Proxy-Authorization: Basic ' . base64_encode($this->authentication());\n }", "function json_basic_auth_handler( $user ) {\n\treturn 1;\n}", "protected function getBasicAuthHeader()\n {\n return \"Basic \" . base64_encode($this->clientId . \":\" . $this->clientSecret);\n }", "function check_auth() {\n global $conf;\n if ($_SERVER['PHP_AUTH_USER'] !== $conf['username'] && $_SERVER['PHP_AUTH_PW'] !== $conf['password']) {\n header('WWW-Authenticate: Basic realm=\"CMS\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'Could not authorise.';\n die();\n }\n}", "public static function basic(string $username, string $password): BasicAuth\n {\n return new BasicAuth($username, $password);\n }", "abstract public function getCredentials();", "public function authentication() {\n return $this->username() . ':' . $this->password();\n }", "public function httpRequestGetBasicAuth(UnitTester $I)\n {\n $I->wantToTest('Http\\Request - getBasicAuth()');\n\n $store = $_SERVER ?? [];\n $time = $_SERVER['REQUEST_TIME_FLOAT'];\n $_SERVER = [\n 'REQUEST_TIME_FLOAT' => $time,\n 'PHP_AUTH_USER' => 'darth',\n 'PHP_AUTH_PW' => 'vader',\n ];\n\n $request = new Request();\n\n $expected = [\n 'username' => 'darth',\n 'password' => 'vader',\n ];\n $actual = $request->getBasicAuth();\n $I->assertSame($expected, $actual);\n\n $_SERVER = $store;\n }", "protected function getCredentials()\n {\n if (empty($this->username) || empty($this->password)) {\n throw new \\Exception('Basic authentication requires a $username & $password property.');\n }\n\n return [$this->username, $this->password];\n }", "function req_auth($realm = 'Secret Realm') {\n\theader('WWW-Authenticate: Basic realm=\"'.$realm.'\"');\n\theader('HTTP/1.1 401 Unauthorized');\n\tprint '<h1>Error 401: Authorization Required</h1>';\n\texit;\n}", "public function setAuthorizeInfo($username, $password)\n {\n if ($username != null) { //The password might be blank\n curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n }\n }", "public function withBasicAuth($username, $password)\n {\n return $this->withHeader(\n 'Authorization',\n sprintf('Basic %s', base64_encode(sprintf('%s:%s', $username, $password)))\n );\n }", "public function authentication(){\n return HelperTest::createBasicHeader();\n }", "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}", "public function httpUser()\n\t{\n\t\treturn $this->server('PHP_AUTH_USER');\n\t}", "public function getHTTPHeaders() {\n\t\treturn array(\n\t\t\t'Authorization: Basic '.base64_encode($this->username.':'.$this->password)\n\t\t);\n\t}", "public function _setRawCredentials()\n\t{\n\t\t/* Check if an API Key or Access Token has been passed as a parameter in the query string. Because of the\n\t\t\tobvious security issues with this, we do not recommend it, but sometimes it is the only choice */\n\t\tif ( isset( \\IPS\\Request::i()->key ) )\n\t\t{\n\t\t\t$this->rawApiKey = \\IPS\\Request::i()->key;\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( \\IPS\\Request::i()->access_token ) and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t{\n\t\t\t$this->rawAccessToken = \\IPS\\Request::i()->access_token;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Look for an API key in an automatically decoded HTTP Basic header */\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) )\n\t\t{\n\t\t\t$this->rawApiKey = $_SERVER['PHP_AUTH_USER'];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* If we're still here, try to find an Authorization header - start with $_SERVER... */\n\t\t$authorizationHeader = NULL;\n\t\tforeach ( $_SERVER as $k => $v )\n\t\t{\n\t\t\tif ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* ...if we didn't find anything there, try apache_request_headers() */\n\t\tif ( !$authorizationHeader and \\function_exists('apache_request_headers') )\n\t\t{\n\t\t\t$headers = @apache_request_headers();\n\t\t\tif ( isset( $headers['Authorization'] ) )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $headers['Authorization'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* If we managed to get one, set if it's an API Key or an Access Token */\n\t\tif ( $authorizationHeader )\n\t\t{\n\t\t\tif ( mb_substr( $authorizationHeader, 0, 7 ) === 'Bearer ' and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t\t{\n\t\t\t\t$this->rawAccessToken = mb_substr( $authorizationHeader, 7 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exploded = explode( ':', base64_decode( mb_substr( $authorizationHeader, 6 ) ) );\n\t\t\t\tif ( isset( $exploded[0] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->rawApiKey = $exploded[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "function test_authourization_fun( $vars ){\r\n\r\n if (isset($_GET['user']) && $_GET['user']){\r\n $_SERVER[\"PHP_AUTH_USER\"] = $_GET['user'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_USER\"] = 'NOUSER';\r\n }\r\n if (isset($_GET['pw']) && $_GET['pw']){\r\n $_SERVER[\"PHP_AUTH_PW\"] = $_GET['pw'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_PW\"] = 'ERRORPASSWORD';\r\n }\r\n}", "public function render_field_basic_authentication() {\n\t\t$value = $this->get_setting( 'enable_basic_authentication', 'no' );\n\t\t?>\n\t\t<p class=\"satispress-togglable-field\">\n\t\t\t<label>\n\t\t\t\t<input type=\"checkbox\" name=\"satispress[enable_basic_authentication]\" id=\"satispress-enable-basic-authentication\" value=\"yes\" <?php checked( $value, 'yes' ); ?>>\n\t\t\t\t<?php _e( 'Enable HTTP Basic Authentication?', 'satispress' ); ?>\n\t\t\t</label>\n\t\t</p>\n\t\t<?php\n\t\t$htaccess = new SatisPress_Htaccess( $this->base_path );\n\t\tif ( ! $htaccess->is_writable() ) {\n\t\t\tprintf( '<p class=\"satispress-field-error\">%s</p>', __( \".htaccess file isn't writable.\" ) );\n\t\t}\n\t}", "public function getCredential();", "public static function authenticate($username, $raw_password);", "public function setBasicAuth(string $username, string $password): self\n {\n $this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n $this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);\n return $this;\n }", "public static function requireBasicHttpAuth($credentials = array())\r\n {\r\n if (!is_array($credentials)) throw new \\Exception('Parameter $credentials in \"' . __METHOD__ . '\" should be an array.');\r\n $credentialsFound = false;\r\n if (count($credentials)) {\r\n foreach ($credentials as $credential) {\r\n if (!empty($credential['password']) && !empty($credential['login']) && $credential['login'] == $_SERVER['PHP_AUTH_USER'] && $credential['password'] == $_SERVER['PHP_AUTH_PW']){\r\n $credentialsFound = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!$credentialsFound) {\r\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\r\n header('HTTP/1.0 401 Unauthorized');\r\n echo 'Auth required.';\r\n exit;\r\n }\r\n }\r\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 authenticate($username, $password);", "public function authenticate($username, $password);", "protected function getBasicHeaders()\n {\n $headers = [];\n\n if ($this->authRequired()) {\n $headers['Authorization'] = sprintf(\n 'Basic %s',\n base64_encode($this->authentication->getUsername() . ':' . $this->authentication->getPassword())\n );\n }\n\n return $headers;\n }", "public function setAuth($username, $password)\n {\n $this->username = $username;\n $this->auth = 'Basic '.base64_encode($username.':'.$password);\n }", "public function iAmAuthenticatingAs($username, $password)\n {\n $this->removeHeader('Authorization');\n $this->authorization = base64_encode($username . ':' . $password);\n $this->addHeader('Authorization', 'Basic ' . $this->authorization);\n }", "public function getAuthorization(): string\n {\n return self::PREFIX . base64_encode($this->username . ':' . $this->password);\n }", "public function basicAuth($usr, $pass) {\n\t\t$this->auth_type = \"basic\";\n\t\t$this->auth_login = true;\n\t\t$this->auth_user = $usr;\n\t\t$this->auth_pass = $pass;\n\t}", "public static function getServerAuthentication() {\n $header = array();\n // PHP as Apache module provides a SAPI function.\n // PHP 5.4+ enables getallheaders() also for FastCGI.\n if (function_exists('getallheaders')) {\n $headers = getallheaders();\n if (isset($headers['Authorization'])) {\n $input = $headers['Authorization'];\n }\n }\n // PHP as CGI with server/.htaccess configuration (e.g., via mod_rewrite)\n // may transfer/forward HTTP request data into server variables.\n elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {\n $input = $_SERVER['HTTP_AUTHORIZATION'];\n }\n // PHP as CGI may provide HTTP request data as environment variables.\n elseif (isset($_ENV['HTTP_AUTHORIZATION'])) {\n $input = $_ENV['HTTP_AUTHORIZATION'];\n }\n if (isset($input)) {\n preg_match_all('@([^, =]+)=\"([^\"]*)\"@', $input, $header);\n $header = array_combine($header[1], $header[2]);\n }\n return $header;\n }", "public function getUsername()\n {\n if (! isset($this->basicAuth[\"username\"]))\n return null;\n\n return $this->basicAuth[\"username\"];\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public function setAuthenticateHeader()\n {\n $response = \\Yii::$app->response;\n $response->getHeaders()->set('WWW-Authenticate', \"Basic realm=\\\"{$this->realm}\\\"\");\n }", "public function testBasicAuth()\n {\n $response = $this->get('/home');\n $response->assertStatus(302);\n\n $user = User::factory()->create(['verified' => true]);\n // Authenticated and verified user is allowed to see the homepage.\n $response = $this->actingAs($user)->get('/home');\n $response->assertStatus(200);\n\n $this->assertAuthenticatedAs($user);\n }", "public function getBasicAuthMethod() {\n\t\treturn $this->selectedEndpoint['basic_auth_method'];\n\t}", "function rest_get_authenticated_app_password()\n {\n }", "public function getValueRepresentation() {\n return 'Basic '.base64_encode($this->username.':'.$this->password->getCharacters());\n }", "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 authenticate(string $username, string $password);", "public function authenticate($username, $password)\n {\n curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n return $this;\n }", "private function _tryPlainAuth()\n {\n if (!array_key_exists('PHP_AUTH_USER', $_SERVER)\n || !array_key_exists('PHP_AUTH_PW', $_SERVER)\n ) {\n return array();\n }\n return array (\n 'login' => $_SERVER['PHP_AUTH_USER'],\n 'hash' => md5($_SERVER['PHP_AUTH_PW'])\n );\n }", "public function setAuth($username, $password);", "public function basicAuth(bool $clearResponse = false): bool\n\t{\n\t\tif($this->isLoggedIn() || $this->login($this->request->getUsername(), $this->request->getPassword()) === true)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif($clearResponse)\n\t\t{\n\t\t\t$this->response->clear();\n\t\t}\n\n\t\t$this->response->getHeaders()->add('WWW-Authenticate', 'basic');\n\n\t\t$this->response->setStatus(401);\n\n\t\treturn false;\n\t}", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "public function withBasicAuth($user, $password=null)\n {\n $this->basicAuth = \"{$user}\";\n\n $this->basicAuth .= !empty($password) ? \":{$password}\" : \"\";\n\n return $this->basicAuth;\n }", "private function onlyBasicAccounts()\n {\n helper(\"auth\");\n\n if (isset($_COOKIE[\"token\"]))\n {\n $tokenCookie = $_COOKIE[\"token\"];\n $token = isValid($tokenCookie);\n \n if ($token != null && isAuthenticated(\"RUser\"))\n {\n $this->userMail = $token->email;\n $this->userName = $token->firstName;\n $this->userImage = ((new UserModel())->find($token->email))->image;\n }\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n }\n }", "public function setAuth($username, $password = null)\n {\n if ($username) {\n $this->optionManager->set(['HTTPAUTH' => CURLAUTH_BASIC, 'USERPWD', (string) $username . ':' . (string) $password]); \n }\n \n return $this;\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing password\");\n }\n \n // realm\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "function phpbb_http_login($param)\n{\n\tglobal $auth, $user;\n\tglobal $config;\n\n\t$param_defaults = array(\n\t\t'auth_message'\t=> '',\n\n\t\t'autologin'\t\t=> false,\n\t\t'viewonline'\t=> true,\n\t\t'admin'\t\t\t=> false,\n\t);\n\n\t// Overwrite default values with passed values\n\t$param = array_merge($param_defaults, $param);\n\n\t// User is already logged in\n\t// We will not overwrite his session\n\tif (!empty($user->data['is_registered']))\n\t{\n\t\treturn;\n\t}\n\n\t// $_SERVER keys to check\n\t$username_keys = array(\n\t\t'PHP_AUTH_USER',\n\t\t'Authorization',\n\t\t'REMOTE_USER', 'REDIRECT_REMOTE_USER',\n\t\t'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION',\n\t\t'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION',\n\t\t'AUTH_USER',\n\t);\n\n\t$password_keys = array(\n\t\t'PHP_AUTH_PW',\n\t\t'REMOTE_PASSWORD',\n\t\t'AUTH_PASSWORD',\n\t);\n\n\t$username = null;\n\tforeach ($username_keys as $k)\n\t{\n\t\tif (isset($_SERVER[$k]))\n\t\t{\n\t\t\t$username = $_SERVER[$k];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$password = null;\n\tforeach ($password_keys as $k)\n\t{\n\t\tif (isset($_SERVER[$k]))\n\t\t{\n\t\t\t$password = $_SERVER[$k];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Decode encoded information (IIS, CGI, FastCGI etc.)\n\tif (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)\n\t{\n\t\tlist($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);\n }\n\n\tif (!is_null($username) && !is_null($password))\n\t{\n\t\tset_var($username, $username, 'string', true);\n\t\tset_var($password, $password, 'string', true);\n\n\t\t$auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']);\n\n\t\tif ($auth_result['status'] == LOGIN_SUCCESS)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\telse if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)\n\t\t{\n\t\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t\ttrigger_error('NOT_AUTHORISED');\n\t\t}\n\t}\n\n\t// Prepend sitename to auth_message\n\t$param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message'];\n\n\t// We should probably filter out non-ASCII characters - RFC2616\n\t$param['auth_message'] = preg_replace('/[\\x80-\\xFF]/', '?', $param['auth_message']);\n\n\theader('WWW-Authenticate: Basic realm=\"' . $param['auth_message'] . '\"');\n\theader('HTTP/1.0 401 Unauthorized');\n\n\ttrigger_error('NOT_AUTHORISED');\n}", "function authGet() { }", "function authenticateHeader($message = 'Authentication required')\n{\n header('WWW-Authenticate: Basic realm=\"FusionDirectory\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"$message\\n\";\n exit;\n}", "protected function setBasicAuthHeader(): void\n {\n $this->setRequestHeader(\n 'Authorization',\n 'Basic ' . base64_encode($this->appId . ':' . $this->appPassword)\n );\n }", "public function getCredentials()\n { return $this->get('credentials'); }", "public function useBasicAuthorization($username, $password)\n\t{\n\t\t$this->options[self::OPTION_DEFAULT_HEADERS] = array_merge(\n\t\t\t$this->options[self::OPTION_DEFAULT_HEADERS],\n\t\t\t['Authorization' => 'Basic '.base64_encode(\"{$username}:{$password}\")]\n\t\t);\n\n\t\treturn $this;\n\t}", "public function testThatPasswordGrantLoginSendsBasicRequestCorrectly()\n {\n $api = new MockAuthenticationApi([new Response(200)]);\n\n $api->call()->login_with_default_directory( [\n 'username' => 'the_username',\n 'password' => 'the_password',\n ] );\n\n $this->assertEquals( 'https://test-domain.auth0.com/oauth/token', $api->getHistoryUrl() );\n\n $request_headers = $api->getHistoryHeaders();\n $this->assertArrayHasKey( 'Auth0-Client', $request_headers );\n $this->assertEquals( self::$expectedTelemetry, $request_headers['Auth0-Client'][0] );\n $this->assertArrayHasKey( 'Content-Type', $request_headers );\n $this->assertEquals( 'application/json', $request_headers['Content-Type'][0] );\n\n $request_body = $api->getHistoryBody();\n $this->assertEquals( 'the_username', $request_body['username'] );\n $this->assertEquals( 'the_password', $request_body['password'] );\n $this->assertEquals( 'password', $request_body['grant_type'] );\n $this->assertEquals( '__test_client_id__', $request_body['client_id'] );\n $this->assertEquals( '__test_client_secret__', $request_body['client_secret'] );\n }", "public function get_auth_string()\n {\n }", "function getCredentials()\r\n\t{\r\n\t\t$user = $this->makeRequest('http://api.twitter.com/account/verify_credentials.xml');\r\n\t\tif($user)\r\n\t\t\treturn simplexml_load_string($user);\r\n\t}", "public function getAuthAsString();", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}", "public function getAuth();", "public function getAuth();", "public function httpPassword()\n\t{\n\t\treturn $this->server('PHP_AUTH_PW');\n\t}", "function load_htpasswd(){\n\t\tif(!file_exists(\"/etc/oar/api-users\")){\n\t\t\treturn Array();\n\t\t}\n\n\t\t$res = Array();\n\t\tforeach (file(\"/etc/oar/api-users\") as $key => $value) {\n\t\t\t$array = explode(':',$value);\n\t\t\t$user = $array[0];\n\t\t\t$pass = rtrim($array[1]);\n\t\t\t$res[$user]=$pass;\n\t\t}\n\n\t\treturn $res;\n\t}", "public function getAuthHeader()\n {\n return [\n 'auth' => [\n $this->username,\n $this->password,\n ],\n ];\n }", "public function getToken() {\r\n $token = 'ZGV2czppZHNs';\r\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) {\r\n\t\t\t// mod_php\r\n $username = $_SERVER['PHP_AUTH_USER'];\r\n $password = $_SERVER['PHP_AUTH_PWD'];\r\n $token = base64_encode(\"$username:$password\");\r\n } elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {\r\n\t\t\t// most other servers\r\n if (strpos(strtolower($_SERVER['HTTP_AUTHORIZATION']), 'basic')===0) {\r\n $token = base64_encode(substr($_SERVER['HTTP_AUTHORIZATION'], 6));\r\n }\r\n }\r\n if (is_null($token)) {\r\n\t\t\theader('HTTP/1.0 401 Unauthorized');\r\n return false;\r\n }\r\n return $token;\r\n }", "public function getValidAuthString()\n {\n return 'Basic YXBwc2VydmVyOmFwcHNlcnZlci5pMA==';\n }", "function ac_auth($username, $password) {\r\n\t\t$sr = ldap_search($this->ds, $this->basedn, \"username=$username\");\r\n\t\tif(ldap_count_entries($this->ds, $sr) > 0) {\r\n\t\t\t$inf = ldap_get_entries($this->ds, $sr);\r\n\t\t\t$passmd5 = $inf[0][\"password\"][0];\r\n\t\t\tif(md5($password) == $passmd5) {\r\n\t\t\t\treturn array($inf[0][\"uid\"][0],\r\n\t\t\t\t\t\t$inf[0][\"perms\"][0]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array();\r\n\t}", "public function __construct(\n $basicAuthUserName = null,\n $basicAuthPassword = null\n ) {\n Configuration::$basicAuthUserName = $basicAuthUserName ? $basicAuthUserName : Configuration::$basicAuthUserName;\n Configuration::$basicAuthPassword = $basicAuthPassword ? $basicAuthPassword : Configuration::$basicAuthPassword;\n }", "function getUserFromRequest() {\n return array_key_exists('HTTP_AUTHORIZATION', $_SERVER) ? intval($_SERVER['HTTP_AUTHORIZATION']) : NULL;\n}", "function authenticate() {}", "public function getCookieCredentials() {\n $server_name = $this->full_server_name;\n\n if ($server_name == '[manual]') {\n // Manual server - no login.\n return array(\n 'uri' => $server_name,\n 'username' => 'none',\n 'password' => 'none',\n );\n }\n\n // Get the user name and password from the login field.\n preg_match('/user-name=\\\"(.*)\\\" user-password/i', $server_name, $user_matches);\n preg_match('/user-password=\\\"(.*)\\\" /i', $server_name, $password_matches);\n $username = $user_matches[1];\n $password = $password_matches[1];\n\n return array(\n 'uri' => $server_name,\n 'username' => $username,\n 'password' => $password,\n );\n }", "public function call()\n {\n $req = $this->app->request();\n $res = $this->app->response();\n $authUser = $req->headers('PHP_AUTH_USER');\n $authPass = $req->headers('PHP_AUTH_PW');\n $dbUserAuthenticated = false;\n if ($authUser && $authPass){\n \t$stmt = $this->db->prepare('SELECT * FROM user WHERE username=:username AND password=:password;');\n \t$stmt->bindValue(':username', $authUser);\n \t$stmt->bindValue(':password', $authPass);\n\t\t\t$result = $stmt->execute();\n\t\t\tif($row = $result->fetchArray()){\n\t\t\t\t$dbUserAuthenticated = true;\n\t\t\t}\n }\n \n if ($authUser && $authPass && $dbUserAuthenticated) {\n $this->next->call();\n } \n else {\n \t//Statuscode 403 statt 401 zurückliefern, damit Browser kein Auth Fenster öffnet\n $res->setStatus(403);\n //Auth Header nicht setzen, da Statuscode sonst irgendwie auf 401 geändert wird\n //$res->header('WWW-Authenticate', sprintf('Basic realm=\"%s\"', $this->realm));\n }\n }" ]
[ "0.74485946", "0.7318718", "0.7280017", "0.7205642", "0.71755934", "0.6999301", "0.69968677", "0.6982961", "0.694114", "0.6779061", "0.6761493", "0.6744634", "0.67231935", "0.6718241", "0.66793597", "0.6627333", "0.6622631", "0.65108436", "0.65076506", "0.64851797", "0.6465887", "0.6451727", "0.6369516", "0.6368624", "0.6346711", "0.633795", "0.6337388", "0.63173354", "0.629341", "0.6288767", "0.6270672", "0.625237", "0.6241683", "0.6234582", "0.6196057", "0.6179859", "0.61659425", "0.6141723", "0.6139762", "0.61243874", "0.61151814", "0.6102353", "0.6075575", "0.60735196", "0.60618526", "0.605527", "0.60530466", "0.6039297", "0.5985411", "0.59824955", "0.5978457", "0.5978457", "0.5978291", "0.5962666", "0.5953485", "0.59517354", "0.59489495", "0.5928229", "0.5920685", "0.5918802", "0.5913148", "0.5904119", "0.589899", "0.58981884", "0.5871566", "0.5861079", "0.585628", "0.5852486", "0.5851126", "0.58505255", "0.58450055", "0.5839921", "0.5832086", "0.58293325", "0.582577", "0.581953", "0.5811268", "0.5790565", "0.5787426", "0.5777336", "0.5767512", "0.57670385", "0.5755699", "0.57189023", "0.5716209", "0.57157487", "0.5713809", "0.57015437", "0.57015437", "0.5694179", "0.56912965", "0.5685414", "0.5655079", "0.56260616", "0.56253266", "0.5609342", "0.5606468", "0.56045943", "0.55962783", "0.5596079" ]
0.5935111
57
Obtain application wide HTTP Basic auth credentials (password)
public function getWebserviceAuthPassword() { return $this->getConfig('webservice/auth_password'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public function getBasicAuth()\n {\n return $this->basicAuth;\n }", "public function getBasicAuthPassword() {\n\t\treturn $this->selectedEndpoint['basic_auth_password'];\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 }", "protected function parseBasic()\n {\n return [\n 'username' => input()->server('PHP_AUTH_USER'),\n 'password' => input()->server('PHP_AUTH_PW'),\n ];\n }", "public function testBasicGET_withBasicAuth()\n\t{\n\t\t$Request = new Request(new URL('http://user:password@' . self::TESTHOST . '/basicAuth.php'), null, null, $this->_getDefaultOptions());\n\n\t\t// Return the body as StringValue\n\t\t$result = $Request->getResponseAs(new StringValue());\n\t\t$this->assertEquals('OK', $result);\n\n\t\t$Request = new Request(new URL('http://user:WRONGpassword@' . self::TESTHOST . '/basicAuth.php'));\n\n\t\t// Return the body as StringValue\n\t\t$result = $Request->getResponseAs(new StringValue());\n\t\t$this->assertEquals('Unknown password/user', $result);\n\n\t}", "function _set_basic_auth(&$app, &$c) {\n\t\t$u = $c->param('app.view_http.request.auth.username');\n\t\t$p = $c->param('app.view_http.request.auth.password');\n\t\tif ($u && $p)\n\t\t\t$this->_http->setBasicAuth($u, $p);\n\t}", "private function getCredentials()\n {\n $basic = base64_encode(Settings::$username . ':' . Settings::$password);\n// $basic = base64_encode($this->user_id . ':' . $this->password);\n return $basic;\n }", "public function prepareBasicAuth()\n {\n $authString = base64_encode( $this->options['username'] . ':' . $this->options['password'] );\n\n $this->options['headers']['Authorization'] = \"Basic {$authString}\";\n }", "function http_auth_headers() {\n\t\tif($this->http_user || $this->http_pass):\n\t\t\t$this->http_headers_add('Authorization', \" Basic \".base64_encode($this->http_user . \":\" . $this->http_pass));\n\t\tendif;\n\t}", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "function http_require_auth() {\n\theader('WWW-Authenticate: Basic realm=\"HTTP Authentication System\"');\n\theader('HTTP/1.0 401 Unauthorized');\n\techo \"You must enter a valid login ID and password to access this resource\\n\";\n\texit;\n}", "function wp_populate_basic_auth_from_authorization_header()\n {\n }", "function set_auth_basic($username, $password)\n {\n \\Mutex::lock($this->mutex);\n $this->auth_basic_user = $username;\n $this->auth_basic_pass = $password;\n \\Mutex::unlock($this->mutex);\n }", "public function getAuthorizationBasic()\n {\n if ( ! empty($this->key) && ! empty($this->secret)) {\n $key = rawurlencode($this->key);\n $secret = rawurlencode($this->secret);\n\n return 'Basic ' . base64_encode($key . ':' . $secret);\n }\n\n return false;\n }", "function rest_get_authenticated_app_password()\n {\n }", "function authenticate() {\n //this would be for hard-coded username/password, sometimes useful if you \n //don't have a database\n //echo $_SERVER[\"PHP_AUTH_USER\"] . \"<BR>\";\n if ((isset($_SERVER[\"PHP_AUTH_USER\"]) && ($_SERVER['PHP_AUTH_USER'] == 'client') &&\n isset($_SERVER['PHP_AUTH_PW']) && ($_SERVER[\"PHP_AUTH_PW\"] == 'secret'))) {\n header('HTTP/1.0 200 OK'); //all is good!\n } else {\n -\n //don't let them in!\n header('WWW-Authenticate: Basic realm=\"Test Authentication System\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"You must enter a valid login ID and password to access this resource\\n\";\n }\n exit; //stop execution of the program so we don't get any more errors\n}", "public function httpPassword()\n\t{\n\t\treturn $this->server('PHP_AUTH_PW');\n\t}", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpOpenSIPsException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = array();\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }", "private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpSIPException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }", "public function require_http_basic_auth() {\n\t\t// If authentication data was sent\n\t\tif ( is_null( $this->get_php_auth()->username ) || is_null( $this->get_php_auth()->password ) ) {\n\t\t\tthrow new HTTPBasicUnauthorized();\n\t\t}\n\n\t\treturn true;\n\t}", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "private function promptBasic() {\n $this->debugPrint('Prompting user (BASIC)...');\n\n\n header(\"WWW-Authenticate: Basic realm=\\\"{$this->realm}\\\"\");\n header('HTTP/1.0 401 Unauthorized');\n\n /* This is sent if the user cancels */\n if ($this->redirect_on_failure) {\n echo <<<EOF\n <html>\n <meta http-equiv=\"refresh\" content=\"0; url={$this->redirect_on_failure_url}?error=1\" />\n <body><h2>{$this->fail_text}</h2></body>\n </html>\nEOF;\n } else {\n echo \"<html><body><h2>{$this->fail_text}</h2></body></html>\";\n }\n exit();\n }", "public function GetAllowBasicAuth () {\n\t\treturn $this->allowBasicAuth;\n\t}", "abstract public function getCredentials();", "public function getCredential();", "function check_auth() {\n global $conf;\n if ($_SERVER['PHP_AUTH_USER'] !== $conf['username'] && $_SERVER['PHP_AUTH_PW'] !== $conf['password']) {\n header('WWW-Authenticate: Basic realm=\"CMS\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'Could not authorise.';\n die();\n }\n}", "function setCredentials( $username, $password )\r\n\t{\r\n\t\t$hdrvalue = base64_encode( \"$username:$password\" );\r\n\t\t$this->addHeader( \"Authorization\", \"Basic $hdrvalue\" );\r\n\t}", "public static function basic(string $username, string $password): BasicAuth\n {\n return new BasicAuth($username, $password);\n }", "function req_auth($realm = 'Secret Realm') {\n\theader('WWW-Authenticate: Basic realm=\"'.$realm.'\"');\n\theader('HTTP/1.1 401 Unauthorized');\n\tprint '<h1>Error 401: Authorization Required</h1>';\n\texit;\n}", "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}", "public function httpRequestGetBasicAuth(UnitTester $I)\n {\n $I->wantToTest('Http\\Request - getBasicAuth()');\n\n $store = $_SERVER ?? [];\n $time = $_SERVER['REQUEST_TIME_FLOAT'];\n $_SERVER = [\n 'REQUEST_TIME_FLOAT' => $time,\n 'PHP_AUTH_USER' => 'darth',\n 'PHP_AUTH_PW' => 'vader',\n ];\n\n $request = new Request();\n\n $expected = [\n 'username' => 'darth',\n 'password' => 'vader',\n ];\n $actual = $request->getBasicAuth();\n $I->assertSame($expected, $actual);\n\n $_SERVER = $store;\n }", "public function getBasicAuthUsername() {\n\t\treturn $this->selectedEndpoint['basic_auth_username'];\n\t}", "function test_authourization_fun( $vars ){\r\n\r\n if (isset($_GET['user']) && $_GET['user']){\r\n $_SERVER[\"PHP_AUTH_USER\"] = $_GET['user'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_USER\"] = 'NOUSER';\r\n }\r\n if (isset($_GET['pw']) && $_GET['pw']){\r\n $_SERVER[\"PHP_AUTH_PW\"] = $_GET['pw'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_PW\"] = 'ERRORPASSWORD';\r\n }\r\n}", "protected function getCredentials()\n {\n if (empty($this->username) || empty($this->password)) {\n throw new \\Exception('Basic authentication requires a $username & $password property.');\n }\n\n return [$this->username, $this->password];\n }", "protected function getBasicAuthHeader()\n {\n return \"Basic \" . base64_encode($this->clientId . \":\" . $this->clientSecret);\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "public function getBasicAuthMethod() {\n\t\treturn $this->selectedEndpoint['basic_auth_method'];\n\t}", "public function authentication() {\n return $this->username() . ':' . $this->password();\n }", "public function render_field_basic_authentication() {\n\t\t$value = $this->get_setting( 'enable_basic_authentication', 'no' );\n\t\t?>\n\t\t<p class=\"satispress-togglable-field\">\n\t\t\t<label>\n\t\t\t\t<input type=\"checkbox\" name=\"satispress[enable_basic_authentication]\" id=\"satispress-enable-basic-authentication\" value=\"yes\" <?php checked( $value, 'yes' ); ?>>\n\t\t\t\t<?php _e( 'Enable HTTP Basic Authentication?', 'satispress' ); ?>\n\t\t\t</label>\n\t\t</p>\n\t\t<?php\n\t\t$htaccess = new SatisPress_Htaccess( $this->base_path );\n\t\tif ( ! $htaccess->is_writable() ) {\n\t\t\tprintf( '<p class=\"satispress-field-error\">%s</p>', __( \".htaccess file isn't writable.\" ) );\n\t\t}\n\t}", "public function authentication(){\n return HelperTest::createBasicHeader();\n }", "public function authentication_header() {\n return 'Proxy-Authorization: Basic ' . base64_encode($this->authentication());\n }", "public function setBasicAuth(string $username, string $password): self\n {\n $this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n $this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);\n return $this;\n }", "public function basicAuth($usr, $pass) {\n\t\t$this->auth_type = \"basic\";\n\t\t$this->auth_login = true;\n\t\t$this->auth_user = $usr;\n\t\t$this->auth_pass = $pass;\n\t}", "public function setAuthorizeInfo($username, $password)\n {\n if ($username != null) { //The password might be blank\n curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n }\n }", "function authGet() { }", "public function withBasicAuth($username, $password)\n {\n return $this->withHeader(\n 'Authorization',\n sprintf('Basic %s', base64_encode(sprintf('%s:%s', $username, $password)))\n );\n }", "function json_basic_auth_handler( $user ) {\n\treturn 1;\n}", "public function getCredentials()\n { return $this->get('credentials'); }", "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 _setRawCredentials()\n\t{\n\t\t/* Check if an API Key or Access Token has been passed as a parameter in the query string. Because of the\n\t\t\tobvious security issues with this, we do not recommend it, but sometimes it is the only choice */\n\t\tif ( isset( \\IPS\\Request::i()->key ) )\n\t\t{\n\t\t\t$this->rawApiKey = \\IPS\\Request::i()->key;\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( \\IPS\\Request::i()->access_token ) and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t{\n\t\t\t$this->rawAccessToken = \\IPS\\Request::i()->access_token;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Look for an API key in an automatically decoded HTTP Basic header */\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) )\n\t\t{\n\t\t\t$this->rawApiKey = $_SERVER['PHP_AUTH_USER'];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* If we're still here, try to find an Authorization header - start with $_SERVER... */\n\t\t$authorizationHeader = NULL;\n\t\tforeach ( $_SERVER as $k => $v )\n\t\t{\n\t\t\tif ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* ...if we didn't find anything there, try apache_request_headers() */\n\t\tif ( !$authorizationHeader and \\function_exists('apache_request_headers') )\n\t\t{\n\t\t\t$headers = @apache_request_headers();\n\t\t\tif ( isset( $headers['Authorization'] ) )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $headers['Authorization'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* If we managed to get one, set if it's an API Key or an Access Token */\n\t\tif ( $authorizationHeader )\n\t\t{\n\t\t\tif ( mb_substr( $authorizationHeader, 0, 7 ) === 'Bearer ' and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t\t{\n\t\t\t\t$this->rawAccessToken = mb_substr( $authorizationHeader, 7 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exploded = explode( ':', base64_decode( mb_substr( $authorizationHeader, 6 ) ) );\n\t\t\t\tif ( isset( $exploded[0] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->rawApiKey = $exploded[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing password\");\n }\n \n // realm\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public static function requireBasicHttpAuth($credentials = array())\r\n {\r\n if (!is_array($credentials)) throw new \\Exception('Parameter $credentials in \"' . __METHOD__ . '\" should be an array.');\r\n $credentialsFound = false;\r\n if (count($credentials)) {\r\n foreach ($credentials as $credential) {\r\n if (!empty($credential['password']) && !empty($credential['login']) && $credential['login'] == $_SERVER['PHP_AUTH_USER'] && $credential['password'] == $_SERVER['PHP_AUTH_PW']){\r\n $credentialsFound = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!$credentialsFound) {\r\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\r\n header('HTTP/1.0 401 Unauthorized');\r\n echo 'Auth required.';\r\n exit;\r\n }\r\n }\r\n }", "public function basicAuth(bool $clearResponse = false): bool\n\t{\n\t\tif($this->isLoggedIn() || $this->login($this->request->getUsername(), $this->request->getPassword()) === true)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif($clearResponse)\n\t\t{\n\t\t\t$this->response->clear();\n\t\t}\n\n\t\t$this->response->getHeaders()->add('WWW-Authenticate', 'basic');\n\n\t\t$this->response->setStatus(401);\n\n\t\treturn false;\n\t}", "public function getPassword()\n {\n if (! isset($this->basicAuth[\"password\"]))\n return null;\n\n return $this->basicAuth[\"password\"];\n }", "public function withBasicAuth($user, $password=null)\n {\n $this->basicAuth = \"{$user}\";\n\n $this->basicAuth .= !empty($password) ? \":{$password}\" : \"\";\n\n return $this->basicAuth;\n }", "public function getHTTPHeaders() {\n\t\treturn array(\n\t\t\t'Authorization: Basic '.base64_encode($this->username.':'.$this->password)\n\t\t);\n\t}", "public function setAuthenticateHeader()\n {\n $response = \\Yii::$app->response;\n $response->getHeaders()->set('WWW-Authenticate', \"Basic realm=\\\"{$this->realm}\\\"\");\n }", "public function getAuthorization(): string\n {\n return self::PREFIX . base64_encode($this->username . ':' . $this->password);\n }", "public function getAuth();", "public function getAuth();", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}", "public function setAuth($username, $password)\n {\n $this->username = $username;\n $this->auth = 'Basic '.base64_encode($username.':'.$password);\n }", "public function testBasicAuth()\n {\n $response = $this->get('/home');\n $response->assertStatus(302);\n\n $user = User::factory()->create(['verified' => true]);\n // Authenticated and verified user is allowed to see the homepage.\n $response = $this->actingAs($user)->get('/home');\n $response->assertStatus(200);\n\n $this->assertAuthenticatedAs($user);\n }", "public static function getServerAuthentication() {\n $header = array();\n // PHP as Apache module provides a SAPI function.\n // PHP 5.4+ enables getallheaders() also for FastCGI.\n if (function_exists('getallheaders')) {\n $headers = getallheaders();\n if (isset($headers['Authorization'])) {\n $input = $headers['Authorization'];\n }\n }\n // PHP as CGI with server/.htaccess configuration (e.g., via mod_rewrite)\n // may transfer/forward HTTP request data into server variables.\n elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {\n $input = $_SERVER['HTTP_AUTHORIZATION'];\n }\n // PHP as CGI may provide HTTP request data as environment variables.\n elseif (isset($_ENV['HTTP_AUTHORIZATION'])) {\n $input = $_ENV['HTTP_AUTHORIZATION'];\n }\n if (isset($input)) {\n preg_match_all('@([^, =]+)=\"([^\"]*)\"@', $input, $header);\n $header = array_combine($header[1], $header[2]);\n }\n return $header;\n }", "public function testThatPasswordGrantLoginSendsBasicRequestCorrectly()\n {\n $api = new MockAuthenticationApi([new Response(200)]);\n\n $api->call()->login_with_default_directory( [\n 'username' => 'the_username',\n 'password' => 'the_password',\n ] );\n\n $this->assertEquals( 'https://test-domain.auth0.com/oauth/token', $api->getHistoryUrl() );\n\n $request_headers = $api->getHistoryHeaders();\n $this->assertArrayHasKey( 'Auth0-Client', $request_headers );\n $this->assertEquals( self::$expectedTelemetry, $request_headers['Auth0-Client'][0] );\n $this->assertArrayHasKey( 'Content-Type', $request_headers );\n $this->assertEquals( 'application/json', $request_headers['Content-Type'][0] );\n\n $request_body = $api->getHistoryBody();\n $this->assertEquals( 'the_username', $request_body['username'] );\n $this->assertEquals( 'the_password', $request_body['password'] );\n $this->assertEquals( 'password', $request_body['grant_type'] );\n $this->assertEquals( '__test_client_id__', $request_body['client_id'] );\n $this->assertEquals( '__test_client_secret__', $request_body['client_secret'] );\n }", "private function _tryPlainAuth()\n {\n if (!array_key_exists('PHP_AUTH_USER', $_SERVER)\n || !array_key_exists('PHP_AUTH_PW', $_SERVER)\n ) {\n return array();\n }\n return array (\n 'login' => $_SERVER['PHP_AUTH_USER'],\n 'hash' => md5($_SERVER['PHP_AUTH_PW'])\n );\n }", "public function requestReAuthBasic($realm = 'Restricted area', $message = 'Restricted area')\n {\n $this->send401Unauthorized();\n $this->sendHeader(\"WWW-Authenticate: Basic realm=\\\"{$realm}\\\"\");\n die($message);\n }", "public function authenticate($username, $password)\n {\n curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n return $this;\n }", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "public static function authenticate($username, $raw_password);", "function phpbb_http_login($param)\n{\n\tglobal $auth, $user;\n\tglobal $config;\n\n\t$param_defaults = array(\n\t\t'auth_message'\t=> '',\n\n\t\t'autologin'\t\t=> false,\n\t\t'viewonline'\t=> true,\n\t\t'admin'\t\t\t=> false,\n\t);\n\n\t// Overwrite default values with passed values\n\t$param = array_merge($param_defaults, $param);\n\n\t// User is already logged in\n\t// We will not overwrite his session\n\tif (!empty($user->data['is_registered']))\n\t{\n\t\treturn;\n\t}\n\n\t// $_SERVER keys to check\n\t$username_keys = array(\n\t\t'PHP_AUTH_USER',\n\t\t'Authorization',\n\t\t'REMOTE_USER', 'REDIRECT_REMOTE_USER',\n\t\t'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION',\n\t\t'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION',\n\t\t'AUTH_USER',\n\t);\n\n\t$password_keys = array(\n\t\t'PHP_AUTH_PW',\n\t\t'REMOTE_PASSWORD',\n\t\t'AUTH_PASSWORD',\n\t);\n\n\t$username = null;\n\tforeach ($username_keys as $k)\n\t{\n\t\tif (isset($_SERVER[$k]))\n\t\t{\n\t\t\t$username = $_SERVER[$k];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$password = null;\n\tforeach ($password_keys as $k)\n\t{\n\t\tif (isset($_SERVER[$k]))\n\t\t{\n\t\t\t$password = $_SERVER[$k];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Decode encoded information (IIS, CGI, FastCGI etc.)\n\tif (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)\n\t{\n\t\tlist($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);\n }\n\n\tif (!is_null($username) && !is_null($password))\n\t{\n\t\tset_var($username, $username, 'string', true);\n\t\tset_var($password, $password, 'string', true);\n\n\t\t$auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']);\n\n\t\tif ($auth_result['status'] == LOGIN_SUCCESS)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\telse if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)\n\t\t{\n\t\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t\ttrigger_error('NOT_AUTHORISED');\n\t\t}\n\t}\n\n\t// Prepend sitename to auth_message\n\t$param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message'];\n\n\t// We should probably filter out non-ASCII characters - RFC2616\n\t$param['auth_message'] = preg_replace('/[\\x80-\\xFF]/', '?', $param['auth_message']);\n\n\theader('WWW-Authenticate: Basic realm=\"' . $param['auth_message'] . '\"');\n\theader('HTTP/1.0 401 Unauthorized');\n\n\ttrigger_error('NOT_AUTHORISED');\n}", "public function testThatPasswordGrantRealmLoginSendsBasicRequestCorrectly()\n {\n $api = new MockAuthenticationApi([new Response(200)]);\n\n $api->call()->login( [\n 'username' => 'the_username',\n 'password' => 'the_password',\n 'realm' => 'the_realm',\n ] );\n\n $this->assertEquals( 'https://test-domain.auth0.com/oauth/token', $api->getHistoryUrl() );\n\n $request_body = $api->getHistoryBody();\n $this->assertEquals( 'the_realm', $request_body['realm'] );\n $this->assertEquals( 'http://auth0.com/oauth/grant-type/password-realm', $request_body['grant_type'] );\n }", "public static function auth()\n {\n return (new Authenticator(request()));\n }", "function authenticate() {}", "function getCredentials()\r\n\t{\r\n\t\t$user = $this->makeRequest('http://api.twitter.com/account/verify_credentials.xml');\r\n\t\tif($user)\r\n\t\t\treturn simplexml_load_string($user);\r\n\t}", "public function getValueRepresentation() {\n return 'Basic '.base64_encode($this->username.':'.$this->password->getCharacters());\n }", "abstract public function credentials();", "protected function setBasicAuthHeader(): void\n {\n $this->setRequestHeader(\n 'Authorization',\n 'Basic ' . base64_encode($this->appId . ':' . $this->appPassword)\n );\n }", "public function setAuth($username, $password = null)\n {\n if ($username) {\n $this->optionManager->set(['HTTPAUTH' => CURLAUTH_BASIC, 'USERPWD', (string) $username . ':' . (string) $password]); \n }\n \n return $this;\n }", "public function authenticate($username, $password);", "public function authenticate($username, $password);", "public function setAuth($username, $password);", "function load_htpasswd(){\n\t\tif(!file_exists(\"/etc/oar/api-users\")){\n\t\t\treturn Array();\n\t\t}\n\n\t\t$res = Array();\n\t\tforeach (file(\"/etc/oar/api-users\") as $key => $value) {\n\t\t\t$array = explode(':',$value);\n\t\t\t$user = $array[0];\n\t\t\t$pass = rtrim($array[1]);\n\t\t\t$res[$user]=$pass;\n\t\t}\n\n\t\treturn $res;\n\t}", "public function readCredentials()\n {\n $apiId = !empty($_POST['connection']['appId']) ? $_POST['connection']['appId'] : '';\n $apiUsername = !empty($_POST['connection']['apiUsername']) ? $_POST['connection']['apiUsername'] : '';\n $apiPassword = !empty($_POST['connection']['apiPassword']) ? $_POST['connection']['apiPassword'] : '';\n\n if (empty($apiId) || empty($apiUsername) || empty($apiPassword)) {\n return $this->error('You must provide a valid iContact AppID/Username/Password');\n }\n\n $this->setCredentials($_POST['connection']);\n\n $result = $this->testConnection();\n\n if ($result !== true) {\n return $this->error('Could not connect to iContact: ' . $result);\n }\n\n /**\n * finally, save the connection details\n */\n $this->save();\n $this->success('iContact connected successfully');\n }", "public function getValidAuthString()\n {\n return 'Basic YXBwc2VydmVyOmFwcHNlcnZlci5pMA==';\n }", "public function getAuthPassword(){\n return $this->password;\n }", "public function getAuthPassword(){\n return $this->password;\n }", "public function get_auth_string()\n {\n }", "protected function getBasicHeaders()\n {\n $headers = [];\n\n if ($this->authRequired()) {\n $headers['Authorization'] = sprintf(\n 'Basic %s',\n base64_encode($this->authentication->getUsername() . ':' . $this->authentication->getPassword())\n );\n }\n\n return $headers;\n }", "public function getAuthPassword()\n {\n // TODO: Implement getAuthPassword() method.\n }", "public function authenticate()\n {\n $response = $this->client->write(\n sprintf('/auth/userpass/login/%s', $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "function authenticateHeader($message = 'Authentication required')\n{\n header('WWW-Authenticate: Basic realm=\"FusionDirectory\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"$message\\n\";\n exit;\n}", "public function getToken() {\r\n $token = 'ZGV2czppZHNs';\r\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) {\r\n\t\t\t// mod_php\r\n $username = $_SERVER['PHP_AUTH_USER'];\r\n $password = $_SERVER['PHP_AUTH_PWD'];\r\n $token = base64_encode(\"$username:$password\");\r\n } elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {\r\n\t\t\t// most other servers\r\n if (strpos(strtolower($_SERVER['HTTP_AUTHORIZATION']), 'basic')===0) {\r\n $token = base64_encode(substr($_SERVER['HTTP_AUTHORIZATION'], 6));\r\n }\r\n }\r\n if (is_null($token)) {\r\n\t\t\theader('HTTP/1.0 401 Unauthorized');\r\n return false;\r\n }\r\n return $token;\r\n }", "abstract public function getAuthenticator();", "public function getAuthPassword()\n {\n return $this->password;\n }" ]
[ "0.7523664", "0.74823713", "0.74811625", "0.7398969", "0.71562576", "0.71474934", "0.70811874", "0.7046823", "0.6956327", "0.6894791", "0.68580043", "0.67634106", "0.6721884", "0.66682696", "0.6665077", "0.6660533", "0.6604092", "0.6603612", "0.6582806", "0.65725285", "0.65713215", "0.6556028", "0.65190184", "0.64901835", "0.6488836", "0.64842916", "0.64464617", "0.6398036", "0.63456845", "0.6322284", "0.6274981", "0.6259991", "0.6245557", "0.6239576", "0.6234102", "0.62327516", "0.6226958", "0.6203312", "0.6195943", "0.61937976", "0.61899626", "0.6158891", "0.61275065", "0.61274374", "0.6120573", "0.611467", "0.6066449", "0.60617596", "0.6055892", "0.6025921", "0.60173327", "0.60169977", "0.6000676", "0.5960969", "0.5960852", "0.59426105", "0.5941465", "0.5941283", "0.5934414", "0.5918876", "0.5911826", "0.5906139", "0.5906139", "0.5896368", "0.5890007", "0.5887174", "0.58871144", "0.58683896", "0.5867206", "0.5860403", "0.58551955", "0.58295244", "0.58295244", "0.58295244", "0.5826512", "0.5826384", "0.5824975", "0.58218503", "0.5818383", "0.5812989", "0.5806465", "0.58042264", "0.57972115", "0.5792525", "0.5789285", "0.5789285", "0.5786562", "0.5783693", "0.5779036", "0.5770713", "0.57693577", "0.57693577", "0.5768785", "0.57332194", "0.57181555", "0.57090366", "0.5703026", "0.57020825", "0.5701691", "0.5686339" ]
0.60417295
49
Query if receiver is out of europe.
public function isInternationalShipping($countryCode) { $countrycode = strtoupper($countryCode); return (null === $this->getProfileByCountryCode($countryCode)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isEuRegistered();", "public function isNotNumbered(){\n return $this->type === self::UP || $this->getFreeSeating();\n }", "public static function isFromEu()\n {\n $countryCode = self::getCountryCode(self::getClientIp());\n\n if (self::isEuCountry($countryCode)) {\n return true;\n }\n return false;\n }", "function isEUCKR($string){\n $result = true;\n $string = array_values((array)unpack('C*', $string));\n $bytes = & $string;\n $length = count($bytes);\n $i = 0;\n while ($i < $length && $bytes[$i++] > 0x80);\n for (; $i < $length; ++$i) {\n if ($bytes[$i] < 0x80) {\n continue;\n }\n if ($bytes[$i] >= 0xA1 && $bytes[$i] <= 0xFE) {\n if (!isset($bytes[++$i])\n || ($bytes[$i] < 0xA1 || $bytes[$i] > 0x7E)) {\n $result = false;\n break;\n }\n } else {\n $result = false;\n break;\n }\n }\n unset($bytes);\n return $result;\n }", "public function isEof(): bool;", "public function isEof(): bool\n {\n return $this->source->isEof();\n }", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "public function isToEuCountry(): bool\n {\n return in_array(\n $this->getCountry(),\n AbstractConsignment::EURO_COUNTRIES\n );\n }", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }", "public function isUnderpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNDERPAID;\n }", "public function isEatenUp()\n {\n return $this->eaten >= 100;\n }", "public function isUnpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNPAID;\n }", "public function isOutOfStock(){\n\t\treturn FALSE;\n\t}", "public function hasAlreadyUsedUpMoney()\n {\n return !! Timestamp :: build( $this ) -> getChargingStatusTimestamp( OrderStatusEnum :: USED_UP );\n }", "public function isUnavailable($from, $to)\n {\n return 0 < timetable_query_a(\n $this->timetable->specifics()\n ->where('is_available', 0),\n $from, $to\n );\n }", "public function isAfterSale(): bool\n {\n return $this->item->sell_in < self::DEADLINE;\n }", "private function isEndOfDay()\n {\n // > 10:00pm\n return (int) $this->block->confirmed_at->format('H') >= 22;\n }", "function is_out_of_stock() {\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n\t\t$stock_status = get_post_meta($post_id, '_stock_status',true);\n\t\t\n\t\tif ($stock_status == 'outofstock') {\n\t\treturn true;\n\t\t} else {\n\t\treturn false;\n\t\t}\n\t}", "public function isItHome() {\n if (!$this->getExpectedDelivery()) {\n return false;\n }\n return (time() - $this->getExpectedDelivery() < 0) ? false : true;\n }", "public function hasReservedRange()\n {\n return count($this->get(self::RESERVED_RANGE)) !== 0;\n }", "public function isDeactivatedSometime()\n {\n $invoker = $this->getInvoker();\n \n return $invoker->{$this->_options['from']['name']} !== null \n || $invoker->{$this->_options['until']['name']} !== null;\n }", "public function isCurrencyEuro()\n {\n $currency = Shopware()->Shop()->getCurrency()->getCurrency();\n\n if ($currency != 'EUR') {\n return false;\n }\n return true;\n }", "function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}", "public function isUnofficial(): bool\n {\n return self::ISO_STATUS_UNOFFICIAL === $this->isoStatus;\n }", "public function is_user_over_quota()\n {\n }", "private function checkIfTimeLeft()\r\n {\r\n if($this->expireDateTime < strtotime(\"now\"))\r\n {\r\n generic::successEncDisplay(\"Emails have been sent out, however, there are a number of emails to be sent, and the server run out of time.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "public function hasOpal() {\n return $this->_has(25);\n }", "public function checkTimeEnd(): bool;", "private function carHasAlreadyStoppedCharging()\n {\n return in_array( $this -> charging_status, [ OrderStatusEnum :: CHARGED, OrderStatusEnum :: USED_UP ]);\n }", "public function is_endless() {\r\n\t\treturn 0 == $this->end_date;\r\n\t}", "function is_valid_for_use() {\n\t\t\tif ( ! in_array( get_woocommerce_currency(), apply_filters( 'woocommerce_esewa_supported_currencies', array( 'NPR' ) ) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public function checkForLose()\n\t{\n\n\t\tif($this->phrase->counter() == $this->lives) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function mac_offending($mac) {\n\n $sql_query = \"SELECT block FROM mac_info WHERE mac = '$mac'\";\n $result = mysql_query($sql_query)\n\tor die (mysql_error());\n\t\n $current_row = mysql_fetch_assoc($result);\n \n $block = $current_row['block'];\n \n if (strlen($block)>3)\n\treturn $block;\n else\n\treturn FALSE;\n\t\n}", "function is_available_room($room_number)\n{\n\t//\n\t$room_rs = mysql_query(\"SELECT bed_limit FROM rooms WHERE room_number=\".$room_number);\n\t$occupied_rs = mysql_query(\"SELECT count(*) as total_occupied FROM room_availability WHERE room_number=\".$room_number.\" && status='1'\");\n\t//\n\t$roomdata = mysql_fetch_object($room_rs);\n\t$occupieddata = mysql_fetch_object($occupied_rs);\n\t\n\tif($roomdata->bed_limit == $occupieddata->total_occupied)\n\t{\n\t\t// not avail\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\t$num = intval($roomdata->bed_limit)-intval($occupieddata->total_occupied);\n\t\treturn $num;\n\t}\n\n}", "function isLost(){\n\tglobal $userid;\n\tif(!isConnected() && !isVisitor()) return true;\n\n\treturn false;\n}", "public function tellNotEnoughMoneyInAccount()\n {\n }", "private function __unAvailableReasonSubscribe($data)\r\n\t{\r\n\t\t$id=(isset($data[\"id\"]) AND is_numeric($data[\"id\"]))?$data[\"id\"]:null;\r\n\t\t$room_id=$data[\"roomid\"];\r\n\t\t$start=date(\"Ymd\",strtotime($data[\"date\"][\"start\"]));\r\n\t\t$end =date(\"Ymd\",strtotime($data[\"date\"][\"end\"]));\r\n\t\t$res=$this->__checkIfExists($start,$end,array( \"room_id\"=>$room_id,\"exclusive\"=>$id ));\r\n\t\tif(!empty($res)) throw new Exception(__(\"指定期間には既に設定済みです\"));\r\n\r\n\t\t//if the some schedule data set as the same condition is exists.\r\n\t\t$res=$this->__checkIfExistsOfSchedule($this->K9DataSchedule,$room_id,$start,$end);\r\n\t\tif(empty($res)) throw new Exception(__(\"指定した期間には宿泊予約が設定されています\"));\r\n\r\n\t\t$res=$this->__checkIfExistsOfSchedule($this->K9DataReststaySchedule,$room_id,$start,$end);\r\n\t\tif(empty($res)) throw new Exception(__(\"指定した期間には宿泊予約が設定されています\"));\r\n\r\n\t\t$save=array();\r\n\t\tif($id) $save[\"id\"]=$id=$id;\r\n\t\t$save[\"start_date\"]=$start;\r\n\t\t$save[\"end_date\"] =$end;\r\n\t\t$save[\"reason_id\"] =$data[\"reasonid\"];\r\n\t\t$save[\"room_id\"] =$data[\"roomid\"];\r\n\t\t$save[\"remarks\"] =$data[\"remarks\"];\r\n\t\t$this->K9DataUnavailableRoom->id=($id?$id:null);\r\n\t\tif(!$data=$this->K9DataUnavailableRoom->save($save)) throw new Exception(__(\"正常に処理が終了しませんでした\"));\r\n\t\treturn $data[$this->K9DataUnavailableRoom->name];\r\n\t}", "public function hasOffers();", "function goNoGoForLaunch($place){\n return $this->ship->hold->get($this->fuel()) >= $this->getFuelReqTo($place);\n }", "public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }", "public function expired()\n {\n return !$this->subscribed() && $this->billing_trial_ends_at && strtotime($this->billing_trial_ends_at) <= time();\n }", "public function hasWeddingmsg(){\n return $this->_has(25);\n }", "public function isFree()\n {\n return ((float) $this->price <= 0.00);\n }", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function hasStopdf(){\r\n return $this->_has(23);\r\n }", "function isZerofilled(): bool;", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "final public static function transactionWasRejectedByTheFraudGateway()\n {\n return self::get(2055);\n }", "public function getStillWanted() {\n $wanted = Event::fireReturn($this->getEventID(), $this->type, $this->filter, 'ping');\n if ($wanted || count($wanted)) {\n return true;\n }\n return false;\n }", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "function cmb_id_not_meet($field) { global $post; return $post->ID != 631; }", "public function checkOutsideConnection()\n {\n // Require only on this function to not overload memory with not needed classes\n require_once _PS_MODULE_DIR_ . 'doofinder/lib/EasyREST.php';\n $client = new EasyREST(true, 3);\n $result = $client->get(sprintf('%s/auth/login', self::DOOMANAGER_URL));\n\n return $result && $result->originalResponse && isset($result->headers['code'])\n && (strpos($result->originalResponse, 'HTTP/2 200') || $result->headers['code'] == 200);\n }", "function isOvertime()\n {\n if($this->jadwalKembali > $this->tanggalKembali){\n return false;\n }else{\n return true;\n }\n }", "public function isBalanceExceeded()\n {\n return self::BALANCE_EXCEEDED === $this->code;\n }", "public function hasUnit() {\n return $this->_has(11);\n }", "public function has_expired()\n\t{\n\t\treturn $this->until < time();\n\t}", "public function isOperational();", "public function networkDataAtcUk()\n {\n return $this->networkDataAtc()->isUk();\n }", "public function isAccountNonExpired(): bool\n {\n return true;\n }", "public function isDeactivatedTemporarily()\n {\n if ($this->isDeactivatedSometime() === false)\n return false;\n \n $invoker = $this->getInvoker();\n $from = $this->_options['from']['name'];\n $until = $this->_options['until']['name'];\n \n return (\n $invoker->$from !== null \n && $invoker->$until !== null\n && strtotime($invoker->$from) < strtotime($invoker->$until)\n )\n ||\n (\n $invoker->$from === null \n && $invoker->$until !== null\n );\n }", "public function inactiveCheck()\n\t\t{\n\t\t\t$schedule = $this->getSchedule();\n\t\t\tif ($schedule->getAnalyzer()->getBalance() <= 0)\n\t\t\t{\n\t\t\t\t$as = $_SESSION['current_app']; // App Status can be grabbed from here\n\n\t\t\t\tif ($as->level1 == 'external_collections')\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"recovered\",\"external_collections\",\"*root\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"paid\",\"customer\",\"*root\"));\n\t\t\t\t}\n\n\t\t\t\t$this->Affiliations->expireAll();\n\t\t\t\t$schedule->removeScheduledTransactions();\n\t\t\t\t$schedule->save();\n\n\t\t\t\t$queue_manager = ECash::getFactory()->getQueueManager();\n\t\t\t\t$queue_item = new ECash_Queues_BasicQueueItem($this->getId());\n\t\t\t\t$queue_manager->getQueueGroup('automated')->remove($queue_item);\n\n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\n\t\t}", "public function isEuMember() {\n\t\treturn $this->getEuMember();\n\t}", "public function hasTimeLimitReached(): bool;", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "public function is_available()\n\t\t{\n\t\t\t$is_available = true;\n\t\t\t$iute_params = WC_Gateway_Iute_CRUD::get(IUTE_TABLE_PARAMS);\n\t\t\t$total = $this->get_order_total();\n\n\t\t\tforeach ($iute_params as $param) {\n\n\t\t\t\tif ($param->minAmount > $total or $param->maxAmount < $total) {\n\t\t\t\t\t$is_available = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $is_available;\n\t\t}", "public function isOnline()\n\t {\t\tdate_default_timezone_set('Pacific/Auckland');\n\t\t\t$to_time = strtotime(date('Y-m-d H:i:s'));\n\t\t\t$from_time = strtotime($this->last_online);\n\t\t\tif( round(abs($to_time - $from_time) / 60,2) < 10){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t }", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "function validaemisor($emisor){\n\tif($emisor!=\"SME100125GR4\"){return -3;}else{return 0;}\n}", "public function hasLateDaysRemaining() {\n return $this->getLateDaysRemaining() > 0;\n }", "public function getAvailable()\n {\n if (!$this->IsAvailable) {\n return false;\n }\n\n if (!$this->getAvailableFrom() && !$this->getAvailableTill()) {\n return false;\n } elseif ($this->validateDate() && $this->validateAvailability()) {\n return true;\n }\n\n return false;\n }", "public function hasRingLv(){\r\n return $this->_has(7);\r\n }", "public function isAccountNonExpired()\n {\n return true;\n }", "public function deliveryPriceOutDhaka()\n {\n }", "function getIsAvailable() ;", "function ifAvailable($isbn,$con)\r\n\t{\r\n\t\t$result = mysqli_query($con, \"SELECT * from booksdb where isbn13 IN ('$isbn');\");\r\n\t\t$row = mysqli_fetch_array($result);\r\n\t\tif($row['copies'] == $row['rented'])\r\n\t\t{\r\n\t\t\treturn \"0\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$available = $row['copies'] - $row['rented'];\r\n\t\t\treturn $available;\r\n\t\t}\r\n\t}", "public function isAccountNonExpired()\r\n {\r\n return true;\r\n }", "public function isAccountNonExpired()\r\n {\r\n return true;\r\n }", "public function check_avail(){ \n\t\tif(!empty($this->data['HrPermission']['per_from']) && !empty($this->data['HrPermission']['per_to']) && !empty($this->data['HrPermission']['per_date'])){\n\t\t\t// get used leave\n\t\t\t$date_str = $this->get_search_date($this->data['HrPermission']['per_date']);\n\t\t\t$this->unBindModel(array('hasOne' => array('HrPerStatus', 'HrPerUser')));\t\t\t\n\t\t\t$data = $this->find('all', array('fields' => array(\"TIME_FORMAT(SEC_TO_TIME( SUM( TIME_TO_SEC(no_hrs))), '%k:%i') as count\", 'HrPermission.id'), \n\t\t\t'conditions' => array('HrPermission.app_users_id' => $this->data['HrPermission']['user_id'], 'HrPermission.is_deleted' => 'N', 'is_approve !=' => 'R', \n\t\t\t'per_date like' => $date_str.'%')));\t\t\t\n\t\t\t$used = $data[0][0]['count'];\n\t\t\t\n\t\t\tif(empty($used)){\t\n\t\t\t\t$total_hrs = $this->data['HrPermission']['no_hrs'];\n\t\t\t}else{\n\t\t\t\t$total_hrs = $this->add_time($used, $this->data['HrPermission']['no_hrs']);\t\n\t\t\t}\n\t\t\t// find total usable hours\t\t\t\t\t\n\t\t\t$total_hrs = explode(':', $total_hrs);\t\t\t\n\t\t\t$avail = 2;\t\t\t\t\n\t\t\tif(($total_hrs[0] >= $avail && $total_hrs[1] > 0) || ($total_hrs[0] > 2)){ \n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function isEphemeral() : bool;", "public function hasSilencedf(){\r\n return $this->_has(30);\r\n }", "public function isNotReceived()\n\t{\n\t\tif($this->test_status_id == Test::NOT_RECEIVED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "public function is_us()\n {\n\n return $this->is_country('US');\n\n\t}" ]
[ "0.5810553", "0.57183486", "0.560649", "0.554364", "0.5464359", "0.5463785", "0.5441145", "0.5401435", "0.5399801", "0.53993", "0.53170955", "0.52964807", "0.5296124", "0.52960604", "0.5265303", "0.5248056", "0.5240073", "0.5210997", "0.5199926", "0.51877314", "0.51398194", "0.51357526", "0.50943625", "0.5091249", "0.5086098", "0.5072743", "0.5060584", "0.5060584", "0.5056101", "0.5028957", "0.5020326", "0.50183517", "0.5010853", "0.500987", "0.5009161", "0.49934062", "0.4988682", "0.49877512", "0.49833477", "0.4980347", "0.4977715", "0.49764797", "0.49723133", "0.49669984", "0.4965113", "0.49638227", "0.4963252", "0.49605024", "0.4933477", "0.49299964", "0.49264726", "0.49239004", "0.49222827", "0.49195728", "0.49172953", "0.49077228", "0.48878452", "0.48869833", "0.48796412", "0.4871036", "0.48691067", "0.4864888", "0.48620445", "0.48555043", "0.4842758", "0.48370135", "0.48314258", "0.48313108", "0.48300886", "0.48298347", "0.48298347", "0.48298347", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.4828521", "0.48251426", "0.481859", "0.48145887", "0.48124826", "0.48115793", "0.48074052", "0.48028642", "0.4802098", "0.4798848", "0.4798848", "0.47987622", "0.47972724", "0.4794559", "0.4787111", "0.47712594" ]
0.0
-1
Get allowed payment methods for autocreate
public function getAutocreatePaymentMethods() { return $this->_toArrayObject($this->getConfig( 'autocreate/autocreate_allowed-payments')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvailablePaymentMethods ();", "public function getAutocreateAllowedPaymentMethods()\n {\n $path = 'intraship/autocreate/autocreate_allowed-payments';\n $methodCodes = Mage::getStoreConfig($path);\n if (null === $methodCodes) {\n $methodCodes = '';\n }\n return $methodCodes;\n }", "function getAutoEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\t\n\t$autoEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoEnabledPaymentMethod() == \"y\" )\n\t\t{\n\t\t\tarray_push($autoEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\treturn $autoEnabledPaymentMethod;\n\t\n}", "protected function getAllAvailableMethods()\n {\n /* TODO get all available payment methods from toolbox */\n }", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_ACC,\n self::PAYMENT_METHOD_ALP,\n self::PAYMENT_METHOD_APL,\n self::PAYMENT_METHOD_AMX,\n self::PAYMENT_METHOD_AZP,\n self::PAYMENT_METHOD_BON,\n self::PAYMENT_METHOD_CFY,\n self::PAYMENT_METHOD_CSY,\n self::PAYMENT_METHOD_CUP,\n self::PAYMENT_METHOD_DIN,\n self::PAYMENT_METHOD_DII,\n self::PAYMENT_METHOD_DIB,\n self::PAYMENT_METHOD_DIS,\n self::PAYMENT_METHOD_DNK,\n self::PAYMENT_METHOD_ECA,\n self::PAYMENT_METHOD_ELV,\n self::PAYMENT_METHOD_EPS,\n self::PAYMENT_METHOD_ESY,\n self::PAYMENT_METHOD_INT,\n self::PAYMENT_METHOD_JCB,\n self::PAYMENT_METHOD_JEL,\n self::PAYMENT_METHOD_KLN,\n self::PAYMENT_METHOD_MAU,\n self::PAYMENT_METHOD_MDP,\n self::PAYMENT_METHOD_MFX,\n self::PAYMENT_METHOD_MPX,\n self::PAYMENT_METHOD_MYO,\n self::PAYMENT_METHOD_PAP,\n self::PAYMENT_METHOD_PAY,\n self::PAYMENT_METHOD_PEF,\n self::PAYMENT_METHOD_PFC,\n self::PAYMENT_METHOD_PSC,\n self::PAYMENT_METHOD_REK,\n self::PAYMENT_METHOD_SAM,\n self::PAYMENT_METHOD_SWB,\n self::PAYMENT_METHOD_SCX,\n self::PAYMENT_METHOD_SWP,\n self::PAYMENT_METHOD_TWI,\n self::PAYMENT_METHOD_UAP,\n self::PAYMENT_METHOD_VIS,\n self::PAYMENT_METHOD_WEC,\n ];\n }", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_COD,\n self::PAYMENT_METHOD_CVS,\n self::PAYMENT_METHOD_OTHER,\n ];\n }", "public static function getPaymentMethods()\n {\n return [\n static::MAIL,\n static::DIRECT_DEPOSIT,\n ];\n }", "public static function getPaymentMethods() {\n\n // return array(\n // self::PAYMENT_METHOD_PAY_PAL => 'Pay Pal',\n // self::PAYMENT_METHOD_MONEY_BOOKERS => 'Skrill',\n // self::PAYMENT_METHOD_WIRE_TRANSFER => 'Wiretransfer',\n // );\n\n $payment_methods = array();\n\n if(Option::getByName('payment_method_paypal')) \n $payment_methods[self::PAYMENT_METHOD_PAY_PAL] = 'Pay Pal';\n\n if(Option::getByName('payment_method_skrill')) \n $payment_methods[self::PAYMENT_METHOD_MONEY_BOOKERS] = 'Skrill';\n\n if(Option::getByName('payment_method_wiretransfer') && Option::getByName('wiretransfer_doc_path')) \n $payment_methods[self::PAYMENT_METHOD_WIRE_TRANSFER] = 'Wiretransfer';\n\n if(Option::getByName('payment_method_check')) \n $payment_methods[self::PAYMENT_METHOD_CHECK] = 'Check';\n\n if(Option::getByName('payment_method_no_payment')) \n $payment_methods[self::PAYMENT_METHOD_NO_PAYMENT] = 'No Payment';\n\n return $payment_methods;\n }", "public function getPaymentMethodAllowableValues() : array\n {\n return [\n self::PAYMENT_METHOD_COD,\n self::PAYMENT_METHOD_CVS,\n self::PAYMENT_METHOD_OTHER,\n ];\n }", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_NONE,\n self::PAYMENT_METHOD_DOMESTIC_BANK_TRANSFER,\n self::PAYMENT_METHOD_ABROAD_BANK_TRANSFER,\n self::PAYMENT_METHOD_ACCOUNT_TRANSFER,\n self::PAYMENT_METHOD_CREDIT_CARD,\n ];\n }", "public function getPayMethodAllowableValues()\n {\n return [\n self::PAY_METHOD_BANK_TRANSFER,\nself::PAY_METHOD_CHEQUE,\nself::PAY_METHOD_CREDIT_CARD,\nself::PAY_METHOD_GIRO_ACH,\nself::PAY_METHOD_OTHER, ];\n }", "public function getSupportedPaymentTypes()\n {\n return [PaymentMethod::PAYPAL];\n }", "public static function payment_methods() {\n return array(\n CheckfrontModule::PaymentPayNow => 'Pay now',\n CheckfrontModule::PaymentPayLater => 'Pay later'\n );\n }", "public function get_payment_methods() {\n\t\treturn $this->get_supported_payment_methods();\n\t}", "public function getPaymentMethods() {\r\n\t\t//@TODO: Insert PaymentMethods into the datebase, create table\r\n\t\t$payment_methods = array();\r\n\t\t\t$payment_methods[0] = array('id' => 0, 'name' => 'AMEX');\r\n\t\t\t$payment_methods[1] = array('id' => 1, 'name' => 'Discover');\r\n\t\t\t$payment_methods[2] = array('id' => 2, 'name' => 'Mastercard');\r\n\t\t\t$payment_methods[3] = array('id' => 3, 'name' => 'Visa');\r\n\t\t\t$payment_methods[4] = array('id' => 4, 'name' => 'Store Credit');\r\n\t\t\t$payment_methods[5] = array('id' => 5, 'name' => 'Check');\r\n\t\t\t$payment_methods[6] = array('id' => 6, 'name' => 'Wire Transfer');\r\n\t\t\t$payment_methods[7] = array('id' => 7, 'name' => 'Trade');\r\n\t\t\t$payment_methods[9] = array('id' => 9, 'name' => 'Cash');\r\n\t\treturn $payment_methods; //array\r\n\t}", "public function getMethodOfPaymentAllowableValues()\n {\n $baseVals = [\n self::METHOD_OF_PAYMENT_PAID_BY_BUYER,\n self::METHOD_OF_PAYMENT_COLLECT_ON_DELIVERY,\n self::METHOD_OF_PAYMENT_DEFINED_BY_BUYER_AND_SELLER,\n self::METHOD_OF_PAYMENT_FOB_PORT_OF_CALL,\n self::METHOD_OF_PAYMENT_PREPAID_BY_SELLER,\n self::METHOD_OF_PAYMENT_PAID_BY_SELLER,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "public function get_supported_payment_methods() {\n\t\treturn array(\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANCONTACT,\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANK_TRANSFER,\n\t\t\tPronamic_WP_Pay_PaymentMethods::CREDIT_CARD,\n\t\t\tPronamic_WP_Pay_PaymentMethods::IDEAL,\n\t\t\tPronamic_WP_Pay_PaymentMethods::SOFORT,\n\t\t);\n\t}", "public function getPaymentMethods()\n {\n return $this->payment_methods;\n }", "public function getAllowedMethods()\n {\n \n \n \n return array( \n 'homedelivery' => $this->getConfigData('homedelivery'),\n \n 'matkahuolto' => $this->getConfigData('matkahuolto'),\n 'smartpost' => $this->getConfigData('smartpost'),\n \n \n \n 'chooseapostoffice' => $this->getConfigData('chooseapostoffice'), \n 'default' => $this->getConfigData('closestpostoffice'),\n \n );\n \n }", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_BANK_TRANSFER,\n self::METHOD_BILLING_PROVIDER,\n self::METHOD_CASH_ON_DELIVERY,\n self::METHOD_CHECK_PAYMENT,\n self::METHOD_CREDIT_CARD,\n self::METHOD_DEBIT_CARD,\n self::METHOD_DIRECT_DEBIT,\n self::METHOD_ELECTRONIC_INVOICE,\n self::METHOD_GIFT_CARD,\n self::METHOD_MOBILE_PAYMENT,\n self::METHOD_ONLINE_BANK_TRANSFER,\n self::METHOD_OPEN_INVOICE,\n self::METHOD_PREPAID_CARD,\n self::METHOD_TERMINAL,\n self::METHOD_WALLET,\n ];\n }", "public function getCardsPaymentMethods()\n {\n $payment_methods = Mage::getModel('mercadopago/core')->getPaymentMethods();\n $payment_methods_types = array(\"credit_card\", \"debit_card\", \"prepaid_card\");\n $types = array();\n\n //percorre todos os payments methods\n foreach ($payment_methods['response'] as $pm) {\n\n //filtra por payment_methods\n if (in_array($pm['payment_type_id'], $payment_methods_types)) {\n $types[] = $pm;\n }\n }\n\n return $types;\n }", "public function getAllowedMethods()\n {\n return array(\n $this->_code . '_private' => Mage::getStoreConfig('carrier/vconnect_postnord_home/name'),\n $this->_code . '_commercial' => Mage::getStoreConfig('carrier/vconnect_postnord_business/name'),\n $this->_code . '_pickup' => Mage::getStoreConfig('carrier/vconnect_postnord_pickup/name'),\n $this->_code . '_mailbox' => Mage::getStoreConfig('carrier/vconnect_postnord_mailbox/name'),\n );\n }", "public function getPaymentMethodsForCod()\n {\n return $this->_toArrayObject($this->getConfig(\n 'packages/global_settings_payments-for-cod'));\n }", "public function getBillingMethodAllowableValues()\n {\n return [\n self::BILLING_METHOD_ACTUAL_RATES,\n self::BILLING_METHOD_FIXED_FEE,\n self::BILLING_METHOD_NOT_TO_EXCEED,\n self::BILLING_METHOD_OVERRIDE_RATE,\n ];\n }", "public static function getPaymentTypes()\n\t{\n\t\t$types = array('' => 'Any');\n\t\treturn array_merge($types, PaymentMethod::getPaymentMethods());\n\t}", "public function getAllowedMethods()\r\r\n {\r\r\n return array('smartsend' => $this->getConfigData('name'));\r\r\n }", "public function getPaymentTypeAllowableValues()\n {\n return [\n self::PAYMENT_TYPE_CARD,\n self::PAYMENT_TYPE_MPO,\n self::PAYMENT_TYPE_MOBILEPAY,\n self::PAYMENT_TYPE_VIPPS,\n self::PAYMENT_TYPE_VIPPS_RECURRING,\n self::PAYMENT_TYPE_SWISH,\n self::PAYMENT_TYPE_VIABILL,\n self::PAYMENT_TYPE_ANYDAY,\n self::PAYMENT_TYPE_MANUAL,\n self::PAYMENT_TYPE_APPLEPAY,\n self::PAYMENT_TYPE_GOOGLEPAY,\n self::PAYMENT_TYPE_PAYPAL,\n self::PAYMENT_TYPE_KLARNA_PAY_NOW,\n self::PAYMENT_TYPE_KLARNA_PAY_LATER,\n self::PAYMENT_TYPE_KLARNA_SLICE_IT,\n self::PAYMENT_TYPE_KLARNA_DIRECT_BANK_TRANSFER,\n self::PAYMENT_TYPE_KLARNA_DIRECT_DEBIT,\n self::PAYMENT_TYPE_RESURS,\n self::PAYMENT_TYPE_MOBILEPAY_SUBSCRIPTIONS,\n self::PAYMENT_TYPE_EMV_TOKEN,\n self::PAYMENT_TYPE_BCMC,\n self::PAYMENT_TYPE_BLIK,\n self::PAYMENT_TYPE_PP_BLIK_OC,\n self::PAYMENT_TYPE_GIROPAY,\n self::PAYMENT_TYPE_IDEAL,\n self::PAYMENT_TYPE_P24,\n self::PAYMENT_TYPE_SEPA,\n self::PAYMENT_TYPE_VERKKOPANKKI,\n ];\n }", "function getCronEnabledPaymentMethods()\n{\n\t$registeredPaymentMethods = getRegisteredPaymentMethods();\n\t\n\t$cronEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoChargeEnabledPaymentMethod() == \"y\")\n\t\t{\n\t\t\tarray_push($cronEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\t$autoChargePaymentMethod = implode(\",\", $cronEnabledPaymentMethod);\n\t\n\treturn $autoChargePaymentMethod;\n}", "public function toOptionArray()\n {\n $methods = [];\n\n //default empty value\n $methods[] = [\"value\" => \"\", \"label\" => __(\"Accept all payment methods\")];\n $accessToken = $this->scopeConfig->getValue(\\MercadoPago\\Core\\Helper\\ConfigData::PATH_ACCESS_TOKEN, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId());\n\n if (empty($accessToken)) {\n return $methods;\n }\n\n $this->coreHelper->log(\"GET /v1/payment_methods\", 'mercadopago');\n\n try {\n $response = \\MercadoPago\\Core\\Lib\\RestClient::get(\"/v1/payment_methods\", null, [\"Authorization: Bearer \" . $accessToken]);\n } catch (\\Exception $e) {\n $this->coreHelper->log(\"PaymentMethodsTicket:: An error occurred at the time of obtaining the ticket payment methods: \" . $e);\n return [];\n }\n\n if (isset($response['error']) || (isset($response['status']) && ($response['status'] != '200' && $response['status'] != '201'))) {\n return $methods;\n }\n\n $response = $response['response'];\n\n foreach ($response as $pm) {\n if (isset($pm['payment_type_id']) && $pm['payment_type_id'] == \"ticket\" || $pm['payment_type_id'] == \"atm\") {\n $methods[] = [\n 'value' => $pm['id'],\n 'label' => __($pm['name'])\n ];\n }\n }\n\n $this->coreHelper->log(\"PaymentMethodsTicket:: Displayed\", 'mercadopago', $methods);\n\n return $methods;\n }", "public function getAllowedMethods(): array;", "public function getActiveMethods(){\n\n $activeCarriers = $this->shipmentConfig->getActiveCarriers();\n $methods = array();\n\n foreach($activeCarriers as $carrierCode => $carrierModel)\n {\n $carrierTitle =$this->scopeConfig->getValue('carriers/'.$carrierCode.'/title');\n\n if( $carrierMethods = $carrierModel->getAllowedMethods() )\n {\n foreach ($carrierMethods as $methodCode => $method)\n {\n $code= $carrierCode.'_'.$methodCode;\n $methods[]=array(\n 'label'=>$carrierTitle,\n 'value'=>$code\n );\n }\n }\n }\n\n return $methods; \n }", "abstract public function getPaymentMethod();", "public function getAllowedMethods()\n {\n return array($this->_code => 'Pickup');\n }", "public function getPaymentByAllowableValues()\n {\n return [\n self::PAYMENT_BY_DUE_DATE,\n self::PAYMENT_BY_DISCOUNT_DATE,\n ];\n }", "public function testAllowedPaymentMethods()\n {\n $expected = [\n 'ideal',\n 'bancontact',\n 'sofort',\n 'eps',\n 'giropay',\n 'belfius',\n 'creditcard',\n 'paypal',\n 'directdebit',\n ];\n\n $this->assertEquals($expected, SubscriptionRemover::ALLOWED_METHODS);\n }", "public function getPaymentMethods()\n {\n return $this->getValue('payment_method_categories');\n }", "public function getAllowedMethods()\n {\n return [$this->_code => __($this->getConfigData(self::SHIPPING_NAME))];\n }", "public static function listPaymentMethods()\n {\n return [\n [\n 'id' => self::PAYMENT_BY_CASH,\n 'name' => 'Tiền mặt',\n ],\n [\n 'id' => self::PAYMENT_BY_CONTRACT,\n 'name' => 'Hợp đồng',\n ],\n ];\n }", "public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}", "public function get_payment_methods()\n\t{\n\t\t//retrieve all invoice\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_APPROVE,\n self::METHOD_DENY,\n ];\n }", "public function getAllowedMethods(): array {\n return $this->configuration['allowed_methods'];\n }", "function getSignupEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isSignupEnabled()== 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\n}", "public function get_payment_methods()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function methods()\n {\n return collect(Paymentmethods::getList());\n }", "public function getAllowedMethods()\n {\n return $this->methods;\n }", "public static function PaymentOptionList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'pyr'=>t(\"Pay On Delivery\"),\n \t 'pyp'=>t(\"paypal\"),\n \t 'stp'=>t(\"stripe\"),\n \t 'mcd'=>t(\"mercapado\"),\n \t 'ide'=>t(\"sisow\"),\n \t 'payu'=>t(\"payumoney\"),\n \t 'pys'=>t(\"paysera\"), \t \n \t 'bcy'=>t(\"Barclay\"),\n \t 'epy'=>t(\"EpayBg\"),\n \t 'atz'=>t(\"Authorize.net\"),\n \t 'obd'=>t(\"Offline Bank Deposit\"),\n \t 'btr' =>t(\"Braintree\")\n \t);\n }", "function paymentmethods() {\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,payment_method,status FROM #__em_paymentmethod\";\r\n $db->setQuery($query);\r\n $result = $db->loadObjectList();\r\n return $result;\r\n }", "public function getAllowedMethods()\n {\n return array('bestway'=>$this->getConfigData('name'));\n }", "public function getAllowedMethods()\n {\n return ['loomisrate' => __('Loomis')];\n }", "public static function get_enabled_payment_times(){\n\t\t$enabled_payment_times = [];\n\t\t$enabled_payment_methods = self::get_enabled_payment_methods();\n foreach($enabled_payment_methods as $method_code => $payment_method){\n $enabled_payment_times[$payment_method['time_type']][$method_code] = $payment_method;\n }\n\t return $enabled_payment_times;\n\t}", "public function getPlatformPaymentTypeAllowableValues()\n {\n return [\n self::PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT,\n self::PLATFORM_PAYMENT_TYPE_COMMISSION,\n self::PLATFORM_PAYMENT_TYPE__DEFAULT,\n self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE,\n self::PLATFORM_PAYMENT_TYPE_VAT,\n ];\n }", "abstract public function getPaymentDrivers();", "public function getBuyingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_buying_payment_method}}', ['order_id' => 'id']);\n }", "public function getAllowedMethods(): array {\n return $this->allowedMethods;\n }", "public function getAllPaymentMethods($asArray = false) {\r\n $jsonMethods = array();\r\n $methods = array();\r\n $model = new Mage_Checkout_Block_Onepage_Payment_Methods();\r\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\r\n try {\r\n $selectedPaymentMethod = $quote->getPayment()->getData('method');\r\n } catch (Exception $e) {\r\n $this->logException($e, 'Get payment method');\r\n $this->_JSONencodeAndRespond(array(\"title\" => \"Error\", \"content\" => $e->getMessage()));\r\n return;\r\n }\r\n foreach ($model->getMethods() as $method) {\r\n $methodTitle = $method->getTitle();\r\n $methodCode = $method->getCode();\r\n if ($methodCode == \"paypal_express\") { // PayPal. Has logo and strange label text, override\r\n $methodTitle = \"PayPal\";\r\n }\r\n\r\n //eLabelz specific fix\r\n if ($methodCode == 'msp_cashondelivery') {\r\n $methodTitle .= \" – \" . Mage::helper('core')->currency($quote->getMspCashondeliveryInclTax(), true, false);\r\n }\r\n\r\n $m = array(\r\n 'type' => 'option',\r\n 'title' => $methodTitle,\r\n 'code' => $methodCode,\r\n 'price' => $this->getPaymentMethodPrice($methodCode),\r\n // Payment fee (price) is not available for standard payment methods, for extensions this need to be individualy coded\r\n 'image' => null,\r\n 'options' => $this->_getSuboptionsForPaymentMethod($methodCode),\r\n );\r\n $methods[] = $m;\r\n }\r\n if ($asArray)\r\n return $methods;\r\n $jsonMethods['payment_methods'] = $methods;\r\n\r\n return $jsonMethods;\r\n }", "function getRegisteredPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isUIEnabled() == 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\t\n}", "function admin_display_payment_gateways()\n {\n $return = array (\n 'name' => $this->name,\n 'title' => 'CC - Manual Payment',\n );\n\n return $return;\n }", "public function getPaymentMethods()\n {\n if (!isset($this->data['paymentProfiles']) || empty($this->data['paymentProfiles'])) {\n return null;\n }\n $paymentMethods = [];\n foreach ($this->data['paymentProfiles'] as $method) {\n $paymentMethods[$method['id']] = new PaymentMethod($method['id'], $method['visibleName']);\n }\n return collect($paymentMethods);\n }", "public function getAllowedMethods()\n {\n return [$this->getCarrierCode() => __($this->getConfigData('name'))];\n }", "public static function getPaymentMethods($exclude_cash = false) {\n\t\treturn $exclude_cash ?\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->andWhere(['not', ['name' => Payment::CASH]])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t:\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t;\n\t}", "public function registerPaymentGateways()\n {\n return [];\n }", "public function getAcceptablePaymentCards()\n {\n return $this->acceptablePaymentCards;\n }", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_GET,\n self::METHOD_POST,\n ];\n }", "public function iN_PaymentMethods() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_payment_methods WHERE payment_method_id = '1'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn $data;\n\t}", "public function getMercadoPagoPaymentMethods($accessToken)\n {\n $mp = $this->getApiInstance($accessToken);\n try {\n $response = $mp->get(\"/v1/payment_methods\");\n if ($response['status'] == 401 || $response['status'] == 400) {\n return false;\n }\n } catch (\\Exception $e) {\n return false;\n }\n \n return $response['response'];\n }", "public static function getPaymentTypes(){\n return array(self::IGFC=> PaymentUtils::getLabelText('PAYMENT_TYPE_IGFS'),self::CMPT1 => PaymentUtils::getLabelText('PAYMENT_TYPE_CMPT'));\n }", "public function getIsAutoPayAllowableValues()\r\n {\r\n return [\r\n self::IS_AUTO_PAY_TRUE,\r\n self::IS_AUTO_PAY_FALSE,\r\n ];\r\n }", "public static function getAllPaymentMethods()\n {\n $methods = [];\n $directory = __DIR__ . DIRECTORY_SEPARATOR . 'Method';\n $files = scandir($directory);\n foreach ($files as $file) {\n $file = $directory . DIRECTORY_SEPARATOR . $file;\n\n $info = pathinfo($file);\n if (!isset($info['extension']) || $info['extension'] !== 'php') {\n continue;\n }\n\n $class_name = basename($info['filename'], '.php');\n if (in_array($class_name, ['AbstractMethod'])) {\n continue;\n }\n\n $methods[] = $class_name;\n }\n\n return $methods;\n }", "public function get_allowedMethods() {\n\t\treturn Response::make('', '200',\n\t\t\t\tarray('Allow' => 'GET,PUT,POST,DELETE'));\n\t}", "public function allowedMethods(): array\n\t{\n\t\treturn [];\n\t}", "public function getMethods()\r\n {\r\n return $this->validMethods;\r\n }", "private function registerPaymentMethods()\n {\n $pPosition = 0;\n foreach ($this->paymentMethods as $pValue => $pSub) {\n if ($this->isAboveShopwareVersion52()) {\n $action = 'payment_processor_csrf/process';\n } else {\n $action = 'payment_processor/process';\n }\n $this->createPayment(array(\n 'name' => $pValue,\n 'description' => $pSub['description'],\n 'action' => $action,\n 'active' => 0,\n 'position' => $pPosition,\n 'additionalDescription' => ''\n ));\n $pPosition++;\n }\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PAYMENT,\n self::TYPE_CREDIT,\n self::TYPE_CARD_CHECK,\n ];\n }", "public function getAvailableTFAMethods()\n {\n $availableMethods = self::$tfaMethods;\n\n // Email\n $isTFAEmailEnabled = $this->isTFAEmailEnabled();\n $isEmailActivated = $this->isEmailActivated();\n if (\n false === $isTFAEmailEnabled ||\n false === $isEmailActivated\n ) {\n unset($availableMethods['email']);\n }\n\n // SMS\n $isTFASmsEnabled = $this->isTFASmsEnabled();\n $isMobileActivated = $this->isMobileActivated();\n if (\n false === $isTFASmsEnabled ||\n false === $isMobileActivated\n ) {\n unset($availableMethods['sms']);\n }\n\n // Authenticator\n $isTFAAuthenticatorEnabled = $this->isTFAAuthenticatorEnabled();\n $isTFAAuthenticatorActivated = $this->isTFAAuthenticatorActivated();\n $tfaAuthenticatorSecret = $this->getTFAAuthenticatorSecret();\n if (\n false === $isTFAAuthenticatorEnabled ||\n false === $isTFAAuthenticatorActivated ||\n empty($tfaAuthenticatorSecret)\n ) {\n unset($availableMethods['authenticator']);\n }\n\n // Recovery code\n $recoveryCodes = $this->getUserRecoveryCodes(true, true);\n if (empty($recoveryCodes)) {\n unset($availableMethods['recovery_code']);\n }\n\n return $availableMethods;\n }", "public function getPaymentMethods()\n {\n $obj = new stdClass();\n\n // Must be in specific order for checksum --\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n // -----------------------------------------\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Ask for GetPaymentMethods and get response\n $result = $this->client->GetPaymentMethods($obj);\n $result = $result->GetPaymentMethodsResult;\n $methods = isset($result->PaymentMethods->PaymentMethod) ? $result->PaymentMethods->PaymentMethod : null;\n\n $obj->Timestamp = $result->Timestamp;\n\n if (!is_null($methods)) {\n // Assign all properties of the PaymentMethods object as property of mainObject\n $obj = $this->parseForChecksum($obj, $methods);\n }\n\n // Unset properties for new Checksum\n unset($obj->Checksum);\n\n // Verify response data by making a new Checksum\n $CheckSum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $CheckSum)\n throw new Exception('Data could not be verified');\n\n return (array) $methods;\n }", "public function toArray()\n {\n $payments = $this->_paymentConfig->getAllMethods();\n\n $methods = [];\n\n foreach ($payments as $paymentCode => $paymentModel) {\n if ($paymentCode == 'iways_paypalplus_payment') {\n continue;\n }\n if (empty($paymentTitle)) {\n $paymentTitle = $paymentCode;\n }\n $paymentTitle = $this->_scopeConfig->getValue('payment/' . $paymentCode . '/title');\n $methods[$paymentCode] = $paymentTitle;\n }\n return $methods;\n }", "static function getPayMethodsOptions($type = 0)\n\t{\n\t\tglobal $ilDB, $lng;\n\t\t\n\t\t$res = $ilDB->query('SELECT * FROM payment_paymethods WHERE pm_enabled = 1');\n\t\t$options = array();\n\t\t\n\t\t//this is only for additional entries in SelectInputGUIs\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'all':\t\n\t\t\t\t$options['all'] = $lng->txt('pay_all');\n\t\t\t\tbreak;\n\t\t\tcase 'not_specified': \t\n\t\t\t\t$options[0] = $lng->txt('paya_pay_method_not_specified');\n\t\t\t\tbreak;\n\t\t\t//default: break;\n\t\t}\n\t\t\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$options[$row['pm_id']] = ilPayMethods::getStringByPaymethod($row['pm_title']);\n\t\t}\t\t\n\t\n\t\treturn $options;\n\t}", "public function whmcs_get_payment_methods($params = array()) {\n\t\t$params['action'] = 'GetPaymentMethods';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "static public function validMethodProvider()\n {\n return array(\n array('GET'),\n array('TRACE'),\n array('PROPFIND'),\n array('MKCOL'),\n array('X-MS-ENUMATTS'),\n );\n }", "function f3d_payment_method_filter($available_gateways)\n{\n\tglobal $wp, $current_user;\n\n\t$isDistributor = ($current_user && $current_user->roles && in_array('distributor', $current_user->roles));\n\t$disallow = $isDistributor\n\t\t? ['paypal']\n\t\t: ['bacs'];\n\n\tforeach($available_gateways as $gateway_id => $gateway)\n\t{\n\t\tif (in_array($gateway_id, $disallow))\n\t\t{\n\t\t\tunset($available_gateways[$gateway_id]);\n\t\t}\n\t}\n\n\treturn $available_gateways;\n}", "public function getPaymentMethods(Request $request){\n error_log(\"Request for getPaymentMethods $request\");\n\n $params = array(\n \"merchantAccount\" => env('MERCHANT_ACCOUNT'),\n \"channel\" => \"Web\"\n );\n\n $response = $this->checkout->paymentMethods($params);\n\n return $response;\n }", "public function getInstallments() {\n $api = new ApiPaymentMethods($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function get_possible_payment_methods_for_order( WC_Order $order ) {\n\n\t\tif ( ! isset( self::$possible_payment_method_cache[ $order->get_id() ] ) || is_null( self::$possible_payment_method_cache[ $order->get_id() ] ) ) {\n\t\t\ttry {\n\t\t\t\t$transaction = $this->get_transaction_from_order( $order );\n\t\t\t\tif ( $transaction->getState() != \\PostFinanceCheckout\\Sdk\\Model\\TransactionState::PENDING ) {\n\t\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] =\n\t\t\t\t\t\t$transaction->getAllowedPaymentMethodConfigurations();\n\t\t\t\t\treturn self::$possible_payment_method_cache[ $order->get_id() ];\n\t\t\t\t}\n\t\t\t\t$integration_method = get_option( WooCommerce_PostFinanceCheckout::CK_INTEGRATION );\n\t\t\t\t$payment_methods = $this->get_transaction_service()->fetchPaymentMethods(\n\t\t\t\t\t$transaction->getLinkedSpaceId(),\n\t\t\t\t\t$transaction->getId(),\n\t\t\t\t\t$integration_method\n\t\t\t\t);\n\t\t\t\t$method_configuration_service = WC_PostFinanceCheckout_Service_Method_Configuration::instance();\n\t\t\t\t$possible_methods = array();\n\t\t\t\tforeach ( $payment_methods as $payment_method ) {\n\t\t\t\t\t$method_configuration_service->update_data( $payment_method );\n\t\t\t\t\t$possible_methods[] = $payment_method->getId();\n\t\t\t\t}\n\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = $possible_methods;\n\t\t\t} catch ( WC_PostFinanceCheckout_Exception_Invalid_Transaction_Amount $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = array();\n\t\t\t\tthrow $e;\n\t\t\t} catch ( \\PostFinanceCheckout\\Sdk\\ApiException $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = array();\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t\treturn self::$possible_payment_method_cache[ $order->get_id() ];\n\t}", "public function getInstalledPaymentMethods() {\r\n\t\t// load internal names of installed payment methods\r\n\t\t$this->load->model('setting/extension');\r\n\t\t$paymentCodeList = $this->model_setting_extension->getInstalled('payment');\r\n\r\n\t\t// Get description name of payment methods.\r\n\t\t// It must implemented inline because there is no model method for it.\r\n\t\t// Based on implementation in method getList in class ControllerExtensionExtensionPayment\r\n\t\t$paymentMethods = [];\r\n\t\tforeach ($paymentCodeList as $paymentCode) {\r\n\t\t\t// check if main file of extension exists\r\n\t\t\t$mainFilePath = DIR_APPLICATION . 'controller/extension/payment/' . $paymentCode . '.php';\r\n\t\t\tif (!file_exists($mainFilePath)) {\r\n\t\t\t\tcontinue; // extension is registered as installed, but file is missing\r\n\t\t\t}\r\n\r\n\t\t\t// load description name of payment method from language file of extension\r\n\t\t\t$this->load->language('extension/payment/' . $paymentCode, 'extension');\r\n\t\t\t$extensionName = $this->language->get('extension')->get('heading_title');\r\n\r\n\t\t\t$paymentMethods[] = [\r\n\t\t\t\t'code' => $paymentCode,\r\n\t\t\t\t'name' => $extensionName\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\treturn $paymentMethods;\r\n\t}", "public static function getSupportedMethods(): array {}", "function getAllowedHttpMethods();", "public function getTaxEntryMethodAllowableValues()\n {\n return [\n self::TAX_ENTRY_METHOD_INCLUSIVE,\n self::TAX_ENTRY_METHOD_EXCLUSIVE,\n ];\n }", "public function getPaymentOption() {\r\n $query = $this->db->get('v_combo_payment_method');\r\n \r\n if( $query->num_rows() > 0 ) {\r\n return $query->result();\r\n } else {\r\n return array();\r\n }\r\n }", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_GET,\n self::METHOD_HEAD,\n self::METHOD_POST,\n self::METHOD_PUT,\n self::METHOD_PATCH,\n self::METHOD_DELETE,\n self::METHOD_OPTIONS,\n self::METHOD_TRACE,\n ];\n }", "public function getAllowedMethods() {\n //we only have one method so just return the name from the admin panel\n return array('bluedart' => $this->getConfigData('title'));\n }", "public function getChargeModeAllowableValues()\r\n {\r\n return [\r\n self::CHARGE_MODE_PRE_PAID,\r\n self::CHARGE_MODE_POST_PAID,\r\n self::CHARGE_MODE_FREE,\r\n ];\r\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PURCHASE,\nself::TYPE_REFUND,\nself::TYPE_PARTIAL_REFUND, ];\n }", "public function getAllPaymentMethods($translate = true)\n {\n if (empty($this->paymentMethods)) {\n $free = new \\PiedWeb\\ReservationBundle\\PaymentMethod\\Free();\n $this->paymentMethods[$free->getId()] = $translate ? $this->trans->trans('choices.'.$free->getHumanId()) : $free->getHumanId();\n\n $paymentMethods = explode('|', $this->getConfigurationPool()->getContainer()->getParameter('app.payment_method'));\n foreach ($paymentMethods as $paymentMethod) {\n $p = new $paymentMethod();\n $this->paymentMethods[$p->getId()] = $translate ? $this->trans->trans('choices.'.$p->getHumanId()) : $p->getHumanId();\n }\n }\n\n return $this->paymentMethods;\n }", "public function canPayment()\n {\n return true;\n }", "public static function getPaymentMethodsRetroCompatibilite($iso_code)\n {\n // HSS -> Web Payment Pro / Integral Evolution\n // ECS -> Express Checkout Solution\n // PPP -> PAYPAL PLUS\n\n $payment_method = array(\n 'AU' => array(WPS, HSS, ECS),\n 'BE' => array(WPS, ECS),\n 'CN' => array(WPS, ECS),\n 'CZ' => array(),\n 'DE' => array(WPS, ECS, PPP),\n 'ES' => array(WPS, HSS, ECS),\n 'FR' => array(WPS, HSS, ECS),\n 'GB' => array(WPS, HSS, ECS),\n 'HK' => array(WPS, HSS, ECS),\n 'IL' => array(WPS, ECS),\n 'IN' => array(WPS, ECS),\n 'IT' => array(WPS, HSS, ECS),\n 'JP' => array(WPS, HSS, ECS),\n 'MY' => array(WPS, ECS),\n 'NL' => array(WPS, ECS),\n 'NZ' => array(WPS, ECS),\n 'PL' => array(WPS, ECS),\n 'PT' => array(WPS, ECS),\n 'RA' => array(WPS, ECS),\n 'RE' => array(WPS, ECS),\n 'SG' => array(WPS, ECS),\n 'TH' => array(WPS, ECS),\n 'TR' => array(WPS, ECS),\n 'TW' => array(WPS, ECS),\n 'US' => array(WPS, ECS),\n 'ZA' => array(WPS, ECS));\n\n\n $return = isset($payment_method[$iso_code]) ? $payment_method[$iso_code] : $payment_method['GB'];\n if(Configuration::get('VZERO_ENABLED'))\n {\n $return[] = PVZ;\n }\n return $return;\n }", "public function validMethods()\n {\n return $this->valid_method;\n }", "public function setDefaultActivePaymentMethod()\n {\n $criteria = new CDbCriteria;\n $criteria->select = 't.name, t.value';\n $criteria->condition = \"t.name LIKE 'payment_method_%' AND t.value = 1\";\n\n $data = Option::model()->findAll($criteria);\n\n $payment_method_options = array();\n\n foreach($data as $option) {\n if($option->name == 'payment_method_paypal') $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n if($option->name == 'payment_method_skrill') $payment_method_options[] = self::PAYMENT_METHOD_MONEY_BOOKERS;\n if($option->name == 'payment_method_wiretransfer') $payment_method_options[] = self::PAYMENT_METHOD_WIRE_TRANSFER;\n if($option->name == 'payment_method_check') $payment_method_options[] = self::PAYMENT_METHOD_CHECK;\n if($option->name == 'payment_method_no_payment') $payment_method_options[] = self::PAYMENT_METHOD_NO_PAYMENT;\n }\n\n if(empty($payment_method_options))\n $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n\n if(!in_array($this->payment_method, $payment_method_options))\n $this->payment_method = $payment_method_options[0];\n }", "public function getShippingMethods()\n {\n $array = array();\n foreach ($this->config as $key => $item) {\n if ($key == 'allowed_domestic_methods') {\n foreach ($item as $item_internal) {\n $array['Domestic'][] = $item_internal['name'];\n }\n }\n\n if ($key == 'allowed_international_methods') {\n foreach ($item as $item_internal) {\n $array['International'][] = $item_internal['name'];\n }\n }\n }\n return $array;\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_ATM_WITHDRAWAL,\n self::TYPE_ATM_WITHDRAWAL_REVERSAL,\n self::TYPE_BALANCE_ADJUSTMENT,\n self::TYPE_BALANCE_ROLLOVER,\n self::TYPE_BANK_TRANSFER,\n self::TYPE_CAPTURE,\n self::TYPE_CAPTURE_REVERSAL,\n self::TYPE_CARD_TRANSFER,\n self::TYPE_CHARGEBACK,\n self::TYPE_CHARGEBACK_REVERSAL,\n self::TYPE_DEPOSIT_CORRECTION,\n self::TYPE_FEE,\n self::TYPE_GRANT,\n self::TYPE_INSTALLMENT,\n self::TYPE_INSTALLMENT_REVERSAL,\n self::TYPE_INTERNAL_TRANSFER,\n self::TYPE_INVOICE_DEDUCTION,\n self::TYPE_LEFTOVER,\n self::TYPE_MANUAL_CORRECTION,\n self::TYPE_MISC_COST,\n self::TYPE_PAYMENT,\n self::TYPE_PAYMENT_COST,\n self::TYPE_REFUND,\n self::TYPE_REFUND_REVERSAL,\n self::TYPE_REPAYMENT,\n self::TYPE_RESERVE_ADJUSTMENT,\n self::TYPE_SECOND_CHARGEBACK,\n ];\n }" ]
[ "0.8374894", "0.8035531", "0.7383147", "0.7357937", "0.7353068", "0.7294984", "0.71629965", "0.714662", "0.7137405", "0.71327126", "0.7105028", "0.70548487", "0.7012187", "0.69951344", "0.698721", "0.6980836", "0.6971872", "0.69658285", "0.68909985", "0.68540984", "0.68209505", "0.678699", "0.67802364", "0.6762042", "0.67514867", "0.67260516", "0.6712215", "0.6703438", "0.66336143", "0.6632772", "0.660517", "0.6588731", "0.6566134", "0.6546852", "0.65425915", "0.65363264", "0.6525452", "0.6487281", "0.6446192", "0.64277685", "0.6417551", "0.6415532", "0.6387917", "0.6342774", "0.63373506", "0.6329594", "0.6327337", "0.629792", "0.6291025", "0.626952", "0.62467223", "0.6245325", "0.6237063", "0.6235786", "0.6223846", "0.62223506", "0.62072104", "0.6151723", "0.61486274", "0.614857", "0.6138169", "0.6126916", "0.61265856", "0.6104154", "0.6093636", "0.6078542", "0.6074747", "0.6069937", "0.60511935", "0.6035435", "0.60198253", "0.60126513", "0.6010318", "0.5998003", "0.5995468", "0.5978365", "0.5965592", "0.59550935", "0.5947976", "0.5946991", "0.5943431", "0.5940825", "0.5930033", "0.59237653", "0.5918309", "0.59109694", "0.5902561", "0.5895835", "0.5884097", "0.5882771", "0.58621335", "0.585177", "0.58379906", "0.58373624", "0.5820169", "0.58082354", "0.5797606", "0.57897633", "0.57814056", "0.57799107" ]
0.83365333
1
Get allowed order status codes
public function getAutocreateStatusCodes() { return $this->_toArrayObject($this->getConfig( 'autocreate/autocreate_allowed-status-codes')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrderStatusAllowableValues()\n {\n return [\n self::ORDER_STATUS_PENDING,\n self::ORDER_STATUS_UNSHIPPED,\n self::ORDER_STATUS_PARTIALLY_SHIPPED,\n self::ORDER_STATUS_SHIPPED,\n self::ORDER_STATUS_CANCELED,\n self::ORDER_STATUS_UNFULFILLABLE,\n self::ORDER_STATUS_INVOICE_UNCONFIRMED,\n self::ORDER_STATUS_PENDING_AVAILABILITY,\n ];\n }", "public function getListOrderStatus(){\n\n return $this->client->makeRequest('orderstatus', 'GET');\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_APPROVAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL,\n self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL_REVERSED,\n self::STATUS_AUTH_ADJUSTMENT_AUTHORISED,\n self::STATUS_AUTH_ADJUSTMENT_ERROR,\n self::STATUS_AUTH_ADJUSTMENT_REFUSED,\n self::STATUS_AUTHORISED,\n self::STATUS_BANK_TRANSFER,\n self::STATUS_BANK_TRANSFER_PENDING,\n self::STATUS_BOOKED,\n self::STATUS_BOOKING_PENDING,\n self::STATUS_CANCELLED,\n self::STATUS_CAPTURE_PENDING,\n self::STATUS_CAPTURE_REVERSAL_PENDING,\n self::STATUS_CAPTURE_REVERSED,\n self::STATUS_CAPTURED,\n self::STATUS_CAPTURED_EXTERNALLY,\n self::STATUS_CHARGEBACK,\n self::STATUS_CHARGEBACK_EXTERNALLY,\n self::STATUS_CHARGEBACK_PENDING,\n self::STATUS_CHARGEBACK_REVERSAL_PENDING,\n self::STATUS_CHARGEBACK_REVERSED,\n self::STATUS_CREDITED,\n self::STATUS_DEPOSIT_CORRECTION,\n self::STATUS_DEPOSIT_CORRECTION_PENDING,\n self::STATUS_DISPUTE,\n self::STATUS_DISPUTE_CLOSED,\n self::STATUS_DISPUTE_EXPIRED,\n self::STATUS_DISPUTE_NEEDS_REVIEW,\n self::STATUS_ERROR,\n self::STATUS_EXPIRED,\n self::STATUS_FAILED,\n self::STATUS_FEE,\n self::STATUS_FEE_PENDING,\n self::STATUS_INTERNAL_TRANSFER,\n self::STATUS_INTERNAL_TRANSFER_PENDING,\n self::STATUS_INVOICE_DEDUCTION,\n self::STATUS_INVOICE_DEDUCTION_PENDING,\n self::STATUS_MANUAL_CORRECTION_PENDING,\n self::STATUS_MANUALLY_CORRECTED,\n self::STATUS_MATCHED_STATEMENT,\n self::STATUS_MATCHED_STATEMENT_PENDING,\n self::STATUS_MERCHANT_PAYIN,\n self::STATUS_MERCHANT_PAYIN_PENDING,\n self::STATUS_MERCHANT_PAYIN_REVERSED,\n self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING,\n self::STATUS_MISC_COST,\n self::STATUS_MISC_COST_PENDING,\n self::STATUS_OPERATION_AUTHORIZED,\n self::STATUS_OPERATION_BOOKED,\n self::STATUS_OPERATION_PENDING,\n self::STATUS_OPERATION_RECEIVED,\n self::STATUS_PAYMENT_COST,\n self::STATUS_PAYMENT_COST_PENDING,\n self::STATUS_RECEIVED,\n self::STATUS_REFUND_PENDING,\n self::STATUS_REFUND_REVERSAL_PENDING,\n self::STATUS_REFUND_REVERSED,\n self::STATUS_REFUNDED,\n self::STATUS_REFUNDED_EXTERNALLY,\n self::STATUS_REFUSED,\n self::STATUS_RESERVE_ADJUSTMENT,\n self::STATUS_RESERVE_ADJUSTMENT_PENDING,\n self::STATUS_RETURNED,\n self::STATUS_SECOND_CHARGEBACK,\n self::STATUS_SECOND_CHARGEBACK_PENDING,\n self::STATUS_UNDEFINED,\n ];\n }", "public function getOrderStatusAllowableValues() : array\n {\n return [\n self::ORDER_STATUS_PENDING,\n self::ORDER_STATUS_UNSHIPPED,\n self::ORDER_STATUS_PARTIALLY_SHIPPED,\n self::ORDER_STATUS_SHIPPED,\n self::ORDER_STATUS_CANCELED,\n self::ORDER_STATUS_UNFULFILLABLE,\n self::ORDER_STATUS_INVOICE_UNCONFIRMED,\n self::ORDER_STATUS_PENDING_AVAILABILITY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_RECEIVED,\nself::STATUS_COMPLETED,\nself::STATUS_CANCELLED, ];\n }", "public function getAutocreateAllowedStatusCodes()\n {\n $path = 'intraship/autocreate/autocreate_allowed-status-codes';\n $statusCodes = Mage::getStoreConfig($path);\n if (null === $statusCodes) {\n $statusCodes = '';\n }\n return $statusCodes;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_0,\nself::STATUS_1,\nself::STATUS_2, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::AWAITING_ORDER,\n self::SHIPPING_SOON,\n self::SHIPPED,\n self::DELIVERED,\n self::RETURNED,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_MINUS_1,\r\n self::STATUS_0,\r\n self::STATUS_1,\r\n self::STATUS_2,\r\n self::STATUS_3,\r\n self::STATUS_4,\r\n self::STATUS_5,\r\n self::STATUS_6,\r\n self::STATUS_7,\r\n self::STATUS_8,\r\n self::STATUS_9,\r\n self::STATUS_10,\r\n self::STATUS_11,\r\n ];\r\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ORDER_STATUS_CHANGE,\n self::BUYER_REQUESTED_CHANGE,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_LOCKED,\nself::STATUS_AVAILABLE, ];\n }", "public function getValidStatusCodes()\n {\n return array(\n self::STATUS_OK,\n self::STATUS_ACCEPTED,\n self::STATUS_NON_AUTHORITATIVE_INFORMATION,\n self::STATUS_NO_CONTENT,\n self::STATUS_RESET_CONTENT,\n self::STATUS_PARTIAL_CONTENT,\n self::STATUS_CREATED\n );\n }", "function getOrderStatusList(){\n\treturn [\n\t\t\"NEW\" => [\n\t\t\t'code' => 1,\n\t\t\t'text' => \"Yet to Start\"\n\t\t],\n\t\t\"IN_PROGRESS\" => [\n\t\t\t'code' => 2,\n\t\t\t'text' => \"Working\"\n\t\t],\n\t\t\"DELIVERED\" => [\n\t\t\t'code' => 3,\n\t\t\t'text' => \"Delivered\"\n\t\t],\n\t\t\"IN_REVIEW\" => [\n\t\t\t'code' => 4,\n\t\t\t'text' => \"In review\"\n\t\t],\n\t\t\"COMPLETED\" => [\n\t\t\t'code' => 5,\n\t\t\t'text' => \"Completed\"\n\t\t],\n\t\t\"CANCELLED\" => [\n\t\t\t'code' => 6,\n\t\t\t'text' => \"Cancelled\"\n\t\t],\n\t\t\"PENDIND_REQUIREMENT\" => [\n\t\t\t'code' => 7,\n\t\t\t'text' => \"Pending Requirement\"\n\t\t]\n\t];\n}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_TEMPORARY,\n self::STATUS_SAVED,\n self::STATUS_POSTED,\n self::STATUS_COMMITTED,\n self::STATUS_CANCELLED,\n self::STATUS_ADJUSTED,\n self::STATUS_QUEUED,\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_ANY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_CANCELED,\n self::STATUS_DISABLED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_PENDING,\n self::STATUS_SUCCESSFUL,\n self::STATUS_NOT_SUCCESSFUL,\n self::STATUS_DISCARDED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_REQUESTED,\n self::STATUS_RESERVED,\n self::STATUS_IN_HOUSE,\n self::STATUS_CANCELLED,\n self::STATUS_CHECKED_OUT,\n self::STATUS_NO_SHOW,\n self::STATUS_WAIT_LIST,\n self::STATUS_UNKNOWN,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_FREEZED,\r\n self::STATUS_DOWN,\r\n self::STATUS_ACTIVE,\r\n self::STATUS_ERROR,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PLACEMENT_ACTIVE,\nself::STATUS_TERMINATED,\nself::STATUS_RENEWAL_PENDING,\nself::STATUS_PLACEMENT_STARTING, ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_QUEUED,\n self::STATUS_PROPOSING,\n self::STATUS_ACCEPTED,\n self::STATUS_FAILED,\n self::STATUS_ACTIVE,\n self::STATUS_PUBLISHED,\n self::STATUS_TERMINATED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_NOT_SUBSCRIBED,\n self::STATUS_SUBSCRIBED,\n self::STATUS_IN_PROGRESS,\n self::STATUS_COMPLETED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::CANCELLED,\nself::NEED_TO_BE_SENT,\nself::OPEN,\nself::RECEIVED,\nself::RETURNED,\nself::RETURNED_PAID,\nself::SENT,\nself::SENT_AND_AUTOPAID, ];\n }", "public function getOrderStatus(){\n return $this->_getData(self::ORDER_STATUS);\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_RUNNING,\r\n self::STATUS_ABNORMAL,\r\n self::STATUS_INSTALLING,\r\n self::STATUS_INSTALL_FAILED,\r\n self::STATUS_UPGRADING,\r\n self::STATUS_UPGRADE_FAILED,\r\n self::STATUS_DELETING,\r\n self::STATUS_DELETE_SUCCESS,\r\n self::STATUS_DELETE_FAILED,\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_ROLLBACKING,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_FINISHED,\n ];\n }", "public function getValidUnsentOrderStatuses()\n {\n $statuses = $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/valid_unsent_order_statuses',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n\n return explode(',', $statuses);\n }", "public function get_order_statuses( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t$statuses = get_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status' );\n\n\t\tif ( ! $statuses ) {\n\t\t\t$statuses = array();\n\t\t}\n\n\t\treturn $statuses;\n\t}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING,\n self::STATUS_INPROGRESS,\n self::STATUS_SUCCESS,\n self::STATUS_FAILED,\n self::STATUS_TIMEOUT,\n self::STATUS_PARTIALSUCCESS,\n ];\n }", "public static function getOrderFormStatusChoices(): array\n {\n //====================================================================//\n // Load Prestashop Status List\n return array_merge_recursive(\n array(array(\n \"id_order_state\" => 0,\n \"name\" => \"Use Generic Status\",\n )),\n OrderState::getOrderStates(SLM::getDefaultLangId())\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_INITIALIZED,\n self::STATUS_CHALLENGE_REQUIRED,\n self::STATUS_CHALLENGE_ONGOING,\n self::STATUS_AUTHENTICATED,\n self::STATUS_AUTHORIZED,\n self::STATUS_SETTLED,\n self::STATUS_CANCELED,\n self::STATUS_TRANSMITTED,\n self::STATUS_FAILED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_IDLE,\n self::STATUS_DISABLED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNSHIPPED,\n self::SHIPPED,\n self::CANCELED_BY_SELLER,\n self::CANCELED_BY_BUYER,\n self::RETURNED,\n self::REFUNDED,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_PROTECTING,\r\n self::STATUS_DELETING,\r\n self::STATUS_RESTORING,\r\n self::STATUS_ERROR,\r\n self::STATUS_WAITING_PROTECT,\r\n self::STATUS_WAITING_DELETE,\r\n self::STATUS_WAITING_RESTORE,\r\n ];\r\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::SYSTEMTEST,\n self::SYSTEMNOTIFICATION,\n self::SELLERORDER_ACCEPTED,\n self::SELLERORDER_SHIPPING,\n self::SELLERORDER_PAYMENT,\n self::SELLERORDER_CANCELLATION_REQUEST,\n self::SELLERORDER_CANCELLATION_ACCEPTED,\n self::SELLERORDER_CANCELLATION_DENIED,\n self::SELLERORDER_REFUND,\n self::SELLERORDER_INVOICE,\n self::SELLERORDER_RETURN_RECEIVED,\n self::SELLEROFFER_NEW,\n self::SELLEROFFER_UPDATE,\n self::SELLEROFFER_END,\n self::SELLEROFFER_STOCK_UPDATE,\n self::SELLEROFFER_PRICE_UPDATE,\n self::SELLERREPORT_REQUEST,\n self::SELLERCHANNEL_UNLINKED,\n self::SELLERMETA_SELLER_ATTRIBUTES_UPDATE_REQUEST,\n self::SELLERTICKET_REPLY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_ON_HOLD,\n self::STATUS_HOLD_PAYMENTS,\n self::STATUS_INACTIVE,\n self::STATUS_ONE_TIME,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DELETED,\n self::STATUS_ACTIVE,\n self::STATUS_PROCESSING,\n self::STATUS_SENDING,\n self::STATUS_COMPLETED,\n self::STATUS_PAUSED,\n self::STATUS_CANCELLED,\n self::STATUS_DRAFT,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_EXPIRED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_MEETING,\n self::STATUS_WAITING_ROOM,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PASS_PROTOCOL_DO_NOT_USE,\nself::RAW_PROTOCOL,\nself::V1_PROTOCOL,\nself::FLIGHT_PROTOCOL,\nself::MEMBERSHIP,\nself::SINGLE_USE_COUPON, ];\n }", "public static function getPossibleStatuses()\n {\n return array(\n 'Not started',\n 'Started',\n 'Finished',\n );\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_CREATION_IN_PROGRESS,\r\n self::STATUS_CREATION_FAILED,\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_APPLY_IN_PROGRESS,\r\n self::STATUS_APPLIED,\r\n ];\r\n }", "public function getOrderStatuses()\n {\n $response = $this->client->request('GET', '/v1/settings/orderstatuses');\n return new GetOrderStatusesResponse($response);\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DRAFT,\n self::STATUS_IN_PROGRESS,\n self::STATUS_APPROVED,\n self::STATUS_REJECTED,\n self::STATUS_FEEDBACK,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_LAUNCHING,\r\n self::STATUS_RUNNING,\r\n self::STATUS_FINISHED,\r\n self::STATUS_FAILED,\r\n self::STATUS_CANCELLED,\r\n ];\r\n }", "public function getAvailableStatuses()\n {\n return [\n self::STATUS_NEW => 'New',\n self::STATUS_PROCESSING => 'Processing',\n self::STATUS_DONE => 'Done',\n self::STATUS_ERROR => 'Error'\n ];\n }", "public function getStatus() {\r\n\t\t$status = array();\r\n\t\tif ($this -> draft) {\r\n\t\t\t$status['type'] = 0;\r\n\t\t\t$status['condition'] = 'draft';\r\n\t\t\treturn $status;\r\n\t\t}\r\n\t\tif ($this -> is_approved) {\r\n\t\t\t$status['type'] = 2;\r\n\t\t\t$status['condition'] = 'approved';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$status['type'] = 1;\r\n\t\t\t$status['condition'] = 'pending';\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_CONSISTENT,\r\n self::STATUS_INCONSISTENT,\r\n self::STATUS_COMPARING,\r\n self::STATUS_WAITING_FOR_COMPARISON,\r\n self::STATUS_FAILED_TO_COMPARE,\r\n self::STATUS_TARGET_DB_NOT_EXIST,\r\n self::STATUS_CAN_NOT_COMPARE,\r\n ];\r\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_INIT,\r\n self::STATUS_EXECUTING,\r\n self::STATUS_ERROR,\r\n self::STATUS_TIMEOUT,\r\n self::STATUS_FINISHED,\r\n ];\r\n }", "function getOrderStatusCodes(...$keys){\n\t$order_status = getOrderStatusList();\n\t$codes = [];\n\tforeach($keys as $key){\n\t\tif (isset($order_status[$key])) {\n\t\t\tarray_push($codes, $order_status[$key]['code']);\n\t\t}\n\t}\n\treturn $codes;\n}", "public function getMapOrderStatuses()\n {\n return $this->map_order_statuses;\n }", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_ARCHIVED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PENDING,\n self::PENDING_SENT,\n self::PENDING_DOCUMENT_SENT,\n self::PENDING_PROGRESS,\n self::PENDING_UPDATE,\n self::PENDING_SENT_UPDATE,\n self::TIMEOUT,\n self::ACCEPT,\n self::DECLINE,\n self::INVALID_NAME,\n self::FAILED,\n self::CANCEL,\n self::AUTO_CANCEL,\n self::ACTIVE,\n self::SENT,\n self::OPEN,\n self::TMCH_CLAIM,\n self::TMCH_CLAIM_CONFIRMED,\n self::TMCH_CLAIM_REJECTED,\n self::TMCH_CLAIM_EXPIRED,\n self::TMCH_CLAIM_PENDING,\n self::TMCH_CLAIM_FAILED,\n self::FAILED_REF,\n ];\n }", "public static function statuses() {\n return [\n self::STATUS_ACTIVE => 'Активный',\n self::STATUS_DISABLED => 'Отключен',\n ];\n }", "public function getItemStatusAllowableValues()\n {\n $baseVals = [\n self::ITEM_STATUS_ACTIVE,\n self::ITEM_STATUS_CANCELLED,\n self::ITEM_STATUS_SHIPPED,\n self::ITEM_STATUS_DELIVERED,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PREPROCESSING,\n self::STAGING_QUEUED,\n self::STAGING,\n self::STAGING_COMPLETED,\n self::STAGING_FAILED,\n self::TRANSFORMING_QUEUED,\n self::TRANSFORMING,\n self::TRANSFORMING_FAILED,\n self::TRANSFORMING_COMPLETED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_SUCCESS,\n self::STATUS_UNKNOWN_DEVICE,\n self::STATUS_UNCONFIRMED_DEVICE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNKNOWN,\n self::PENDING,\n self::PROCESSING,\n self::SUCCESS,\n self::FAIL,\n self::PARTIAL_FAIL,\n self::SYSTEM_ERROR,\n self::DELETED,\n ];\n }", "public static function fetch_order_status() {\n $order_id = wc_get_order( $_POST['order_id'] );\n $order_key = OmisePluginHelperWcOrder::get_order_key_by_id( $order_id );\n\n if ( ! wp_verify_nonce( $_POST['nonce'], $order_key ) ) {\n die ( 'Busted!');\n }\n\n wp_send_json_success( array( 'order_status' => $order_id->get_status() ) );\n }", "function getOrderStatusCode($key){\n\t$order_status = getOrderStatusList();\n\tif ($order_status[$key]) {\n\t\treturn $order_status[$key]['code'];\n\t}\n\treturn null;\n}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_PAUSED,\n self::STATUS_DELETED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::OFFER,\n self::CHANNELOFFER,\n self::ORDERITEMID,\n ];\n }", "public function getOrderTypeAllowableValues()\n {\n return [\n self::ORDER_TYPE_STANDARD_ORDER,\n self::ORDER_TYPE_LONG_LEAD_TIME_ORDER,\n self::ORDER_TYPE_PREORDER,\n self::ORDER_TYPE_BACK_ORDER,\n self::ORDER_TYPE_SOURCING_ON_DEMAND_ORDER,\n ];\n }", "public function getEnumStatusSupply(){\n return ['WAITING','IN PROGRESS','CANCELED','COMPLETED'];\n }", "protected function getHttpResponseCodes() {\n return array (\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Switch Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 418 => 'I\\'m a teapot',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 425 => 'Unordered Collection',\n 426 => 'Upgrade Required',\n 449 => 'Retry With',\n 450 => 'Blocked by Windows Parental Controls',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 509 => 'Bandwidth Limit Exceeded',\n 510 => 'Not Extended'\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_WON,\n self::STATUS_ELIMINATED,\n self::STATUS_PLAYING,\n ];\n }", "public static function statuses()\n {\n return [\n self::STATUS_PENDING => Yii::t('app', 'Pending'),\n self::STATUS_REJECTED => Yii::t('app', 'Rejected'),\n self::STATUS_ACCEPTED => Yii::t('app', 'Accepted')\n ];\n }", "public function getValidationStatusAllowableValues()\n {\n return [\n self::VALIDATION_STATUS_SUCCESS,\n self::VALIDATION_STATUS_FAILURE,\n self::VALIDATION_STATUS_SKIPPED,\n self::VALIDATION_STATUS_UNKNOWN,\n ];\n }", "public function get_valid_statuses() {\n\t\treturn array_keys( _wc_cs_get_credits_statuses() ) ;\n\t}", "public static function getAllowableEnumValues()\n {\n return [\n self::_201,\n self::_202,\n self::_203,\n self::_204,\n self::_244,\n self::_205\n ];\n }", "public function allowedOrderStateDataProvider()\n {\n return [\n [Order::STATE_PROCESSING],\n [Order::STATE_COMPLETE],\n [Order::STATE_PAYMENT_REVIEW],\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NOT_ENOUGH_DELIVERY_TARGET,\n self::OUT_OF_STOCK,\n self::OVER_SOV_DAILY_LIMIT,\n self::OVER_SOV_WEEKLY_LIMIT,\n self::UNKNOWN,\n ];\n }", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "protected static function getBackupCodeJsonStatusCodes()\n {\n return array(\n self::NO_IDENTIFIER_SUPPLIED,\n self::NO_TOKEN_SUPPLIED,\n self::INVALID_TOKEN,\n self::IDENTIFIER_TOO_LONG,\n );\n }", "public function getOrderTypeAllowableValues() : array\n {\n return [\n self::ORDER_TYPE_STANDARD_ORDER,\n self::ORDER_TYPE_LONG_LEAD_TIME_ORDER,\n self::ORDER_TYPE_PREORDER,\n self::ORDER_TYPE_BACK_ORDER,\n self::ORDER_TYPE_SOURCING_ON_DEMAND_ORDER,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::CREATED,\n self::USED,\n self::EXPIRED,\n self::CANCELLED,\n ];\n }", "public static function getOrderStatusChoices(): array\n {\n //====================================================================//\n // Load Prestashop Status List\n $psStates = OrderState::getOrderStates(SLM::getDefaultLangId());\n $choices = array();\n //====================================================================//\n // Walk on Prestashop States List\n foreach ($psStates as $psState) {\n //====================================================================//\n // If State is Know\n if (!self::isKnown($psState[\"id_order_state\"])) {\n continue;\n }\n //====================================================================//\n // Detect Splash State Code\n $code = self::getSplashCode($psState[\"id_order_state\"]);\n if (isset($choices[$code])) {\n continue;\n }\n $choices[$code] = $psState[\"name\"];\n }\n\n return $choices;\n }", "public function getQuotationStatusAllowableValues()\n {\n return [\n self::QUOTATION_STATUS_UNSUBMITTED,\n self::QUOTATION_STATUS_SUBMITTED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::LEGACY,\n self::STATIC_REMOTE_KEY,\n self::ANCHORS,\n self::UNKNOWN_COMMITMENT_TYPE,\n ];\n }", "public static function getStatusList() {\r\n return [\r\n self::STATUS_ACTIVE => 'Active',\r\n self::STATUS_RETIRED => 'Retired'\r\n ];\r\n }", "public function getAllStatus()\n {\n return OrderStatus::all();\n }", "public static function getValidStatuses(): array\n {\n return array_keys(self::getStatuses());\n }", "public function getOrderStatus()\n {\n return $this->status;\n }", "function get_allowed_woo_status_ps_sms()\n{\n if (!function_exists('wc_get_order_statuses'))\n return;\n $statuses = wc_get_order_statuses() ? wc_get_order_statuses() : array();\n $order_status_settings = ps_sms_options('order_status', 'sms_buyer_settings', array());\n $allowed_statuses = array();\n foreach ((array) $statuses as $status_val => $status_name) {\n if (in_array(substr($status_val, 3), $order_status_settings))\n $allowed_statuses[substr($status_val, 3)] = $status_name;\n }\n return $allowed_statuses;\n}", "protected static function getStatuses()\n {\n return [\n CrudController::STATUS_SUCCESS => 'successfully',\n CrudController::STATUS_FAILURE => 'unsuccessfully',\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNSUPPORTED,\n self::UNKNOWN,\n self::CASH,\n self::GIFT,\n self::SPECIAL_PROMOTION,\n self::PAYMENT_DUE,\n self::CREDIT_TEMPORARY,\n self::CREDIT_ROLL,\n self::TCC_GIFT,\n self::UNSUPPPORTED,\n self::MINIPROGRAM,\n self::CREDIT,\n self::INNER,\n self::DEBT_TEMP,\n self::DEBT_FIXED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::COPY_CODE,\n self::ONE_TAP\n ];\n }", "public function getInvoiceStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0, 'name' => 'Completed'); //done, can not be edited, but not retured\r\n\t\t\t$status[1] = array('id' => 1, 'name' => 'Unfinished'); //still open, can be edited\r\n\t\t\t$status[2] = array('id' => 2, 'name' => 'Returned'); //done, can not be edited, retured\r\n\t\t\t$status[3] = array('id' => 3, 'name' => 'Closed'); //memo only, done, closed out. memo close date updated\r\n\t\t\t$status[4] = array('id' => 4, 'name' => 'Converted'); //memo only, converted\r\n\t\t\t$status[5] = array('id' => 5, 'name' => 'Cancelled'); //layaways only, cancelled\r\n\t\treturn $status;\r\n\t}", "public static function getArrayStatus() {\n return array(\n self::STATUS_INACTIVE => DomainConst::CONTENT00408,\n self::STATUS_ACTIVE => DomainConst::CONTENT00539,\n self::STATUS_APPROVED => DomainConst::CONTENT00476,\n self::STATUS_CANCEL => DomainConst::CONTENT00477,\n self::STATUS_REQUIRED_UPDATE => DomainConst::CONTENT00478,\n );\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "public function getIdrunstatusAllowableValues()\n {\n return [\n self::IDRUNSTATUS_4010,\n self::IDRUNSTATUS_4020,\n self::IDRUNSTATUS_4030,\n ];\n }", "public function getEnumValues()\n {\n return array(\n 'PHONE_VERIFICATION_STATUS_UNKNOWN' => self::PHONE_VERIFICATION_STATUS_UNKNOWN,\n 'PHONE_VERIFICATION_STATUS_VERIFIED' => self::PHONE_VERIFICATION_STATUS_VERIFIED,\n );\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::O,\n self::PP,\n self::ID,\n self::DL,\n self::OT,\n ];\n }", "public function getStatusList()\n {\n return [\n self::STATUS_CREATED,\n self::STATUS_SUCCESS,\n self::STATUS_FAIL\n ];\n }", "public function providerRetriableCodes() {\n return array(\n array(Response::STATUS_CODE_429),\n array(Response::STATUS_CODE_503),\n array(Response::STATUS_CODE_504)\n );\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::TO_RENTED,\n self::TO_SOLD,\n self::TO_WITHDRAWN,\n self::TO_AVAILABLE,\n self::TO_UNDER_OFFER,\n self::TO_UNDER_OPTION,\n ];\n }", "public function getStatusesAsArray()\n {\n return array(\n Braintree_Transaction::AUTHORIZATION_EXPIRED => $this->__('Authorization Expired'),\n Braintree_Transaction::AUTHORIZING => $this->__('Authorizing'),\n Braintree_Transaction::AUTHORIZED => $this->__('Authorized'),\n Braintree_Transaction::GATEWAY_REJECTED => $this->__('Gateway Rejected'),\n Braintree_Transaction::FAILED => $this->__('Failed'),\n Braintree_Transaction::PROCESSOR_DECLINED => $this->__('Processor Declined'),\n Braintree_Transaction::SETTLED => $this->__('Settled'),\n Braintree_Transaction::SETTLING => $this->__('Settling'),\n Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT => $this->__('Submitted For Settlement'),\n Braintree_Transaction::VOIDED => $this->__('Voided'),\n Braintree_Transaction::UNRECOGNIZED => $this->__('Unrecognized'),\n Braintree_Transaction::SETTLEMENT_DECLINED => $this->__('Settlement Declined'),\n Braintree_Transaction::SETTLEMENT_PENDING => $this->__('Settlement Pending')\n );\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::REASON_FOR_MOVING_EXPIRED,\n self::ASKING_PRICE_NOT_MET,\n self::RENEW_OBJECT_IN_MEDIA,\n self::CHOSE_OTHER_REAL_ESTATE_AGENT,\n self::PURCHASED_BY_OWNER,\n self::SOLD_BY_OTHER_REAL_ESTATE_AGENT,\n self::OWNER_HAS_RENTED_PROPERTY,\n self::LOGGED_OF_AS_BOG_OBJECT,\n self::WITHDRAWN_FROM_AUCTION,\n self::SELLER_CONTINUES_TO_INHABIT,\n self::OBJECT_REGISTERED_TWICE,\n self::ASSIGNMENT_TERMINATED_BY_REALTOR,\n ];\n }" ]
[ "0.7346533", "0.71609074", "0.7136835", "0.70839745", "0.69826186", "0.68639934", "0.685117", "0.685117", "0.680649", "0.67214763", "0.67155796", "0.6693787", "0.66892797", "0.66667557", "0.6659035", "0.6629131", "0.66114885", "0.6595187", "0.65838534", "0.6561804", "0.6534793", "0.652398", "0.6521217", "0.6514153", "0.65127903", "0.65102255", "0.6506022", "0.6505027", "0.6503435", "0.6500031", "0.64809084", "0.647735", "0.6471195", "0.64709574", "0.6454716", "0.6446713", "0.6445031", "0.64324623", "0.6430032", "0.6416444", "0.64141136", "0.64120495", "0.64106804", "0.6402758", "0.63980067", "0.63967514", "0.6390687", "0.6384787", "0.6379389", "0.636559", "0.6364999", "0.6348929", "0.63485575", "0.63444895", "0.63139814", "0.6310587", "0.63081884", "0.6307151", "0.62990475", "0.6296662", "0.6293319", "0.62800854", "0.6277572", "0.6273972", "0.6264836", "0.62595856", "0.6253693", "0.6236424", "0.62295187", "0.6226065", "0.62080353", "0.62059325", "0.61980015", "0.6197034", "0.6196767", "0.61967534", "0.6171092", "0.6166897", "0.61597383", "0.61525553", "0.61485314", "0.61478907", "0.614603", "0.6140914", "0.612676", "0.61161566", "0.6109041", "0.61083275", "0.60950285", "0.60940737", "0.60906726", "0.6090387", "0.6075447", "0.60697573", "0.6048499", "0.60479265", "0.6046979", "0.60374653", "0.6037208", "0.6037077" ]
0.60520077
94
Obtain commaseparated list of payment method codes that apply for shipment auto creation.
public function getAutocreateAllowedPaymentMethods() { $path = 'intraship/autocreate/autocreate_allowed-payments'; $methodCodes = Mage::getStoreConfig($path); if (null === $methodCodes) { $methodCodes = ''; } return $methodCodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_ACC,\n self::PAYMENT_METHOD_ALP,\n self::PAYMENT_METHOD_APL,\n self::PAYMENT_METHOD_AMX,\n self::PAYMENT_METHOD_AZP,\n self::PAYMENT_METHOD_BON,\n self::PAYMENT_METHOD_CFY,\n self::PAYMENT_METHOD_CSY,\n self::PAYMENT_METHOD_CUP,\n self::PAYMENT_METHOD_DIN,\n self::PAYMENT_METHOD_DII,\n self::PAYMENT_METHOD_DIB,\n self::PAYMENT_METHOD_DIS,\n self::PAYMENT_METHOD_DNK,\n self::PAYMENT_METHOD_ECA,\n self::PAYMENT_METHOD_ELV,\n self::PAYMENT_METHOD_EPS,\n self::PAYMENT_METHOD_ESY,\n self::PAYMENT_METHOD_INT,\n self::PAYMENT_METHOD_JCB,\n self::PAYMENT_METHOD_JEL,\n self::PAYMENT_METHOD_KLN,\n self::PAYMENT_METHOD_MAU,\n self::PAYMENT_METHOD_MDP,\n self::PAYMENT_METHOD_MFX,\n self::PAYMENT_METHOD_MPX,\n self::PAYMENT_METHOD_MYO,\n self::PAYMENT_METHOD_PAP,\n self::PAYMENT_METHOD_PAY,\n self::PAYMENT_METHOD_PEF,\n self::PAYMENT_METHOD_PFC,\n self::PAYMENT_METHOD_PSC,\n self::PAYMENT_METHOD_REK,\n self::PAYMENT_METHOD_SAM,\n self::PAYMENT_METHOD_SWB,\n self::PAYMENT_METHOD_SCX,\n self::PAYMENT_METHOD_SWP,\n self::PAYMENT_METHOD_TWI,\n self::PAYMENT_METHOD_UAP,\n self::PAYMENT_METHOD_VIS,\n self::PAYMENT_METHOD_WEC,\n ];\n }", "public function getPaymentMethods() {\r\n\t\t//@TODO: Insert PaymentMethods into the datebase, create table\r\n\t\t$payment_methods = array();\r\n\t\t\t$payment_methods[0] = array('id' => 0, 'name' => 'AMEX');\r\n\t\t\t$payment_methods[1] = array('id' => 1, 'name' => 'Discover');\r\n\t\t\t$payment_methods[2] = array('id' => 2, 'name' => 'Mastercard');\r\n\t\t\t$payment_methods[3] = array('id' => 3, 'name' => 'Visa');\r\n\t\t\t$payment_methods[4] = array('id' => 4, 'name' => 'Store Credit');\r\n\t\t\t$payment_methods[5] = array('id' => 5, 'name' => 'Check');\r\n\t\t\t$payment_methods[6] = array('id' => 6, 'name' => 'Wire Transfer');\r\n\t\t\t$payment_methods[7] = array('id' => 7, 'name' => 'Trade');\r\n\t\t\t$payment_methods[9] = array('id' => 9, 'name' => 'Cash');\r\n\t\treturn $payment_methods; //array\r\n\t}", "public function getPaymentMethodsForCod()\n {\n return $this->_toArrayObject($this->getConfig(\n 'packages/global_settings_payments-for-cod'));\n }", "public static function getPaymentMethods() {\n\n // return array(\n // self::PAYMENT_METHOD_PAY_PAL => 'Pay Pal',\n // self::PAYMENT_METHOD_MONEY_BOOKERS => 'Skrill',\n // self::PAYMENT_METHOD_WIRE_TRANSFER => 'Wiretransfer',\n // );\n\n $payment_methods = array();\n\n if(Option::getByName('payment_method_paypal')) \n $payment_methods[self::PAYMENT_METHOD_PAY_PAL] = 'Pay Pal';\n\n if(Option::getByName('payment_method_skrill')) \n $payment_methods[self::PAYMENT_METHOD_MONEY_BOOKERS] = 'Skrill';\n\n if(Option::getByName('payment_method_wiretransfer') && Option::getByName('wiretransfer_doc_path')) \n $payment_methods[self::PAYMENT_METHOD_WIRE_TRANSFER] = 'Wiretransfer';\n\n if(Option::getByName('payment_method_check')) \n $payment_methods[self::PAYMENT_METHOD_CHECK] = 'Check';\n\n if(Option::getByName('payment_method_no_payment')) \n $payment_methods[self::PAYMENT_METHOD_NO_PAYMENT] = 'No Payment';\n\n return $payment_methods;\n }", "public function getAvailablePaymentMethods ();", "public function getActiveMethods(){\n\n $activeCarriers = $this->shipmentConfig->getActiveCarriers();\n $methods = array();\n\n foreach($activeCarriers as $carrierCode => $carrierModel)\n {\n $carrierTitle =$this->scopeConfig->getValue('carriers/'.$carrierCode.'/title');\n\n if( $carrierMethods = $carrierModel->getAllowedMethods() )\n {\n foreach ($carrierMethods as $methodCode => $method)\n {\n $code= $carrierCode.'_'.$methodCode;\n $methods[]=array(\n 'label'=>$carrierTitle,\n 'value'=>$code\n );\n }\n }\n }\n\n return $methods; \n }", "public static function getPaymentMethods()\n {\n return [\n static::MAIL,\n static::DIRECT_DEPOSIT,\n ];\n }", "public function getAutocreatePaymentMethods()\n {\n return $this->_toArrayObject($this->getConfig(\n 'autocreate/autocreate_allowed-payments'));\n }", "public static function listPaymentMethods()\n {\n return [\n [\n 'id' => self::PAYMENT_BY_CASH,\n 'name' => 'Tiền mặt',\n ],\n [\n 'id' => self::PAYMENT_BY_CONTRACT,\n 'name' => 'Hợp đồng',\n ],\n ];\n }", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "function getAutoEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\t\n\t$autoEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoEnabledPaymentMethod() == \"y\" )\n\t\t{\n\t\t\tarray_push($autoEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\treturn $autoEnabledPaymentMethod;\n\t\n}", "public static function PaymentOptionList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'pyr'=>t(\"Pay On Delivery\"),\n \t 'pyp'=>t(\"paypal\"),\n \t 'stp'=>t(\"stripe\"),\n \t 'mcd'=>t(\"mercapado\"),\n \t 'ide'=>t(\"sisow\"),\n \t 'payu'=>t(\"payumoney\"),\n \t 'pys'=>t(\"paysera\"), \t \n \t 'bcy'=>t(\"Barclay\"),\n \t 'epy'=>t(\"EpayBg\"),\n \t 'atz'=>t(\"Authorize.net\"),\n \t 'obd'=>t(\"Offline Bank Deposit\"),\n \t 'btr' =>t(\"Braintree\")\n \t);\n }", "public function getPayMethodAllowableValues()\n {\n return [\n self::PAY_METHOD_BANK_TRANSFER,\nself::PAY_METHOD_CHEQUE,\nself::PAY_METHOD_CREDIT_CARD,\nself::PAY_METHOD_GIRO_ACH,\nself::PAY_METHOD_OTHER, ];\n }", "public function getCardsPaymentMethods()\n {\n $payment_methods = Mage::getModel('mercadopago/core')->getPaymentMethods();\n $payment_methods_types = array(\"credit_card\", \"debit_card\", \"prepaid_card\");\n $types = array();\n\n //percorre todos os payments methods\n foreach ($payment_methods['response'] as $pm) {\n\n //filtra por payment_methods\n if (in_array($pm['payment_type_id'], $payment_methods_types)) {\n $types[] = $pm;\n }\n }\n\n return $types;\n }", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_COD,\n self::PAYMENT_METHOD_CVS,\n self::PAYMENT_METHOD_OTHER,\n ];\n }", "function getCronEnabledPaymentMethods()\n{\n\t$registeredPaymentMethods = getRegisteredPaymentMethods();\n\t\n\t$cronEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoChargeEnabledPaymentMethod() == \"y\")\n\t\t{\n\t\t\tarray_push($cronEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\t$autoChargePaymentMethod = implode(\",\", $cronEnabledPaymentMethod);\n\t\n\treturn $autoChargePaymentMethod;\n}", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_NONE,\n self::PAYMENT_METHOD_DOMESTIC_BANK_TRANSFER,\n self::PAYMENT_METHOD_ABROAD_BANK_TRANSFER,\n self::PAYMENT_METHOD_ACCOUNT_TRANSFER,\n self::PAYMENT_METHOD_CREDIT_CARD,\n ];\n }", "public static function payment_methods() {\n return array(\n CheckfrontModule::PaymentPayNow => 'Pay now',\n CheckfrontModule::PaymentPayLater => 'Pay later'\n );\n }", "public function get_payment_methods()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function get_payment_methods()\n\t{\n\t\t//retrieve all invoice\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function getPaymentMethodAllowableValues() : array\n {\n return [\n self::PAYMENT_METHOD_COD,\n self::PAYMENT_METHOD_CVS,\n self::PAYMENT_METHOD_OTHER,\n ];\n }", "public function getAllowedMethods()\n {\n return [$this->_code => __($this->getConfigData(self::SHIPPING_NAME))];\n }", "public function getMethodOfPaymentAllowableValues()\n {\n $baseVals = [\n self::METHOD_OF_PAYMENT_PAID_BY_BUYER,\n self::METHOD_OF_PAYMENT_COLLECT_ON_DELIVERY,\n self::METHOD_OF_PAYMENT_DEFINED_BY_BUYER_AND_SELLER,\n self::METHOD_OF_PAYMENT_FOB_PORT_OF_CALL,\n self::METHOD_OF_PAYMENT_PREPAID_BY_SELLER,\n self::METHOD_OF_PAYMENT_PAID_BY_SELLER,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "public function getShippingMethods()\n {\n $array = array();\n foreach ($this->config as $key => $item) {\n if ($key == 'allowed_domestic_methods') {\n foreach ($item as $item_internal) {\n $array['Domestic'][] = $item_internal['name'];\n }\n }\n\n if ($key == 'allowed_international_methods') {\n foreach ($item as $item_internal) {\n $array['International'][] = $item_internal['name'];\n }\n }\n }\n return $array;\n }", "public function getPaymentMethods()\n {\n return $this->payment_methods;\n }", "function paymentmethods() {\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,payment_method,status FROM #__em_paymentmethod\";\r\n $db->setQuery($query);\r\n $result = $db->loadObjectList();\r\n return $result;\r\n }", "public static function getPaymentMethods($exclude_cash = false) {\n\t\treturn $exclude_cash ?\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->andWhere(['not', ['name' => Payment::CASH]])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t:\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t;\n\t}", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_BANK_TRANSFER,\n self::METHOD_BILLING_PROVIDER,\n self::METHOD_CASH_ON_DELIVERY,\n self::METHOD_CHECK_PAYMENT,\n self::METHOD_CREDIT_CARD,\n self::METHOD_DEBIT_CARD,\n self::METHOD_DIRECT_DEBIT,\n self::METHOD_ELECTRONIC_INVOICE,\n self::METHOD_GIFT_CARD,\n self::METHOD_MOBILE_PAYMENT,\n self::METHOD_ONLINE_BANK_TRANSFER,\n self::METHOD_OPEN_INVOICE,\n self::METHOD_PREPAID_CARD,\n self::METHOD_TERMINAL,\n self::METHOD_WALLET,\n ];\n }", "public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}", "public function get_supported_payment_methods() {\n\t\treturn array(\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANCONTACT,\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANK_TRANSFER,\n\t\t\tPronamic_WP_Pay_PaymentMethods::CREDIT_CARD,\n\t\t\tPronamic_WP_Pay_PaymentMethods::IDEAL,\n\t\t\tPronamic_WP_Pay_PaymentMethods::SOFORT,\n\t\t);\n\t}", "public static function getPaymentTypes()\n\t{\n\t\t$types = array('' => 'Any');\n\t\treturn array_merge($types, PaymentMethod::getPaymentMethods());\n\t}", "public function getPaymentTypeAllowableValues()\n {\n return [\n self::PAYMENT_TYPE_CARD,\n self::PAYMENT_TYPE_MPO,\n self::PAYMENT_TYPE_MOBILEPAY,\n self::PAYMENT_TYPE_VIPPS,\n self::PAYMENT_TYPE_VIPPS_RECURRING,\n self::PAYMENT_TYPE_SWISH,\n self::PAYMENT_TYPE_VIABILL,\n self::PAYMENT_TYPE_ANYDAY,\n self::PAYMENT_TYPE_MANUAL,\n self::PAYMENT_TYPE_APPLEPAY,\n self::PAYMENT_TYPE_GOOGLEPAY,\n self::PAYMENT_TYPE_PAYPAL,\n self::PAYMENT_TYPE_KLARNA_PAY_NOW,\n self::PAYMENT_TYPE_KLARNA_PAY_LATER,\n self::PAYMENT_TYPE_KLARNA_SLICE_IT,\n self::PAYMENT_TYPE_KLARNA_DIRECT_BANK_TRANSFER,\n self::PAYMENT_TYPE_KLARNA_DIRECT_DEBIT,\n self::PAYMENT_TYPE_RESURS,\n self::PAYMENT_TYPE_MOBILEPAY_SUBSCRIPTIONS,\n self::PAYMENT_TYPE_EMV_TOKEN,\n self::PAYMENT_TYPE_BCMC,\n self::PAYMENT_TYPE_BLIK,\n self::PAYMENT_TYPE_PP_BLIK_OC,\n self::PAYMENT_TYPE_GIROPAY,\n self::PAYMENT_TYPE_IDEAL,\n self::PAYMENT_TYPE_P24,\n self::PAYMENT_TYPE_SEPA,\n self::PAYMENT_TYPE_VERKKOPANKKI,\n ];\n }", "public function methods()\n {\n return collect(Paymentmethods::getList());\n }", "public function get_postal_code_list()\n {\n return $this -> generate_postal_code_list();\n }", "public function getBuyingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_buying_payment_method}}', ['order_id' => 'id']);\n }", "abstract protected function getPaymentMethodCode();", "public function getShippingMethods();", "public function get_payment_methods() {\n\t\treturn $this->get_supported_payment_methods();\n\t}", "public function getPaymentByAllowableValues()\n {\n return [\n self::PAYMENT_BY_DUE_DATE,\n self::PAYMENT_BY_DISCOUNT_DATE,\n ];\n }", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "public function getPaymentMethods()\n {\n return $this->getValue('payment_method_categories');\n }", "public function toOptionArray()\n { \n $multipletableratesMethods = $this->getMultipletableratesMethods(); \n $defaultMethods = Mage::getModel('adminhtml/system_config_source_shipping_allmethods')->toOptionArray(true);\n\n //get rid of an empty entry\n unset($defaultMethods[0]); \n $methods = array_merge($multipletableratesMethods, $defaultMethods);\n return $methods;\n }", "public function getSupportedPaymentTypes()\n {\n return [PaymentMethod::PAYPAL];\n }", "public function getBillingMethodAllowableValues()\n {\n return [\n self::BILLING_METHOD_ACTUAL_RATES,\n self::BILLING_METHOD_FIXED_FEE,\n self::BILLING_METHOD_NOT_TO_EXCEED,\n self::BILLING_METHOD_OVERRIDE_RATE,\n ];\n }", "public function toOptionArray()\n {\n $methods = [];\n\n //default empty value\n $methods[] = [\"value\" => \"\", \"label\" => __(\"Accept all payment methods\")];\n $accessToken = $this->scopeConfig->getValue(\\MercadoPago\\Core\\Helper\\ConfigData::PATH_ACCESS_TOKEN, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId());\n\n if (empty($accessToken)) {\n return $methods;\n }\n\n $this->coreHelper->log(\"GET /v1/payment_methods\", 'mercadopago');\n\n try {\n $response = \\MercadoPago\\Core\\Lib\\RestClient::get(\"/v1/payment_methods\", null, [\"Authorization: Bearer \" . $accessToken]);\n } catch (\\Exception $e) {\n $this->coreHelper->log(\"PaymentMethodsTicket:: An error occurred at the time of obtaining the ticket payment methods: \" . $e);\n return [];\n }\n\n if (isset($response['error']) || (isset($response['status']) && ($response['status'] != '200' && $response['status'] != '201'))) {\n return $methods;\n }\n\n $response = $response['response'];\n\n foreach ($response as $pm) {\n if (isset($pm['payment_type_id']) && $pm['payment_type_id'] == \"ticket\" || $pm['payment_type_id'] == \"atm\") {\n $methods[] = [\n 'value' => $pm['id'],\n 'label' => __($pm['name'])\n ];\n }\n }\n\n $this->coreHelper->log(\"PaymentMethodsTicket:: Displayed\", 'mercadopago', $methods);\n\n return $methods;\n }", "public static function getOfflinePaymentList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'obd'=>t(\"Offline Bank Deposit\") ,\n \t 'pyr'=>t(\"Pay On Delivery\"), \t \n \t);\n }", "function get_organizer_payment_methods($organizer = NULL){\n\t\t$query = \"SELECT distinct(payment_key),payment_method_name\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organizer_payment_settings','dbtables');\n\t\t$query .= \" WHERE organizer_id = $organizer AND status = 1\";\n\n\t\t$res = $this->db->query($query);\n\t\t$resArr = $res->result_array();\n\n\t\tif(!empty($resArr)){\n\t\t\treturn $resArr;\n\t\t}else{\n\t\t\t$data = array();\n\t\t\treturn $data;\n\t\t}\n\t}", "abstract public function getPaymentMethod();", "public function iN_PaymentMethods() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_payment_methods WHERE payment_method_id = '1'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn $data;\n\t}", "public static function getPaymentTypes(){\n return array(self::IGFC=> PaymentUtils::getLabelText('PAYMENT_TYPE_IGFS'),self::CMPT1 => PaymentUtils::getLabelText('PAYMENT_TYPE_CMPT'));\n }", "protected function getAllAvailableMethods()\n {\n /* TODO get all available payment methods from toolbox */\n }", "function getRegisteredPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isUIEnabled() == 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\t\n}", "public function toArray()\n {\n $payments = $this->_paymentConfig->getAllMethods();\n\n $methods = [];\n\n foreach ($payments as $paymentCode => $paymentModel) {\n if ($paymentCode == 'iways_paypalplus_payment') {\n continue;\n }\n if (empty($paymentTitle)) {\n $paymentTitle = $paymentCode;\n }\n $paymentTitle = $this->_scopeConfig->getValue('payment/' . $paymentCode . '/title');\n $methods[$paymentCode] = $paymentTitle;\n }\n return $methods;\n }", "public function getPaymentMethods()\n {\n if (!isset($this->data['paymentProfiles']) || empty($this->data['paymentProfiles'])) {\n return null;\n }\n $paymentMethods = [];\n foreach ($this->data['paymentProfiles'] as $method) {\n $paymentMethods[$method['id']] = new PaymentMethod($method['id'], $method['visibleName']);\n }\n return collect($paymentMethods);\n }", "public static function getAllPaymentMethods()\n {\n $methods = [];\n $directory = __DIR__ . DIRECTORY_SEPARATOR . 'Method';\n $files = scandir($directory);\n foreach ($files as $file) {\n $file = $directory . DIRECTORY_SEPARATOR . $file;\n\n $info = pathinfo($file);\n if (!isset($info['extension']) || $info['extension'] !== 'php') {\n continue;\n }\n\n $class_name = basename($info['filename'], '.php');\n if (in_array($class_name, ['AbstractMethod'])) {\n continue;\n }\n\n $methods[] = $class_name;\n }\n\n return $methods;\n }", "public static function getPaymentMethodsRetroCompatibilite($iso_code)\n {\n // HSS -> Web Payment Pro / Integral Evolution\n // ECS -> Express Checkout Solution\n // PPP -> PAYPAL PLUS\n\n $payment_method = array(\n 'AU' => array(WPS, HSS, ECS),\n 'BE' => array(WPS, ECS),\n 'CN' => array(WPS, ECS),\n 'CZ' => array(),\n 'DE' => array(WPS, ECS, PPP),\n 'ES' => array(WPS, HSS, ECS),\n 'FR' => array(WPS, HSS, ECS),\n 'GB' => array(WPS, HSS, ECS),\n 'HK' => array(WPS, HSS, ECS),\n 'IL' => array(WPS, ECS),\n 'IN' => array(WPS, ECS),\n 'IT' => array(WPS, HSS, ECS),\n 'JP' => array(WPS, HSS, ECS),\n 'MY' => array(WPS, ECS),\n 'NL' => array(WPS, ECS),\n 'NZ' => array(WPS, ECS),\n 'PL' => array(WPS, ECS),\n 'PT' => array(WPS, ECS),\n 'RA' => array(WPS, ECS),\n 'RE' => array(WPS, ECS),\n 'SG' => array(WPS, ECS),\n 'TH' => array(WPS, ECS),\n 'TR' => array(WPS, ECS),\n 'TW' => array(WPS, ECS),\n 'US' => array(WPS, ECS),\n 'ZA' => array(WPS, ECS));\n\n\n $return = isset($payment_method[$iso_code]) ? $payment_method[$iso_code] : $payment_method['GB'];\n if(Configuration::get('VZERO_ENABLED'))\n {\n $return[] = PVZ;\n }\n return $return;\n }", "public function getSellingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_selling_payment_method}}', ['order_id' => 'id']);\n }", "protected function generate_postal_code_list()\n {\n $sql = \"SELECT PostalCode FROM zip_list\";\n $conn = $this -> connect();\n $stmt = $this -> query($conn, $sql);\n $this -> disconnect($conn);\n\n $list = [];\n while($row = $stmt -> fetch()): $list[] = $row['PostalCode']; endwhile;\n return $list;\n }", "public function getInstalledPaymentMethods() {\r\n\t\t// load internal names of installed payment methods\r\n\t\t$this->load->model('setting/extension');\r\n\t\t$paymentCodeList = $this->model_setting_extension->getInstalled('payment');\r\n\r\n\t\t// Get description name of payment methods.\r\n\t\t// It must implemented inline because there is no model method for it.\r\n\t\t// Based on implementation in method getList in class ControllerExtensionExtensionPayment\r\n\t\t$paymentMethods = [];\r\n\t\tforeach ($paymentCodeList as $paymentCode) {\r\n\t\t\t// check if main file of extension exists\r\n\t\t\t$mainFilePath = DIR_APPLICATION . 'controller/extension/payment/' . $paymentCode . '.php';\r\n\t\t\tif (!file_exists($mainFilePath)) {\r\n\t\t\t\tcontinue; // extension is registered as installed, but file is missing\r\n\t\t\t}\r\n\r\n\t\t\t// load description name of payment method from language file of extension\r\n\t\t\t$this->load->language('extension/payment/' . $paymentCode, 'extension');\r\n\t\t\t$extensionName = $this->language->get('extension')->get('heading_title');\r\n\r\n\t\t\t$paymentMethods[] = [\r\n\t\t\t\t'code' => $paymentCode,\r\n\t\t\t\t'name' => $extensionName\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\treturn $paymentMethods;\r\n\t}", "public static function getPaymentMethodsByIsoCode($iso_code)\n {\n // HSS -> Web Payment Pro / Integral Evolution\n // ECS -> Express Checkout Solution\n // PPP -> PAYPAL PLUS\n // PVZ -> Braintree / Payment VZero\n\n $payment_method = array(\n // EUROPE\n 'BE'=>array(WPS, ECS),\n 'CZ'=>array(WPS, ECS),\n 'DE'=>array(WPS, ECS, PPP),\n 'ES'=>array(WPS, HSS, ECS),\n 'FR'=>array(WPS, HSS, ECS),\n 'IT'=>array(WPS, HSS, ECS),\n 'VA'=>array(WPS, HSS, ECS),\n 'NL'=>array(WPS, ECS),\n 'AN'=>array(WPS, ECS), //Netherlands Antilles\n 'PL'=>array(WPS, ECS),\n 'PT'=>array(WPS, ECS),\n 'AT'=>array(WPS, ECS),\n 'CH'=>array(WPS, ECS),\n 'DK'=>array(WPS, ECS),\n 'FI'=>array(WPS, ECS),\n 'GR'=>array(WPS, ECS),\n 'HU'=>array(WPS, ECS),\n 'LU'=>array(WPS, ECS),\n 'NO'=>array(WPS, ECS),\n 'RO'=>array(WPS, ECS),\n 'RU'=>array(WPS, ECS),\n 'SE'=>array(WPS, ECS),\n 'SK'=>array(WPS, ECS),\n 'UA'=>array(WPS, ECS),\n 'TR'=>array(WPS, ECS),\n 'SI'=>array(WPS, ECS),\n 'GB'=>array(WPS, HSS, ECS),\n 'IE'=>array(WPS, ECS),\n 'LT'=>array(WPS, ECS),\n 'EE'=>array(WPS, ECS),\n 'LV'=>array(WPS, ECS),\n 'RS'=>array(WPS, ECS),\n 'HR'=>array(WPS, ECS),\n 'MD'=>array(WPS, ECS),\n 'BA'=>array(WPS, ECS),\n 'AL'=>array(WPS, ECS),\n 'MT'=>array(WPS, ECS),\n 'MC'=>array(WPS, ECS),\n 'IS'=>array(WPS, ECS),\n\n //ASIE\n 'CN'=>array(WPS, ECS),\n 'MO'=>array(WPS, ECS),\n 'HK'=>array(WPS, HSS, ECS),\n 'JP'=>array(WPS, HSS, ECS),\n 'MY'=>array(WPS, ECS),\n 'BN'=>array(WPS, ECS),\n 'ID'=>array(WPS, ECS),\n 'KH'=>array(WPS, ECS),\n 'LA'=>array(WPS, ECS),\n 'PH'=>array(WPS, ECS),\n 'TL'=>array(WPS, ECS),\n 'VN'=>array(WPS, ECS),\n 'IL'=>array(WPS, ECS), //Israel\n 'SG'=>array(WPS, ECS),\n 'TH'=>array(WPS, ECS),\n 'TW'=>array(WPS, ECS),\n\n // OCEANIE\n 'NZ'=>array(WPS, ECS),\n 'PW'=>array(WPS, ECS),\n 'AU'=>array(WPS, HSS, ECS),\n\n // AMERIQUE LATINE\n 'BR'=>array(WPS, ECS),\n 'MX'=>array(WPS, ECS),\n 'CL'=>array(WPS, ECS),\n 'CO'=>array(WPS, ECS),\n 'PE'=>array(WPS, ECS),\n\n //AFRIQUE\n 'SL'=>array(WPS, ECS),\n 'SN'=>array(WPS, ECS),\n );\n $return = isset($payment_method[$iso_code]) ? $payment_method[$iso_code] : false;\n if(Configuration::get('VZERO_ENABLED'))\n {\n $return[] = PVZ;\n }\n return $return;\n }", "public function getPaymentMethods()\n {\n $obj = new stdClass();\n\n // Must be in specific order for checksum --\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n // -----------------------------------------\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Ask for GetPaymentMethods and get response\n $result = $this->client->GetPaymentMethods($obj);\n $result = $result->GetPaymentMethodsResult;\n $methods = isset($result->PaymentMethods->PaymentMethod) ? $result->PaymentMethods->PaymentMethod : null;\n\n $obj->Timestamp = $result->Timestamp;\n\n if (!is_null($methods)) {\n // Assign all properties of the PaymentMethods object as property of mainObject\n $obj = $this->parseForChecksum($obj, $methods);\n }\n\n // Unset properties for new Checksum\n unset($obj->Checksum);\n\n // Verify response data by making a new Checksum\n $CheckSum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $CheckSum)\n throw new Exception('Data could not be verified');\n\n return (array) $methods;\n }", "public function getCodes () {\n $list = [\n '' => '全部',\n 'optask' => '任务',\n 'patientrecord' => '运营备注',\n 'patientstage' => '患者阶段',\n 'patientgroup' => '患者分组',\n 'patientremark' => '患者文本备注',\n ];\n\n return $list;\n }", "abstract public function getPaymentDrivers();", "public function getMapPaymentTypes()\n {\n return $this->map_payment_types;\n }", "public function getTransactionTypes()\n\t{\n\t\t$processed_list = array();\n\t\t$alias_map = array();\n\n\t\t$selected_types = $this->orderCardTransactionTypes(\n\t\t\t$this->config->get('emerchantpay_checkout_transaction_type')\n\t\t);\n\t\t$methods = \\Genesis\\API\\Constants\\Payment\\Methods::getMethods();\n\n\t\tforeach ($methods as $method) {\n\t\t\t$alias_map[$method . self::PPRO_TRANSACTION_SUFFIX] = \\Genesis\\API\\Constants\\Transaction\\Types::PPRO;\n\t\t}\n\n\t\t$alias_map = array_merge($alias_map, [\n\t\t\tself::GOOGLE_PAY_TRANSACTION_PREFIX . self::GOOGLE_PAY_PAYMENT_TYPE_AUTHORIZE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::GOOGLE_PAY,\n\t\t\tself::GOOGLE_PAY_TRANSACTION_PREFIX . self::GOOGLE_PAY_PAYMENT_TYPE_SALE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::GOOGLE_PAY,\n\t\t\tself::PAYPAL_TRANSACTION_PREFIX . self::PAYPAL_PAYMENT_TYPE_AUTHORIZE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::PAY_PAL,\n\t\t\tself::PAYPAL_TRANSACTION_PREFIX . self::PAYPAL_PAYMENT_TYPE_SALE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::PAY_PAL,\n\t\t\tself::PAYPAL_TRANSACTION_PREFIX . self::PAYPAL_PAYMENT_TYPE_EXPRESS =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::PAY_PAL,\n\t\t\tself::APPLE_PAY_TRANSACTION_PREFIX . self::APPLE_PAY_PAYMENT_TYPE_AUTHORIZE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::APPLE_PAY,\n\t\t\tself::APPLE_PAY_TRANSACTION_PREFIX . self::APPLE_PAY_PAYMENT_TYPE_SALE =>\n\t\t\t\t\\Genesis\\API\\Constants\\Transaction\\Types::APPLE_PAY,\n\t\t]);\n\n\t\tforeach ($selected_types as $selected_type) {\n\t\t\tif (array_key_exists($selected_type, $alias_map)) {\n\t\t\t\t$transaction_type = $alias_map[$selected_type];\n\n\t\t\t\t$processed_list[$transaction_type]['name'] = $transaction_type;\n\n\t\t\t\t// WPF Custom Attribute\n\t\t\t\t$key = $this->getCustomParameterKey($transaction_type);\n\n\t\t\t\t$processed_list[$transaction_type]['parameters'][] = array(\n\t\t\t\t\t$key => str_replace(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tself::PPRO_TRANSACTION_SUFFIX,\n\t\t\t\t\t\t\tself::GOOGLE_PAY_TRANSACTION_PREFIX,\n\t\t\t\t\t\t\tself::PAYPAL_TRANSACTION_PREFIX,\n\t\t\t\t\t\t\tself::APPLE_PAY_TRANSACTION_PREFIX\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t$selected_type\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$processed_list[] = $selected_type;\n\t\t\t}\n\t\t}\n\n\t\treturn $processed_list;\n\t}", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "public static function get_enabled_payment_times(){\n\t\t$enabled_payment_times = [];\n\t\t$enabled_payment_methods = self::get_enabled_payment_methods();\n foreach($enabled_payment_methods as $method_code => $payment_method){\n $enabled_payment_times[$payment_method['time_type']][$method_code] = $payment_method;\n }\n\t return $enabled_payment_times;\n\t}", "function add_payssion_gateway( $methods )\r\n\t{\n\t\treturn array_merge($methods, \n\t\t\t\tarray(\n\t\t\t\t\t\t'WC_Gateway_Payssion', \n\t\t\t\t\t\t'WC_Gateway_Payssion_Alipay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Banamex',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Bancochile',\r\n\t\t\t\t\t\t'WC_Gateway_Payssion_Bancodobrasil',\r\n\t\t\t\t\t\t'WC_Gateway_Payssion_Bancomer',\n\t\t\t\t\t\t'WC_Gateway_Payssion_BitCashJP',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Bitcoin',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Boleto',\n\t\t\t\t\t\t'WC_Gateway_Payssion_CashU',\n\t\t\t\t\t\t'WC_Gateway_Payssion_CreditCardJP',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Dragonpay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Enets',\n\t\t\t\t\t\t'WC_Gateway_Payssion_MercadoPago',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Molpay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Neosurf',\n\t\t\t\t\t\t'WC_Gateway_Payssion_NetCashJP',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Nganluong',\n\t\t\t\t\t\t'WC_Gateway_Payssion_OneCard',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Openbucks',\n\t\t\t\t\t\t'WC_Gateway_Payssion_OXXO',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Paysafecard',\n\t\t\t\t\t\t'WC_Gateway_Payssion_POLi',\n\t\t\t\t\t\t'WC_Gateway_Payssion_QIWI',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Redcompra',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Santander',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Santandermx',\n\t\t\t\t\t\t'WC_Gateway_Payssion_SOFORT',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Tenpay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Trustpay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Unionpay',\n\t\t\t\t\t\t'WC_Gateway_Payssion_WebMoney',\n\t\t\t\t\t\t'WC_Gateway_Payssion_WebMoneyJP',\n\t\t\t\t\t\t'WC_Gateway_Payssion_Yamoney'));\r\n\t}", "protected function _getPaymentMethodsHtml()\n {\n return $this->_getHtmlByHandle('checkout_onepage_paymentmethod');\n }", "public function get_possible_payment_methods_for_cart() {\n\n\t\t$current_cart_id = WC_PostFinanceCheckout_Helper::instance()->get_current_cart_id();\n\t\tif ( ! isset( self::$possible_payment_method_cache[ $current_cart_id ] ) || is_null( self::$possible_payment_method_cache[ $current_cart_id ] ) ) {\n\t\t\ttry {\n\n\t\t\t\t$transaction = $this->get_transaction_from_session();\n\t\t\t\tif ( $transaction->getState() != \\PostFinanceCheckout\\Sdk\\Model\\TransactionState::PENDING ) {\n\t\t\t\t\tself::$possible_payment_method_cache[ $current_cart_id ] =\n\t\t\t\t\t\t$transaction->getAllowedPaymentMethodConfigurations();\n\t\t\t\t\treturn self::$possible_payment_method_cache[ $current_cart_id ];\n\t\t\t\t}\n\t\t\t\t$integration_method = get_option( WooCommerce_PostFinanceCheckout::CK_INTEGRATION );\n\t\t\t\t$payment_methods = $this->get_transaction_service()->fetchPaymentMethods(\n\t\t\t\t\t$transaction->getLinkedSpaceId(),\n\t\t\t\t\t$transaction->getId(),\n\t\t\t\t\t$integration_method\n\t\t\t\t);\n\n\t\t\t\t$method_configuration_service = WC_PostFinanceCheckout_Service_Method_Configuration::instance();\n\t\t\t\t$possible_methods = array();\n\t\t\t\tforeach ( $payment_methods as $payment_method ) {\n\t\t\t\t\t$method_configuration_service->update_data( $payment_method );\n\t\t\t\t\t$possible_methods[] = $payment_method->getId();\n\t\t\t\t}\n\t\t\t\tself::$possible_payment_method_cache[ $current_cart_id ] = $possible_methods;\n\t\t\t} catch ( WC_PostFinanceCheckout_Exception_Invalid_Transaction_Amount $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $current_cart_id ] = array();\n\t\t\t\tthrow $e;\n\t\t\t} catch ( \\PostFinanceCheckout\\Sdk\\ApiException $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $current_cart_id ] = array();\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t\treturn self::$possible_payment_method_cache[ $current_cart_id ];\n\t}", "public function get_possible_payment_methods_for_order( WC_Order $order ) {\n\n\t\tif ( ! isset( self::$possible_payment_method_cache[ $order->get_id() ] ) || is_null( self::$possible_payment_method_cache[ $order->get_id() ] ) ) {\n\t\t\ttry {\n\t\t\t\t$transaction = $this->get_transaction_from_order( $order );\n\t\t\t\tif ( $transaction->getState() != \\PostFinanceCheckout\\Sdk\\Model\\TransactionState::PENDING ) {\n\t\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] =\n\t\t\t\t\t\t$transaction->getAllowedPaymentMethodConfigurations();\n\t\t\t\t\treturn self::$possible_payment_method_cache[ $order->get_id() ];\n\t\t\t\t}\n\t\t\t\t$integration_method = get_option( WooCommerce_PostFinanceCheckout::CK_INTEGRATION );\n\t\t\t\t$payment_methods = $this->get_transaction_service()->fetchPaymentMethods(\n\t\t\t\t\t$transaction->getLinkedSpaceId(),\n\t\t\t\t\t$transaction->getId(),\n\t\t\t\t\t$integration_method\n\t\t\t\t);\n\t\t\t\t$method_configuration_service = WC_PostFinanceCheckout_Service_Method_Configuration::instance();\n\t\t\t\t$possible_methods = array();\n\t\t\t\tforeach ( $payment_methods as $payment_method ) {\n\t\t\t\t\t$method_configuration_service->update_data( $payment_method );\n\t\t\t\t\t$possible_methods[] = $payment_method->getId();\n\t\t\t\t}\n\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = $possible_methods;\n\t\t\t} catch ( WC_PostFinanceCheckout_Exception_Invalid_Transaction_Amount $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = array();\n\t\t\t\tthrow $e;\n\t\t\t} catch ( \\PostFinanceCheckout\\Sdk\\ApiException $e ) {\n\t\t\t\tself::$possible_payment_method_cache[ $order->get_id() ] = array();\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t\treturn self::$possible_payment_method_cache[ $order->get_id() ];\n\t}", "public function ratesCodesDataProvider()\n {\n return [\n [['some_code'], 'ESCAPED:some_code'],\n [['some_code', 'some_code2'], 'ESCAPED:some_code, some_code2'],\n [[], ''],\n [null, ''],\n ];\n }", "public function getAllowedMethods()\n {\n return array(\n $this->_code . '_private' => Mage::getStoreConfig('carrier/vconnect_postnord_home/name'),\n $this->_code . '_commercial' => Mage::getStoreConfig('carrier/vconnect_postnord_business/name'),\n $this->_code . '_pickup' => Mage::getStoreConfig('carrier/vconnect_postnord_pickup/name'),\n $this->_code . '_mailbox' => Mage::getStoreConfig('carrier/vconnect_postnord_mailbox/name'),\n );\n }", "function admin_display_payment_gateways()\n {\n $return = array (\n 'name' => $this->name,\n 'title' => 'CC - Manual Payment',\n );\n\n return $return;\n }", "private function registerPaymentMethods()\n {\n $pPosition = 0;\n foreach ($this->paymentMethods as $pValue => $pSub) {\n if ($this->isAboveShopwareVersion52()) {\n $action = 'payment_processor_csrf/process';\n } else {\n $action = 'payment_processor/process';\n }\n $this->createPayment(array(\n 'name' => $pValue,\n 'description' => $pSub['description'],\n 'action' => $action,\n 'active' => 0,\n 'position' => $pPosition,\n 'additionalDescription' => ''\n ));\n $pPosition++;\n }\n }", "public function getPaymentOption() {\r\n $query = $this->db->get('v_combo_payment_method');\r\n \r\n if( $query->num_rows() > 0 ) {\r\n return $query->result();\r\n } else {\r\n return array();\r\n }\r\n }", "public function getPlatformPaymentTypeAllowableValues()\n {\n return [\n self::PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT,\n self::PLATFORM_PAYMENT_TYPE_COMMISSION,\n self::PLATFORM_PAYMENT_TYPE__DEFAULT,\n self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE,\n self::PLATFORM_PAYMENT_TYPE_VAT,\n ];\n }", "function woocommerce_add_paycoingateway_gateway($methods) {\n\t\t\t$methods[] = 'WC_Gateway_PaycoinGateway';\n\t\t\treturn $methods;\n\t\t}", "static function getPayMethodsOptions($type = 0)\n\t{\n\t\tglobal $ilDB, $lng;\n\t\t\n\t\t$res = $ilDB->query('SELECT * FROM payment_paymethods WHERE pm_enabled = 1');\n\t\t$options = array();\n\t\t\n\t\t//this is only for additional entries in SelectInputGUIs\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'all':\t\n\t\t\t\t$options['all'] = $lng->txt('pay_all');\n\t\t\t\tbreak;\n\t\t\tcase 'not_specified': \t\n\t\t\t\t$options[0] = $lng->txt('paya_pay_method_not_specified');\n\t\t\t\tbreak;\n\t\t\t//default: break;\n\t\t}\n\t\t\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$options[$row['pm_id']] = ilPayMethods::getStringByPaymethod($row['pm_title']);\n\t\t}\t\t\n\t\n\t\treturn $options;\n\t}", "public function toOptionArray()\n {\n $options = parent::toOptionArray();\n\n $output = [];\n\n if (isset($options[Rule::RULE_SHIPPING_CODE]['value'])) {\n $output = $options[Rule::RULE_SHIPPING_CODE]['value'];\n }\n\n return $output;\n }", "public function getCcAvailableTypes()\n {\n //Listando apenas cielo pois já contem todas as bandeiras\n $_types = Mage::getModel('gwap/source_cctypes_cielo')->toOptionArray();\n //$_types[] = Mage::getModel('gwap/source_cctypes_redecard')->toOptionArray();\n \n $types = array();\n foreach ($_types as $data) {\n if (isset($data['label']) && isset($data['value']) && $data['value']!='') {\n $types[substr_replace($data['value'],'',-2)] = $data['label'];\n }\n }\n \n if ($method = $this->getMethod()) {\n //Armazena os cartões habilitados nas duas operadoras\n $availableTypes = $method->getConfigData('cctypes_rcard');\n $availableTypes .= ','.$method->getConfigData('cctypes_cielo');\n \n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n $allTypes = array();\n // Remove 2 ultimos caracteres do cartão\n foreach($availableTypes as $substype){\n $allTypes[] = substr_replace($substype,'',-2);\n }\n //Compara com cartões disponíveis\n foreach ($types as $code=>$name) {\n if (!in_array($code, $allTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "private function codOpcionales(): array\n {\n $codigos = [];\n if ($this->ws === 'wsfe') {\n $codigos = $this->FEParamGetTiposOpcional();\n $codigos = array_map(function ($o) {\n return $o->Id;\n }, $codigos->OpcionalTipo);\n }\n\n return $codigos;\n }", "public static function getAvailableBankCodes()\n {\n return [\n Banks::CPI => 'Interac Combined Pay-in',\n Banks::BCT => 'Bancontact',\n ];\n }", "function getSignupEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isSignupEnabled()== 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\n}", "private function getMethodClassMap()\n {\n return [\n 'account_channels' => \\XRPHP\\Api\\Anon\\Account\\AccountChannelsMethod::class,\n 'account_currencies' => \\XRPHP\\Api\\Anon\\Account\\AccountCurrenciesMethod::class,\n 'account_info' => \\XRPHP\\Api\\Anon\\Account\\AccountInfoMethod::class,\n 'account_lines' => \\XRPHP\\Api\\Anon\\Account\\AccountLinesMethod::class,\n 'account_objects' => \\XRPHP\\Api\\Anon\\Account\\AccountObjectsMethod::class,\n 'account_offers' => \\XRPHP\\Api\\Anon\\Account\\AccountOffersMethod::class,\n 'account_tx' => \\XRPHP\\Api\\Anon\\Account\\AccountTxMethod::class,\n 'gateway_balances' => \\XRPHP\\Api\\Anon\\Account\\GatewayBalancesMethod::class,\n 'noripple_check' => \\XRPHP\\Api\\Anon\\Account\\NorippleCheckMethod::class,\n 'ledger' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerMethod::class,\n 'ledger_closed' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerClosedMethod::class,\n 'ledger_current' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerCurrentMethod::class,\n 'ledger_data' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerDataMethod::class,\n 'ledger_entry' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerEntryMethod::class,\n 'sign' => \\XRPHP\\Api\\Anon\\Transaction\\SignMethod::class,\n 'sign_for' => \\XRPHP\\Api\\Anon\\Transaction\\SignForMethod::class,\n 'submit' => \\XRPHP\\Api\\Anon\\Transaction\\SubmitMethod::class,\n 'submit_multisigned' => \\XRPHP\\Api\\Anon\\Transaction\\SubmitMultisignedMethod::class,\n 'transaction_entry' => \\XRPHP\\Api\\Anon\\Transaction\\TransactionEntryMethod::class,\n 'tx' => \\XRPHP\\Api\\Anon\\Transaction\\TxMethod::class,\n 'book_offers' => \\XRPHP\\Api\\Anon\\PathOrderBook\\BookOffersMethod::class,\n 'ripple_path_find' => \\XRPHP\\Api\\Anon\\PathOrderBook\\RipplePathFindMethod::class,\n 'channel_authorize' => \\XRPHP\\Api\\Anon\\PaymentChannel\\ChannelAuthorizeMethod::class,\n 'channel_verify' => \\XRPHP\\Api\\Anon\\PaymentChannel\\ChannelVerifyMethod::class,\n 'fee' => \\XRPHP\\Api\\Anon\\ServerInfo\\FeeMethod::class,\n 'server_info' => \\XRPHP\\Api\\Anon\\ServerInfo\\ServerInfoMethod::class,\n 'server_state' => \\XRPHP\\Api\\Anon\\ServerInfo\\ServerStateMethod::class,\n 'ping' => \\XRPHP\\Api\\Anon\\Utility\\PingMethod::class,\n 'random' => \\XRPHP\\Api\\Anon\\Utility\\RandomMethod::class\n ];\n }", "public function getProcessingTypeAllowableValues()\n {\n return [\n self::PROCESSING_TYPE_ATM_WITHDRAW,\n self::PROCESSING_TYPE_BALANCE_INQUIRY,\n self::PROCESSING_TYPE_ECOMMERCE,\n self::PROCESSING_TYPE_MOTO,\n self::PROCESSING_TYPE_POS,\n self::PROCESSING_TYPE_PURCHASE_WITH_CASHBACK,\n self::PROCESSING_TYPE_RECURRING,\n self::PROCESSING_TYPE_TOKEN,\n ];\n }", "public function getPaymentMethod(){\n return $this->_getData(self::PAYMENT_METHOD);\n }", "public function getActiveVendorMethods($vendorId=0){\n \t$methods = Mage::getModel('csmultishipping/source_shipping_methods')->getMethods();\n \t$VendorMethods=array();\n \tif(count($methods) >0 ) {\n \t\t$vendorShippingConfig = $this->getShippingConfig($vendorId);\n \t\tforeach($methods as $code=>$method) {\n \t\t\t$model=Mage::getModel($method['model']);\n \t\t\t$key = strtolower(Ced_CsMultiShipping_Model_Vsettings_Shipping_Methods_Abstract::SHIPPING_SECTION.'/'.$code.'/active');\n \t\t\tif(isset($vendorShippingConfig[$key]['value']) && $vendorShippingConfig[$key]['value']){\n\t \t\t\t$fields = $model->getFields();\n\t \t\t\tif (count($fields) > 0) {\n\t \t\t\t\tforeach ($fields as $id=>$field) {\n\t\t \t\t\t\t$key = strtolower(Ced_CsMultiShipping_Model_Vsettings_Shipping_Methods_Abstract::SHIPPING_SECTION.'/'.$code.'/'.$id);\n\t\t \t\t\t\tif(isset($vendorShippingConfig[$key]))\n\t\t \t\t\t\t\t$VendorMethods[$code][$id] = $vendorShippingConfig[$key]['value'];\n\t \t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn $VendorMethods;\n \t}\n \telse \n \t\treturn $VendorMethods;\n }", "public function getPaymentMethod() \n {\n return $this->_fields['PaymentMethod']['FieldValue'];\n }", "protected function getPaymentMethod(){\n return $this->method;\n }", "public function getPayCycleAllowableValues()\n {\n return [\n self::PAY_CYCLE_WEEKLY,\nself::PAY_CYCLE_BI_WEEKLY,\nself::PAY_CYCLE_SEMI_MONTHLY,\nself::PAY_CYCLE_FOUR_WEEKLY,\nself::PAY_CYCLE_MONTHLY,\nself::PAY_CYCLE_TIMESHEET,\nself::PAY_CYCLE_PROJECT_COMPLETION,\nself::PAY_CYCLE_CUSTOM, ];\n }", "public function getAllowedMethods()\n {\n \n \n \n return array( \n 'homedelivery' => $this->getConfigData('homedelivery'),\n \n 'matkahuolto' => $this->getConfigData('matkahuolto'),\n 'smartpost' => $this->getConfigData('smartpost'),\n \n \n \n 'chooseapostoffice' => $this->getConfigData('chooseapostoffice'), \n 'default' => $this->getConfigData('closestpostoffice'),\n \n );\n \n }", "public function getPaymentCurrencyOptions()\n { \n // Return the options as array\n return $this->currencyManager->toOptionArray();\n }", "public function getCcTypes() {\n\n\t\t$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();\n\t\t$types = $cc_types->toOptionArray();\n\n $availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');\n\n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n\t\t\t$result = array(); \n\t\t\tforeach ($types as $val) { \n\t\t\t if (($key = array_search($val['value'], $availableTypes, TRUE))!==false) { \n\t\t\t\t $result[] = $val; \n\t\t\t\t unset($availableTypes[$key]); \n\t\t\t }\n\t\t\t}\n }\n\n return $result; \n }", "public function getPaymentplans() {\n return $this->paymentPlans;\n }", "public function getAllPaymentMethods($asArray = false) {\r\n $jsonMethods = array();\r\n $methods = array();\r\n $model = new Mage_Checkout_Block_Onepage_Payment_Methods();\r\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\r\n try {\r\n $selectedPaymentMethod = $quote->getPayment()->getData('method');\r\n } catch (Exception $e) {\r\n $this->logException($e, 'Get payment method');\r\n $this->_JSONencodeAndRespond(array(\"title\" => \"Error\", \"content\" => $e->getMessage()));\r\n return;\r\n }\r\n foreach ($model->getMethods() as $method) {\r\n $methodTitle = $method->getTitle();\r\n $methodCode = $method->getCode();\r\n if ($methodCode == \"paypal_express\") { // PayPal. Has logo and strange label text, override\r\n $methodTitle = \"PayPal\";\r\n }\r\n\r\n //eLabelz specific fix\r\n if ($methodCode == 'msp_cashondelivery') {\r\n $methodTitle .= \" – \" . Mage::helper('core')->currency($quote->getMspCashondeliveryInclTax(), true, false);\r\n }\r\n\r\n $m = array(\r\n 'type' => 'option',\r\n 'title' => $methodTitle,\r\n 'code' => $methodCode,\r\n 'price' => $this->getPaymentMethodPrice($methodCode),\r\n // Payment fee (price) is not available for standard payment methods, for extensions this need to be individualy coded\r\n 'image' => null,\r\n 'options' => $this->_getSuboptionsForPaymentMethod($methodCode),\r\n );\r\n $methods[] = $m;\r\n }\r\n if ($asArray)\r\n return $methods;\r\n $jsonMethods['payment_methods'] = $methods;\r\n\r\n return $jsonMethods;\r\n }", "public function whmcs_get_payment_methods($params = array()) {\n\t\t$params['action'] = 'GetPaymentMethods';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function get_payment_method($method = '')\n{\n global $db_prefix;\n $tmp = array();\n\n if (!$method) {\n $res = sql_query(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_type='payment' AND mod_enabled = '1'\");\n while ($row = sql_fetch_array($res)) {\n // get fee\n $module_config = $summary = array();\n $payment_cmd = 'init';\n $payment_extra_fee = 0;\n $mod = $row['mod_id'];\n if (!file_exists('./module/'.$mod.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Payment module '.$method.' not found.'));\n }\n require('./module/'.$mod.'/window.php');\n $tmp[$row['mod_id']]['method'] = $row['mod_id'];\n $tmp[$row['mod_id']]['name'] = $row['mod_name'];\n $tmp[$row['mod_id']]['fee'] = $payment_extra_fee;\n }\n\n return $tmp;\n } else {\n $payment_cmd = 'init';\n $payment_extra_fee = 0;\n $row = sql_qquery(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_id='$method' AND mod_type='payment' AND mod_enabled = '1'\");\n if (!$row) {\n return false;\n }\n $mod = $row['mod_id'];\n if (!file_exists('./module/'.$mod.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Payment module '.$method.' not found.'));\n }\n require('./module/'.$mod.'/window.php');\n return (array('method' => $row['mod_id'], 'name' => $row['mod_name'], 'fee' => $payment_extra_fee));\n }\n}", "public function getCcAvailableTypes()\n {\n $types = $this->_getConfig()->getCcTypes();\n if ($method = $this->getMethod()) {\n $availableTypes = $method->getConfigData('cctypes');\n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n foreach ($types as $code=>$name) {\n if (!in_array($code, $availableTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }" ]
[ "0.7044585", "0.6971927", "0.6866795", "0.68647474", "0.6851176", "0.67435807", "0.67114186", "0.66956615", "0.66905975", "0.66831565", "0.6669455", "0.6654036", "0.6616623", "0.6588809", "0.6584626", "0.6558207", "0.6543649", "0.6539898", "0.6488918", "0.64038485", "0.6402445", "0.63567084", "0.63472515", "0.631686", "0.6279591", "0.6249851", "0.62438947", "0.6239268", "0.6223439", "0.62187934", "0.6212296", "0.6195243", "0.61271334", "0.6122478", "0.61062473", "0.60917896", "0.60907406", "0.6090326", "0.6040425", "0.60310096", "0.60297006", "0.60084516", "0.6000879", "0.59999835", "0.5982573", "0.59734416", "0.5961963", "0.5936094", "0.59243435", "0.590375", "0.5892489", "0.58672076", "0.5862474", "0.5861533", "0.58476263", "0.58456457", "0.5818247", "0.5814207", "0.58062905", "0.5805614", "0.57986903", "0.5723915", "0.5705671", "0.5692161", "0.567692", "0.5662522", "0.56583756", "0.5657029", "0.56373537", "0.5622277", "0.55990076", "0.55906683", "0.55752605", "0.55727494", "0.55577165", "0.5551719", "0.5541333", "0.55384177", "0.5532125", "0.55299956", "0.55189544", "0.55148065", "0.5505217", "0.5500341", "0.54999864", "0.54859436", "0.5482259", "0.5479646", "0.54610884", "0.5455973", "0.54420656", "0.5439962", "0.54309404", "0.5427134", "0.5423567", "0.5387459", "0.5384051", "0.5383726", "0.5374633", "0.5368781" ]
0.6939194
2
Obtain commaseparated list of order status codes that apply for shipment auto creation.
public function getAutocreateAllowedStatusCodes() { $path = 'intraship/autocreate/autocreate_allowed-status-codes'; $statusCodes = Mage::getStoreConfig($path); if (null === $statusCodes) { $statusCodes = ''; } return $statusCodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrderStatusList(){\n\treturn [\n\t\t\"NEW\" => [\n\t\t\t'code' => 1,\n\t\t\t'text' => \"Yet to Start\"\n\t\t],\n\t\t\"IN_PROGRESS\" => [\n\t\t\t'code' => 2,\n\t\t\t'text' => \"Working\"\n\t\t],\n\t\t\"DELIVERED\" => [\n\t\t\t'code' => 3,\n\t\t\t'text' => \"Delivered\"\n\t\t],\n\t\t\"IN_REVIEW\" => [\n\t\t\t'code' => 4,\n\t\t\t'text' => \"In review\"\n\t\t],\n\t\t\"COMPLETED\" => [\n\t\t\t'code' => 5,\n\t\t\t'text' => \"Completed\"\n\t\t],\n\t\t\"CANCELLED\" => [\n\t\t\t'code' => 6,\n\t\t\t'text' => \"Cancelled\"\n\t\t],\n\t\t\"PENDIND_REQUIREMENT\" => [\n\t\t\t'code' => 7,\n\t\t\t'text' => \"Pending Requirement\"\n\t\t]\n\t];\n}", "public function getListOrderStatus(){\n\n return $this->client->makeRequest('orderstatus', 'GET');\n }", "public function getOrderStatusAllowableValues()\n {\n return [\n self::ORDER_STATUS_PENDING,\n self::ORDER_STATUS_UNSHIPPED,\n self::ORDER_STATUS_PARTIALLY_SHIPPED,\n self::ORDER_STATUS_SHIPPED,\n self::ORDER_STATUS_CANCELED,\n self::ORDER_STATUS_UNFULFILLABLE,\n self::ORDER_STATUS_INVOICE_UNCONFIRMED,\n self::ORDER_STATUS_PENDING_AVAILABILITY,\n ];\n }", "public function fcpoGetStatus() \n {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE fcpo_txid = '{$this->oxorder__fcpotxid->value}' ORDER BY fcpo_sequencenumber ASC\";\n $aRows = $this->_oFcpoDb->getAll($sQuery);\n\n $aStatus = array();\n foreach ($aRows as $aRow) {\n $oTransactionStatus = $this->_oFcpoHelper->getFactoryObject('fcpotransactionstatus');\n $sTransactionStatusOxid = (isset($aRow[0])) ? $aRow[0] : $aRow['oxid'];\n $oTransactionStatus->load($sTransactionStatusOxid);\n $aStatus[] = $oTransactionStatus;\n }\n\n return $aStatus;\n }", "function getOrderStatusCodes(...$keys){\n\t$order_status = getOrderStatusList();\n\t$codes = [];\n\tforeach($keys as $key){\n\t\tif (isset($order_status[$key])) {\n\t\t\tarray_push($codes, $order_status[$key]['code']);\n\t\t}\n\t}\n\treturn $codes;\n}", "public function getCronExportOrderConfigStatus()\n {\n $status = [$this->getDefaultStatusForState(LocalOrder::STATE_HOLDED)];\n if ($this->getConfigValue(self::XML_PATH . 'order/filter_status')) {\n $unprocessedData = $this->getConfigValue(self::XML_PATH . 'order/filter_status');\n // Processing data\n $status = explode(',', $unprocessedData);\n }\n return $status;\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "public static function getStatusList() {\r\n return [\r\n self::STATUS_ACTIVE => 'Active',\r\n self::STATUS_RETIRED => 'Retired'\r\n ];\r\n }", "public function getOrderStatusAllowableValues() : array\n {\n return [\n self::ORDER_STATUS_PENDING,\n self::ORDER_STATUS_UNSHIPPED,\n self::ORDER_STATUS_PARTIALLY_SHIPPED,\n self::ORDER_STATUS_SHIPPED,\n self::ORDER_STATUS_CANCELED,\n self::ORDER_STATUS_UNFULFILLABLE,\n self::ORDER_STATUS_INVOICE_UNCONFIRMED,\n self::ORDER_STATUS_PENDING_AVAILABILITY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_APPROVAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL,\n self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL_REVERSED,\n self::STATUS_AUTH_ADJUSTMENT_AUTHORISED,\n self::STATUS_AUTH_ADJUSTMENT_ERROR,\n self::STATUS_AUTH_ADJUSTMENT_REFUSED,\n self::STATUS_AUTHORISED,\n self::STATUS_BANK_TRANSFER,\n self::STATUS_BANK_TRANSFER_PENDING,\n self::STATUS_BOOKED,\n self::STATUS_BOOKING_PENDING,\n self::STATUS_CANCELLED,\n self::STATUS_CAPTURE_PENDING,\n self::STATUS_CAPTURE_REVERSAL_PENDING,\n self::STATUS_CAPTURE_REVERSED,\n self::STATUS_CAPTURED,\n self::STATUS_CAPTURED_EXTERNALLY,\n self::STATUS_CHARGEBACK,\n self::STATUS_CHARGEBACK_EXTERNALLY,\n self::STATUS_CHARGEBACK_PENDING,\n self::STATUS_CHARGEBACK_REVERSAL_PENDING,\n self::STATUS_CHARGEBACK_REVERSED,\n self::STATUS_CREDITED,\n self::STATUS_DEPOSIT_CORRECTION,\n self::STATUS_DEPOSIT_CORRECTION_PENDING,\n self::STATUS_DISPUTE,\n self::STATUS_DISPUTE_CLOSED,\n self::STATUS_DISPUTE_EXPIRED,\n self::STATUS_DISPUTE_NEEDS_REVIEW,\n self::STATUS_ERROR,\n self::STATUS_EXPIRED,\n self::STATUS_FAILED,\n self::STATUS_FEE,\n self::STATUS_FEE_PENDING,\n self::STATUS_INTERNAL_TRANSFER,\n self::STATUS_INTERNAL_TRANSFER_PENDING,\n self::STATUS_INVOICE_DEDUCTION,\n self::STATUS_INVOICE_DEDUCTION_PENDING,\n self::STATUS_MANUAL_CORRECTION_PENDING,\n self::STATUS_MANUALLY_CORRECTED,\n self::STATUS_MATCHED_STATEMENT,\n self::STATUS_MATCHED_STATEMENT_PENDING,\n self::STATUS_MERCHANT_PAYIN,\n self::STATUS_MERCHANT_PAYIN_PENDING,\n self::STATUS_MERCHANT_PAYIN_REVERSED,\n self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING,\n self::STATUS_MISC_COST,\n self::STATUS_MISC_COST_PENDING,\n self::STATUS_OPERATION_AUTHORIZED,\n self::STATUS_OPERATION_BOOKED,\n self::STATUS_OPERATION_PENDING,\n self::STATUS_OPERATION_RECEIVED,\n self::STATUS_PAYMENT_COST,\n self::STATUS_PAYMENT_COST_PENDING,\n self::STATUS_RECEIVED,\n self::STATUS_REFUND_PENDING,\n self::STATUS_REFUND_REVERSAL_PENDING,\n self::STATUS_REFUND_REVERSED,\n self::STATUS_REFUNDED,\n self::STATUS_REFUNDED_EXTERNALLY,\n self::STATUS_REFUSED,\n self::STATUS_RESERVE_ADJUSTMENT,\n self::STATUS_RESERVE_ADJUSTMENT_PENDING,\n self::STATUS_RETURNED,\n self::STATUS_SECOND_CHARGEBACK,\n self::STATUS_SECOND_CHARGEBACK_PENDING,\n self::STATUS_UNDEFINED,\n ];\n }", "public function getAutocreateStatusCodes()\n {\n return $this->_toArrayObject($this->getConfig(\n 'autocreate/autocreate_allowed-status-codes'));\n }", "public function getMapOrderStatuses()\n {\n return $this->map_order_statuses;\n }", "public function getStatusList()\n {\n return [\n self::STATUS_CREATED,\n self::STATUS_SUCCESS,\n self::STATUS_FAIL\n ];\n }", "public static function getAllStatus(): array\n {\n $statuses = array();\n //====================================================================//\n // Complete Status Informations\n foreach (SplashStatus::getAll() as $status) {\n $statuses[] = array(\n 'code' => $status,\n 'field' => 'SPLASH_ORDER_'.strtoupper($status),\n 'name' => str_replace(\"Order\", \"Status \", $status),\n 'desc' => 'Order Status for '.str_replace(\"Order\", \"\", $status)\n );\n }\n\n return $statuses;\n }", "public function getPayoneStatusList() \n {\n $aPayoneStatusList = $this->_oFcpoHelper->fcpoGetPayoneStatusList();\n \n $aNewList = array();\n foreach ($aPayoneStatusList as $sStatusId) {\n $oStatus = new stdClass();\n $oStatus->sId = $sStatusId;\n $oStatus->sTitle = $this->_oFcpoHelper->fcpoGetLang()->translateString('fcpo_status_'.$sStatusId, null, true);\n $aNewList[] = $oStatus;\n }\n \n return $aNewList;\n }", "public static function getStatusList()\n {\n return BaseServiceDelivery::getStatusList();\n }", "public static function getOrderStatusChoices(): array\n {\n //====================================================================//\n // Load Prestashop Status List\n $psStates = OrderState::getOrderStates(SLM::getDefaultLangId());\n $choices = array();\n //====================================================================//\n // Walk on Prestashop States List\n foreach ($psStates as $psState) {\n //====================================================================//\n // If State is Know\n if (!self::isKnown($psState[\"id_order_state\"])) {\n continue;\n }\n //====================================================================//\n // Detect Splash State Code\n $code = self::getSplashCode($psState[\"id_order_state\"]);\n if (isset($choices[$code])) {\n continue;\n }\n $choices[$code] = $psState[\"name\"];\n }\n\n return $choices;\n }", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "public function getInvoiceStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0, 'name' => 'Completed'); //done, can not be edited, but not retured\r\n\t\t\t$status[1] = array('id' => 1, 'name' => 'Unfinished'); //still open, can be edited\r\n\t\t\t$status[2] = array('id' => 2, 'name' => 'Returned'); //done, can not be edited, retured\r\n\t\t\t$status[3] = array('id' => 3, 'name' => 'Closed'); //memo only, done, closed out. memo close date updated\r\n\t\t\t$status[4] = array('id' => 4, 'name' => 'Converted'); //memo only, converted\r\n\t\t\t$status[5] = array('id' => 5, 'name' => 'Cancelled'); //layaways only, cancelled\r\n\t\treturn $status;\r\n\t}", "public function getOrderPaymentStatusList()\n {\n $oList = oxNew('oePayPalOrderPaymentStatusList');\n\n return $oList;\n }", "public function getAvailableStatuses()\n {\n return [\n self::STATUS_NEW => 'New',\n self::STATUS_PROCESSING => 'Processing',\n self::STATUS_DONE => 'Done',\n self::STATUS_ERROR => 'Error'\n ];\n }", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public function getInvoiceItemStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0, 'name' => 'Normal Sale');\r\n\t\t\t$status[1] = array('id' => 1, 'name' => 'Returned');\r\n\t\t\t$status[2] = array('id' => 2, 'name' => 'Pending Return');\r\n\t\t\t$status[3] = array('id' => 3, 'name' => 'Closed Memo');\r\n\t\treturn $status; //array\r\n\t}", "public function getValidUnsentOrderStatuses()\n {\n $statuses = $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/valid_unsent_order_statuses',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n\n return explode(',', $statuses);\n }", "function listOrderStatus() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show orders if user has access\n\t\tif($page->validatePath(\"/janitor/admin/shop/order/list\")) {\n\n\t\t\tinclude_once(\"classes/shop/supershop.class.php\");\n\t\t\t$model = new SuperShop();\n\n\t\t\t$_ .= '<div class=\"orders\">';\n\t\t\t$_ .= '<h2>Order status</h2>';\n\n\n\t\t\tif($model->order_statuses) {\n\t\t\t\t$_ .= '<ul class=\"orders\">';\n\t\t\t\tforeach($model->order_statuses as $order_status => $order_status_name) {\n\t\t\t\t\t$_ .= '<li class=\"'.superNormalize($order_status_name).'\">';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '<a href=\"/janitor/admin/shop/order/list/\"'.$order_status.'\">'.$order_status_name.'</a> ';\n\t\t\t\t\t$_ .= '<span class=\"count\">'.$model->getOrderCount(array(\"status\" => $order_status)).'</span>';\n\t\t\t\t\t$_ .= '<h3>';\n\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\t\t}\n\n\t\treturn $_;\n\t}", "public static function statuses()\n {\n return [\n self::STATUS_PENDING => Yii::t('app', 'Pending'),\n self::STATUS_REJECTED => Yii::t('app', 'Rejected'),\n self::STATUS_ACCEPTED => Yii::t('app', 'Accepted')\n ];\n }", "public function getOrderStatuses()\n {\n $response = $this->client->request('GET', '/v1/settings/orderstatuses');\n return new GetOrderStatusesResponse($response);\n }", "public static function getOrderFormStatusChoices(): array\n {\n //====================================================================//\n // Load Prestashop Status List\n return array_merge_recursive(\n array(array(\n \"id_order_state\" => 0,\n \"name\" => \"Use Generic Status\",\n )),\n OrderState::getOrderStates(SLM::getDefaultLangId())\n );\n }", "public function getOrderStatus(){\n return $this->_getData(self::ORDER_STATUS);\n }", "public function get_statuses() {\n\n\t\t// In this order statuses will appear in filters bar.\n\t\t$statuses = [\n\t\t\tEmail::STATUS_DELIVERED => __( 'Delivered', 'wp-mail-smtp-pro' ),\n\t\t\tEmail::STATUS_SENT => __( 'Sent', 'wp-mail-smtp-pro' ),\n\t\t\tEmail::STATUS_WAITING => __( 'Pending', 'wp-mail-smtp-pro' ),\n\t\t\tEmail::STATUS_UNSENT => __( 'Failed', 'wp-mail-smtp-pro' ),\n\t\t];\n\n\t\t// Exclude Delivered and Pending statuses for mailers without verification API.\n\t\tif ( Helpers::mailer_without_send_confirmation() ) {\n\t\t\tunset( $statuses[ Email::STATUS_DELIVERED ] );\n\t\t\tunset( $statuses[ Email::STATUS_WAITING ] );\n\t\t}\n\n\t\treturn $statuses;\n\t}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_RECEIVED,\nself::STATUS_COMPLETED,\nself::STATUS_CANCELLED, ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PLACEMENT_ACTIVE,\nself::STATUS_TERMINATED,\nself::STATUS_RENEWAL_PENDING,\nself::STATUS_PLACEMENT_STARTING, ];\n }", "function ostGetCompletedOrderStatus(){\r\n\r\n\treturn CONF_ORDSTATUS_DELIVERED;\r\n}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "function cb_wc_add_status( $wc_statuses_arr ) {\n\t$new_statuses_arr = array();\n\n\t// Add new order status after payment pending.\n\tforeach ( $wc_statuses_arr as $id => $label ) {\n\t\t$new_statuses_arr[ $id ] = $label;\n\n\t\tif ( 'wc-pending' === $id ) { // after \"Payment Pending\" status.\n\t\t\t$new_statuses_arr['wc-blockchainpending'] = __( 'Blockchain Pending', 'coinbase' );\n\t\t}\n\t}\n\n\treturn $new_statuses_arr;\n}", "public function getAllStatus()\n {\n return OrderStatus::all();\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_0,\nself::STATUS_1,\nself::STATUS_2, ];\n }", "public static function getStatusesList()\n {\n return [\n static::STATUS_ACTIVE => 'Active',\n static::STATUS_BLOCKED => 'Blocked',\n ];\n }", "public static function getPossibleStatuses()\n {\n return array(\n 'Not started',\n 'Started',\n 'Finished',\n );\n }", "public function getDeliveryStatusList(){\n\t\t/* variable initialization */\n\t\t$strReturnArr\t= $strQueryArr\t= array();\n\t\t\n\t\t/* Creating query array */\n\t\t$strQueryArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strTableName,\n\t\t\t\t\t\t\t\t\t'column'=>array('id','description'),\n\t\t\t\t\t\t\t\t\t'where'=>array('attribute_code'=>DELIVERY_STATUS_WIDGET_ATTR_CODE),\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t \n\t\t/* Get data from dataset */\n\t\t$strResultSetArr\t= $this->_databaseObject->getDataFromTable($strQueryArr);\n\t\t/* removed used variable */\n\t\tunset($strQueryArr);\n\t\t\n\t\t/* if status found teh do needful */\n\t\tif(!empty($strResultSetArr)){\n\t\t\t/* Iterting the loop */\n\t\t\tforeach($strResultSetArr as $strResultSetArrKey => $strResultSetArrValue){\n\t\t\t\t/* setting the key value paris */\n\t\t\t\t$strReturnArr['keyvalue'][$strResultSetArrValue['id']]\t= $strResultSetArrValue['description'];\n\t\t\t}\n\t\t}\n\t\t/* set the default result set */\n\t\t$strReturnArr['defaultvalue']\t= $strResultSetArr;\n\t\t/* removed used variable */\n\t\tunset($strResultSetArr);\n\t\t\n\t\t/* return the status result set */\n\t\treturn $strReturnArr;\n\t}", "public function getStatus() {\r\n\t\t$status = array();\r\n\t\tif ($this -> draft) {\r\n\t\t\t$status['type'] = 0;\r\n\t\t\t$status['condition'] = 'draft';\r\n\t\t\treturn $status;\r\n\t\t}\r\n\t\tif ($this -> is_approved) {\r\n\t\t\t$status['type'] = 2;\r\n\t\t\t$status['condition'] = 'approved';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$status['type'] = 1;\r\n\t\t\t$status['condition'] = 'pending';\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "public function getEnumStatusSupply(){\n return ['WAITING','IN PROGRESS','CANCELED','COMPLETED'];\n }", "protected function _setDefaultOrderStatuses() {\n $completedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('completed_order_status'));\n $failedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('cancelled_order_status'));\n $partialRefundedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('partial_refunded_order_status'));\n $refundedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('refunded_order_status'));\n\n if ($completedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_completed_status_id', $completedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($failedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_failed_status_id', $failedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($partialRefundedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_partial_refunded_status_id', $partialRefundedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($refundedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_refunded_status_id', $refundedOrderStatusId, $this->config->get('config_store_id'));\n }\n $this->cache->delete(\"order_status.\" . (int)$this->config->get('config_language_id'));\n }", "function get_all_woo_status_ps_sms()\n{\n if (!function_exists('wc_get_order_statuses'))\n return;\n $statuses = wc_get_order_statuses() ? wc_get_order_statuses() : array();\n $opt_statuses = array();\n foreach ((array) $statuses as $status_val => $status_name) {\n $opt_statuses[substr($status_val, 3)] = $status_name;\n }\n return $opt_statuses;\n}", "public function get_order_status()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('order_status');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('order_status_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public static function statuses() {\n return [\n self::STATUS_ACTIVE => 'Активный',\n self::STATUS_DISABLED => 'Отключен',\n ];\n }", "public function add_valid_order_statuses( $statuses, $order ) {\n\t\t$payment_method = $order->get_payment_method();\n\t\tif ( in_array( $payment_method, WC_Swedbank_Plugin::PAYMENT_METHODS, true ) ) {\n\t\t\t$statuses = array_merge(\n\t\t\t\t$statuses,\n\t\t\t\tarray(\n\t\t\t\t\t'processing',\n\t\t\t\t\t'completed',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $statuses;\n\t}", "public static function getArrayStatus() {\n return array(\n self::STATUS_INACTIVE => DomainConst::CONTENT00408,\n self::STATUS_ACTIVE => DomainConst::CONTENT00539,\n self::STATUS_APPROVED => DomainConst::CONTENT00476,\n self::STATUS_CANCEL => DomainConst::CONTENT00477,\n self::STATUS_REQUIRED_UPDATE => DomainConst::CONTENT00478,\n );\n }", "protected static function getBackupCodeJsonStatusCodes()\n {\n return array(\n self::NO_IDENTIFIER_SUPPLIED,\n self::NO_TOKEN_SUPPLIED,\n self::INVALID_TOKEN,\n self::IDENTIFIER_TOO_LONG,\n );\n }", "public function getSaleableStatusIds()\n {\n return [self::STATUS_ENABLED];\n }", "public function getOrderStatus()\n {\n return $this->status;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_PENDING,\n self::STATUS_SUCCESSFUL,\n self::STATUS_NOT_SUCCESSFUL,\n self::STATUS_DISCARDED,\n ];\n }", "public function getValidStatusCodes()\n {\n return array(\n self::STATUS_OK,\n self::STATUS_ACCEPTED,\n self::STATUS_NON_AUTHORITATIVE_INFORMATION,\n self::STATUS_NO_CONTENT,\n self::STATUS_RESET_CONTENT,\n self::STATUS_PARTIAL_CONTENT,\n self::STATUS_CREATED\n );\n }", "public function get_order_statuses( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t$statuses = get_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status' );\n\n\t\tif ( ! $statuses ) {\n\t\t\t$statuses = array();\n\t\t}\n\n\t\treturn $statuses;\n\t}", "protected static function getStatuses()\n {\n return [\n CrudController::STATUS_SUCCESS => 'successfully',\n CrudController::STATUS_FAILURE => 'unsuccessfully',\n ];\n }", "public function getStatusesAsArray()\n {\n return array(\n Braintree_Transaction::AUTHORIZATION_EXPIRED => $this->__('Authorization Expired'),\n Braintree_Transaction::AUTHORIZING => $this->__('Authorizing'),\n Braintree_Transaction::AUTHORIZED => $this->__('Authorized'),\n Braintree_Transaction::GATEWAY_REJECTED => $this->__('Gateway Rejected'),\n Braintree_Transaction::FAILED => $this->__('Failed'),\n Braintree_Transaction::PROCESSOR_DECLINED => $this->__('Processor Declined'),\n Braintree_Transaction::SETTLED => $this->__('Settled'),\n Braintree_Transaction::SETTLING => $this->__('Settling'),\n Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT => $this->__('Submitted For Settlement'),\n Braintree_Transaction::VOIDED => $this->__('Voided'),\n Braintree_Transaction::UNRECOGNIZED => $this->__('Unrecognized'),\n Braintree_Transaction::SETTLEMENT_DECLINED => $this->__('Settlement Declined'),\n Braintree_Transaction::SETTLEMENT_PENDING => $this->__('Settlement Pending')\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_NOT_SUBSCRIBED,\n self::STATUS_SUBSCRIBED,\n self::STATUS_IN_PROGRESS,\n self::STATUS_COMPLETED,\n ];\n }", "public function getPendingOrders($status) {\r\n if($status != \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n $condition = new Zend_Db_Expr(\"sales.entity_id = main_table.order_id AND sales.status = '$status'\");\r\n $orders->getSelect()->join(array('sales' => $orders->getTable('sales/order')),\r\n $condition,\r\n array('status' => 'sales.status'));\r\n elseif($status == \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n endif;\r\n return $orders; \r\n }", "public function getListDeliveryStatus()\n {\n return $this->client->makeRequest('deliverystatus', 'GET');\n }", "function olc_get_customers_statuses() {\n\n\t$customers_statuses_array = array(array());\n\t$customers_statuses_query = olc_db_query(SELECT.\"customers_status_id, customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag, customers_status_ot_discount\".SQL_FROM . TABLE_CUSTOMERS_STATUS . SQL_WHERE.\"language_id = '\" . SESSION_LANGUAGE_ID . \"' order by customers_status_id\");\n\t$i=1; // this is changed from 0 to 1 in cs v1.2\n\twhile ($customers_statuses = olc_db_fetch_array($customers_statuses_query)) {\n\t\t$i=$customers_statuses['customers_status_id'];\n\t\t$customers_statuses_array[$i] = array('id' => $customers_statuses['customers_status_id'],\n\t\t'text' => $customers_statuses['customers_status_name'],\n\t\t'csa_public' => $customers_statuses['customers_status_public'],\n\t\t'csa_image' => $customers_statuses['customers_status_image'],\n\t\t'csa_discount' => $customers_statuses['customers_status_discount'],\n\t\t'csa_ot_discount_flag' => $customers_statuses['customers_status_ot_discount_flag'],\n\t\t'csa_ot_discount' => $customers_statuses['customers_status_ot_discount'],\n\t\t'csa_graduated_prices' => $customers_statuses['customers_status_graduated_prices']\n\t\t);\n\t}\n\treturn $customers_statuses_array;\n}", "public function Get_Status() {\n $flags = array(\n 'complete' => array(\n 'code' => 'complete',\n 'name' => 'Complete',\n //'_update' => array($this,'_Status_Make_Complete'),\n ),\n 'cool' => array(\n 'code' => 'cool',\n 'name' => 'Cool',\n //'_update' => array($this,'_Status_Make_Complete'),\n )\n );\n // Apply any filter for adding to the flag list\n $status = apply_filters('vcff_reports_status',$status,$this);\n // Return the flag list\n return $flags;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_QUEUED,\n self::STATUS_PROPOSING,\n self::STATUS_ACCEPTED,\n self::STATUS_FAILED,\n self::STATUS_ACTIVE,\n self::STATUS_PUBLISHED,\n self::STATUS_TERMINATED,\n ];\n }", "function preorder_count()\n\t{\n\t\t$active = 0;\n\t\t$completed = 0;\n\n\t\twhile (list($a,$arr) = each($this->preorders))\n\t\t{\n\t\t\tif ($arr['pre_status'] == PRE_ACTIVE) { $active++; }\n\t\t\telseif ($arr['pre_status'] == PRE_COMPLETED) { $completed++; }\n\t\t}\n\t\treset($this->preorders);\n\n\t\treturn array($active,$completed);\n\t}", "public static function allStatuses()\n {\n $statuses = ProductOrderStatus::all();\n return $statuses;\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_MINUS_1,\r\n self::STATUS_0,\r\n self::STATUS_1,\r\n self::STATUS_2,\r\n self::STATUS_3,\r\n self::STATUS_4,\r\n self::STATUS_5,\r\n self::STATUS_6,\r\n self::STATUS_7,\r\n self::STATUS_8,\r\n self::STATUS_9,\r\n self::STATUS_10,\r\n self::STATUS_11,\r\n ];\r\n }", "public function getStatusList()\n {\n return ['0' => __('修改'), '1' => __('提议'), '2' => __('新增'), '3' => __('废止')];\n }", "private static function getKnownStatus(): array\n {\n //====================================================================//\n // Already Loaded\n if (isset(self::$psKnownStatus)) {\n return self::$psKnownStatus;\n }\n //====================================================================//\n // Load Default Orders Statuses\n self::$psKnownStatus = self::$psOrderStatus;\n //====================================================================//\n // NOT ALLOWED WRITE => STOP HERE\n if (!self::isAllowedWrite()) {\n return self::$psKnownStatus;\n }\n //====================================================================//\n // Complete Status from User Settings\n foreach (SplashStatus::getAll() as $status) {\n //====================================================================//\n // Load Target Status from Settings\n $psStateId = Configuration::get('SPLASH_ORDER_'.strtoupper($status));\n if ($psStateId > 0) {\n self::$psKnownStatus[$psStateId] = $status;\n }\n }\n\n return self::$psKnownStatus;\n }", "protected function getVendorOrders() {\n\n\t\t$this->load->model('sale/vdi_order');\n\t\t$data = array();\n\n if (isset($this->request->request['filter_order_status'])) {\n //check input - should be list of integers\n if (1 === preg_match('/^[0-9,\\s]+$/',\n $this->request->request['filter_order_status'])) {\n $data['filter_order_status'] = $this->request->request['filter_order_status'];\n }\n }\n\n $result = array();\n $orderCount = $this->model_sale_vdi_order->getTotalOrders($data);\n $result['total_order_count'] = $orderCount;\n\n if (!isset($this->request->request['metaonly']) ||\n (\"true\" !== $this->request->request['metaonly'])) {\n $orders = $this->model_sale_vdi_order->getOrdersByOrderProductStatus($data);\n $result['orders'] = $orders;\n }\n\n\t\treturn $result;\n\t}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_FINISHED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_LOCKED,\nself::STATUS_AVAILABLE, ];\n }", "public static function arrayStatuses() {\n\n /*\n $statuses = array(\n 'all' => array(\n 'label' => __( 'All', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'publish' => array(\n 'label' => __( 'Publish', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'trash' => array(\n 'label' => __( 'Trash', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n )\n );*/\n $statuses = array(\n 'all' => array(\n 'label' => __( 'All', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_PENDING => array(\n 'label' => __( 'Pending', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_CONFIRMED => array(\n 'label' => __( 'Confirmed', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_CANCELLED => array(\n 'label' => __( 'Cancelled', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_DEFUNCT => array(\n 'label' => __( 'Defunct', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'trash' => array(\n 'label' => __( 'Trash', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n )\n );\n return $statuses;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_ON_HOLD,\n self::STATUS_HOLD_PAYMENTS,\n self::STATUS_INACTIVE,\n self::STATUS_ONE_TIME,\n ];\n }", "public function statusOptions()\n\t{\n\t\treturn array('pending', 'processing', 'complete', 'on_hold');\n\t}", "public static function fetch_order_status() {\n $order_id = wc_get_order( $_POST['order_id'] );\n $order_key = OmisePluginHelperWcOrder::get_order_key_by_id( $order_id );\n\n if ( ! wp_verify_nonce( $_POST['nonce'], $order_key ) ) {\n die ( 'Busted!');\n }\n\n wp_send_json_success( array( 'order_status' => $order_id->get_status() ) );\n }", "public static function getStatus() {\n return array(\n Users::STATUS_INACTIVE => DomainConst::CONTENT00028,\n Users::STATUS_ACTIVE => DomainConst::CONTENT00027,\n Users::STATUS_NEED_CHANGE_PASS => DomainConst::CONTENT00212,\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_CANCELED,\n self::STATUS_DISABLED,\n ];\n }", "function getProposalStatusList()\n {\n $query = \"SELECT StatusID, Name FROM ProposalStatus;\";\n $stmt = $this->conn->prepare( $query );\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getProcessedOrderStatus($store = null)\n {\n return $this->getPaymentValue('order_status', ConfigProvider::CODE, $store);\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_TEMPORARY,\n self::STATUS_SAVED,\n self::STATUS_POSTED,\n self::STATUS_COMMITTED,\n self::STATUS_CANCELLED,\n self::STATUS_ADJUSTED,\n self::STATUS_QUEUED,\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_ANY,\n ];\n }", "function get_allowed_woo_status_ps_sms()\n{\n if (!function_exists('wc_get_order_statuses'))\n return;\n $statuses = wc_get_order_statuses() ? wc_get_order_statuses() : array();\n $order_status_settings = ps_sms_options('order_status', 'sms_buyer_settings', array());\n $allowed_statuses = array();\n foreach ((array) $statuses as $status_val => $status_name) {\n if (in_array(substr($status_val, 3), $order_status_settings))\n $allowed_statuses[substr($status_val, 3)] = $status_name;\n }\n return $allowed_statuses;\n}", "public static function getAvailableStatus()\n {\n return array(\n self::STATUS_DRAFT => self::STATUS_DRAFT,\n self::STATUS_REVIEWED => self::STATUS_REVIEWED,\n self::STATUS_PUBLISH => self::STATUS_PUBLISH,\n self::STATUS_HIDDEN => self::STATUS_HIDDEN\n );\n }", "public function allowedOrderStateDataProvider()\n {\n return [\n [Order::STATE_PROCESSING],\n [Order::STATE_COMPLETE],\n [Order::STATE_PAYMENT_REVIEW],\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING,\n self::STATUS_INPROGRESS,\n self::STATUS_SUCCESS,\n self::STATUS_FAILED,\n self::STATUS_TIMEOUT,\n self::STATUS_PARTIALSUCCESS,\n ];\n }", "public static function laratablesOrderStatus()\n {\n return 'status';\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_CREATION_IN_PROGRESS,\r\n self::STATUS_CREATION_FAILED,\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_APPLY_IN_PROGRESS,\r\n self::STATUS_APPLIED,\r\n ];\r\n }", "public function getPurchaseOrdersWaitingToBeApproved()\n {\n try {\n return $this->xero->load(PurchaseOrder::class)\n ->setParameter('status', 'SUBMITTED')\n ->orderBy('Date')\n ->execute();\n } catch (\\Exception $e){\n $this->addToErrors(\"xero error :: Failed to retrieve purchase orders :: {$e->getMessage()}\");\n }\n }", "public function getOrderTypeAllowableValues()\n {\n return [\n self::ORDER_TYPE_STANDARD_ORDER,\n self::ORDER_TYPE_LONG_LEAD_TIME_ORDER,\n self::ORDER_TYPE_PREORDER,\n self::ORDER_TYPE_BACK_ORDER,\n self::ORDER_TYPE_SOURCING_ON_DEMAND_ORDER,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DELETED,\n self::STATUS_ACTIVE,\n self::STATUS_PROCESSING,\n self::STATUS_SENDING,\n self::STATUS_COMPLETED,\n self::STATUS_PAUSED,\n self::STATUS_CANCELLED,\n self::STATUS_DRAFT,\n ];\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "function ostGetOrderStatues( $fullList = true, $format = 'just' )\r\n{\r\n\t$data = array();\r\n\tif ( $fullList )\r\n\t{\r\n\t\t$q = db_phquery( \"SELECT * FROM ?#ORDER_STATUSES_TABLE WHERE statusID=?\", ostGetCanceledStatusId() );\r\n\t\t$row = db_fetch_assoc( $q );\r\n\t\tLanguagesManager::ml_fillFields(ORDER_STATUSES_TABLE, $row);\r\n\r\n\t\t$r = array( \"statusID\" => $row[\"statusID\"],\r\n\t\t\t\t\"status_name\" => $row[\"status_name\"], \r\n\t\t\t\t\"sort_order\" => $row[\"sort_order\"],\r\n\t\t \"color\" => $row[\"color\"]);\r\n\t\t_correctOrderStatusName( $r );\r\n\t\t$data[] = $r;\r\n\t}\r\n\r\n\t$q = db_phquery(\"\r\n\t\tSELECT *, \".LanguagesManager::sql_prepareField('status_name').\" AS status_name FROM ?#ORDER_STATUSES_TABLE\r\n\t\tWHERE statusID!=? ORDER BY sort_order ASC, status_name ASC\", ostGetCanceledStatusId() );\r\n\twhile( $r = db_fetch_assoc( $q ) )\r\n\t{\r\n\t\tLanguagesManager::ml_fillFields(ORDER_STATUSES_TABLE, $r);\r\n\t\t//if($format!='html')\r\n\t\t//\t$r[\"status_name\"] = xHtmlSpecialChars($r[\"status_name\"]);\r\n\r\n\t\t$data[] = $r;\r\n\t}\r\n\r\n\tswitch ($format){\r\n\t\tdefault:\r\n\t\tcase 'just':\r\n\t\t\tbreak;\r\n\t\tcase 'html':\r\n\t\t\t$data = xHtmlSpecialChars($data);\r\n\t\t\tbreak;\r\n\t}\r\n\treturn $data;\r\n}", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_LAUNCHING,\r\n self::STATUS_RUNNING,\r\n self::STATUS_FINISHED,\r\n self::STATUS_FAILED,\r\n self::STATUS_CANCELLED,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_EXPIRED,\n ];\n }", "public function get_event_status()\n {\n return array(0 => 'undefined'//, 1 => 'due for approval'\n ,2 => 'confirmed', 3 => 'cancelled'//, 4 => 'delegated'\n ,10 => 'tentative', 11 => 'needs-action'\n );\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_MEETING,\n self::STATUS_WAITING_ROOM,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_RUNNING,\r\n self::STATUS_ABNORMAL,\r\n self::STATUS_INSTALLING,\r\n self::STATUS_INSTALL_FAILED,\r\n self::STATUS_UPGRADING,\r\n self::STATUS_UPGRADE_FAILED,\r\n self::STATUS_DELETING,\r\n self::STATUS_DELETE_SUCCESS,\r\n self::STATUS_DELETE_FAILED,\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_ROLLBACKING,\r\n ];\r\n }", "public static function getOpenStates()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_ASSIGNED,\n self::STATUS_OVERDUE,\n ];\n }", "public function get_valid_statuses() {\n\t\treturn array_keys( _wc_cs_get_credits_statuses() ) ;\n\t}", "public function toOptionArray()\n {\n\t\t$result = array();\n\t\t\n\t\t$data = Mage::getModel('sales/order_status')->getResourceCollection()->getData();\n \n if(!is_null($data))\n {\n\t\t\tforeach($data as $row)\t\t\t\n\t\t\t\t$result[] = array('value' => $row['status'], 'label'=>Mage::helper('adminhtml')->__($row['label']));\t\t\t\n\t\t}\n \n return $result;\n }" ]
[ "0.74333483", "0.718919", "0.6755712", "0.6717691", "0.6545037", "0.652188", "0.65060127", "0.6495169", "0.6479992", "0.6477323", "0.6470433", "0.6464733", "0.64537954", "0.6450141", "0.64454305", "0.64212596", "0.63890857", "0.63744205", "0.63519764", "0.63384366", "0.62655306", "0.6216738", "0.62000865", "0.6186438", "0.6183636", "0.6179242", "0.61778307", "0.6167564", "0.61607844", "0.6148213", "0.6136463", "0.6122582", "0.61212164", "0.61149967", "0.61149967", "0.6105617", "0.61048883", "0.608521", "0.6069998", "0.606772", "0.6067004", "0.6060685", "0.60331386", "0.59838444", "0.5939659", "0.5929176", "0.59129", "0.5897764", "0.5893338", "0.58813953", "0.58804893", "0.58675355", "0.58659035", "0.5855599", "0.58433264", "0.58402765", "0.58378583", "0.58350974", "0.5833155", "0.58219206", "0.5821091", "0.5817868", "0.5808001", "0.57971984", "0.57957494", "0.57896113", "0.5788459", "0.5785319", "0.5760841", "0.5754477", "0.5752617", "0.5749213", "0.5729885", "0.57289094", "0.57233274", "0.57204384", "0.57139105", "0.5711931", "0.57117057", "0.57100385", "0.56960034", "0.56957203", "0.5689577", "0.56867707", "0.5681113", "0.5674366", "0.5674258", "0.5672157", "0.56700987", "0.56668854", "0.56668854", "0.5649303", "0.56489664", "0.56396204", "0.56378365", "0.56376654", "0.5635045", "0.56348854", "0.5632164", "0.5629644" ]
0.6431981
15
Is autocreate notification enabled?
public function isAutocreateNotification() { return (1 == $this->getConfig('autocreate/autocreate_notify')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAutoNotifyEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/abandoned_notifications/auto_notify_enable')==0) ? false : true;\n }", "function notificationEnabled(){\n\t\treturn false;\n\t}", "public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}", "public function supportsTopicNotification() {\n \treturn $this->manager->supportsTopicNotification();\n\t}", "public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }", "public function isNotificationsSupported() {\n return false;\n }", "public function isTrackingNotification()\n {\n return (1 == $this->getConfig('notification/tracking_notification'));\n }", "public function supportsCourseNotification() {\n \treturn $this->manager->supportsCourseNotification();\n\t}", "public function isAppEventEnabled()\n {\n return true;\n }", "protected function getSendNotificationFlag()\n {\n return (bool) \\XLite\\Core\\Request::getInstance()->sendNotification;\n }", "public function can_auto_create_users() {\n return (bool)$this->config['weautocreateusers'];\n }", "function notify_addon_enabled_from_admin_panel() {\n return ( (!!qa_opt('qw_enable_email_notfn')) &&\n (\n (!!qa_opt('qw_notify_cat_followers')) ||\n (!!qa_opt('qw_notify_tag_followers')) ||\n (!!qa_opt('qw_notify_user_followers'))\n )\n );\n }", "public function isPending(): bool;", "public function notification();", "public function notification();", "public function notify() : bool{}", "public function maybe_create_notification() {\n\t\tif ( ! $this->should_show_notification() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}", "public function get_notification_types()\n {\n return false;\n }", "public function notifyOne() : bool{}", "function backorders_require_notification() {\n\t\tif ($this->data['backorders']=='notify') return true;\n\t\treturn false;\n\t}", "public function isSubscribed(): bool;", "public function isEnableConfirmations()\r\n {\r\n return $this->enable_confirmations;\r\n }", "protected function should_show_notification() {\n\t\t// Don't show a notification if the indexing has already been started earlier.\n\t\tif ( $this->indexing_helper->get_started() > 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Never show a notification when nothing should be indexed.\n\t\treturn $this->indexing_helper->get_filtered_unindexed_count() > 0;\n\t}", "public function isActivated() {}", "public function checkForOneTimeDemoMessage(): bool\n {\n return $this->getCustomerAttrCreditHold() && $this->configProvider->isOptionCreditHoldEnable() && !$this->getFlag();\n }", "public function status_subscription(){\n\t\t\treturn true;\n\t\t}", "public function supportsCourseCatalogNotification() {\n \treturn $this->manager->supportsCourseCatalogNotification();\n\t}", "public function hasNotifications()\n {\n return count($this->notifications) > 0;\n }", "public function isPending()\n {\n return true;\n }", "public function areRegisterMessagesEnabled() : bool{\n \treturn $this->register_message;\n }", "static public function status()\n {\n $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));\n }", "protected function useEmailNotifications()\n {\n return true;\n }", "public function hasFlashNotification()\n {\n return Session::has('flash_notification');\n }", "public function isAutomaticallySubscribed($phid);", "public function isAutomaticallySubscribed($phid);", "public function supportsTermNotification() {\n \treturn $this->manager->supportsTermNotification();\n\t}", "public function supportsCourseOfferingNotification() {\n \treturn $this->manager->supportsCourseOfferingNotification();\n\t}", "public static function isSessionAutoStartEnabled() {}", "public function canSend()\n {\n $flag = intval(setting(\"mail_notify_{$this->getTemplateTag()}\"));\n\n return !!$flag;\n }", "public function isAutoTrackUpdate()\n {\n return $this->autoTrackUpdate;\n }", "function getReminderWasAutomatic() {\n\t\treturn $this->getData('reminderWasAutomatic')==1?1:0;\n\t}", "public static function enable_google_notification() {\n\t\tself::$google_notification_enabled = true;\n\t}", "public static function enable_google_notification() {\n\t\tself::$google_notification_enabled = true;\n\t}", "public function is_feedback_notice_active() {\n\t\t// Check whether the current user has sufficient capabilities for the notice to be displayed\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check whether the plugin has been installed long enough for the notice to be displayed\n\t\t$plugin_installed = get_option( 'wpba_installed_timestamp' );\n\n\t\tif ( $plugin_installed && ( time() - $plugin_installed ) <= 60 * 60 * 24 * 7 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! get_user_meta( get_current_user_id(), 'wpba/notice_disabled/feedback', true );\n\t}", "function isForumNotificationEnabled($user_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryf('SELECT COUNT(*) cnt FROM frm_notification WHERE user_id = %s AND frm_id = %s',\n\t\t array('integer', 'integer'), array($user_id, $this->id));\n\t\t \n\t\twhile($record = $ilDB->fetchAssoc($result))\n\t\t{\t\t\n\t\t\treturn (bool)$record['cnt'];\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function isActivatable()\n {\n return true ;\n }", "function isAttached(ftpClientObserver $observer) {\r\n\t\tif ( isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isReported()\n\t{\n\t\tif ($this->get('state') == self::APP_STATE_FLAGGED)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function shouldDiscoverEvents(): bool\n {\n return false;\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "function isThreadNotificationEnabled($user_id, $thread_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryf('\n\t\t\tSELECT COUNT(*) cnt FROM frm_notification \n\t\t\tWHERE user_id = %s \n\t\t\tAND thread_id = %s',\n\t\t\tarray('integer', 'integer'),\n\t\t\tarray($user_id, $thread_id));\t\t \t\n\n\t\t\t\t\n\t\twhile($record = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\treturn (bool)$record['cnt'];\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function _isEnabled()\n {\n return Mage::helper('gri_reward')->isEnabledOnFront()\n && Mage::helper('gri_reward')->getGeneralConfig('publish_history');\n }", "public function hasPendingNotification($data_id);", "public function isEnableAdminEmail ()\n {\n return $this->scopeConfig->isSetFlag(\n 'b2bregistration/admin_notification/admin_notification_enable',\n ScopeInterface::SCOPE_STORE\n );\n }", "protected function maybe_show_donation_message() {\n\t\t// Only show the message to plugin admins\n\t\tif ( ! current_user_can( 'iggogrid_edit_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! IggoGrid::$model_options->get( 'message_donation_nag' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// How long has the plugin been installed?\n\t\t$seconds_installed = time() - IggoGrid::$model_options->get( 'first_activation' );\n\t\treturn ( $seconds_installed > 30*DAY_IN_SECONDS );\n\t}", "protected function hasCreatedPackSubscription(): bool\n {\n return !!$this->packSubscription;\n }", "public function can_activate(): bool;", "public function hasRead()\n {\n return ($this->status == NOTIFICATION_VIEWED);\n }", "public function hasAutoUpdate()\n {\n return $this->auto_update !== null;\n }", "public static function resubscribeNotifications()\n\t{\n\t\ttry {\n\t\t\tISC_ADMIN_EBAY_OPERATIONS::setApplicationNotificationsEnabled(true);\n\t\t}\n\t\tcatch (ISC_EBAY_API_EXCEPTION $ex) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isVacationAutoResponder()\n {\n // has 'auto-submitted' header?\n if ($this->headers->has('auto-submitted')) {\n return true;\n }\n\n // return true if 'x-vacationmessage' is set and not empty\n if (!$this->headers->has('x-vacationmessage')) {\n return false;\n }\n\n return $this->headers->get('x-vacationmessage') != '';\n }", "public function hasPendingActions()\r\n {\r\n }", "public function is_active(): bool;", "private function should_show_feedback_notice() {\n\t\t$activated_time = get_option( 'neve_install' );\n\t\tif ( ! empty( $activated_time ) ) {\n\t\t\tif ( time() - intval( $activated_time ) > 14 * DAY_IN_SECONDS ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function addComposerModeNotification() {}", "function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}", "public function canHandleSubscriptions():bool\n {\n return false;\n }", "public function isScheduled()\n {\n return $this->publish_status == Status::SCHEDULED;\n }", "public function isEnabled()\n {\n return true;\n\n }", "function getNotification(){\n\n\n}", "public function is_tracking_enabled()\n {\n }", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "private function isEnableOpenPlatform()\n {\n return $this->config()->has('wechat.open_platform');\n }", "public function notificationCanSend( $metaData )\n\t{\n\t\treturn true;\n\t}", "public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }", "public function getSendNotificationsOnLeads() {\n\n return (bool) $this->send_notifications_on_leads;\n\n }", "public function isEnabled() {}", "public function markNotificationAsRead()\n\t{\n\t\t//get current login user\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$this->MeetingUser->updateAll(\n\t\t\t\tarray('MeetingUser.is_read' => 1),\n\t\t\t\tarray('MeetingUser.to_user' => $user)\n\t\t);\n\t\techo \"true\";\n\t\texit;\n\t}", "public function isAutoApproval ()\n {\n return $this->scopeConfig->isSetFlag(\n 'b2bregistration/approval/auto_approval',\n ScopeInterface::SCOPE_STORE\n );\n }", "function oncreate(){\n\t\treturn true;\n\t}", "public function isEnabled() {\n return true;\n }", "public function isOpened() : bool {\n $status = $this->delivery_status;\n return\n $status === WebhookEvent::EVENT_OPEN ||\n $status === WebhookEvent::EVENT_CLICK ||\n $status === WebhookEvent::EVENT_UNSUB;\n }", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function form_is_available_to_create_a_note()\n {\n\n }", "public function isUserNotificationEnabled($email) {\n\n \t$select = $this->getSelect()->reset('column')->where('email=?',$email);\n \t\n \t$result = $this->getConnection()->query($select)->fetchAll();\n \treturn (bool)count($result);\n }", "public function isAutomation(): bool\n {\n return Helper::isPro() && $this->source_type === AutomationSchedule::class;\n }", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }", "public function enable(): bool {}", "public function isNotify($obj)\n {\n return $this->validate($obj, 'notify');\n }", "public function hasAutomotive()\n {\n return $this->automotive !== null;\n }", "private function isReviewSendingEnabled()\n {\n return $this->_scopeConfig->getValue(\n AntavoConfigInterface::XML_PATH_REVIEW_EVENT_SENDING,\n ScopeInterface::SCOPE_STORES,\n $this->_storeManager->getStore()->getId()\n );\n }", "public function isTrackingAvailable()\n {\n return true;\n }", "public function is_runnable()\n\t{\n\t\treturn (bool) $this->config['delete_pms_days'];\n\t}", "function canUpdateBGEvents() {\n if ($this->fields[\"background\"]\n && !Session::haveRight(self::$rightname, self::MANAGE_BG_EVENTS)) {\n return false;\n }\n\n return true;\n }", "public function isEnabled(): bool;", "public function isEnabled(): bool;" ]
[ "0.76643604", "0.6952752", "0.68690777", "0.66079074", "0.65760154", "0.65232956", "0.65062505", "0.6424132", "0.6375673", "0.6360894", "0.63271666", "0.61732924", "0.61557096", "0.61444485", "0.61444485", "0.6124729", "0.60925066", "0.6087531", "0.6067352", "0.6064699", "0.6045208", "0.60280216", "0.600516", "0.5965876", "0.5965165", "0.59637964", "0.5950123", "0.59417623", "0.5907064", "0.58837646", "0.5873875", "0.58660287", "0.58588725", "0.5853734", "0.5853734", "0.584017", "0.5835899", "0.5807795", "0.5806898", "0.5806615", "0.57635665", "0.575259", "0.575259", "0.575057", "0.5742137", "0.57209164", "0.57021344", "0.5698979", "0.5691688", "0.568789", "0.56779754", "0.5677772", "0.5676311", "0.5671519", "0.56611377", "0.56508654", "0.56447285", "0.5636035", "0.56283164", "0.5625691", "0.5613463", "0.56114936", "0.5608097", "0.5601445", "0.55977565", "0.5596084", "0.55949944", "0.5585572", "0.55831945", "0.5579512", "0.557564", "0.5574303", "0.55684775", "0.5565468", "0.5553731", "0.5553038", "0.55521214", "0.5550767", "0.5538891", "0.5532579", "0.55300343", "0.5528183", "0.55227816", "0.55227816", "0.55227816", "0.5522489", "0.5516241", "0.55134183", "0.5511874", "0.5502833", "0.549903", "0.54984784", "0.5498289", "0.5497713", "0.54960823", "0.5490997", "0.54769254", "0.54730165", "0.54728365", "0.54728365" ]
0.86518586
0
Get tracking notification message
public function isTrackingNotification() { return (1 == $this->getConfig('notification/tracking_notification')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTrackingNotificationMessage($store=null)\n {\n return (string) $this->getConfig('notification/tracking_notification_message',$store);\n }", "function getNotification(){\n\n\n}", "public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }", "public function getNotification()\n {\n return $this->notification;\n }", "public function getNotification()\n\t{\n\t\treturn $this->notification;\n\t}", "public function getTrackingKey()\n {\n if (!is_null($this->_messageTrackKey))\n return $this->_messageTrackKey;\n else\n return null;\n }", "public function getMessage()\n {\n return Mage::registry('current_message');\n }", "public function get_portfolio_notification();", "public function notification();", "public function notification();", "public function getActivityNotify()\n {\n return $this->get(self::_ACTIVITY_NOTIFY);\n }", "public function getNotificationEmail() {}", "public function get_status_message() {\n\n\t\treturn $this->get_status_info()->message;\n\t}", "function getNotificationMessage($request, $notification) {\n\t\t// Allow hooks to override default behavior\n\t\t$message = null;\n\t\tHookRegistry::call('NotificationManager::getNotificationMessage', array(&$notification, &$message));\n\t\tif($message) return $message;\n\n\t\tswitch ($notification->getType()) {\n\t\t\tcase NOTIFICATION_TYPE_PUBLISHED_ISSUE:\n\t\t\t\treturn __('notification.type.issuePublished');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_SUCCESS:\n\t\t\t\treturn __('gifts.giftRedeemed');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_NO_GIFT_TO_REDEEM:\n\t\t\t\treturn __('gifts.noGiftToRedeem');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_ALREADY_REDEEMED:\n\t\t\t\treturn __('gifts.giftAlreadyRedeemed');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_INVALID:\n\t\t\t\treturn __('gifts.giftNotValid');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_TYPE_INVALID:\n\t\t\t\treturn __('gifts.subscriptionTypeNotValid');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_NON_EXPIRING:\n\t\t\t\treturn __('gifts.subscriptionNonExpiring');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_REQUESTED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookRequested');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_CREATED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookCreated');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_UPDATED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookUpdated');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_DELETED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookDeleted');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_MAILED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookMailed');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.settingsSaved');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.submissionAssigned');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorAssigned');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorDenied');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorRemoved');\n\t\t\tdefault:\n\t\t\t\treturn parent::getNotificationMessage($request, $notification);\n\t\t}\n\t}", "public function message() {\n $message = $this->rawMessage();\n\n return t($message['message'], $message['options'], array('context' => 'bibdk_holdingstatus'));;\n }", "public static function get_message()\n\t{\n\t\treturn Session::instance()->get('alert');\n\t}", "public function get_reference()\n\t{\n\t\treturn $this->user->lang(\n\t\t\t'NOTIFICATION_REFERENCE',\n\t\t\t$this->get_data('message_subject')\n\t\t);\n\t}", "abstract public function get_message();", "function getMessage() {\n return $this->message;\n }", "public function get_notification_get(){\n $notification = $this->model->getAllwhere('notification');\n\n $resp = array(\n 'rccode' => 1,\n 'message' => 'SUCCESS',\n 'notification' => (!empty($notification) ) ? $notification: [],\n );\n $this->response($resp);\n }", "public function get_message()\n {\n return $this->_message;\n }", "function getNotify() {\r\r\n\t\treturn $this->notify;\r\r\n\t}", "function getMessage(){\n\t\t\treturn $this->message;\n\t\t}", "public function getCustomerNoteNotify();", "public function getMessage() {\n return self::$message;\n }", "public function getNotificationById($id);", "public function getMessage(){\n\t\treturn $this->message;\n\t}", "function SDKNotifications($message){\r\n echo \"<h4>$message</h4>\";\r\n}", "public function get_message() { return $this->getMessage(); }", "public function getMessage(): string\n {\n return $this->data->message;\n }", "public function getNotificationUrl() {\n return (string) $this->getValue('notification_url');\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }", "public function getNotificationUUID(): string\n {\n return $this->rawData['notificationUUID'];\n }", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "public function message()\r\n {\r\n return $this->message;\r\n }", "public function message()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getSendEmailNotificationDetail()\n {\n return isset($this->sendEmailNotificationDetail) ? $this->sendEmailNotificationDetail : null;\n }", "protected function getMessage()\n {\n return $this->message;\n }", "public function getNotify()\n {\n return $this->notify;\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "public function track($params) {\n if (ENVIRONMENT !== 'development') {\n return $this->mp->track($params['message'], array(\"label\" => $params['action'], \"ip\" => $this->CI->input->ip_address()));\n }\n }", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function get_raw_message() { return $this->raw_message; }", "public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }", "public function getmessage()\n {\n return array_shift($this->storage);\n }", "public function getMessage () {\n\t\treturn $this->message;\n\t}", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "private function getMessage(){ \n\t\t\t//return $this->message;\n\t\t //return \"Sample Message\";\n\t\t\t//$msgArray = array(\"s_id\" => \"s_id\",\"u_id\" => \"u_id\",\"status\"=>\"status\");\n\t\t\t//return json_encode($msgArray); \n\t\t\treturn $this->message;\n\t\t\t\n\t\t}", "public function getMessage()\n {\n return Arr::get($this->getData(true), static::messageKey());\n }", "public function getMessage() \n\t{\n\t\treturn $this->message;\n\t}", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function get_unknow_message() {\n\t\treturn __( 'Unknown service message', 'the-events-calendar' );\n\t}", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function lastNotify()\n {\n return $this->notifications()->first();\n }", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }" ]
[ "0.7264003", "0.6880497", "0.65835613", "0.6554903", "0.64200586", "0.6372995", "0.6267631", "0.62362796", "0.619858", "0.619858", "0.6161041", "0.6113437", "0.61070424", "0.6098253", "0.6091903", "0.6065279", "0.6055796", "0.6031461", "0.6009866", "0.6007518", "0.60054255", "0.6004216", "0.59755266", "0.5965704", "0.5964679", "0.59569997", "0.5949082", "0.5914638", "0.59064865", "0.5892655", "0.58867496", "0.58865774", "0.58865774", "0.58865774", "0.58865774", "0.5884048", "0.58684456", "0.5865328", "0.58605313", "0.58533645", "0.58533645", "0.585205", "0.58498996", "0.5847391", "0.5836427", "0.58336127", "0.58223385", "0.5821277", "0.5821277", "0.5821277", "0.5819871", "0.5808659", "0.5807522", "0.5807522", "0.5807522", "0.5807522", "0.5796262", "0.57893157", "0.57832205", "0.57827735", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.5780263", "0.57756495", "0.5771772", "0.57666045", "0.57666045", "0.57633626", "0.5758291", "0.5758291", "0.5757427", "0.5752269", "0.5752269", "0.5752269", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998" ]
0.0
-1
Get tracking notification message
public function getTrackingNotificationMessage($store=null) { return (string) $this->getConfig('notification/tracking_notification_message',$store); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNotification(){\n\n\n}", "public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }", "public function getNotification()\n {\n return $this->notification;\n }", "public function getNotification()\n\t{\n\t\treturn $this->notification;\n\t}", "public function getTrackingKey()\n {\n if (!is_null($this->_messageTrackKey))\n return $this->_messageTrackKey;\n else\n return null;\n }", "public function getMessage()\n {\n return Mage::registry('current_message');\n }", "public function get_portfolio_notification();", "public function notification();", "public function notification();", "public function getActivityNotify()\n {\n return $this->get(self::_ACTIVITY_NOTIFY);\n }", "public function getNotificationEmail() {}", "public function get_status_message() {\n\n\t\treturn $this->get_status_info()->message;\n\t}", "function getNotificationMessage($request, $notification) {\n\t\t// Allow hooks to override default behavior\n\t\t$message = null;\n\t\tHookRegistry::call('NotificationManager::getNotificationMessage', array(&$notification, &$message));\n\t\tif($message) return $message;\n\n\t\tswitch ($notification->getType()) {\n\t\t\tcase NOTIFICATION_TYPE_PUBLISHED_ISSUE:\n\t\t\t\treturn __('notification.type.issuePublished');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_SUCCESS:\n\t\t\t\treturn __('gifts.giftRedeemed');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_NO_GIFT_TO_REDEEM:\n\t\t\t\treturn __('gifts.noGiftToRedeem');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_ALREADY_REDEEMED:\n\t\t\t\treturn __('gifts.giftAlreadyRedeemed');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_INVALID:\n\t\t\t\treturn __('gifts.giftNotValid');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_TYPE_INVALID:\n\t\t\t\treturn __('gifts.subscriptionTypeNotValid');\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_NON_EXPIRING:\n\t\t\t\treturn __('gifts.subscriptionNonExpiring');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_REQUESTED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookRequested');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_CREATED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookCreated');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_UPDATED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookUpdated');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_DELETED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookDeleted');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_MAILED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.bookMailed');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.settingsSaved');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.submissionAssigned');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorAssigned');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorDenied');\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:\n\t\t\t\treturn __('plugins.generic.booksForReview.notification.authorRemoved');\n\t\t\tdefault:\n\t\t\t\treturn parent::getNotificationMessage($request, $notification);\n\t\t}\n\t}", "public function message() {\n $message = $this->rawMessage();\n\n return t($message['message'], $message['options'], array('context' => 'bibdk_holdingstatus'));;\n }", "public static function get_message()\n\t{\n\t\treturn Session::instance()->get('alert');\n\t}", "public function get_reference()\n\t{\n\t\treturn $this->user->lang(\n\t\t\t'NOTIFICATION_REFERENCE',\n\t\t\t$this->get_data('message_subject')\n\t\t);\n\t}", "abstract public function get_message();", "function getMessage() {\n return $this->message;\n }", "public function get_notification_get(){\n $notification = $this->model->getAllwhere('notification');\n\n $resp = array(\n 'rccode' => 1,\n 'message' => 'SUCCESS',\n 'notification' => (!empty($notification) ) ? $notification: [],\n );\n $this->response($resp);\n }", "public function get_message()\n {\n return $this->_message;\n }", "function getNotify() {\r\r\n\t\treturn $this->notify;\r\r\n\t}", "function getMessage(){\n\t\t\treturn $this->message;\n\t\t}", "public function getCustomerNoteNotify();", "public function getMessage() {\n return self::$message;\n }", "public function getNotificationById($id);", "public function getMessage(){\n\t\treturn $this->message;\n\t}", "function SDKNotifications($message){\r\n echo \"<h4>$message</h4>\";\r\n}", "public function get_message() { return $this->getMessage(); }", "public function getMessage(): string\n {\n return $this->data->message;\n }", "public function getNotificationUrl() {\n return (string) $this->getValue('notification_url');\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }", "public function getNotificationUUID(): string\n {\n return $this->rawData['notificationUUID'];\n }", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "public function message()\r\n {\r\n return $this->message;\r\n }", "public function message()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getSendEmailNotificationDetail()\n {\n return isset($this->sendEmailNotificationDetail) ? $this->sendEmailNotificationDetail : null;\n }", "protected function getMessage()\n {\n return $this->message;\n }", "public function getNotify()\n {\n return $this->notify;\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getMessage()\r\n {\r\n return $this->message;\r\n }", "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "public function track($params) {\n if (ENVIRONMENT !== 'development') {\n return $this->mp->track($params['message'], array(\"label\" => $params['action'], \"ip\" => $this->CI->input->ip_address()));\n }\n }", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function getMessage() {\n\t\treturn $this->message;\n\t}", "public function get_raw_message() { return $this->raw_message; }", "public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }", "public function getmessage()\n {\n return array_shift($this->storage);\n }", "public function getMessage () {\n\t\treturn $this->message;\n\t}", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "public function message()\n {\n return $this->message;\n }", "private function getMessage(){ \n\t\t\t//return $this->message;\n\t\t //return \"Sample Message\";\n\t\t\t//$msgArray = array(\"s_id\" => \"s_id\",\"u_id\" => \"u_id\",\"status\"=>\"status\");\n\t\t\t//return json_encode($msgArray); \n\t\t\treturn $this->message;\n\t\t\t\n\t\t}", "public function getMessage()\n {\n return Arr::get($this->getData(true), static::messageKey());\n }", "public function getMessage() \n\t{\n\t\treturn $this->message;\n\t}", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function get_unknow_message() {\n\t\treturn __( 'Unknown service message', 'the-events-calendar' );\n\t}", "public function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }", "public function lastNotify()\n {\n return $this->notifications()->first();\n }", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }", "public function getMessage()\n {\n return $this->message;\n }" ]
[ "0.6880497", "0.65835613", "0.6554903", "0.64200586", "0.6372995", "0.6267631", "0.62362796", "0.619858", "0.619858", "0.6161041", "0.6113437", "0.61070424", "0.6098253", "0.6091903", "0.6065279", "0.6055796", "0.6031461", "0.6009866", "0.6007518", "0.60054255", "0.6004216", "0.59755266", "0.5965704", "0.5964679", "0.59569997", "0.5949082", "0.5914638", "0.59064865", "0.5892655", "0.58867496", "0.58865774", "0.58865774", "0.58865774", "0.58865774", "0.5884048", "0.58684456", "0.5865328", "0.58605313", "0.58533645", "0.58533645", "0.585205", "0.58498996", "0.5847391", "0.5836427", "0.58336127", "0.58223385", "0.5821277", "0.5821277", "0.5821277", "0.5819871", "0.5808659", "0.5807522", "0.5807522", "0.5807522", "0.5807522", "0.5796262", "0.57893157", "0.57832205", "0.57827735", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.57816344", "0.5780263", "0.57756495", "0.5771772", "0.57666045", "0.57666045", "0.57633626", "0.5758291", "0.5758291", "0.5757427", "0.5752269", "0.5752269", "0.5752269", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998", "0.5750998" ]
0.7264003
0
Get autocreate settings for intraship, multipack and personally is not possible
public function getAutocreateSettings($countryCode) { $countryCode = strtoupper($countryCode); $settings = new ArrayObject(array()); // Append default profile from config.xml. $settings->offsetSet('profile', $this->getProfileDefault()); // Append insurance from config.xml. $settings->offsetSet('insurance', $this->getConfig( 'autocreate/autocreate_insurance')); // Append personally. $settings->offsetSet('personally', 0); // Append bulkfreight from config.xml. $settings->offsetSet('bulkfreight', $this->getConfig( 'autocreate/autocreate_bulkfreight')); return $settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get_settings();", "abstract public function getSettings();", "public function getSettings() {\n $scenario = \\Drupal::installProfile();\n if ($scenario === 'dfs_obio_acm') {\n $scenario = 'dfs_obio';\n }\n return \\Drupal::config('as_lift.settings.' . $scenario);\n }", "static function get_settings(){\n\t\t\t\treturn array(\n\t\t\t\t\t'icon' => 'icon_ribbon_alt',\n\t\t\t\t\t'title' => esc_html__('Promo Box', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "public static function get_allowed_settings()\n {\n }", "function getToolSettings() {\n /*reserved for future use*/\n }", "public function getSettings();", "public static function getToolSettings();", "abstract public function settings(): array;", "public function get_settings()\n {\n }", "public function defineSettings(){\n return array();\n }", "function buddyexpressdesk_settings(){\n $settings = new stdClass;\n\t$GET = new BDESK_DB;\n $GET->statement('SELECT * FROM bdesk_site LIMIT 1');\n $GET->execute();\n\t$defaults = $GET->fetch();\n\tforeach ($defaults as $name => $value) {\n\t\tif (empty($paths->$name)) {\n\t\t\t$settings->$name = $value;\n\t\t}\n\t}\n\treturn $settings;\n}", "private static function default_settings() {\n\t\treturn array(\n\t\t\t'module_ga' => true,\n\t\t\t'module_ip' => true,\n\t\t\t'module_log' => true,\n\t\t\t'sent_data' => false,\n\t\t\t'api_key' => '',\n\t\t\t'mark_as_approved' => true,\n\t\t);\n\t}", "function getSettings()\n\t{\n\t\treturn false;\n\t}", "public function commonSettings(): array;", "public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_orderstandard';\n\n\t\treturn $settings;\n\t}", "public function settings()\n\t{\n\t\t$settings = array(\n\t\t\t'user_id' \t=> '',\n\t\t\t'private_key' \t=> '',\n\t\t\t'debug'\t=> array('r',\n\t\t\t\tarray(\n\t\t\t\t\t'y' => lang('yes'),\n\t\t\t\t\t'n' => lang('no')\n\t\t\t\t),\n\t\t\t\t'n'\n\t\t\t)\n\t\t);\n\n\t\treturn $settings;\n\t}", "function preferences() { \n\n\t\t$preferences = array(); \n\n\t\t$preferences[] = array('name'=>'hostname','default'=>'xbox','type'=>'string','description'=>'XBOX Hostname');\n\t\t$preferences[] = array('name'=>'smbpath','default'=>'smb://hostname/mp3/','type'=>'string','description'=>'Samba share path to mp3s');\n\t\t\n\t\t//needed to add basic authentication support later\n\t\t//$preferences[] = array('name'=>'username','default'=>'xbox','type'=>'string','description'=>'XBMC Username');\n\t\t//$preferences[] = array('name'=>'password','default'=>'','type'=>'string','description'=>'XBMC Password');\n\n\t\treturn $preferences;\n\n\t}", "function getRestoreSettings() {\n /*reserved for future use*/\n }", "public function getDefaultSettings();", "private function getSettings()\n {\n return array(\n 'frontpage' => array(\n 'name' => 'Frontpage',\n 'key' => 'frontpage',\n 'type' => 'text',\n 'help' => 'Type the slug of the home page'\n ),\n\n );\n }", "function dw_tinymce_settings($settings)\n{\n // print_r($settings);\n if (!current_user_can('manage_options')) {\n $settings['toolbar1'] = array();\n $settings['toolbar2'] = array();\n return $settings;\n } else {\n return $settings;\n }\n}", "function getClearSettings() {\n /*reserved for future use*/\n }", "public static function getSettings()\n {\n return [\n 'login' => 'editor',\n 'legalTemplates' => ['city'],\n 'access' => [\n 'templates' => [\n [\n 'name' => 'city',\n 'roles' => ['editor'],\n // 'editRoles' => ['editor'], // <-- user has no edit permission\n ],\n ]\n ]\n ];\n }", "function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}", "private static function _get_default_settings()\n\t{\n\t\treturn array(\n\t\t\t'nr_api_key'\t\t\t\t\t\t=> '',\n\t\t\t'nr_apps_list'\t\t\t\t\t\t=> '', // The apps list associated with the account\n\t\t\t'nr_selected_app_servers'\t\t\t=> '', // The servers from the selected app\n\t\t\t'user_datasets'\t\t\t\t\t\t=> '', // Saved user datasets\n\t\t);\n\t}", "function get_registered_settings()\n {\n }", "public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }", "private function settingsAnalyzer()\n {\n require '../configuration/app.php';\n\n if ($external_server_settings['mode'] == 'on') {\n return $this->settings[] = $external_server_settings; \n }\n \n return $this->settings[] = $server_settings;\n }", "public function getSettings() : array;", "function inkpro_create_options() {\r\n\treturn array();\r\n}", "public static function getSettings()\n {\n return [\n 'login' => 'editor',\n 'legalTemplates' => ['skyscraper'],\n 'access' => [\n 'templates' => [\n [\n 'name' => 'skyscraper',\n 'roles' => ['editor'],\n 'editRoles' => ['editor'], // <-- has edit permission\n ]\n ]\n ]\n ];\n }", "static function get_settings(){\n\t\t\t\treturn array(\t\n\t\t\t\t\t'icon' => GDLR_CORE_URL . '/framework/images/page-builder/nav-template.png', \n\t\t\t\t\t'title' => esc_html__('Templates', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_directlink';\n\n\t\treturn $settings;\n\t}", "function get_all_user_settings()\n {\n }", "public function settings()\n\t{\n\t\t$settings = array();\n\n\t\t$settings['early_global'] = array('c', array(\n\t\t 'member_id' => \"global_member_id\",\n\t\t 'group_id' => \"global_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t $settings['early_logged_in'] = array('c', array(\n\t\t 'member_id' => \"logged_in_member_id\",\n\t\t 'group_id' => \"logged_in_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t // for demo, include some others\n\t $settings['include_other'] = array('c', array(\n\t\t 'include_other' => \"Include other member variables\",\n\t\t), array());\n\t\t\n \t\t$settings['others'] = array('ms', array(\n\t\t 'username' => 'username',\n\t\t 'screen_name' => 'screen_name',\n\t\t 'email' => 'email',\n\t\t // 'last_visit' => 'last_visit',\n\t\t 'access_cp' => 'access_cp',\n\t\t // defaults\n\t\t), array());\n\n\t\t$settings['handy'] = array('c', array(\n\t\t 'comment_edit_time_limit' => \"comment_edit_time_limit\",\n\t\t), array('comment_edit_time_limit'));\n\n\t\treturn $settings;\n\t}", "function get_settings()\n {\n #global $pdo, $db_settings;\n #$database = Database::getInstance();\n $result = Database::$content->query(\"SELECT name, value FROM \".Database::$db_settings['settings_table']);\n while($line = $result->fetch())\n {\n $settings[$line['name']] = $line['value'];\n }\n return $settings;\n }", "public function getSettings()\n {\n $settings = new Settings();\n $requestUrl = $this->getRequestUrl();\n $settings->setFetchUrl($requestUrl);\n $settings->setPrefix(sha1($requestUrl));\n $settings->setEmailPreview(isset($_REQUEST['emailPreview']) ? $_REQUEST['emailPreview'] === 'true' : false);\n $settings->setPhonePreview(isset($_REQUEST['telPreview']) ? $_REQUEST['telPreview'] === 'true' : false);\n return $settings;\n }", "abstract protected function getSetting() ;", "function getSettingsList(){\n\t\treturn array(\n\t\t'institute_name',\n\t\t'institute_phone',\n\t\t'institute_address',\n\t\t'email',\n\t\t'notifications',\n\t\t'facebook_url',\n\t\t'linkedin_url',\n\t\t'twitter_url',\n\t\t'youtube_url',\n\t\t'copyright',\n\t\t'metatags'\n\t\t);\n\t}", "protected static function getSettings()\r\n {\r\n if(!self::$avail_settings)\r\n {\r\n $data = self::db()->query(\r\n 'SELECT * FROM `:prefix:rbac_user_settings` AS `t1` '\r\n . 'JOIN `:prefix:forms_fieldtypes` AS `t2` '\r\n . 'ON `t1`.`fieldtype`=`t2`.`type_id` '\r\n . 'WHERE `is_editable`=? '\r\n . 'ORDER BY `fieldset` ASC, `position` ASC',\r\n array('Y')\r\n );\r\n if($data)\r\n {\r\n self::$avail_settings = $data->fetchAll();\r\n }\r\n }\r\n return self::$avail_settings;\r\n }", "function retrieveExternalSettings()\n\t\t{\n\t\t\t$props = mapi_getprops($this->store, array(PR_EC_OUTOFOFFICE, PR_EC_OUTOFOFFICE_MSG, PR_EC_OUTOFOFFICE_SUBJECT));\n\t\t\tif (! isset($props[PR_EC_OUTOFOFFICE_MSG])) {\n\t\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_OUTOFOFFICE_MSG);\n\t\t\t\tif ($stream) {\n\t\t\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\t\t\t$props[PR_EC_OUTOFOFFICE_MSG] = mapi_stream_read($stream, $stat[\"cb\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->settings[\"outofoffice\"][\"set\"] = isset($props[PR_EC_OUTOFOFFICE]) ? ($props[PR_EC_OUTOFOFFICE] ? \"true\" : \"false\") : \"false\";\n\t\t\t$this->settings[\"outofoffice\"][\"message\"] = windows1252_to_utf8(isset($props[PR_EC_OUTOFOFFICE_MSG]) ? $props[PR_EC_OUTOFOFFICE_MSG] : \"\");\n\t\t\t$this->settings[\"outofoffice\"][\"subject\"] = windows1252_to_utf8(isset($props[PR_EC_OUTOFOFFICE_SUBJECT]) ? $props[PR_EC_OUTOFOFFICE_SUBJECT] : \"\");\n\t\t}", "public function getGeneralSettingsDefaultData()\n {\n $settings = array(\n 'enabled' => 1,\n 'pull_out' => 1,\n 'display_interval' => 1,\n 'custom_css' => '',\n 'wheel_sound' => 1,\n 'show_fireworks' => 0,\n 'pull_out_image_url' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'vss_spinandwin' . DS . 'gift.png'\n );\n return $settings;\n }", "public static function get_settings() {\n\t\treturn array_merge( SpamLyticsHelper::default_settings(), get_option( 'spamlytics', array() ) );\n\t}", "function settings()\n\t{\n\t\t$settings = array();\n\t\t$settings['script_folder_path'] = \"\";\n\t\treturn $settings;\n\t}", "private function defaultSettings()\n {\n\t\t$default_config = array(\n 'Plugins.Keypic.SigninEnabled' => false,\n\t\t\t 'Plugins.Keypic.SignupEnabled' => true,\n\t\t\t 'Plugins.Keypic.PostEnabled' => true,\n\t\t\t 'Plugins.Keypic.CommentEnabled' => true,\n\t\t\t 'Plugins.Keypic.SigninWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.PostWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.CommentWidthHeight' => '1x1',\n\t\t\t 'Plugins.Keypic.SignupRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.SigninRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.PostRequestType' => 'getScript',\n\t\t\t 'Plugins.Keypic.CommentRequestType' => 'getScript',\n\t\t );\n\t\t \n\t\tSaveToConfig($default_config);\n }", "function opslert_plugin_settings(){\n return array( \n 'ops_alert_server' => array('friendly_name' => 'Ops Alert Server', \n 'default' => 'alerts.cheggnet.com',\n 'type' => 'string'),\n 'ops_alert_server_offset' => array('friendly_name' => 'Alert Offset',\n 'default' => 1000000, \n 'type' => 'integer')\n \n );\n}", "public function getSettings(): array\n {\n return [];\n }", "public function getSettings($erps_id = 0)\t\r\n\t{ \r\n return parent::getSettings();\t\r\n \r\n\t}", "private function getQuickviewSettings()\n {\n $store = Mage::app()->getStore();\n $settings = array(\n 'media' => $this->getMediaType(),\n 'navigation' => (int)Mage::getStoreConfig('quickview/settings/navigation', $store),\n 'overlay_show' => (int)Mage::getStoreConfig('quickview/settings/overlay_show', $store),\n 'overlay_color' => Mage::getStoreConfig('quickview/settings/overlay_color', $store),\n 'overlay_opacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/settings/overlay_opacity', $store))\n );\n\n $settings = $this->checkDefaultQuickviewSettings($settings);\n return $settings;\n }", "abstract protected function define_my_settings();", "function redmine_sso_get_setting_keys() {\n return array(\n 'url',\n 'protocol',\n 'api_key',\n 'client_id',\n 'client_secret',\n 'user_filter_mode',\n 'project_id',\n 'group_id',\n 'new_user_access',\n 'role_assigning',\n 'daily_checkup',\n 'disable_login'\n );\n}", "function getSettings() {\n\t\t$current_opts = get_option('wassup_settings');\n\t\t$default_opts = $this->defaultSettings();\n\t\t$settings = array();\n\t\tif (!empty($current_opts) && is_array($current_opts)) {\n\t\t\tforeach ($default_opts as $skey => $defaultvalue) {\n\t\t\t if (array_key_exists($skey,$current_opts)) {\n\t\t\t \t$settings[$skey] = $current_opts[$skey];\n\t\t\t } else {\n\t\t\t \t$settings[$skey] = $defaultvalue;\n\t\t\t }\n\t\t\t} //end foreach\n\t\t} else {\n\t\t\t$settings = $default_opts;\n\t\t}\n\t\treturn $settings;\n\t}", "public static function getDefaultSettingsKeys();", "public function getSettings()\n {\n return Initiatives::getInstance()->getSettings();\n }", "function bb_get_mystique_options() {\r\n\t$get_mystique_options = bb_mystique_default_settings();\r\n\t//$get_mystique_options = bb_get_option( 'bb-mystique' );\r\n\treturn $get_mystique_options;\r\n}", "function scorm_get_popup_options_array(){\n global $CFG;\n return array('resizable'=> isset($CFG->scorm_resizable) ? $CFG->scorm_resizable : 0,\n 'scrollbars'=> isset($CFG->scorm_scrollbars) ? $CFG->scorm_scrollbars : 0,\n 'directories'=> isset($CFG->scorm_directories) ? $CFG->scorm_directories : 0,\n 'location'=> isset($CFG->scorm_location) ? $CFG->scorm_location : 0,\n 'menubar'=> isset($CFG->scorm_menubar) ? $CFG->scorm_menubar : 0,\n 'toolbar'=> isset($CFG->scorm_toolbar) ? $CFG->scorm_toolbar : 0,\n 'status'=> isset($CFG->scorm_status) ? $CFG->scorm_status : 0);\n}", "private function getSettings(){\n $settings = Auth::user()->settings;\n if(!$settings){\n $settings = new \\App\\Setting;\n $settings->user_id = Auth::id();\n foreach(Cons::$default_settings as $key => $value){\n $settings->{$key} = $value;\n }\n $settings->save();\n return Cons::$default_settings;\n }\n return $settings; // return created settings\n }", "public function getSettings(): array {\n\t\treturn [\n\t\t\t// Enable debug mode (to print errors).\n\t\t\t'debug' => !empty(elgg_get_config('debug')),\n\t\t\t'security' => [\n\t\t\t\t'requestedAuthnContext' => false,\n\t\t\t],\n\t\t\t// Service Provider Data that we are deploying.\n\t\t\t'sp' => $this->getSPSettings(),\n\t\t\t\n\t\t\t// Identity Provider Data that we want connected with our SP.\n\t\t\t'idp' => $this->getIDPSettings(),\n\t\t];\n\t}", "function ffw_port_get_settings() {\n\n $settings = get_option( 'ffw_port_settings' );\n if( empty( $settings ) ) {\n\n // Update old settings with new single option\n\n $general_settings = is_array( get_option( 'ffw_port_settings_general' ) ) ? get_option( 'ffw_port_settings_general' ) : array();\n\n\n $settings = array_merge( $general_settings );\n\n update_option( 'ffw_port_settings', $settings );\n }\n return apply_filters( 'ffw_port_get_settings', $settings );\n}", "public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ems_ecommerce';\n\n\t\treturn $settings;\n\t}", "public function settings(): array\n {\n return [];\n }", "function debuggify_get_options($action = NULL){\n\n global $debuggify_settings_name;\n\n // Plugin Defaults\n $defaults = array(\n 'apikey' => '6487a4edf9e534c6164579dd327b01f4',\n 'enabled' => '0'\n );\n\n //Return default settings\n if($action == \"reset\"){\n delete_option($debuggify_settings_name);\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\n }\n\n //Get the settings from the database\n $database_settings = get_option($debuggify_settings_name);\n if($database_settings){\n $need_to_update = false;\n\n //Check whether all the settings are present or not\n foreach($defaults as $k => $v){\n\n if( !array_key_exists( $k, $database_settings)) {\n $database_settings[$k] = $v;\n $need_to_update = true;\n }\n }\n\n if($need_to_update) {\n update_option($debuggify_settings_name, $database_settings);\n }\n\n return $database_settings;\n }else{\n //Add the settings\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\n }\n }", "function get_integration_settings($set_admin_defaults = FALSE) {\n\tglobal $db, $wpuAbs;\n\t\n\t$config_fields = get_db_schema();\n\t$wpSettings = array();\n\tif ($wpuAbs->ver == 'PHPBB3') {\n\t\tforeach($config_fields as $var_name => $field_name) {\n\t\t\tif ($wpuAbs->config('wpu_'.$field_name) !== FALSE) {\n\t\t\t\t$wpSettings[$var_name] = $wpuAbs->config('wpu_'.$field_name);\n\t\t\t\t//unset($GLOBALS['config']['wpu_'.$field_name]);\n\t\t\t} elseif ($set_admin_defaults) {\n\t\t\t\t$wpSettings[$var_name] = set_default($var_name);\n\t\t\t}\n\t\t}\n\t\treturn $wpSettings;\t\n\t}\n\t\n\t$sql = 'SELECT * FROM ' . WP_INT_TABLE . ' LIMIT 1';\n\tif (!$result = $db->sql_query($sql)) {\n\t\t//db error -- die\n\t\tmessage_die(GENERAL_ERROR, $lang['WP_DBErr_Retrieve'], __LINE__, __FILE__, $sql);\n\t\treturn FALSE;\n\t}\n\tif (!$db->sql_numrows($result)) {\n\t\t// table not populated yet\n\t\treturn FALSE;\n\t}\n\telse {\n\t\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$fullFieldSet = get_db_schema();\n\t\t\n\t\tforeach($fullFieldSet as $var_name => $field_name) {\n\t\t\t$wpSettings[$var_name] = $row[$field_name];\n\t\t}\n\t}\n}", "function get_user_settings( $user )\n {\n //Unimplemented\n }", "function dl_cadi_settings(){\r\n\r\n}", "function grab_db_settings(){\n\t\n\t\treturn new pfagos_settings();\n\t}", "function ul_cadi_settings(){\r\n\r\n}", "function get_setting() {\n // has to be overridden\n return NULL;\n }", "function get_settings($hash_id = null)\r\n\t{\r\n\r\n\t}", "public function getSetting() {}", "public function getSetting() {}", "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 bdpp_get_settings() {\n\t\n\t$options = get_option('bdpp_opts');\n\t\n\t$settings = (is_array($options)) ? $options : array();\n\t\n\treturn $settings;\n}", "public static function getSettings()\n\t\t{\n\t\t\treturn self::$ettings;\n\t\t}", "public function get_settings() {\n\t\tif ( ! is_array( $this->_settings ) ) {\n\t\t\t$this->_settings = get_option( $this->token, array() );\n\t\t}\n\t\t\n\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\tif ( ! isset( $this->_settings[$k] ) && isset( $v['default'] ) ) {\n\t\t\t\t$this->_settings[$k] = $v['default'];\n\t\t\t}\n\t\t\tif ( $v['type'] == 'checkbox' && $this->_settings[$k] != true ) {\n\t\t\t\t$this->_settings[$k] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_settings;\n\t}", "public function getSettings(){\r\n\t\treturn $this->initSettings;\r\n\t}", "public static function getSettings() {\n\n\t\tglobal $lumi_aiowps_tweaks;\n\t\tif( isset( $lumi_aiowps_tweaks['Settings'] ) ) {\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t} else {\n\t\t\tinclude_once( __DIR__ . '/SettingsAPI.class.php' );\n\t\t\t$lumi_aiowps_tweaks['Settings'] = new SettingsAPI();\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t}\n\n\t}", "private function settings()\n {\n if (!$this->settings) {\n $this->settings = userSettings::findOrMake($this->tid);\n }\n return $this->settings;\n }", "private function settings_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Global Settings', 'formidable' ) . '</h3>'\n\t\t\t\t. '<p><strong>' . __( 'General', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )\n\t\t\t\t. '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )\n \t . '</p>',\n\t\t\t'prev_page' => 'import',\n\t\t\t'next_page' => 'addons',\n\t\t);\n\t}", "private function get_settings()\r\n\t{\r\n\t\tlist ($this->path, $this->webpath, $this->maxwidth, $this->maxheight, $this->type, $this->size, $this->preview_width, $this->preview_cols, $this->tablestyle, $this->picstyle) = $this->elements->get_element(0, \"show\", 0, 0);\r\n\t}", "public function getViewerPreferences() {}", "public function get_settings() {\n $this->create_object_settings();\n return array($this->settings);\n }", "function settings()\n{\n return Yii::app()->settings;\n}", "function construct_settings()\r\n\t{\r\n\t\tglobal $ilance, $phrase;\r\n\t\t\t\r\n\t\t$sql = $ilance->db->query(\"SELECT * FROM \" . DB_PREFIX . \"fbbridge_configuration\", 0, null, __FILE__, __LINE__);\r\n\t\tif ($ilance->db->num_rows($sql) > 0)\r\n\t\t{\r\n\t\t\t\t$html = '';\r\n\t\t\t\twhile ($res = $ilance->db->fetch_array($sql))\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\t$html .= '<tr>';\r\n\t\t\t\t\t$html .= '<td width=\"27%\" valign=\"top\" nowrap>'.stripslashes($res['description']).'</td>';\r\n\t\t\t\t\t$html .= '<td width=\"34%\" align=\"left\" valign=\"top\">';\r\n\t\t\t\t\tif($res['inputtype'] == \"yesno\")\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\t$html .= '<input type=\"radio\" name=\"'.$res['name'].'\" id=\"'.$res['name'].'\" value=\"1\" ';\r\n\t\t\t\t\t\tif ($res['value'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= 'checked=\"checked\">';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$html .= '<label for=\"'.$res['name'].'\">'.$phrase['_yes'].'</label>';\r\n\r\n\t\t\t\t\t\t$html .= '<input name=\"'.$res['name'].'\" id=\"'.$res['name'].'2\" type=\"radio\" value=\"0\" ';\r\n\t\t\t\t\t\tif ($res['value'] == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= 'checked=\"checked\">';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<label for=\"'.$res['name'].'2\">'.$phrase['_no'].'</label>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($res['inputtype'] == 'textarea')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<textarea name=\"'.$res['name'].'\" id=\"'.$res['name'].'\" style=\"width:250px; height:100px;\">'.$res['value'].'</textarea>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($res['inputtype'] == 'text')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .='<input style=\"padding:2px; height:15px; width:150px; font-family: verdana;\" id=\"'.$res['name'].'\" type=\"text\" name=\"'.$res['name'].'\" value=\"'.$res['value'].'\" />';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t$html .= '</tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$html .= '<tr>';\r\n\t\t\t\t$html .= '<td width=\"27%\" height=\"15\">'.stripslashes($res['description']).'</td>';\r\n\t\t\t\t$html .= '</tr>';\r\n\t\t}\r\n\t\treturn $html;\r\n\t}", "public function core_settings(){\r\n\t\tif($this->has_admin_panel()) return $this->module_core_settings();\r\n return $this->module_no_permission();\r\n\t}", "public function getBasicSettingsValues()\n\t{\n\t\t$values = array();\n\n\t\t$values[\"webspace_dir\"] = getcwd().\"/data\";\n\t\t$values[\"data_dir\"] = $this->setup->ini->readVariable(\"clients\",\"datadir\");\n\t\t$values[\"convert_path\"] = $this->setup->ini->readVariable(\"tools\",\"convert\");\n\t\t$values[\"zip_path\"] = $this->setup->ini->readVariable(\"tools\",\"zip\");\n\t\t$values[\"unzip_path\"] = $this->setup->ini->readVariable(\"tools\",\"unzip\");\n\t\t$values[\"ghostscript_path\"] = $this->setup->ini->readVariable(\"tools\",\"ghostscript\");\n\t\t$values[\"java_path\"] = $this->setup->ini->readVariable(\"tools\",\"java\");\n\t\t$values[\"htmldoc_path\"] = $this->setup->ini->readVariable(\"tools\",\"htmldoc\");\n\t\t//$values[\"mkisofs_path\"] = $this->setup->ini->readVariable(\"tools\",\"mkisofs\");\n\t\t$values[\"ffmpeg_path\"] = $this->setup->ini->readVariable(\"tools\",\"ffmpeg\");\n\t\t$values[\"latex_url\"] = $this->setup->ini->readVariable(\"tools\",\"latex\");\n\t\t$values[\"fop_path\"] = $this->setup->ini->readVariable(\"tools\",\"fop\");\n\t\t$values[\"vscanner_type\"] = $this->setup->ini->readVariable(\"tools\", \"vscantype\");\n\t\t$values[\"scan_command\"] = $this->setup->ini->readVariable(\"tools\", \"scancommand\");\n\t\t$values[\"clean_command\"] = $this->setup->ini->readVariable(\"tools\", \"cleancommand\");\n\t\t$values[\"log_path\"] = $this->setup->ini->readVariable(\"log\",\"path\").\"/\".\n\t\t\t$this->setup->ini->readVariable(\"log\",\"file\");\n\t\t$values[\"chk_log_status\"] = !$this->setup->ini->readVariable(\"log\",\"enabled\");\n\t\t$values[\"time_zone\"] = $this->setup->ini->readVariable(\"server\", \"timezone\");\n\t\t\n\t\t// https settings\n\t\t$values[\"auto_https_detect_enabled\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_enabled\");\n\t\t$values[\"auto_https_detect_header_name\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_name\");\n\t\t$values[\"auto_https_detect_header_value\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_value\");\n\n\t\t$this->form->setValuesByArray($values);\n\t}", "protected function getEditableConfigNames()\n {\n return ['pubcid_cookie_management.settings'];\n }", "function get_settings(){\n $settings = array(\n 'section_title' => array(\n 'name' => __('GWP Custom Tabs','GWP'),\n 'type' => 'title',\n 'desc' => '',\n 'id' => 'wc_'.$this->id.'_section_title'\n ),\n 'title' => array(\n 'name' => __( 'Global Custom Tabs', 'GWP' ),\n 'type' => $this->post_type,\n 'desc' => __( 'Start typing the Custom Tab name, Used for including custom tabs on all products.', 'GWP' ),\n 'desc_tip' => true,\n 'default' => '',\n 'id' => 'wc_'.$this->id.'_globals'\n ),\n 'section_end' => array(\n 'type' => 'sectionend',\n 'id' => 'wc_'.$this->id.'_section_end'\n )\n );\n return apply_filters( 'wc_'.$this->id.'_settings', $settings );\n }", "public function getSettings(){\n $allSettings = GeneralSetting::all();\n \n $settingsArray = array();\n foreach ($allSettings as $settings) {\n $refl3 = new ReflectionObject($settings);\n $prop3 = $refl3->getProperty('attributes');\n $prop3->setAccessible(true);\n $setting = $prop3->getValue($settings);\n array_push($settingsArray, $setting);\n \n }\n $this->layout->content = View::make('admin.settings')->with('settings',$settingsArray);\n }", "function admin_setup()\n\t {\n\t\t $this->db->select('*');\n\t\t $this->db->from(DB_PREFIX.'system_settings');\n\t\t $data = $this->db->get()->row_array();\n\t\t return $data;\n\t }", "private function appSettings()\n {\n $getModuleUrl = function() {\n return strtok($this->module->getUrl(''), '?');\n };\n $removeExtraSlashes = function($url) {\n return preg_replace(\"/(?<!https:)(?<!http:)\\/{2,}/\", \"/\", $url);\n };\n $project_templates = [\n 'template for single study' => $this->module->getUrl('data/EPU_single.xml'),\n 'template for multiple studies' => $this->module->getUrl('data/EPU_multiple.xml'),\n ];\n $data = [\n 'module_version' => $this->module->VERSION,\n 'module_prefix' => $this->module->PREFIX,\n 'module_url' => $getModuleUrl(),\n 'redcap_root_url' => APP_PATH_WEBROOT_FULL,\n 'redcap_relative_url' => APP_PATH_WEBROOT,\n 'redcap_full_url' => $removeExtraSlashes(APP_PATH_WEBROOT_FULL.APP_PATH_WEBROOT),\n 'project_templates' => $project_templates,\n ];\n return $data;\n }", "function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}", "function EpcwSettings() { \n\treturn EpcwSettings::instance();\n}", "public function loadSettings()\n {\n // old Alfred v4 settings\n $settings = \\Alfred\\getVariables(self::$settingsArgs);\n\n\n if (\\Alfred\\getAlfredVersion() >= 5) {\n $new_settings = \\Alfred\\getVariables(self::$settingsArgsV5);\n\n if (!empty($settings['language']) && $settings['language'] !== 'en_EN' && $new_settings['language'] !== 'en_EN') {\n $settings['language'] = $new_settings['language'];\n }\n if (empty($settings['language'])) {\n $settings['language'] = $new_settings['language'];\n }\n if (!empty($new_settings['timezone']) && $new_settings['timezone'] !== 'none') {\n $settings['time_zone'] = $new_settings['timezone'];\n }\n if (!empty($new_settings['base_currencies'])) {\n $settings['base_currency'] = str_replace(' ', '', $new_settings['base_currencies']);\n $settings['base_currency'] = explode(',', $settings['base_currency']);\n }\n if (!empty($new_settings['apikey_fixer'])) {\n $settings['fixer_apikey'] = $new_settings['apikey_fixer'];\n }\n if (!empty($new_settings['apikey_coinmarket'])) {\n $settings['coinmarket_apikey'] = $new_settings['apikey_coinmarket'];\n }\n if (!empty($new_settings['crypto_decimals'])) {\n $settings['crypto_decimals'] = $new_settings['crypto_decimals'];\n }\n if (!empty($new_settings['vat_value'])) {\n $settings['vat_percentage'] = $new_settings['vat_value'];\n }\n if (!empty($new_settings['pixels_base'])) {\n $settings['base_pixels'] = $new_settings['pixels_base'];\n }\n if (\n !empty($new_settings['date_format']) && $new_settings['date_format'] !== 'j F, Y, g:i:s a' ||\n empty($settings['time_format'])\n ) {\n $settings['time_format'] = $new_settings['date_format'];\n if (is_string($settings['time_format'])) {\n $settings['time_format'] = explode('|', $new_settings['date_format']);\n }\n }\n if (!empty($new_settings['number_output_format'])) {\n $settings['number_output_format'] = $new_settings['number_output_format'];\n }\n if (!empty($new_settings['currency_decimals'])) {\n $settings['currency_decimals'] = $new_settings['currency_decimals'];\n }\n }\n\n return $settings;\n }", "private function load_settings() {\n\t\t\n\t}", "public function applicationSettings(): array\n {\n if ($this->getUser() !== NULL) {\n $this->getUser()->locale = request()->header('locale', 'en');\n $this->getUser()->save();\n }\n if ($this->getDriver() !== NULL) {\n $this->getDriver()->locale = request()->header('locale', 'en');\n $this->getDriver()->save();\n }\n\n return [\n 'status' => 1,\n 'settings' => [\n 'minimum_order_weight' => Setting::get('minimum_order_weight', 1.0),\n 'cash_out_threshold' => Setting::get('cash_out_threshold', 1.0),\n 'support_email' => Setting::get('support_email'),\n 'mobile_phone' => Setting::get('mobile_phone'),\n 'land_line' => Setting::get('land_line'),\n 'twitter_account' => Setting::get('twitter_account'),\n 'facebook_account' => Setting::get('facebook_account'),\n 'instagram_account' => Setting::get('instagram_account'),\n 'privacy_policy' => Storage::url(Setting::get('privacy_policy')),\n 'terms_conditions' => Storage::url(Setting::get('terms_conditions')),\n 'address' => Setting::get('address', ''),\n 'brief' => Setting::get('brief', ''),\n 'faq' => Setting::get('faq', ''),\n ],\n ];\n }", "public function default_settings() : array {\n\t\treturn [\n\t\t\t'layout' => 'block',\n\t\t\t'newsletter' => '',\n\t\t\t'theme' => 'light',\n\t\t\t'type' => 'subscribe',\n\t\t];\n\t}", "function get_settings() {\n\t\treturn $this->settings;\n\t}", "public function getSettings()\n\t{\n try {\n $code = 200;\n\n $app_settings = $this->appSettings();\n $projects = $this->projectsData();\n $api_token_data = $this->apiTokenData();\n\n $response = compact('app_settings', 'projects', 'api_token_data');\n } catch (\\Exception $e) {\n $response = [\n 'message' => $e->getMessage(),\n ];\n $code = $e->getCode();\n }finally {\n $this->printJSON($response, $code);\n }\n }" ]
[ "0.63378453", "0.62347597", "0.6161217", "0.6126158", "0.6080462", "0.6071456", "0.60645837", "0.6045896", "0.60454845", "0.6038419", "0.6021133", "0.60065794", "0.60037154", "0.59871894", "0.598535", "0.5983005", "0.593792", "0.590947", "0.589587", "0.5884401", "0.58816797", "0.5862476", "0.5843997", "0.5831999", "0.58164847", "0.5816024", "0.581425", "0.58092976", "0.57977694", "0.5791022", "0.57883537", "0.57676053", "0.57645845", "0.5752147", "0.57493", "0.5732865", "0.5731437", "0.5725825", "0.57191855", "0.57097834", "0.5708305", "0.56770813", "0.56731284", "0.566719", "0.56631625", "0.5661403", "0.566044", "0.5641959", "0.5638226", "0.56372124", "0.56223434", "0.56211835", "0.56025296", "0.5598543", "0.55972475", "0.5584819", "0.55736005", "0.5556019", "0.5547177", "0.55433655", "0.5541405", "0.5535471", "0.5534978", "0.5523595", "0.55177104", "0.55153555", "0.5502089", "0.5478792", "0.54721844", "0.5470964", "0.54707664", "0.54707664", "0.5467353", "0.5462437", "0.54623705", "0.54584485", "0.54523975", "0.54502827", "0.5443644", "0.5442926", "0.54400903", "0.5429812", "0.5426198", "0.54248685", "0.54243547", "0.54162264", "0.5415568", "0.5409757", "0.5409323", "0.54053354", "0.5404736", "0.5402606", "0.5402093", "0.5398272", "0.5397225", "0.5383148", "0.538257", "0.53808", "0.53751415", "0.5372349" ]
0.5523065
64
Is go green in checkout enabled?
public function isCheckoutGoGreen() { return (1 == $this->getConfig('checkout/gogreen_enabled')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkout_check() {\n\t\treturn false;\n\t}", "public static function checkoutMode() {\n\n \tif ( file_exists(PassThru::$_realPath.'/checkoutmode') ) {\n \t\tLog::out(\"passthru - checkoutMode positive\");\n \t\treturn true;\n \t}\n \n \treturn false;\n \n }", "public function isCheckoutAvailable()\n {\n return Mage::helper('checkout')->isMultishippingCheckoutAvailable();\n }", "public function isAheadworksCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('AW_Onestepcheckout');\n }", "function is_checkout() {\n\t\treturn ( is_page( carton_get_page_id( 'checkout' ) ) || is_page( carton_get_page_id( 'pay' ) ) ) ? true : false;\n\t}", "public function isExpressCheckout(): bool\n {\n return false;\n }", "public function isTmFireCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('TM_FireCheckout');\n }", "public function canFireCheckout()\n {\n return (bool)Mage::getStoreConfig('firecheckout/general/enabled');\n }", "public function isIwdCheckout()\n {\n return Mage::helper('core')->isModuleEnabled('IWD_Opc');\n }", "public function is_vcs_checkout($context)\n {\n }", "public function canUseCheckout()\n {\n if (!$this->isApiKeyConfigured()) {\n return false;\n }\n return $this->_canUseCheckout;\n }", "public static function isEnabled() {\n global $DB;\n $iterator = $DB->request([\n 'SELECT' => ['state'],\n 'FROM' => 'glpi_crontasks',\n 'WHERE' => [\n 'name' => 'telemetry',\n 'state' => 1\n ]\n\n ]);\n return count($iterator) > 0;\n }", "public function availableCheckout()\n {\n //and disables method if it is not\n\n $country = $this->_website->getConfig('payment/mercadopago/country');\n\n if (!in_array($country, $this->available_transparent_credit_cart)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_custom/active', 0, 'websites', $this->_website->getId());\n }\n\n if (!in_array($country, $this->available_transparent_ticket)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_customticket/active', 0, 'websites', $this->_website->getId());\n }\n }", "function tinc_enabled()\n{\n $mdl = new \\OPNsense\\Tinc\\Tinc();\n\n foreach ($mdl->networks->network->iterateItems() as $network) {\n if ($network->enabled == '1') {\n return true;\n }\n }\n\n return false;\n}", "public function checkEnabled()\n {\n $app_id = $this->_application->id;\n return $this->app->zoocart->getConfig($app_id)->get('enable_cart');\n }", "public function is_available() {\n\t\tif ( 'yes' === $this->enabled ) {\n\t\t\tif ( ! $this->testmode && is_checkout() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( ! $this->secret_key || ! $this->publishable_key ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function isBalanced()\n {\n return (self::$open === 0);\n }", "public function isUsingUnsupportedCheckout()\n {\n // is it one of our properly supported extensions?\n if ($this->isAheadworksCheckout()) {\n return false;\n }\n\n if ($this->isIwdCheckout()) {\n return false;\n }\n\n if ($this->isTmFireCheckout()) {\n return false;\n }\n\n // has an extension we don't recognise changed the checkout URL?\n if ($this->isDifferentUrl()) {\n return true;\n }\n\n // has an extension rewritten the onepage checkout controller\n if ($this->defaultUrlExtended()) {\n return true;\n }\n\n // probably we are using the default checkout\n return false;\n }", "public function isEnabled()\n\t{\n\t\t// note: don't use $this->_main->.. as it might not exist when this func is called.\n\t\treturn Mage::helper('shoptimally_upsalecoupons/main')->isEnabled();\n\t}", "public function canUseCheckout()\n {\n $token = \\Mage::getStoreConfig('payment/cryptomarket/cryptomkt_apikey');\n\n if (false === isset($token) || true === empty($token)) {\n $this->debugData('[ERROR] In Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): There was an error retrieving the token store param from the database or this Magento store does not have a CryptoMarket token.');\n\n return false;\n }\n\n $this->debugData('[INFO] Leaving Cryptomarket_Core_Model_Method_Redirect::canUseCheckout(): token obtained from storage successfully.');\n\n return true;\n }", "private function isOpcModuleActive()\n {\n // fallback for mobile-enabled theme\n if (Configuration::get('OPC_MOBILE_FALLBACK') && $this->context->getMobileDevice())\n return false;\n\n // fallback for paypal express checkout\n if (isset($this->context->cookie->express_checkout) && Configuration::get('OPC_PAYPAL_EXPRESS_FALLBACK'))\n return false;\n\n if ($this->opcModuleActive > -1)\n return $this->opcModuleActive;\n\n $opc_mod_script = _PS_MODULE_DIR_ . 'onepagecheckout/onepagecheckout.php';\n if (file_exists($opc_mod_script)) {\n require_once($opc_mod_script);\n $opc_mod = new OnePageCheckout();\n $this->opcModuleActive = (Tools::getValue('opc-debug') == 1900)?true:((Tools::getValue('opc-debug') == 1901)?false:$opc_mod->active);\n } else {\n $this->opcModuleActive = 0;\n }\n return $this->opcModuleActive;\n }", "public function is_active(): bool;", "public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }", "public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }", "public function svnEnabled()\r\n\t{\r\n\t\treturn $this->container->get('request')->getSession()->has('context');\r\n\t}", "public function isGreen(): bool {\n return $this->assertStatusIs('green');\n }", "public function isActive() \n {\t\n \t// if PIWIK tracking is activated return TRUE\n \tif (Mage::getStoreConfig('piwik/piwik/active')) {\n \t\treturn true;\n \t}\n \t// return FALSE otherwise\n \treturn false;\n }", "function _exp_checkout_payment_success() {\n return true;\n }", "public function getOnlyActiveBranch(): bool;", "public function getEnabled()\n\t{\n\t\treturn ($this->getHashrate() > 0);\n\t}", "public function getNeedsExternalInfoInCheckout();", "protected function shouldActivatePack(): bool\n {\n // If at least an account is not in trial, pack should be activated.\n return !!$this->accounts->first(fn (AccountContract $account) => !$account->getChargebee()->isTrial());\n }", "public function hasIsCheckIn(){\n return $this->_has(3);\n }", "public function isActive(): bool\n {\n return in_array($this -> charging_status, $this->activeOrdersStatuses);\n }", "protected function in_progress() {\n\t\treturn 'in_progress' === get_option( 'ratesync_sync_status' );\n\t}", "public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }", "public function isPossibleOnepageCheckout()\n {\n return $this->helper('checkout')->canOnepageCheckout() && !$this->getQuote()->getHasError();\n }", "public static function isTravisMode(): bool\n {\n return !empty(self::input(\"SPLASH_TRAVIS\"));\n }", "protected function _isEnabled()\n {\n return $this->currentCustomer->getCustomerId() && $this->_rewardData->isEnabledOnFront()\n && $this->_rewardData->getGeneralConfig('publish_history');\n }", "public function updateCreditStatus()\n {\n $return = false;\n $updateQuery = \"update users set deposit_status='LIVE' where id='\" .\n $this->_user['id'] . \"' AND brand='\" . $this->_session['brand'] . \"'\";\n if(mysql_query($updateQuery)) {\n $return = true;\n }\n return $return;\n }", "public function allowCheckout()\n {\n if ($this->getQuote()->hasRecurringItems() && $this->_reurringOrderNotAllowed()) {\n return false;\n }\n\n return Mage::helper('customer')->isLoggedIn()\n || (Mage::helper('klarna_kco/checkout')->isAllowedGuestCheckout($this->getQuote())\n && !Mage::helper('customer')->isLoggedIn());\n }", "public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }", "public function is_enabled()\n {\n }", "private function isPayflowProVaultEnable()\r\n {\r\n return (bool)$this->scopeConfig->getValue(self::XML_PATH_PAYMENT_PAYFLOWPRO_CC_VAULT_ACTIVE);\r\n }", "public function isCheckoutDisabled()\n {\n return $this->scopeConfig->getValue(\n self::CHECKOUT_DISABLE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function checkGlobalActive() {\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/active') == 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function check_addon_status()\n {\n $checker = array('unique_identifier' => $this->unique_identifier);\n $this->db->where($checker);\n $addon_details = $this->db->get('addons')->row_array();\n if ($addon_details['status']) {\n return true;\n } else {\n redirect(site_url(), 'refresh');\n }\n }", "public function isSelected()\n {\n /* @var $session Dhl_Intraship_Model_Session */\n $session = Mage::getSingleton('intraship/session');\n return (\n true === $session->hasData('is_gogreen') &&\n 1 === (int) $session->getData('is_gogreen')\n );\n }", "public function checkForOneTimeDemoMessage(): bool\n {\n return $this->getCustomerAttrCreditHold() && $this->configProvider->isOptionCreditHoldEnable() && !$this->getFlag();\n }", "function it_exchange_abandoned_carts_is_active_shopper() {\n\t// We do not start tracking until they log in\n\tif ( ! it_exchange_get_current_customer() )\n\t\treturn false;\n\n\t// We do not start tracking until they have an item in their cart\n\t$cart_products = it_exchange_get_cart_products();\n\tif ( count( $cart_products ) < 1 )\n\t\treturn false;\n\n\t// If user is logged in and has an item in their cart, this is an active shopper\n\treturn true;\n}", "static function activePayment()\n\t{\n global $configClass;\n if($configClass['active_payment'] == 1 || $configClass['integrate_membership'] == 1)\n\t\t{\n return true;\n }\n\t\telse\n\t\t{\n return false;\n }\n }", "protected static function isCreditMode(): bool\n {\n return self::$isCredit;\n }", "public function isInStock()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED;\n }", "public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }", "public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }", "public function is_enabled()\n {\n }", "public function isVconnetEnabled() {\n\t\n\t\t$installed = Mage::helper('core')->isModuleEnabled('Vconnect_Postnord');\n\t\t\n\t\tif($installed == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n\t}", "public function isEnabled()\n {\n return $this->status == 1;\n }", "public static function checkVendorKycStatus() {\n $storeModel = new \\App\\StoreModel();\n $storeId = Auth::user()->id;\n $allowProductUpload = $storeModel->getStoreKYCStatus($storeId);\n return $allowProductUpload;\n }", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "public function getCheckoutGoGreenLabel()\n {\n return $this->getConfig('checkout/gogreen_label');\n }", "function uds_pricing_is_active()\n{\n\tif(function_exists('uds_active_shortcodes')) {\n\t\t$active_shortcodes = uds_active_shortcodes();\n\t\tif( ! in_array('uds-pricing-table', $active_shortcodes)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }", "public function checkStatus()\n {\n echo 'All Branch of Bank is Opened at 9:30 AM<br>';\n }", "function TS_VCSC_GutenbergStatusCheck() {\r\n\t\t\t$this->TS_VCSC_GutenbergPlugin = \"false\";\r\n\t\t\t$this->TS_VCSC_GutenbergBlocks = \"false\";\r\n $this->TS_VCSC_GutenbergExists = \"false\";\r\n\t\t\tif (has_filter('replace_editor', 'gutenberg_init')) {\r\n\t\t\t\t$this->TS_VCSC_GutenbergPlugin = \"true\";\r\n $this->TS_VCSC_GutenbergExists = \"true\";\r\n\t\t\t}\t\t\r\n if (TS_VCSC_VersionCompare($GLOBALS['wp_version'], '5.0-beta') >= 0) {\r\n\t\t\t\t$this->TS_VCSC_GutenbergBlocks = \"true\";\r\n $this->TS_VCSC_GutenbergExists = \"true\";\r\n\t\t\t}\r\n\t\t}", "public function companyIsActive()\n {\n return true ;\n }", "public function isSignupChecked()\n {\n $v = Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();\n \n return \n Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED\n == $v\n || Professio_BudgetMailer_Model_Config_Source_Account::CHECKED\n == $v;\n }", "public function klarnaPaymentEnabled($store = null)\n {\n return Mage::getStoreConfigFlag('payment/klarna_kco/active', $store);\n }", "public function is_active();", "public function hasActiveCart();", "public function isMultishippingCheckoutAvailable(){\n $multishippingFlag = parent::isMultishippingCheckoutAvailable();\n if(Mage::getSingleton('mysubscription/cart')->getMsquote()->hasItems()){\n return false;\n }\n return $multishippingFlag;\n }", "public function SinglePageCheckoutSupported()\n\t{\n\t\t$agent = '';\n\t\tif(isset($_SERVER['HTTP_USER_AGENT'])) {\n\t\t\t$agent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\t\t}\n\n\t\t// iPhone\n\t\tif(strpos($agent, 'safari') !== false && strpos($agent, 'mobile') !== false) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Windows Mobile\n\t\telse if(strpos($agent, 'windows ce') !== false) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Opera Mini & Opera Mobile\n\t\telse if(strpos($agent, 'opera mini') !== false || strpos($agent, 'opera mobile') !== false) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn true;\n\t}", "public function enabled()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->issetCustomExec())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->fields['USE']->getValue() == 'Y';\n\t}", "public function has_active_dependencies(): bool;", "public function enabled();", "public function enabled();", "public function enabled();", "public function enabled();", "public function isIndependentCreditSupported();", "function update_status() {\n global $order;\n if ($this->enabled && ((int) constant(\"MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ZONE\") > 0)) {\n $check_flag = false;\n $check_query = tep_db_query(\"select zone_id from \" . TABLE_ZONES_TO_GEO_ZONES . \" where geo_zone_id = '\" . constant(\"MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ZONE\") . \"' and zone_country_id = '\" . $order->delivery['country']['id'] . \"' order by zone_id\");\n while ($check = tep_db_fetch_array($check_query)) {\n if ($check['zone_id'] < 1) {\n $check_flag = true;\n break;\n } else if ($check['zone_id'] == $order->delivery['zone_id']) {\n $check_flag = true;\n break;\n }\n }\n \n if (! $check_flag) {\n $this->enabled = false;\n }\n }\n }", "public function enabled()\n {\n if (!empty($this->_data[self::BUSINESS])) {\n return true;\n }\n\n return false;\n }", "abstract function is_paying();", "public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }", "public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }", "public function isActiveQuoteAdjustmentEnabled()\n {\n $flag = (integer) $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/adjust_inventory',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n\n return $flag > 1;\n }", "function parcelcheckout_getDebugMode()\n\t{\n\t\tif(is_file(dirname(__FILE__) . '/debug.php'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function isFullCheckout()\n {\n $payment = $this->getOnePage()->getQuote()->getPayment();\n if (!$payment->getMethod()) {\n return false;\n }\n\n if (!$payment->getMethodInstance() instanceof Expercash_Expercash_Model_Expercashmpf) {\n return false;\n }\n\n return true;\n }", "public function isActive() {\n\n\t\treturn ($this->getConfigValue('account_status') == \"active\");\n\t}", "public static function is_enable() {\n\t\treturn true;\n\t}", "public function hasPilotTestingAccounts()\n {\n foreach ($this->order_configurations as $config) {\n if ($config->configuration & 16384) {\n return true;\n }\n }\n return false;\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "function woocommerce_enabled()\n{\n\tif(class_exists('Woocommerce'))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function isTagalysActive()\n\t{\n\t\t//$status = $this->scopeConfig->getValue('tgs_search/default/status', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\t\t$status = $this->scopeConfig->getValue('tagalys_tglssearch/general/enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n\t\tif ($status)\n\t\t{\n\n\t\t\t//$service = $this->tglssearchClientConnector;\n\t\t\t$service = $this->tglssearchClientConnector;\n\t\t $tagalys = $service->isRequestSuccess();\n\t\t if($tagalys)\n\t\t\t{\n\t\t\t\t//print_r('if');die;\n\t\t \treturn $service;\n\t\t }\n\t\t\telse\n\t\t\t{\n\t\t\t\t//print_r('else');die;\n\t\t \treturn false;\n\t\t }\n\n\t\t} else\n\t\t{\n\t\t\t//print_r('false');die;\n\t\t\treturn false;\n\t\t}\n\t\t//print_r('nthg');die;\n\t}", "public function is_checkout_confirmation() {\n\n\t\treturn is_checkout() && $this->get_gateway()->is_available() && $this->get_cart_nonce();\n\t}", "function isActive(){\n\t\treturn $this->getSessionID() == $this->getUser()->getShift() && $this->getStatus() == '1' ? true : false;\n\t}", "function genesis_extender_essentials_is_active_nag()\n\t\t{\t\t\t\n\t\t\techo '<div id=\"update-nag\">';\n\t\t\tprintf( __( '<strong>Genesis Extender & Genesis Essentials Are Currently Active!</strong> These two Cobalt Apps products are not to be used together so deactivate <a href=\"%s\">Genesis Extender</a> or <a href=\"%s\">Genesis Essentials</a>.', 'extender' ), admin_url( 'plugins.php' ), admin_url( 'plugins.php' ) );\n\t\t\techo '</div>';\n\t\t}", "public function enable(): bool {}", "public function inSetup()\n\t{\n\t\t$setupComplete = $this->config()->get('confirm_step') ? 3 : 2;\n\n\t\treturn ($this->get('setup_stage') < $setupComplete);\n\t}", "public function getWebhookStatus()\n {\n return (bool)Mage::getStoreConfigFlag('trello_api/webhook/status');\n }", "public function validateCheckoutStepVisibility()\n {\n // No product has been selected\n if (Collection::getCurrent()->noSelection) {\n return false;\n }\n\n // Postal is not in pricing table.\n if (!Pricing::hasPostal(Collection::getCurrent()->postal)) {\n return false;\n }\n\n return true;\n }" ]
[ "0.7065807", "0.6995742", "0.6961207", "0.69493455", "0.67209923", "0.6685659", "0.6673397", "0.66221535", "0.66175735", "0.6590853", "0.6529487", "0.6349142", "0.6305523", "0.62243265", "0.61834246", "0.61740243", "0.60942614", "0.60889304", "0.60873085", "0.60654086", "0.60505754", "0.60438013", "0.60232073", "0.6009299", "0.5998582", "0.59980196", "0.59859544", "0.5956652", "0.59552175", "0.5929576", "0.5927883", "0.5913286", "0.5901811", "0.589978", "0.5889541", "0.5868632", "0.5858598", "0.5850282", "0.5843966", "0.58400774", "0.58276004", "0.58039665", "0.5797706", "0.57845813", "0.57817", "0.5780899", "0.57792217", "0.5736222", "0.57343626", "0.5732218", "0.57245827", "0.57201403", "0.5717587", "0.5717511", "0.57123506", "0.5710021", "0.57081497", "0.5705887", "0.57021916", "0.5686034", "0.5682091", "0.5672229", "0.5670742", "0.565673", "0.56541973", "0.56412923", "0.5639182", "0.5624664", "0.56244135", "0.5618669", "0.5618505", "0.56120884", "0.5608661", "0.5608264", "0.5604106", "0.5604106", "0.5604106", "0.5604106", "0.56023186", "0.55853766", "0.55849135", "0.5573581", "0.55734533", "0.55734533", "0.5554528", "0.55500025", "0.5549967", "0.55488074", "0.55457747", "0.55415064", "0.5538992", "0.55365866", "0.55362993", "0.5533075", "0.5530623", "0.5527112", "0.5526024", "0.5519975", "0.55197686", "0.55096394" ]
0.81843555
0
Get label HTML for go green in checkout.
public function getCheckoutGoGreenLabel() { return $this->getConfig('checkout/gogreen_label'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatusColorText()\n {\n $status = $this->status;\n $list = self::getStatusOption();\n\n $color = 'default';\n if ($status == self::STATUS_NEW) {\n $color = 'info';\n }\n if ($status == self::STATUS_USED) {\n $color = 'default';\n }\n if ($status == self::STATUS_DONE) {\n $color = 'primary';\n }\n if ($status == self::STATUS_UNCONFIRMED) {\n $color = 'warning';\n }\n\n if (!empty($status) && in_array($status, array_keys($list))) {\n return '<span class=\"label label-' . $color . '\">' . $list[$status] . '</span>';\n }\n return '<span class=\"label label-' . $color . '\">' . Yii::$app->getModule('billing')->t('Unknown') . '</span>';\n }", "public function StatusLabel()\n {\n $html = DBHTMLText::create();\n\n if (strpos($this->Status, FlowStatus::COMPLETED) !== false) {\n $html->setValue('<span style=\"color: #449d44;\">' . $this->Status . '</span>');\n } elseif (strpos($this->Status, FlowStatus::FAILED) !== false) {\n $html->setValue('<span style=\"color: #ff0000;\">' . $this->Status . '</span>');\n } else {\n $html->setValue('<span style=\"color: #ec971f;\">' . $this->Status . '</span>');\n }\n\n return $html;\n }", "public function getStatusLabelName()\n {\n $name = ArrayHelper::getValue(self::getLabelsArray(), $this->status);\n return Html::tag('span', $this->getStatusName(), ['class' => 'label label-' . $name]);\n }", "public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<{$this->element} class='$classes' for='{$this->id}'>{$this->label}{$required}</{$this->element}>\";\n\t\treturn $html;\n\t}", "public function getFrontendButtonLabel()\n {\n $buttonLabel = __('Proceed to checkout');\n if ($this->isCheckoutDisabled()) {\n $buttonLabel = __('Accept Quotation');\n }\n\n return $buttonLabel;\n }", "function getLabel() {\r\n\t\treturn $this->requiredBold&&$this->isRequired()?div::htm_bold(ucfirst($this->label)):ucfirst($this->label);\r\n\t}", "private function _get_invoices_status_label($invoice_info, $return_html = true) {\n // return get_order_status_label($data, $return_html);\n $invoice_status_class = \"label-default\";\n $status = \"draft\";\n $now = get_my_local_time(\"Y-m-d\");\n if ($invoice_info->status == \"draft\" ) {\n $invoice_status_class = \"label-warning\";\n $status = \"Draft\";\n } else if ($invoice_info->status == \"sent\") {\n $invoice_status_class = \"label-success\";\n $status = \"Sudah Terkirim\";\n\n }else if ($invoice_info->status == \"posting\") {\n $invoice_status_class = \"label-info\";\n $status = \"Posting\";\n\n }\n else if ($invoice_info->status == \"paid\") {\n $invoice_status_class = \"label-primary\";\n $status = \"Dibayarkan\";\n\n }\n $invoice_status = \"<span class='label $invoice_status_class large'>\" . $status . \"</span>\";\n if ($return_html) {\n return $invoice_status;\n } else {\n return $status;\n }\n }", "public function getStatusLabelAttribute()\n {\n //ADAPUN VALUENYA AKAN MENCETAK HTML BERDASARKAN VALUE DARI FIELD STATUS\n if ($this->status == 'draft') {\n return '<span class=\"badge badge-secondary\">Draft</span>';\n }\n else {\n return '<span class=\"badge badge-success\">Aktif</span>';\n }\n }", "function filter_woocommerce_cart_totals_coupon_label( $esc_html, $coupon ) {\n\t\tif ( $coupon->code == \"15percent\" ) {\n\t\t\t$esc_html = \"15% Discount\";\n\t\t}\n\n\t\treturn $esc_html;\n\t}", "public function getStatusLabelAttribute()\n {\n //ADAPUN VALUENYA AKAN MENCETAK HTML BERDASARKAN VALUE DARI FIELD STATUS\n if ($this->status == 0) {\n return '<span class=\"badge badge-secondary\">Draft</span>';\n }\n return '<span class=\"badge badge-success\">Aktif</span>';\n }", "private function renderLabel(): string\n {\n $str = '';\n if ($this->label) {\n $str .= '<label for=\"'.$this->getId().'\" '.$this->renderCssClass().'>'.$this->getLabel().'</label>';\n }\n\n return $str;\n }", "public function status_label(){\n\t\t$label='';\n\t\t\tswitch($this->status){\n\t\t\t\tCASE '1' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '2' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '3' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '4' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '5' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '6' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '7' : $label = 'label-warning';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '8' : $label = 'label-danger';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '9' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tCASE '11' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '15' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\treturn $label;\n\t}", "function it_exchange_get_abanonded_cart_status_label( $abandoned_cart ) {\n\t// Make sure the abandoned_cart is an object\n\tif ( empty( $abandoned_cart->ID ) )\n\t\t$abandoned_cart = it_exchange_get_abandoned_cart( $abandoned_cart );\n\tif ( ! is_object( $abandoned_cart ) || 'IT_Exchange_Abandoned_Cart' != get_class( $abandoned_cart ) )\n\t\treturn __( 'Unknown', 'LION' );\n\n\tswitch( $abandoned_cart->cart_status ) {\n\t\tcase 'abandoned' :\n\t\t\t$label = __( 'Abandoned', 'LION' );\n\t\t\tbreak;\n\t\tcase 'reengaged' :\n\t\t\t$label = __( 'Reengaged', 'LION' );\n\t\t\tbreak;\n\t\tcase 'recovered' :\n\t\t\t$label = __( 'Recovered', 'LION' );\n\t\t\tbreak;\n\t\tcase 'expired' :\n\t\t\t$label = __( 'Expired', 'LION' );\n\t\t\tbreak;\n\t\tcase 'lost' :\n\t\t\t$label = __( 'Lost', 'LION' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$label = __( 'Unknown', 'LION' );\n\t}\n\n\treturn apply_filters( 'it_exchange_get_abanonded_cart_status_label', $label, $abandoned_cart );\n}", "public function getFrontendLabel();", "public function getTitleCheckboxHtml() : string\n {\n return '<label class=\"kt-checkbox kt-checkbox--single kt-checkbox--all kt-checkbox--solid\">\n <input type=\"checkbox\" class=\"select-all\" onclick=\"select_all()\">\n <span></span>\n </label>';\n }", "public function get_label() {\n\t\t\treturn __( 'Costumapi', 'text-domain' );\n\t\t}", "function es_cart_change_coupon_label( $html , $coupon){\n\n$html='Discount:';\n\nreturn $html;\n\n}", "public function statusBadge() {\n return \"<label class='badge badge-{$this->status->css_class}'> &bullet; {$this->status->name}</label>\";\n }", "public function getLabelAttribute()\n {\n switch ($this->code) {\n case 'paid':\n $label = 'label-success';\n break;\n case 'delete':\n $label = 'label-danger';\n break;\n case 'partial':\n case 'sent':\n $label = 'label-warning';\n break;\n default:\n $label = 'bg-aqua';\n break;\n }\n\n return $label;\n }", "public function getLabel()\n\t{\n\t\techo '<div class=\"clr\"></div>';\n\t\tif ((string)$this->element['hr'] == 'true') {\n\t\t\treturn '<hr />';\n\t\t} else {\n\t\t\treturn parent::getLabel();\n\t\t}\n\t\techo '<div class=\"clr\"></div>';\n\t}", "public function get_label();", "public function get_label();", "public function getElementLabelHtml()\r\n {\r\n $element = $this->getElement();\r\n $label = $element->getLabel();\r\n if (!empty($label)) {\r\n $element->setLabel($this->__($label));\r\n }\r\n return $element->getLabelHtml();\r\n }", "function render_label() {\n return xFormTemplate::apply($this->template_label, $this->options);\n }", "protected function getLabel()\n\t{\n\t\t$html = array();\n\t\t$class = $this->element['class'] ? (string) $this->element['class'] : '';\n\n\t\t$html[] = '<span class=\"spacer\">';\n\t\t$html[] = '<span class=\"before\"></span>';\n\t\t$html[] = '<span class=\"' . $class . '\">';\n\t\tif ((string) $this->element['hr'] == 'true')\n\t\t{\n\t\t\t$html[] = '<hr class=\"' . $class . '\" />';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$label = '';\n\n\t\t\t// Get the label text from the XML element, defaulting to the element name.\n\t\t\t$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];\n\t\t\t$text = $this->translateLabel ? App::get('language')->txt($text) : $text;\n\n\t\t\t// Build the class for the label.\n\t\t\t$class = !empty($this->description) ? 'hasTip' : '';\n\t\t\t$class = $this->required == true ? $class . ' required' : $class;\n\n\t\t\t// Add the opening label tag and main attributes attributes.\n\t\t\t$label .= '<label id=\"' . $this->id . '-lbl\" class=\"' . $class . '\"';\n\n\t\t\t// If a description is specified, use it to build a tooltip.\n\t\t\tif (!empty($this->description))\n\t\t\t{\n\t\t\t\t$label .= ' title=\"'\n\t\t\t\t\t. htmlspecialchars(\n\t\t\t\t\ttrim($text, ':') . '::' . ($this->translateDescription ? App::get('language')->txt($this->description) : $this->description),\n\t\t\t\t\tENT_COMPAT, 'UTF-8'\n\t\t\t\t) . '\"';\n\t\t\t}\n\n\t\t\t// Add the label text and closing tag.\n\t\t\t$label .= '>' . $text . '</label>';\n\t\t\t$html[] = $label;\n\t\t}\n\t\t$html[] = '</span>';\n\t\t$html[] = '<span class=\"after\"></span>';\n\t\t$html[] = '</span>';\n\n\t\treturn implode('', $html);\n\t}", "public function getStatusLabelAttribute()\n {\n if ($this->status == 0) {\n return '<span class=\"badge badge-primary\">Draft</span>';\n }\n return '<span class=\"badge badge-success\">Publish</span>';\n \n }", "public function getStatusLabel()\n {\n return \\BFOS\\PagseguroBundle\\Utils\\Pagseguro::$transaction_status[$this->status];\n }", "function label() {\n return \"<label>\".$this->label.\": </label>\";\n }", "public function getLabel(): \\Magento\\Framework\\Phrase;", "public function renderLabel(){\n $row = '';\n $row .= \"<div class=\\\"$this->div_class\\\">\";\n $row .= \"<label for=\\\"$this->id\\\" class=\\\"$this->label_class\\\">$this->label</label>\";\n return $row;\n }", "public function label(){\n\t\treturn '<label class=\"control-label\" for=\"'.$this->name.'\">'.$this->label.'</label>';\n\t}", "public function get_label_input()\n\t{\n\t\t$s = $this->get_html();\n\t\tif ( !empty($s) ){\n\t\t\tif ( BBN_IS_DEV ){\n\t\t\t\t$title = str_replace('\"','',print_r($this->cfg,true));\n\t\t\t}\n\t\t\telse if ( isset($this->options['title']) ){\n\t\t\t\t$title = $this->options['title'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$title = '';\n\t\t\t}\n\t\t\t$s = '<label class=\"appui-form-label\" title=\"'.$title.'\">'.$this->label.'</label><div class=\"appui-form-field\">'.$s.'</div>';\n\t\t}\n\t\treturn $s;\n\t}", "public function testGetLabelHtml() {\r\n\t\t$this->testObject->setLabel ( 'hello' );\r\n\t\t\r\n\t\t$expectedHtml = '<label id=\"' . self::TEST_CONTROL_ID . '_label\" for=\"' . self::TEST_CONTROL_ID . '\">hello</label>';\r\n\t\t$actualHtml = $this->testObject->getLabelHtml ();\r\n\t\t\r\n\t\techo \"\\nACTUAL LABEL HTML:\\n$actualHtml\";\r\n\t\t\r\n\t\t$this->assertTrue ( $expectedHtml == $this->testObject->getLabelHtml (), 'incorrect label html found' );\r\n\t}", "function getLabel()\n\t{\n\t\treturn '';\n\t}", "protected function getLabelHtml()\n {\n $classAttribute = $this->getCustomAttributes()->getLabelClass();\n $classAttribute = $classAttribute ? ' class=\"' . $classAttribute . '\"' : \"\";\n\n $forAttribute = sprintf(' for=\"%s\"', $this->getIdAttribute());\n\n $output = '<label' . $classAttribute . $forAttribute . '>';\n $output .= $this->getLabel();\n $output .= '</label>';\n $output .= PHP_EOL;\n\n return $output;\n }", "public function get_label() {\n\t\treturn $this->label;\n\t}", "public static function label()\n {\n return 'Bukeri';\n }", "function payment_label($paid, $insurance = false)\n {\n if ($paid) {\n $string = $insurance ? 'Invoiced' : 'Paid';\n $fancy = \"<span class='text-success'><i class='fa fa-check-circle-o'></i> $string</span>\";\n } else {\n $string = $insurance ? 'Not Invoiced' : 'Not Paid';\n $fancy = \"<span class='text-danger'><i class='fa fa-warning'></i> $string</span>\";\n }\n return $fancy;\n }", "function createCartCountLabel(){\n $count = getCartCount();\n $label = \" \";\n \n if($count != 0) {\n $label = '<div class = \"ui blue horizontal label\">'.$count.'</div>';\n }\n return $label;\n}", "public function approvedBadge() {\n\n if($this->is_approved) {\n $css_class = 'success';\n $text = 'Approved';\n } else {\n $css_class = 'danger';\n $text = 'Unapproved';\n }\n\n return \"<label class='badge badge-{$css_class}'> &bullet; {$text}</label>\";\n }", "function getLabel(): string;", "public function getKlarnaCheckoutGui()\n {\n return $this->getKlarnaOrder()->getHtmlSnippet();\n }", "public function label()\n {\n return $this->label;\n }", "public function getLabel(): string;", "public function getLabel(): string;", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel()\n {\n return 'VR pay eCommerce';\n }", "public function label()\n {\n $result = $this->title;\n if ($this->tags) {\n $tags = '[' . implode('] [', preg_split('/\\s*,\\s*/', $this->tags)) . ']';\n $result .= ' <span style=\"font-weight:bold;padding-left:20px;float:right;\">' . $tags . '</span>';\n }\n return $result;\n }", "public static function inscriptionStatusLabel($status)\n {\n $labels = [\n 'ati' => '<label class=\"label background-gold white\">Aberto</label>',\n 'apr' => '<label class=\"label background-green white\">Aprovado</label>',\n 'rep' => '<label class=\"label background-red white\">Reprovado</label>'\n ];\n return $labels[$status];\n }", "public function getLabel()\n {\n return !empty($this->label) ? $this->label : '';\n }", "public static function notificationStatusLabel($status)\n {\n $labels = [\n 'ati' => '<label class=\"label background-green white\">Ativo</label>',\n 'ina' => '<label class=\"label background-red white\">Inativo</label>'\n ];\n return $labels[$status];\n }", "public function get_label(){ return $this->label; }", "protected function get_label(): string {\n\t\treturn 'You need to override the get_label() method in your class.';\n\t}", "public function getLabel(): string {\n return $this->label;\n }", "public static function userStatusLabel($status)\n {\n $labels = [\n 'ati' => '<label class=\"label background-green white\">Ativo</label>',\n 'ina' => '<label class=\"label background-red white\">Inativo</label>'\n ];\n\n return $labels[$status];\n }", "public static function label()\n {\n return __('Confirmations');\n }", "public function GetLabel();", "public function getStripeLabel() {\n return $this->stripeLabel;\n }", "function custom_field_label_tag($name, $custom_value) {\n $out = sprintf('<label for=\"%s\" class=\"%s\">%s', \n $name.'_custom_field_values_'.$custom_value['CustomField']['id'],\n empty($this->validationErrors[Inflector::camelize($name)]['custom_field_values'][$custom_value['CustomField']['id']]) ? \"\" : \"error\",\n $custom_value['CustomField']['name']\n );\n if($custom_value['CustomField']['is_required']) {\n $out .= \" <span class=\\\"required\\\">*</span>\";\n }\n $out .= \"</label>\";\n return $out;\n }", "public\n\tfunction getTagLabel(): string {\n\t\treturn $this->tagLabel;\n\t}", "public function getLabel()\n {\n return 'Shopware Connect';\n }", "public function getLabel()\n {\n return $this->sLabel;\n }", "public function labelTag($args) {\n $name = $this->orEq($args,'name');\n $content = $this->orEq($args,'label');\n $classes = $this->orEq($args,'classes','');\n return \"<label for='\" . esc_attr( $name ) . \"' for='\" . esc_attr( $classes ) . \"'>\" . esc_html( $content ) . \"</label>\";\n }", "public function labelTag($args) {\n $name = $this->orEq($args,'name');\n $content = $this->orEq($args,'label');\n $classes = $this->orEq($args,'classes','');\n return \"<label for='\" . esc_attr( $name ) . \"' for='\" . esc_attr( $classes ) . \"'>\" . esc_html( $content ) . \"</label>\";\n }", "public function getLabel(): string\n {\n return $this->_label;\n }", "public function getLabel() {\n return $this->label;\n }", "public function getLabel() {\n return $this->label;\n }", "public static function eventStatusLabel($status)\n {\n $labels = [\n 'abe' => '<label class=\"label background-green white\">Aberto</label>',\n 'fec' => '<label class=\"label background-red white\">Fechado</label>',\n 'can' => '<label class=\"label background-red white\">Cancelado</label>'\n ];\n return $labels[$status];\n }", "public function filter_registration_button_label( $label ) {\n\t\t$label = 'Finish Checkout via PayPal';\n\n\t\treturn $label;\n\t}", "private function getRecordsStatusLabel(CustomRequest $request)\n {\n $status = RequestStatus::getString($request->status);\n\n if ($request->status == RequestStatus::Verification) {\n $extra_class = 'info';\n } elseif ($request->status == RequestStatus::Accept || $request->status == RequestStatus::AcceptProdi) {\n $extra_class = 'success';\n } elseif ($request->status == RequestStatus::Reject || $request->status == RequestStatus::RejectProdi || $request->status == RequestStatus::RejectBySistem) {\n $extra_class = 'danger';\n } elseif ($request->status == RequestStatus::Draft) {\n $extra_class = 'warning';\n }\n\n return \"<span class='label label-{$extra_class}'>{$status}</span>\";\n }", "public function get_label()\n\t{\n\t\treturn $this->_label;\n\t}", "private function getStatus($label) {\r\n\t\tif ($label == 'homepage') {\r\n\t\t\t$status = ' disabled';\r\n\t\t} elseif ($label == 'charts' || $label == 'lists' || $label == 'calendar') {\r\n\t\t\t$status = ' menu-extended';\r\n\t\t} elseif ($label == 'reports') {\r\n\t\t\t$status = ' menu-extended menu-reports';\r\n\t\t} elseif ($label == 'compact') {\r\n\t\t\t$status = ' menu-compact';\r\n\t\t} elseif ($label == 'media') {\r\n\t\t\t$status = ' menu-media';\r\n\t\t} else {\r\n\t\t\t$status = '';\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function get_label() {\n return $this->_label;\n }", "public function getLabel()\n\t{\t\t\t\n\t\treturn $this->label;\n\t}", "public function getLabel() {\n return $this->getAttribute('label');\n }", "public function getStatusDescricao() \n {\n switch ($this->status) {\n case self::SEM_NEGOCIACAO:\n return '<span class=\"label label-warning\">Sem Neg.</span>';\n break;\n case self::EM_NEGOCIACAO:\n return '<span class=\"label label-info\">Em Neg.</span>';\n break;\n }\n }", "public function getLabel()\n {\n return $this->getData(self::LABEL);\n }", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();" ]
[ "0.67628026", "0.6717876", "0.66417354", "0.66224724", "0.6611971", "0.6424713", "0.6419074", "0.6403489", "0.6386775", "0.638048", "0.63156706", "0.62147117", "0.6161197", "0.6134485", "0.6096695", "0.6096653", "0.60731083", "0.6072841", "0.60679257", "0.60638046", "0.60351956", "0.60351956", "0.60309124", "0.59909207", "0.5985584", "0.5973817", "0.5971797", "0.5964369", "0.5935511", "0.59284115", "0.59159297", "0.5915187", "0.58864015", "0.5869191", "0.58592236", "0.5851171", "0.5830222", "0.5823678", "0.58235973", "0.57981145", "0.5793211", "0.5790303", "0.5774334", "0.5769751", "0.5769751", "0.5751333", "0.5751333", "0.5751333", "0.5751333", "0.5745321", "0.5736658", "0.572623", "0.5722682", "0.57225746", "0.5716953", "0.5709689", "0.5695457", "0.5684228", "0.568175", "0.5677734", "0.5657301", "0.56520677", "0.56503975", "0.56433964", "0.5639151", "0.5634476", "0.5634476", "0.56330556", "0.56328356", "0.56328356", "0.56201804", "0.5619486", "0.5618736", "0.5617491", "0.56169844", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.561694", "0.5615746", "0.55966705", "0.5596629", "0.55888104", "0.55844367", "0.5582539", "0.5582539", "0.5582539", "0.5582539", "0.5582539", "0.5582539" ]
0.8215448
0
Return TRUE if Mage::getVersion() is lower than 1.4.0.0
public function isVersionRecommendedOrLarger() { return ( (int) implode(null, explode('.', Mage::getVersion())) >= (int) implode(null, explode('.', self::RECOMMENDED_VERSION)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function birdseye_component_checkversion()\n{\n if (!function_exists('get_product_release'))\n return false;\n if (get_product_release() < 207)\n return false;\n\n return true;\n}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "function IsOldVersion()\n{\n $i_too_old = 3; // version 3 PHP is not usable here\n $a_modern = array(4,1,0); // versions prior to this are \"old\" - \"4.1.0\"\n\n $a_this_version = explode(\".\",phpversion());\n\n if ((int) $a_this_version[0] <= $i_too_old)\n die(\"This script requires at least PHP version 4. Sorry.\");\n $i_this_num = ($a_this_version[0] * 10000) +\n ($a_this_version[1] * 100) +\n $a_this_version[2];\n $i_modern_num = ($a_modern[0] * 10000) +\n ($a_modern[1] * 100) +\n $a_modern[2];\n return ($i_this_num < $i_modern_num);\n}", "public function isAboveShopwareVersion52()\n {\n // return if this is shopware 5.2\n return $this->versionCompare( '5.2.0', '>=' );\n }", "public function checkRequiredVersion() {\n if (version_compare(PHP_VERSION, '4.3.2', '>=')) {\n return TRUE;\n }\n $this->logMsg(\n MSG_ERROR,\n PAPAYA_LOGTYPE_MODULES,\n 'Could not get HTML Purifier instance because this PHP version is too old.'\n );\n return FALSE;\n }", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "public function getVersion()\n {\n return true;\n }", "public static function old_version() {\n\n\t\tif ( class_exists( 'TM_Custom_Prices' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public function getVersion()\r\n\t{\r\n\t\t$magentoVersion = Mage::getVersion();\r\n\t \t$pattern = '/[^\\d]/';\r\n\t\t$magentoVersion = preg_replace($pattern, '', $magentoVersion);\r\n\t\t\r\n\t\twhile(strlen($magentoVersion) < 4)\r\n\t\t{\r\n\t\t\t$magentoVersion .= '0';\r\n\t\t}\r\n\t\t$magentoVersion = (int)$magentoVersion;\r\n\t\t\r\n\t\treturn $magentoVersion;\r\n\t}", "private function isOldVersion() {\r\n\t\treturn $this->getRequest ()->getParam ( \"oldversion\", null ) == 1;\r\n\t}", "protected function hasNewerVersion()\n\t{\n\t\treturn version_compare($this->getVersion(),$this->getConfigValue('latest_version'),'<');\n\t}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function getMagentoVersion()\n {\n $version = Mage::getVersion();\n if (!Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')) {\n return $version;\n }\n\n // $mapping = array(\n // '1.13.0.0' => '1.8.0.0',\n // '1.12.0.2' => '1.7.0.2',\n // '1.12.0.0' => '1.7.0.0',\n // '1.11.2.0' => '1.6.2.0',\n // '1.11.1.0' => '1.6.1.0',\n // '1.11.0.0' => '1.6.0.0',\n // '1.10.0.0' => '1.5.0.0'\n // );\n $info = explode('.', $version);\n $info[1] -= 5;\n $version = implode('.', $info);\n\n return $version;\n }", "public function sincePrestashop170()\n {\n if (Tools::version_compare(_PS_VERSION_, '1.7', '>=')) {\n return true;\n }\n return false;\n }", "public static function compatible_version() {\n\n\t\tif ( version_compare( $GLOBALS['wp_version'], THEMECOMPLETE_EPO_WP_VERSION, '<' ) ) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\n\t}", "final public function meets_minimum_requirements()\n\t{\n\t\treturn version_compare($this->minimum_core_version(), CMS_VERSION) < 1;\n\t}", "public function piIsFourPointSixShop()\n {\n return substr(oxRegistry::getConfig()->getVersion(), 0, 3) === '4.6';\n }", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public static function isNewerThan($version = '5.3')\n {\n return version_compare(App::VERSION(), $version) > 0;\n }", "public function hasVersion(){\n return $this->_has(1);\n }", "public function isInstallVersionNewer()\n {\n // Get a db connection so we can find the installed version from #__extensions\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('manifest_cache'))\n ->from ($db->quoteName('#__extensions'))\n ->where ($db->quoteName('element') . ' = '. $db->quote('com_cajobboard'));\n\n $db->setQuery($query);\n\n $manifest = json_decode($db->loadResult(), true);\n $installedRelease = $manifest['version'];\n\n if (version_compare($newRelease, $installedRelease, 'le'))\n {\n JFactory::getApplication()->enqueueMessage(\n Text::sprintf('COM_CAJOBBOARD_NO_UPDATE_TO_AN_OLDER_VERSION', $installedRelease, $newRelease), 'error'\n );\n\n return false;\n }\n\n return true;\n }", "public static function is_at_least_50() {\n\t\treturn version_compare( get_bloginfo( 'version' ), '5.0', '>=' );\n\t}", "public function getMagentoVersion()\n {\n return $this->metadata->getVersion();\n }", "public function getMagentoVersion()\n {\n return $this->metadata->getVersion();\n }", "public function getMagentoVersion(): string\n {\n return $this->productMetadata->getVersion();\n }", "public function hasVersion(){\n return $this->_has(3);\n }", "protected function mm_current_version() {\n $options = $this->options;\n if($options['version'] == MM_PLUGIN_VER)\n return true;\n }", "function version() {\r\n return(\"4.0\");\r\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "function qa_php_version_below($version)\n{\n\t$minphp = qa_version_to_float($version);\n\t$thisphp = qa_version_to_float(phpversion());\n\n\treturn $minphp && $thisphp && $thisphp < $minphp;\n}", "function qa_qa_version_below($version)\n{\n\t$minqa = qa_version_to_float($version);\n\t$thisqa = qa_version_to_float(QA_VERSION);\n\n\treturn $minqa && $thisqa && $thisqa < $minqa;\n}", "public static function isBelow_6_0()\n {\n return (self::getVersionAsInteger() < self::VERSION_6_0);\n }", "function check_php_version () {\n\t$testSplit = explode ('.', '4.3.0');\n\t$currentSplit = explode ('.', phpversion());\n\n\tif ($testSplit[0] < $currentSplit[0])\n\t\treturn True;\n\tif ($testSplit[0] == $currentSplit[0]) {\n\t\tif ($testSplit[1] < $currentSplit[1])\n\t\t\treturn True;\n\t\tif ($testSplit[1] == $currentSplit[1]) {\n\t\t\tif ($testSplit[2] <= $currentSplit[2])\n\t\t\t\treturn True;\n\t\t}\n\t}\n\treturn False;\n}", "function tidypics_is_upgrade_available() {\n\t// sets $version based on code\n\trequire_once elgg_get_plugins_path() . \"tidypics/version.php\";\n\n\t$local_version = elgg_get_plugin_setting('version', 'tidypics');\n\tif ($local_version === false) {\n\t\t// no version set so either new install or really old one\n\t\tif (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {\n\t\t\t$local_version = 0;\n\t\t} else {\n\t\t\t// set initial version for new install\n\t\t\telgg_set_plugin_setting('version', $version, 'tidypics');\n\t\t\t$local_version = $version;\n\t\t}\n\t} elseif ($local_version === '1.62') {\n\t\t// special work around to handle old upgrade system\n\t\t$local_version = 2010010101;\n\t\telgg_set_plugin_setting('version', $local_version, 'tidypics');\n\t}\n\n\tif ($local_version == $version) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function checkVersion($version)\n {\n return version_compare($this->getVersion(), $version, 'lt');\n }", "public function isVersionless(): bool\n {\n return ! $this->isVersioning();\n }", "function versionCheck($template) {\n\tglobal $communitySettings;\n\n\tif ( $template['MinVer'] && ( version_compare($template['MinVer'],$communitySettings['unRaidVersion']) > 0 ) ) return false;\n\tif ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$communitySettings['unRaidVersion']) < 0 ) ) return false;\n\treturn true;\n}", "public function isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "protected function bowOutEarly()\n {\n return ($this->supportsBelow('5.3') === false || $this->supportsAbove('5.4') === false);\n }", "public function hasRightPhpVersion()\n {\n $phpversion = phpversion();\n\n if (version_compare($phpversion, '5.4.0', 'lt')) {\n return false;\n }\n\n return true;\n }", "public function isCompatible($minimum)\n {\n return version_compare(NFWVERSION, $minimum, 'ge');\n }", "public function upgrade($old_version)\r\n\t{\r\n\t\t// Upgrade Logic\r\n\t\treturn true;\r\n\t}", "public function redirectOnWrongPhpVersion()\n {\n if ($this->hasRightPhpVersion() == true) {\n return false;\n }\n\n $link = 'https://www.yireo.com/software/magento-extensions/trashcan/faq#does-this-extension-work-under-php-5-3';\n $msg = 'The Yireo Trashcan module requires PHP 5.4 to work. See our <a target=\"_new\" href=\"%s\">FAQ</a> for details';\n $this->getAdminhtmlSession()->addError($this->__($msg, $link));\n session_write_close();\n\n $this->response = Mage::app()->getResponse();\n $this->response->setRedirect(Mage::getUrl('adminhtml/dashboard/index'));\n $this->response->sendResponse();\n return true;\n }", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "private static function is_version_1_8_or_higher() {\r\n\t\tswitch (Config::get_value(ConfigJQueryUI::VERSION)) {\r\n\t\t\tcase '1.8':\r\n\t\t\tcase '1.9':\r\n\t\t\tcase '1.10':\r\n\t\t\t\treturn true;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isPrestaShopSupportedVersion()\n {\n if (version_compare(_PS_VERSION_, '1.5', '<')) {\n return false;\n }\n\n return true;\n }", "public function isBs4()\n {\n if (!isset($this->_isBs4)) {\n $this->initBsVersion();\n }\n return $this->_isBs4;\n }", "public function minimum_core_version()\n\t{\n\t\treturn CMS_VERSION;\n\t}", "function is_version( $version = '3.5' ) {\n\t\tglobal $wp_version;\n\t\treturn version_compare( $wp_version, $version, '>=' );\n\t}", "public function hasPatchversion(){\n return $this->_has(40);\n }", "function check_php_version($version)\n {\n // intval used for version like \"4.0.4pl1\"\n $testVer=intval(str_replace(\".\", \"\",$version));\n $curVer=intval(str_replace(\".\", \"\",phpversion()));\n if( $curVer < $testVer )\n return false;\n return true;\n }", "protected function bowOutEarly()\n {\n return ($this->supportsBelow('7.3') === false || $this->supportsAbove('7.4') === false);\n }", "protected function checkPHPVersion()\n\t{\n\t\tif (!empty($this->minimumPHPVersion))\n\t\t{\n\t\t\tif (defined('PHP_VERSION'))\n\t\t\t{\n\t\t\t\t$version = PHP_VERSION;\n\t\t\t}\n\t\t\telseif (function_exists('phpversion'))\n\t\t\t{\n\t\t\t\t$version = phpversion();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$version = '5.0.0'; // all bets are off!\n\t\t\t}\n\n\t\t\tif (!version_compare($version, $this->minimumPHPVersion, 'ge'))\n\t\t\t{\n\t\t\t\t$msg = \"<p>You need PHP $this->minimumPHPVersion or later to install this extension</p>\";\n\n\t\t\t\t$this->log($msg);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function is_upgrade()\n\t{\n\t\tif ( get_site_option( 'cur_from' ) ) :\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\treturn FALSE;\n\t\tendif;\n\t}", "public function checkDbVersion()\n {\n if ( GALETTE_MODE === 'DEV' ) {\n Analog::log(\n 'Database version not checked in DEV mode.',\n Analog::INFO\n );\n return true;\n }\n try {\n $select = new \\Zend_Db_Select($this->db);\n $select->from(\n PREFIX_DB . 'database',\n array('version')\n )->limit(1);\n $sql = $select->__toString();\n $res = $select->query()->fetch();\n return $res->version === GALETTE_DB_VERSION;\n } catch ( \\Exception $e ) {\n Analog::log(\n 'Cannot check database version: ' . $e->getMessage(),\n Analog::ERROR\n );\n return false;\n }\n }", "function required_theme_version(){\n\n\t\tif ( get_template_directory() !== get_stylesheet_directory() ) {\n\t\t\t$theme = wp_get_theme( 'xstore' );\n\t\t} else {\n\t\t\t$theme = wp_get_theme();\n\t\t}\n\n\t\tif ( $theme->name == ('XStore') && version_compare( $theme->version, ET_CORE_THEME_MIN_VERSION, '<' ) ) {\n\t\t\t$this->add_error_notice(\n\t\t\t\t__( 'XStore Core plugin requires the following theme: XStore '. ET_CORE_THEME_MIN_VERSION .' or higher.', 'xstore-core' ),\n\t\t\t\t''\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static function isStable()\n {\n return (bool) preg_match('/^[0-9\\.]+$/', static::VERSION);\n }", "public function appVersionIsOutdated()\n {\n $appVersion = '0.0.1';\n\n if (Headers::isAndroid()) {\n $appVersion = $this->android_version;\n } elseif (Headers::isIos()) {\n $appVersion = $this->ios_version;\n }\n\n return -1 === version_compare(Headers::getAppVersion(), $appVersion) ? true : false;\n }", "public function min_php_version_check()\n {\n }", "protected function getPackageStatesVersion()\n {\n return 4;\n }", "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "function rename_component_checkversion()\n{\n // Needs permission fix in reconfigure_nagios.sh script in 2011R2.4\n if (!function_exists('get_product_release') || get_product_release() < 300) {\n return false;\n }\n return true;\n}", "public function isBootstrap4(): bool\n {\n return $this->bootstrapVersion === 4;\n }", "function is_wp_version( $is_ver ) {\n\t$wp_ver = explode( '.', get_bloginfo( 'version' ) );\n\t$is_ver = explode( '.', $is_ver );\n\tif( !isset( $wp_ver[0] ) ) array_push( $wp_ver, 0 );\n\tforeach( $is_ver as $i => $is_val )\n\t\tif( $wp_ver[$i] < $is_val ) return false;\n\treturn true;\n}", "public function has_php_version() {\n\t\treturn version_compare( PHP_VERSION, '5.4', '>=' );\n\t}", "function NeedDatabaseUpgrade()\n\t{\n\t\tif ($this->database_version == -1) {\n\t\t\t$this->CheckCron();\n\t\t}\n\n\t\tif ($this->database_version < SENDSTUDIO_DATABASE_VERSION) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function upgrade($oldVersion)\n {\n // update successful\n return true;\n }", "public static function isBelow_6_2()\n {\n return (self::getVersionAsInteger() < self::VERSION_6_2);\n }", "public function isPrestaShop16()\n {\n if (version_compare(_PS_VERSION_, '1.6', '>=')\n && version_compare(_PS_VERSION_, '1.7', '<')\n ) {\n return true;\n }\n return false;\n }", "protected function getInstalledMajorVersion() {}", "public function hasSourceVersion(){\n return $this->_has(7);\n }", "function MinimumCMSVersion() {\n\t\treturn \"1.11.5\";\n\t}", "public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}", "private function _checkPHPVersion($min)\n {\n if (!version_compare(phpversion(), $min, '>='))\n throw new \\Exception('Your PHP version is too old ! PHP '.$min.' is required.');\n\n return true;\n }", "public function has_versions()\n {\n return ($this->get_current() != 1);\n }", "abstract function has_premium_version();", "public function getMajorVersion() {}", "function get_version_min() {\n return $this->version_min;\n }", "private function _version($v = 5)\r\n\t{\r\n $_cur = intval(phpversion());\r\n\t\tif ($_cur >= $v) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('PHP version ' . $v . ' required; have version ' . $_cur);\r\n\t\t}\r\n return false;\r\n\t}", "public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }", "public function upgrade($oldversion)\n {\n // Update successful\n return true;\n }", "public function getMagentoVersion()\n\t{\n\t\t$version = $this->getSoapVersion();\n\t\tswitch ($version) {\n\t\t\tcase 'v1':\n\t\t\t\t$response = $this->call('core_magento.info', array());\n\t\t\t\tbreak;\n\n\t\t\tcase 'v2':\n\t\t\t\t$response = $this->__call('magentoInfo', array());\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( isset($response) ) {\n\t\t\treturn sprintf('%s %s', $response->getMagentoEdition(), $response->getMagentoVersion());\n\t\t}\n\t}", "public function isPrestashop16()\n {\n if (version_compare(_PS_VERSION_, '1.6', '>=') &&\n version_compare(_PS_VERSION_, '1.7', '<')\n ) {\n return true;\n }\n\n return false;\n }", "private function checkVersion($version){\n\t\tif(VersionMappingBackendQuery::create()->filterByServerRelease(YaffmapConfig::get('version'))->filterByClientRelease($version)->count() == 0){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "public function isDemoVersion()\n {\n if ($this->_blDemoVersion == null) {\n $this->_blDemoVersion = $this->getConfig()->detectVersion() == 1;\n }\n\n return $this->_blDemoVersion;\n }", "public function isAutoVersion(): bool\n {\n }", "function module_loaded($module_name, $min_version = null) {\n $module_class_name = 'melt\\\\' . $module_name . '\\\\' . \\melt\\string\\underline_to_cased($module_name) . \"Module\";\n if (class_exists($module_class_name)) {\n if ($min_version !== null) {\n $module_version = call_user_func(array($module_class_name, \"getVersion\"));\n return version_compare($module_version, $min_version, \">=\");\n }\n return true;\n }\n return false;\n}", "function xmldb_cognitivefactory_upgrade($oldversion = 0) {\n/// older versions to match current functionality \n\n global $CFG;\n\n $result = true;\n\n // Moodle 2.0 line\n \n return true;\n}", "function getMinNucleusVersion() { return '250'; }", "function check_genesis() {\r\n\t\t$theme = wp_get_theme();\r\n\t\tif ($theme->template == 'genesis') {\r\n\t\t\t$parent = $theme->parent();\r\n\t\t\t$compare = version_compare('2.0', $parent->version, '<=');\r\n\t\t\tif ($compare)\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private function is_php_version_ready() {\n\n\t\tif ( ! version_compare( $this->min_php_version , PHP_VERSION, '>=' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->add_error_notice(\n\t\t\t'PHP ' . $this->min_php_version . '+ is required',\n\t\t\t'You\\'re running version ' . PHP_VERSION\n\t\t);\n\n\t\treturn false;\n\t}", "public function hasVersions(): bool;", "function rss_client_upgrade($oldversion) {\n/// This function does anything necessary to upgrade \n/// older versions to match current functionality \n\n global $CFG;\n\n if ($oldversion < 2003111500) {\n # Do something ...\n }\n\n if ($oldversion < 2004112001) {\n // title and description should be TEXT as we don't have control over their length.\n table_column('block_rss_client','title','title','text',10,'unsigned','');\n table_column('block_rss_client','description','description','text',10,'unsigned','');\n }\n\n return true;\n}", "function moodle_require_minimum_php_version() {\n // PLEASE NOTE THIS FUNCTION MUST BE COMPATIBLE WITH OLD UNSUPPORTED VERSIONS OF PHP!\n moodle_minimum_php_version_is_met(true);\n}", "protected function canLoad()\n\t{\n\t\t$v = version_compare($this->getVersion(),$this->getConfigValue('plugin_current_version')); \n\t\t//first, check if this instance is the latest one, or not\n\t\tif($v < 0) return false;\n\t\t\t \n\t\t//save the latest version, for later reference\n\t\tif($v > 0 )\n\t\t\t$this->setConfigValue('plugin_current_version',$this->getVersion());\n\t\t\t\n\t\treturn true;\n\t}", "function plugin_compatible_with_this_geeklog_version ()\n{\n return true;\n}" ]
[ "0.7012129", "0.6901724", "0.6872317", "0.6855226", "0.6806967", "0.67747056", "0.6773816", "0.6770376", "0.67694795", "0.6639491", "0.65929055", "0.6426982", "0.64244163", "0.64230067", "0.64139634", "0.63797873", "0.63410085", "0.6311115", "0.6307454", "0.62590444", "0.6258831", "0.62364703", "0.62362945", "0.62140346", "0.61837226", "0.6179921", "0.6179921", "0.61413157", "0.6139607", "0.6131596", "0.6124211", "0.611411", "0.6113958", "0.61063135", "0.60804206", "0.60589916", "0.60501486", "0.60347825", "0.60199827", "0.60041505", "0.6001968", "0.5999248", "0.5989466", "0.5988105", "0.59810084", "0.597115", "0.59679466", "0.5961537", "0.59508896", "0.59480363", "0.59479415", "0.59408855", "0.5927081", "0.59252614", "0.5924229", "0.59198374", "0.5909655", "0.5904086", "0.5890162", "0.58873117", "0.58778155", "0.587072", "0.58635634", "0.5851131", "0.5834627", "0.5829208", "0.5828586", "0.58154", "0.58127946", "0.58112365", "0.5802468", "0.58018005", "0.5800095", "0.5774834", "0.57658005", "0.5763845", "0.5759268", "0.575283", "0.57446915", "0.57280576", "0.57264453", "0.5726444", "0.5713444", "0.5710638", "0.570866", "0.56851345", "0.56842023", "0.56830907", "0.56807935", "0.56798416", "0.56708103", "0.5664348", "0.5662574", "0.5659557", "0.5654355", "0.56519175", "0.5646594", "0.563935", "0.5620816", "0.5603088" ]
0.6915896
1
Create and return config mapping for magento version lower than 1.4.0.0.
protected function _getMapping($index = null) { return $index; /* // Return given index name if version is larger than 1.4.0.0 if (true === $this->isVersionRecommendedOrLarger()): return $index; endif; // Get index name from mapping. if (!self::$_mapping instanceof ArrayObject): self::$_mapping = new ArrayObject(array()); foreach ($this->_loadSystemXml() as $groups): foreach ($groups as $name => $group): foreach ($group->fields as $fields): foreach ($fields as $field => $attribute): $path = (string) $attribute->config_path; if (!$path) continue; self::$_mapping->offsetSet($path, sprintf( 'intraship/%s/%s', $name, $field)); endforeach; endforeach; endforeach; endforeach; endif; // Return value for given index. if (null !== $index): if (false === self::$_mapping->offsetExists($index)): // Write message to log. $log = sprintf('Undefined index "%s" on mapping table.', $index); Mage::log($log, Zend_Log::NOTICE); // Return the origin index. return $index; endif; return self::$_mapping->offsetGet($index); else: return self::$_mapping; endif; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xmldb_block_online_users_map_upgrade($oldversion) {\n\n global $CFG, $DB, $OUTPUT;\n\n\t$dbman = $DB->get_manager();\n\t\n if ($oldversion < 2007110101) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_centre_lat\";\n $setting->value = 17.383;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_centre_lng\";\n $setting->value = 11.183;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_init_zoom\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008011400) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_debug\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n \n }\n \n if ($oldversion < 2008030600) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_show_offline\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_show_offline_role\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008052700) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_centre_user\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008080700) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_update_limit\";\n $setting->value = 100;\n $DB->insert_record(\"config\",$setting);\n }\n \n\tif ($oldversion < 2010051900) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_has_names\";\n $setting->value = 1;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2010122700) {\n $setting = new object();\n $setting->name = \"block_online_users_map_type\";\n $setting->value = 'osm';\n $DB->insert_record(\"config\",$setting);\n \n // block savepoint reached\n upgrade_block_savepoint(true, 2010122700, 'online_users_map');\n }\n \n return true;\n}", "protected function getExtbaseConfiguration() {}", "function _config_cache(){\n Mapper::config(array('use_cache'=>false));\n \n}", "abstract public function generateConfiguration();", "public function getMagentoVersion()\n {\n $version = Mage::getVersion();\n if (!Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')) {\n return $version;\n }\n\n // $mapping = array(\n // '1.13.0.0' => '1.8.0.0',\n // '1.12.0.2' => '1.7.0.2',\n // '1.12.0.0' => '1.7.0.0',\n // '1.11.2.0' => '1.6.2.0',\n // '1.11.1.0' => '1.6.1.0',\n // '1.11.0.0' => '1.6.0.0',\n // '1.10.0.0' => '1.5.0.0'\n // );\n $info = explode('.', $version);\n $info[1] -= 5;\n $version = implode('.', $info);\n\n return $version;\n }", "public function getPropertyMappingConfiguration() {}", "protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "protected function _getConfigArray(){\n \n return array(\n array(\n 'version' => '0.0.4',\n 'path' => 'bss_quickview/seting_theme/product_image_wrapper',\n 'value' => 'product-item-photo'\n ),\n array(\n 'version' => '0.0.5',\n 'path' => 'bss_quickview/success_popup_design/background_color',\n 'value' => '0088CC'\n ),\n array(\n 'version' => '0.0.5',\n 'path' => 'porto_settings/custom_settings/custom_style',\n 'value' => 'table.desc_spec_tbl{border-collapse:collapse}\ntable.desc_spec_tbl td{border:1px solid #dcdcdc}\n.product.description ul{list-style:disc}\n.page-header.type2.header-newskin .main-panel-top{border-bottom:1px solid rgba(248,248,248,0.2)}\n.page-header.type2.header-newskin .main-panel-inner{border:none}\n#phone-hrs{font-size:1.4em!important;color:#636363;padding-right:15px!important}\n#phone-hrs a{color:#08C!important}\n.page-header.type2.header-newskin .custom-block{width:100%!important;text-align:right!important;top:90%!important;right:0!important}\nh2.side-menu-title{margin:0;background-color:#FF7B0D;color:#fff;font-size:13px;font-weight:700;line-height:1;padding:14px 15px;border-radius:5px 5px 0 0;border-bottom:1px solid #ddd}\n.filterproduct-title{color:#fff!important;background-color:#08c!important;padding-left:20px!important}\n.products-grid.columns4{margin-left:0!important;margin-right:0!important}\n.home-side-menu h2.side-menu-title{color:#fff!important}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart:before,.page-header.type2.header-newskin .minicart-wrapper .action.showcart.active:before{font-size:33px;color:#08C!important}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart{padding-right:17px}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart .counter.qty{margin-top:-21px;background-color:#ff5b5b}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart:after{right:-6px}\n.homepage-bar{border:none;background-color:transparent}\n.homepage-bar .col-lg-4{border-color:#fff;padding-top:14px;padding-bottom:15px}\n.homepage-bar [class*=\" porto-icon-\"],.homepage-bar [class^=\"porto-icon-\"]{color:#465157}\n.homepage-bar .text-area{display:inline-block;vertical-align:middle;text-align:left;margin-left:5px}\n.homepage-bar h3{font-size:14px;font-weight:600;color:#465157;line-height:19px}\n.homepage-bar p{font-size:13px;font-weight:300;color:#839199;line-height:19px}\n.owl-theme .owl-dots .owl-dot span{width:13px;height:13px;border-radius:100%;border:solid 2px #d5d5d5;background:none;position:relative;margin:5px 2px}\n#banner-slider-demo-9.owl-bottom-narrow .owl-controls{text-align:left;padding-left:28px}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot span{border:2px solid rgba(0,0,0,0.2);background:none}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot.active span,#banner-slider-demo-9.owl-theme .owl-dots .owl-dot:hover span{border-color:#fff;background:none}\n.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{border-color:#05131c;background:none}\n.owl-theme .owl-controls .owl-dot.active span:before,.owl-theme .owl-dots .owl-dot:hover span:before{content:\"\";position:absolute;left:3px;top:3px;right:3px;bottom:3px;background-color:#05131c;border-radius:100%}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot.active span:before,#banner-slider-demo-9.owl-theme .owl-dots .owl-dot:hover span:before{background-color:#fff}\n.owl-theme .owl-dots .owl-dot.active span:before,.owl-theme .owl-dots .owl-dot:hover span:before{background-color:#05131c}\n.block.block-subscribe.home-sidebar-block{border:none;background-color:#f4f4f4;text-align:center;border-radius:2px!important}\n.block.block-subscribe.home-sidebar-block .block-title strong{font-size:17px;font-weight:700;color:#05131c}\n.block.block-subscribe.home-sidebar-block .block-content p{line-height:24px;letter-spacing:.001em;color:#4a505e;font-size:14px}\n.block.block-subscribe.home-sidebar-block .newsletter .control input{height:45px;border-color:#e4e4e4;padding-right:10px;border-radius:3px;color:#05131c;text-transform:uppercase}\n.block.block-subscribe.home-sidebar-block button.subscribe{width:100%;margin:7px 0 0;height:auto;position:relative;left:auto;right:auto;top:auto;border-radius:5px;background-color:inherit}\n.block.block-subscribe.home-sidebar-block button.subscribe span{height:45px;text-transform:uppercase;background-color:#05131c;border:none;border-radius:3px;font-size:12px;letter-spacing:.005em;color:#fff;font-family:\"Oswald\";line-height:45px;display:block}\n#testimonials-slider-demo-9{padding:22px;border:solid 2px #0188cc;border-radius:2px}\n.cms-index-index .testimonial-author{margin:8px 0 0}\n.cms-index-index .testimonial-author .img-thumbnail{border:none;padding:0;margin-right:20px;border-radius:100%!important;overflow:hidden}\n.cms-index-index blockquote.testimonial{background-color:transparent;color:#62615e;font-size:14px;font-style:normal;line-height:24px;font-weight:400;font-family:\"Open Sans\";margin:0 -10px;padding:15px 30px 15px 43px;width:100%;float:left;margin-top:13px}\n.cms-index-index blockquote.testimonial:before{color:#0188cc;font-family:\"porto\";font-weight:400;font-size:54px}\n.cms-index-index blockquote.testimonial:after{color:#0188cc;font-family:\"porto\";font-weight:400;font-size:54px;right:-2px}\n.cms-index-index .testimonial-author p{line-height:20px}\n.cms-index-index .testimonial-author p >strong{text-transform:uppercase;font-size:13px;font-weight:700;letter-spacing:.0025em;color:#2b2b2d}\n.cms-index-index blockquote.testimonial p{line-height:24px;letter-spacing:.001em}\n#testimonials-slider-demo-6.owl-theme .owl-controls{text-align:left;padding-left:32px}\n.recent-posts .item{padding-top:40px}\n.recent-posts .post-date{display:block;float:none;text-align:left}\n.recent-posts .post-date .long-date{font-size:13px;font-weight:700;color:#0188cc;line-height:22px;text-transform:uppercase}\n.recent-posts .postTitle{min-height:auto}\n.recent-posts .postTitle h2{margin:0}\n.recent-posts .postTitle h2 a{font-size:17px;font-weight:600;line-height:22px;color:#2b2b2d}\n.recent-posts .postContent{margin:0;padding:0}\n.recent-posts .postContent>p{line-height:27px;letter-spacing:.001em}\n.recent-posts a.readmore{display:none}\n.recent-posts .owl-controls{text-align:left}\n.filterproduct-title{background:none;font-size:17px;color:#2b2b2d}\n.filterproduct-title .content{background:none;padding:0}\n.owl-top-narrow .owl-theme .owl-controls .owl-dots{margin-top:0}\n.small-list.products-grid .product-item .product-item-name{font-size:14px;font-weight:400;letter-spacing:.005em}\n.small-list.products-grid .product-item .product-reviews-summary{margin-top:0}\n.shop-features [class*=\" porto-icon-\"],.shop-features [class^=\"porto-icon-\"]{color:#0188cc;border-color:#0188cc}\n.shop-features h3{font-size:14px;font-weight:700}\n.shop-features p{color:#4a505e;line-height:27px;font-weight:400}\n.shop-features a{font-family:\"Oswald\";font-size:12.5px;text-transform:uppercase;color:#2b2b2d;letter-spacing:.0025em;line-height:26px;border:solid 1px #efefef;padding:7px 28px;background:none;box-shadow:none}\n.shop-features a:hover{background:none;color:#2b2b2d;border-color:#efefef}\n.owl-top-narrow{margin:0 -10px}\n.owl-top-narrow .owl-theme .owl-controls{right:8px}\n.owl-top-narrow .owl-carousel .owl-item > .item{padding:10px}\n@media (min-width: 768px) {\n.catalog-category-view .page-main,.catalog-product-view .page-main{padding-top:0}\n}\n.breadcrumbs li.home a{width:15px;display:inline-block;text-indent:30px;overflow:hidden;float:left;position:relative}\n.breadcrumbs li.home a:after{content:\"\\e883\";font-family:\"porto-icons\";position:absolute;left:0;top:0;text-indent:0}\n.sidebar.sidebar-main{position:relative}\n.block-category-list .block-title,.filter-options-title,.filter .filter-current-subtitle{border:none;background-color:transparent;padding:16px 20px 4px;font-size:15px;text-transform:uppercase;font-weight:600;color:#21293c;letter-spacing:.01em}\n.block-category-list .block-title{padding:0 20px 0}\n.block-category-list .block-title strong{font-weight:600}\n.block-category-list .block-content,.filter-options-content{border:none;background-color:transparent;padding:10px 20px 26px;border-bottom:#efefef solid 1px;position:relative;z-index:2;border-radius:0}\n.filter-current .items{border:none;background-color:transparent;position:relative;z-index:2}\n.filter-current .item{padding-left:20px}\n.filter-current .action.remove{right:20px;color:#21293c}\n.filter-actions{border:none;background-color:transparent;border-bottom:#efefef solid 1px;position:relative;z-index:2;padding-right:20px}\n.filter-actions a{color:#858585}\n.filter-options-title:after{content:\"\\f803\";border:none;color:#21293c;font-size:17px;margin-top:-6px}\n.filter-options-title:hover:after{background:none;color:#21293c}\n.active > .filter-options-title:after{content:\"\\f800\"}\n#ln_slider_price.ui-slider-horizontal{height:3px;box-shadow:none}\n#ln_slider_price .ui-slider-handle{width:12px;height:12px;border-radius:100%}\n.sidebar-title{font-size:15px;font-weight:600;color:#21293c;letter-spacing:.01em;margin-bottom:20px;padding-left:20px;padding-right:20px}\n.porto-icon-left-open-huge:before{content:\"\\f802\";color:#21293c}\n.porto-icon-right-open-huge:before{content:\"\\f801\";color:#21293c}\n.sidebar .owl-top-narrow .owl-theme .owl-controls{top:-40px;right:3px}\n.sidebar .owl-top-narrow .owl-theme .owl-controls .owl-nav div :before{color:#21293c}\n.sidebar .product-items .product-item-info .product-item-photo{max-width:25.19%}\n.sidebar .product-items .product-item-details{margin-left:calc(26% + 15px)}\n.sidebar .product-items .product-item-name a{font-size:12px;color:#5b5b5f;font-weight:400}\n.sidebar .sidebar-filterproducts{margin-bottom:30px;padding-bottom:40px;background:none;border-bottom:#efefef solid 1px}\n.sidebar .product-items .product-item .product-reviews-summary{display:block}\n.sidebar-filterproducts.custom-block + h2{font-size:15px!important;text-transform:uppercase;font-weight:600;color:#21293c!important;letter-spacing:.01em;padding:0 20px}\n.sidebar-filterproducts.custom-block + h2 +h5{font-family:\"Open Sans\"!important;font-weight:600!important;font-size:14px!important;color:#7a7d82!important;letter-spacing:.022em;padding:0 20px}\n.sidebar-filterproducts.custom-block + h2 + h5 + p{color:#21293c!important;font-size:15px!important;letter-spacing:.01em;padding:0 20px}\n.sidebar .custom-block{padding:0 20px}\n.category-boxed-banner.owl-theme .owl-controls{bottom:0}\n.page-products .toolbar .limiter{display:block}\n.page-with-filter .toolbar-amount{display:none}\n.full-width-image-banner{height:300px}\n.full-width-image-banner:after{display:none}\n.full-width-image-banner h2{font-size:36px;font-weight:900;letter-spacing:-.025em;text-transform:uppercase;line-height:38px}\n.full-width-image-banner p{font-size:18px;line-height:38px;font-weight:700;text-transform:uppercase}\n.full-width-image-banner .btn-default{font-size:14px;line-height:25px;letter-spacing:.025em;padding:10px 20px;background-color:#010204;color:#fff;font-family:\"Oswald\";text-transform:uppercase;border-radius:2px;margin-top:31px}\n.page-products .toolbar .limiter .limiter-text{display:none}\n.modes-mode.active{border:none;background:none;color:#111}\n.modes-mode,.modes-mode:hover{border:none;background:none;color:#111;width:15px}\n.toolbar select{border:1px solid #e4e4e4;height:37px;color:#7a7d82;font-weight:400;font-size:14px;text-transform:capitalize;padding:0 10px;padding-right:30px;line-height:31px}\n.toolbar-sorter .sorter-action{margin-top:6px;color:#21293c}\n.toolbar-sorter .sorter-action:before{color:#21293c}\n.pages a.page,.pages strong.page,.pages .action{width:32px;line-height:32px}\n.products-grid + .toolbar.toolbar-products{border-top:solid 1px #efefef;padding-top:25px}\n.filterproducts.products .product-item .product-item-photo{border:solid 1px #ececec}\n.product-item .product-reviews-summary{background:none}\n.price-box .price{font-family:\"Oswald\";font-weight:400;font-size:18px;color:#465157}\n.old-price .price{font-size:13px;color:#999}\n.catalog-product-view .sidebar .custom-block{border:none;color:#6b7a83;padding-bottom:0;margin-bottom:33px;background:none}\n.catalog-product-view .sidebar .custom-block-1>div i{color:#08c;border:none;font-size:40px;float:left}\n.catalog-product-view .sidebar .custom-block-1>div{min-height:65px;clear:both;padding:18px 0;border-bottom:solid 1px #dee5e8;margin-bottom:0}\n.catalog-product-view .sidebar .custom-block-1>div:last-child{border-bottom-width:0}\n.block-manufacturer{text-align:center;padding:10px 20px 0;margin-bottom:0}\n.block-manufacturer hr{border-color:#dee5e8;margin-bottom:0}\n.catalog-product-view .sidebar .custom-block-1>div h3{font-size:14px;font-weight:600;line-height:20px;letter-spacing:.005em;color:#6b7a83;margin-left:80px}\n.block.related{padding:0 20px}\n.block .title strong{font-size:15px;font-weight:600;color:#21293c;letter-spacing:.01em;margin-bottom:20px!important;padding-top:0;text-transform:uppercase}\n.block.related .product-items .product-item-actions{display:none}\n.product-info-main .page-title-wrapper h1{font-size:25px;font-weight:600;letter-spacing:-.01em;color:#21293c;margin:3px 0 15px}\n.prev-next-products a{color:#555}\n.product-reviews-summary .reviews-actions a{line-height:20px;font-size:14px;color:#bdbdbd}\n.product-info-main .product.overview{font-size:14px;font-weight:400;letter-spacing:.005em;line-height:27px;border-bottom:solid 1px #dae2e6}\n.product.media{padding-right:12px}\n.fotorama__stage__shaft{border:none}\n.fotorama__nav--thumbs .fotorama__thumb{border-color:#dae2e6}\n.product-options-bottom .price-box .price-container .price,.product-info-price .price-box .price-container .price{font-family:\"Oswald\";font-size:21px;font-weight:700;letter-spacing:.005em}\n.product-info-main .product-info-price .old-price .price-wrapper .price{font-size:16px;color:#2b2b2d;font-weight:400}\n.product-info-main .fieldset > .field.qty,.product-info-main .nested.options-list > .field.qty{position:relative;width:106px}\n.product-info-main .qty.field .control,.product-info-main .qty.field .qty-changer{margin-left:29px}\n.product-info-main .qty.field .qty-changer > a{position:absolute;top:0;left:0;height:43px;width:30px;line-height:41px;text-align:center;margin:0;border-color:#dae2e6}\n.product-info-main .qty.field .qty-changer > a:first-child{left:auto;right:4px}\n.product-info-main .box-tocart .input-text.qty{font-family:\"Oswald\";display:inline-block;vertical-align:middle;height:43px;width:44px!important;font-size:14px;font-weight:400;text-align:center;color:#61605a;margin:0;border-color:#dae2e6}\n.product-info-main .qty.field .qty-changer > a .porto-icon-up-dir:before{content:\"\\f882\"}\n.product-info-main .qty.field .qty-changer > a .porto-icon-down-dir:before{content:\"\\f883\"}\n.catalog-product-view:not(.weltpixel-quickview-catalog-product-view):not(.weltpixel_quickview-catalog_product-view) .box-tocart .action.tocart{height:43px;font-size:14px;letter-spacing:.05em;font-weight:400}\n.box-tocart .action.tocart:before{content:\"\\e87f\";font-family:\"porto-icons\";margin-right:7px;font-size:16px}\n.action.primary,.action.primary:active{font-family:\"Oswald\";letter-spacing:1px;text-transform:uppercase}\n.product-addto-links .action.towishlist,.product-addto-links .action.tocompare,.moved-add-to-links .action.mailto.friend,.product-social-links .action.mailto.friend{width:43px;height:43px;line-height:41px}\n.product.data.items > .item.content{background-color:#fff;box-shadow:none;border:none;border-top:#dae2e6 solid 1px;font-size:14px;font-weight:400;letter-spacing:.005em;line-height:27px}\n.main-upsell-product-detail .block.upsell .title strong{background:none}\n.block.upsell .title{background:none;border-bottom:#e1e1e1 solid 1px;font-weight:700;margin-bottom:16px;padding-bottom:10px;text-transform:uppercase;text-align:left}\n.block.upsell .title strong{font-size:14px;font-weight:400;font-family:\"Oswald\";color:#302e2a}\n.review-ratings .rating-label{display:block}\n.footer-middle{padding:62px 0 42px}\n.footer-ribbon{margin:-78px 0 25px}\n.footer-middle p{font-size:13px;line-height:20px;margin-bottom:0}\n.footer-middle .block .block-title{margin-bottom:15px}\n.footer-middle .block .block-title strong{font-size:16px;font-weight:700;text-transform:uppercase}\n.footer-middle ul.links li,.footer-middle ul.features li{padding:6px 0}\n.footer-container .validation-advice{position:absolute}\n.footer-middle .block.newsletter .form.subscribe{max-width:400px}\n.footer-middle .block.newsletter .control:before{line-height:48px;margin-left:20px}\n.footer-middle .block.newsletter .control{position:relative}\n.footer-middle .block.newsletter .control input{background-color:#fff;color:#686865;height:48px;border:none;font-size:14px;padding-left:10px}\n.footer-middle .block.newsletter .control div.mage-error{position:absolute;bottom:-22px}\n.footer-middle .block.newsletter .action.subscribe{height:48px;text-transform:uppercase;padding:0 22px}\n.footer-middle .block-bottom{border-top:1px solid #3d3d38;text-align:left;padding:27px 0;overflow:hidden}\n.footer-middle .social-icons a{background-image:none;background-color:#33332f;text-indent:0;color:#fff;border-radius:0;font-size:15px;width:37px;height:37px;text-align:center;margin-left:0;margin-right:4px;float:left;line-height:35px}\n.footer-middle .contact-info li:first-child{border-top-width:0}\n.footer-middle .contact-info li{padding:9px 0}\n.footer-middle .contact-info i{color:#e1ddc3!important;font-size:26px;line-height:28px}\n.footer-middle .contact-info p{line-height:1}\n.footer-middle .contact-info b{font-weight:400;font-size:13px;margin-bottom:7px;display:inline-block}\n.footer-bottom{padding:18px 0}\n.footer-bottom address{float:left}\n.footer-bottom .container{position:relative}\n.footer-bottom .container:before{content:\"\";position:absolute;background-color:#3d3d38;left:15px;right:15px;top:-18px;height:1px;width:calc(100% - 30px)}\n@media (max-width: 991px) {\n.footer .block .block-content{margin-bottom:30px}\n.footer-middle .block-content{min-width:auto!important;width:100%}\n}\n@media (max-width: 767px) {\n.navigation.sw-megamenu > .sticky-logo{display:none}\n.page-header.type2.header-newskin .custom-block{display:none}\n.homepage-bar .col-lg-4{text-align:left!important}\n#banner-slider-demo-9{margin-bottom:20px}\n.sidebar.sidebar-main{position:static}\n.page-products .toolbar .limiter{display:none}\n.product.data.items{margin:0}\n.prev-next-products .product-nav.product-next .product-pop{margin:0}\n.prev-next-products .product-nav.product-prev .product-pop{left:-20px}\n.product-info-main .fieldset > .field.qty{margin-bottom:20px}\n.fieldset > .actions{vertical-align:top}\n.catalog-product-view .sidebar .custom-block{padding:0}\n.footer-middle{padding:62px 0 0;margin-bottom:-20px}\n.footer .block .block-content{margin-bottom:30px}\n.footer-middle .block-content{float:none!important}\n.footer-middle .social-icons{overflow:hidden;float:none!important}\n.footer-bottom .custom-block.f-right{margin-left:0}\n}\n.page-products .sorter{float:left}\n.modes{float:right;margin-right:0;margin-left:20px;margin-top:7px}\n.modes-mode:before{content:\"\\e880\";font-size:14px}\n.mode-list:before{content:\"\\e87b\";font-size:14px}\n.products.wrapper ~ .toolbar .limiter{float:left}\n.products.wrapper ~ .toolbar .pages{float:right}\n@media (min-width: 768px) {\n.page-header.type2.header-newskin .minicart-wrapper{background-color:transparent;width:81px;height:41px;text-align:center;box-shadow:none;border-radius:0;border:none}\n.home-side-menu{background-color:transparent;border-color:#dae2e6;border-radius:2px}\n.home-side-menu h2.side-menu-title{color:#465157;font-size:14.5px;font-weight:700;letter-spacing:.001em}\n.navigation.side-megamenu a,.navigation.side-megamenu a:hover{color:#465157}\n.sw-megamenu.navigation.side-megamenu li.level0.parent > a:after{color:#838b90}\n.sw-megamenu.navigation.side-megamenu li.level0.parent:hover > a:after{color:#fff}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu{border:solid 1px #dae2e6;box-shadow:0 3px 15px -2px rgba(0,0,0,0.3);padding:10px 0 10px 15px}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:before,.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:after{border-bottom-style:solid;content:\"\";display:block;height:0;position:absolute;width:0}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:before{border:8px solid;border-color:transparent #fff transparent transparent;z-index:3;left:-16px;top:11px}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:after{border:9px solid;border-color:transparent #dae2e6 transparent transparent;z-index:2;left:-18px;top:10px;right:auto}\n.sw-megamenu.navigation li.level0.fullwidth .submenu li.level1 > a,.sw-megamenu.navigation li.level0.staticwidth .submenu li.level1 > a{font-size:13px;font-weight:700;color:#434d53;letter-spacing:-.001em;margin-top:9px}\n.sw-megamenu.navigation li.level0.fullwidth .submenu a,.sw-megamenu.navigation li.level0.staticwidth .submenu a,.sw-megamenu.navigation li.level0.classic .submenu a{font-size:13px;font-weight:600;color:#696969;line-height:inherit}\n.sidebar.sidebar-main:before{content:\"\";position:absolute;left:0;right:20px;border:solid 1px #dae2e6;top:0;bottom:0;border-radius:2px}\n.product.data.items > .item.title{padding:10px 30px 10px 0}\n.product.data.items > .item.title > .switch{font-size:14px;font-weight:700;color:#818692;text-transform:uppercase;border:none;border-radius:0;line-height:30px;background:none;padding:0}\n.product.data.items > .item.title:not(.disabled) > .switch:focus,.product.data.items > .item.title:not(.disabled) > .switch:hover{background:none;color:#818692}\n.product.data.items > .item.title.active > .switch,.product.data.items > .item.title.active > .switch:focus,.product.data.items > .item.title.active > .switch:hover{color:#21293c;position:relative;border-bottom:#08C solid 2px}\n.product.data.items > .item.content{padding:35px 0 0;margin-top:45px}\n}\n@media (min-widtH: 768px) {\n.page-header .switcher .options .action.toggle{color:#fff}\n}\n.products-grid .product-item .product-item-info .product-item-photo > a:not(.weltpixel-quickview):after{content:\"\";display:block;background-color:#000;opacity:0;width:100%;height:100%;position:absolute;left:0;top:0;z-index:2;visibility:hidden;transition:all .3s}\n.products-grid .product-item .product-item-info:hover .product-item-photo > a:not(.weltpixel-quickview):after{opacity:.1;visibility:visible}\n.page-header.type2.header-newskin.sticky-header .minicart-wrapper .block-minicart:after{right:38px}\n.page-header.type2.header-newskin.sticky-header .minicart-wrapper .block-minicart:before{right:39px}\n.swatch-attribute.size .swatch-option,.swatch-attribute.manufacturer .swatch-option{background:#fff;color:#636363;border-color:#e9e9e9}\n.swatch-option.text{min-width:26px;line-height:18px;padding:3px;height:26px}\n.pages a.page,.pages strong.page,.pages .action{background:transparent;color:#706f6c;font-size:15px;font-weight:600;line-height:30px}\n.pages a.page:hover,.pages a.action:hover{background-color:transparent;color:#706f6c}\n.pages a.action:hover:before{color:#706f6c!important}\n.pages .action{border-color:transparent}\n.product-info-main .product-info-stock-sku{color:#333;font-size:14px;padding-bottom:23px}\n.product-reviews-summary .reviews-actions a{color:#21293c}\n.product-info-main .product-info-stock-sku{color:#21293c}\n.catalog-product-view .sidebar .custom-block.custom-block-1{margin-top:-25px}\n.block-minicart .block-content > .actions > .secondary .action.viewcart{color:#333;font-weight:500;font-family:\"Oswald\"}\n.cms-index-index .single-images{margin-bottom:5px}\n.product-item .rating-summary .rating-result > span:before{color:#575f68}\n@media (max-width: 767px) {\n.block-category-list .block-title,.block-category-list .block-content,.sidebar-title,.sidebar .custom-block,.sidebar-filterproducts.custom-block + h2,.sidebar-filterproducts.custom-block + h2 +h5,.sidebar-filterproducts.custom-block + h2 + h5 + p{padding-left:0;padding-right:0}\n}\n.page-header .switcher .options .action.toggle{color:#bde1f5}\n.page-wrapper > .breadcrumbs{margin-bottom:0}\n.products-grid .product-item-details .product-item-actions .tocart{text-transform:uppercase;font-size:12.53px;font-family:\"Oswald\";font-weight:400;letter-spacing:.025em;color:#fff;line-height:30px;background-color:#08c;border-color:#08c;}\n.products-grid .product-item-details .product-item-actions .tocart:hover{background-color:#006496!important;border-color:#006496!important;color:#fff}\n.product-item .tocart:before{content:\"\\e87f\";font-size:17px;vertical-align:middle}\n.product-social-links .action.towishlist:before,.product-addto-links .action.towishlist:before,.block-bundle-summary .action.towishlist:before,.product-item .action.towishlist:before,.table-comparison .action.towishlist:before{content:\"\\e889\"}'\n ),\n array(\n 'version' => '0.0.6',\n 'path' => 'persistent/options/lifetime',\n 'value' => '14400'\n ),\n );\n }", "public function createConfig()\n\t{\n\t}", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }", "protected function checkExtbaseMappings(): void\n {\n $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n\n $mappings = [\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Image' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\AttributeFile' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Category' => 'sys_category',\n ];\n\n foreach ($mappings as $class => $mapping) {\n if (empty($configuration['persistence']['classes'][$class]['mapping']['tableName'])) {\n $configuration['persistence']['classes'][$class]['mapping']['tableName'] = $mapping;\n $configurationManager->setConfiguration($configuration);\n }\n }\n\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n }", "protected function getDefaultMapping()\n\t{\n\t\treturn array(\n\t\t\t'subscription' => array(\n\t\t\t\t2 => 'subscription.interval',\n\t\t\t\t3 => 'subscription.datenext',\n\t\t\t\t4 => 'subscription.dateend',\n\t\t\t),\n\t\t\t'address' => array(\n\t\t\t\t2 => 'subscription.base.address.type',\n\t\t\t\t3 => 'subscription.base.address.salutation',\n\t\t\t\t4 => 'subscription.base.address.company',\n\t\t\t\t5 => 'subscription.base.address.vatid',\n\t\t\t\t6 => 'subscription.base.address.title',\n\t\t\t\t7 => 'subscription.base.address.firstname',\n\t\t\t\t8 => 'subscription.base.address.lastname',\n\t\t\t\t9 => 'subscription.base.address.address1',\n\t\t\t\t10 => 'subscription.base.address.address2',\n\t\t\t\t11 => 'subscription.base.address.address3',\n\t\t\t\t12 => 'subscription.base.address.postal',\n\t\t\t\t13 => 'subscription.base.address.city',\n\t\t\t\t14 => 'subscription.base.address.state',\n\t\t\t\t15 => 'subscription.base.address.countryid',\n\t\t\t\t16 => 'subscription.base.address.languageid',\n\t\t\t\t17 => 'subscription.base.address.telephone',\n\t\t\t\t18 => 'subscription.base.address.telefax',\n\t\t\t\t19 => 'subscription.base.address.email',\n\t\t\t\t20 => 'subscription.base.address.website',\n\t\t\t\t21 => 'subscription.base.address.longitude',\n\t\t\t\t22 => 'subscription.base.address.latitude',\n\t\t\t),\n\t\t\t'product' => array(\n\t\t\t\t2 => 'subscription.base.product.type',\n\t\t\t\t3 => 'subscription.base.product.stocktype',\n\t\t\t\t4 => 'subscription.base.product.suppliercode',\n\t\t\t\t5 => 'subscription.base.product.prodcode',\n\t\t\t\t6 => 'subscription.base.product.productid',\n\t\t\t\t7 => 'subscription.base.product.quantity',\n\t\t\t\t8 => 'subscription.base.product.name',\n\t\t\t\t9 => 'subscription.base.product.mediaurl',\n\t\t\t\t10 => 'subscription.base.product.price',\n\t\t\t\t11 => 'subscription.base.product.costs',\n\t\t\t\t12 => 'subscription.base.product.rebate',\n\t\t\t\t13 => 'subscription.base.product.taxrate',\n\t\t\t\t14 => 'subscription.base.product.status',\n\t\t\t\t15 => 'subscription.base.product.position',\n\t\t\t\t16 => 'subscription.base.product.attribute.type',\n\t\t\t\t17 => 'subscription.base.product.attribute.code',\n\t\t\t\t18 => 'subscription.base.product.attribute.name',\n\t\t\t\t19 => 'subscription.base.product.attribute.value',\n\t\t\t),\n\t\t);\n\t}", "public function maybe_migrate_options() {\n \tif ( get_option( 'mylisting_maps', null ) !== null ) {\n \t\treturn;\n \t}\n\n \t// mlog()->note( 'Migrating map service settings' );\n \t$config = $this->get_config();\n \t$cleanup = [];\n\n \t$provider = get_option( 'options_general_maps_platform', null );\n \tif ( ! empty( $provider ) ) {\n \t\t$config['provider'] = $provider;\n \t}\n\n \t// Google Maps\n \t$config['gmaps_api_key'] = get_option( 'options_general_google_maps_api_key', '' );\n \t$config['gmaps_lang'] = get_option( 'options_general_google_maps_language', 'default' );\n \t$config['gmaps_types'] = get_option( 'options_general_autocomplete_types', 'geocode' );\n \t$config['gmaps_locations'] = (array) get_option( 'options_general_autocomplete_locations', [] );\n\n \t// Google Maps skins\n \t$i = 0;\n \t$config['gmaps_skins'] = [];\n \twhile (\n \t\t( $skinkey = get_option( 'options_general_google_maps_custom_skins_'.$i.'_name' ) ) &&\n \t\t( $skinval = get_option( 'options_general_google_maps_custom_skins_'.$i.'_json' ) )\n \t) {\n \t\tif ( $skinval = json_decode( $skinval ) ) {\n \t\t\t$config['gmaps_skins'][ $skinkey ] = json_encode( $skinval );\n \t\t}\n\n \t\t$cleanup[] = 'options_general_google_maps_custom_skins_'.$i.'_name';\n \t\t$cleanup[] = 'options_general_google_maps_custom_skins_'.$i.'_json';\n \t\t$i++;\n \t}\n\n \t// Mapbox\n \t$config['mapbox_api_key'] = get_option( 'options_general_mapbox_api_key', '' );\n \t$config['mapbox_lang'] = get_option( 'options_general_mapbox_language', 'default' );\n \t$config['mapbox_types'] = (array) get_option( 'options_general_mapbox_autocomplete_types', [] );\n \t$config['mapbox_locations'] = (array) get_option( 'options_general_mapbox_autocomplete_locations', [] );\n\n \t// Mapbox skins\n \t$i = 0;\n \t$config['mapbox_skins'] = [];\n \twhile (\n \t\t( $skinkey = get_option( 'options_general_mapbox_custom_skins_'.$i.'_name' ) ) &&\n \t\t( $skinval = get_option( 'options_general_mapbox_custom_skins_'.$i.'_url' ) )\n \t) {\n \t\tif ( $jsonskin = json_decode( $skinval ) ) {\n \t\t\t$config['mapbox_skins'][ $skinkey ] = json_encode( $jsonskin );\n \t\t} else {\n \t\t\t$config['mapbox_skins'][ $skinkey ] = $skinval;\n \t\t}\n\n \t\t$cleanup[] = 'options_general_mapbox_custom_skins_'.$i.'_name';\n \t\t$cleanup[] = 'options_general_mapbox_custom_skins_'.$i.'_url';\n \t\t$i++;\n \t}\n\n \t// save config\n \t$this->set_config( $config );\n\n \t// cleanup old option keys\n \t$cleanup[] = 'options_general_maps_platform';\n \t$cleanup[] = 'general_google_maps_api_key';\n \t$cleanup[] = 'options_general_google_maps_api_key';\n \t$cleanup[] = 'options_general_google_maps_language';\n \t$cleanup[] = 'options_general_autocomplete_types';\n \t$cleanup[] = 'options_general_autocomplete_locations';\n \t$cleanup[] = 'options_general_mapbox_api_key';\n \t$cleanup[] = 'options_general_mapbox_language';\n \t$cleanup[] = 'options_general_mapbox_autocomplete_types';\n \t$cleanup[] = 'options_general_mapbox_autocomplete_locations';\n \t$cleanup[] = 'options_general_mapbox_custom_skins';\n \t$cleanup[] = 'options_general_google_maps_custom_skins';\n\n \tforeach ( $cleanup as $option_name ) {\n \t\tdelete_option( $option_name );\n \t\tdelete_option( '_'.$option_name );\n \t}\n }", "private function deployConfig()\n {\n $config = \\SmConfig::$configTable;\n $currentConfig = $this->_db->fetchAll('config');\n\n foreach ($config as $k => $v) {\n $exists = false;\n foreach ($currentConfig as $c) {\n if ($c['c_name'] == $k) {\n $exists = true;\n break;\n }\n }\n if (!$exists) {\n $this->_db->insert('config', ['c_name' => $k, 'c_value' => $v]);\n }\n }\n }", "public function generateConfigCache()\n\t{\n\t\t// Generate the class/template laoder cache file\n\t\t$objCacheFile = new \\File('system/cache/config/autoload.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/autoload.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the module loader cache file\n\t\t$objCacheFile = new \\File('system/cache/config/modules.php', true);\n\t\t$objCacheFile->write(\"<?php\\n\\n\");\n\n\t\t$objCacheFile->append(sprintf(\"static::\\$active = %s;\\n\", var_export(\\ModuleLoader::getActive(), true)));\n\t\t$objCacheFile->append(sprintf(\"static::\\$disabled = %s;\", var_export(\\ModuleLoader::getDisabled(), true)));\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the config cache file\n\t\t$objCacheFile = new \\File('system/cache/config/config.php', true);\n\t\t$objCacheFile->write('<?php '); // add one space to prevent the \"unexpected $end\" error\n\n\t\tforeach (\\ModuleLoader::getActive() as $strModule)\n\t\t{\n\t\t\t$strFile = 'system/modules/' . $strModule . '/config/config.php';\n\n\t\t\tif (file_exists(TL_ROOT . '/' . $strFile))\n\t\t\t{\n\t\t\t\t$objCacheFile->append(static::readPhpFileWithoutTags($strFile));\n\t\t\t}\n\t\t}\n\n\t\t// Close the file (moves it to its final destination)\n\t\t$objCacheFile->close();\n\n\t\t// Generate the page mapping array\n\t\t$arrMapper = array();\n\t\t$objPages = \\PageModel::findPublishedRootPages();\n\n\t\tif ($objPages !== null)\n\t\t{\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$strBase = ($objPages->dns ?: '*');\n\n\t\t\t\tif ($objPages->fallback)\n\t\t\t\t{\n\t\t\t\t\t$arrMapper[$strBase . '/empty.fallback'] = $strBase . '/empty.' . $objPages->language;\n\t\t\t\t}\n\n\t\t\t\t$arrMapper[$strBase . '/empty.' . $objPages->language] = $strBase . '/empty.' . $objPages->language;\n\t\t\t}\n\t\t}\n\n\t\t// Generate the page mapper file\n\t\t$objCacheFile = new \\File('system/cache/config/mapping.php', true);\n\t\t$objCacheFile->write(sprintf(\"<?php\\n\\nreturn %s;\\n\", var_export($arrMapper, true)));\n\t\t$objCacheFile->close();\n\n\t\t// Add a log entry\n\t\t$this->log('Generated the config cache', __METHOD__, TL_CRON);\n\t}", "protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }", "function getAppConfig() {\n $appConfig = array(\n 'images' => array(\n 'thumbnail' => array (\n 'default_sizes' => array (600, 300, 150),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/thumbnail/\"\n ),\n 'banner' => array (\n 'default_sizes' => array(1000, 500),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/banner/\"\n )\n )\n );\n \n return $appConfig;\n }", "public function getJsonConfig()\n {\n /* @var $product \\Magento\\Catalog\\Model\\Product */\n $product = $this->getProduct();\n\n if (!$this->hasOptions()) {\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat()\n ];\n return $this->_jsonEncoder->encode($config);\n }\n\n $tierPrices = [];\n $tierPricesList = $product->getPriceInfo()->getPrice('tier_price')->getTierPriceList();\n foreach ($tierPricesList as $tierPrice) {\n $tierPrices[] = $tierPrice['price']->getValue();\n }\n\n //qxd testing lo de los productos */\n\n $qxd_config = null;\n\n /*$writer = new \\Zend\\Log\\Writer\\Stream(BP . '/var/log/configurable.log');\n $logger = new \\Zend\\Log\\Logger();\n $logger->addWriter($writer);\n $logger->info(print_r($product->getTypeId(),true));\n $logger->info(print_r('nuevo',true));*/\n\n switch ($product->getTypeId()) {\n case 'bundle': \n //$bundle_block= $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Catalog\\Product\\View\\Type\\Bundle');\n\n //$qxd_config = $bundle_block->getJsonConfig();\n break;\n\n case 'configurable':\n\n $qxd_config = $price_config = json_decode($product->getPriceRangeConfig(), true); \n /*$configurable_block= $this->getLayout()->createBlock('Magento\\ConfigurableProduct\\Block\\Product\\View\\Type\\Configurable');\n\n $configurable_config = $configurable_block->getJsonConfig();\n if($configurable_config){\n $configurable_config = json_decode($configurable_config, true);\n $options = $configurable_config[\"optionPrices\"];\n\n $first_option = reset($options);\n $higherRegular = $first_option[\"oldPrice\"]['amount'];\n $lowerRegular = $first_option[\"oldPrice\"]['amount'];\n $regularPrice = $first_option[\"oldPrice\"]['amount'];\n $specialPrices = [];\n\n $hasSameRegularPrice = true;\n $hasSameSpecialPrice = true;\n\n $hasSpecialPrice = false;\n foreach ($options as $price) {\n //regular\n\n //get higher\n if($price[\"oldPrice\"]['amount'] > $higherRegular)\n $higherRegular = $price[\"oldPrice\"]['amount'];\n\n //get lower\n if($price[\"oldPrice\"]['amount'] < $lowerRegular)\n $lowerRegular = $price[\"oldPrice\"]['amount'];\n\n if($price[\"oldPrice\"]['amount'] != $regularPrice)\n $hasSameRegularPrice = false;\n\n\n //special\n\n if($price[\"finalPrice\"]['amount'] < $price[\"oldPrice\"]['amount']){\n $hasSpecialPrice = true;\n $specialPrices[] = $price[\"finalPrice\"]['amount'];\n }\n }\n\n if(empty($specialPrices)){\n $qxd_config['hasSpecialPrice'] = false;\n }else{\n $qxd_config['hasSpecialPrice'] = true;\n sort($specialPrices);\n $hasSameSpecialPrice = count(array_unique($specialPrices)) == 1;\n $qxd_config['rangeSpecial'] = [\"lower\" => $specialPrices[0], \"higher\" => $specialPrices[count($specialPrices) - 1]];\n \n }\n\n $qxd_config['rangeRegular'] = [\"lower\" => $lowerRegular, \"higher\" => $higherRegular];\n $qxd_config['hasSameSpecialPrice'] = $hasSameSpecialPrice;\n $qxd_config['hasSameRegularPrice'] = $hasSameRegularPrice; \n\n\n }*/\n break;\n \n default:\n break;\n }\n\n $qxd_price = [\n 'amount' => 0,\n 'adjustments' => [],\n 'data' => $qxd_config\n ];\n\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat(),\n 'prices' => [\n 'oldPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(),\n 'adjustments' => []\n ],\n 'basePrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount(),\n 'adjustments' => []\n ],\n 'finalPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(),\n 'adjustments' => []\n ]\n ],\n 'idSuffix' => '_clone',\n 'tierPrices' => $tierPrices,\n 'qxd_price' => $qxd_price\n ];\n\n $responseObject = new \\Magento\\Framework\\DataObject();\n $this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);\n if (is_array($responseObject->getAdditionalOptions())) {\n foreach ($responseObject->getAdditionalOptions() as $option => $value) {\n $config[$option] = $value;\n }\n }\n\n return $this->_jsonEncoder->encode($config);\n }", "public function getModuleConfiguration();", "function phpgwapi_upgrade0_9_14_001()\n\t{\n\t\t// column config_app was added to table phpgw_config (which places it as last column),\n\t\t// but in the tables_current.inc.php it was added as first column.\n\t\t// When setup / schemaproc wants to do the AlterColum it recreates the table for pgSql,\n\t\t// as pgSql could not change the column-type. This recreation is can not be based on \n\t\t// tables_current, but on running tables_baseline throught all update-scripts.\n\t\t// Which gives at the end two different versions of the table on new or updated installs.\n\t\t// I fix it now in the (wrong) order of the tables_current, as some apps might depend on!\n\n\t\t$confs = array();\n\t\t$GLOBALS['phpgw_setup']->oProc->query(\"SELECT * FROM phpgw_config\");\n\t\twhile ($GLOBALS['phpgw_setup']->oProc->next_record())\n\t\t{\n\t\t\t$confs[] = array(\n\t\t\t\t'config_app' => $GLOBALS['phpgw_setup']->oProc->f('config_app'),\n\t\t\t\t'config_name' => $GLOBALS['phpgw_setup']->oProc->f('config_name'),\n\t\t\t\t'config_value' => $GLOBALS['phpgw_setup']->oProc->f('config_value')\n\t\t\t);\n\t\t}\n\t\t$GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_config');\n\n\t\t$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_config',array(\n\t\t\t'fd' => array(\n\t\t\t\t'config_app' => array('type' => 'varchar', 'precision' => 50),\n\t\t\t\t'config_name' => array('type' => 'varchar', 'precision' => 255, 'nullable' => false),\n\t\t\t\t'config_value' => array('type' => 'text')\n\t\t\t),\n\t\t\t'pk' => array(),\n\t\t\t'fk' => array(),\n\t\t\t'ix' => array(),\n\t\t\t'uc' => array('config_name')\n\t\t));\n\n\t\tforeach($confs as $conf)\n\t\t{\n\t\t\t$GLOBALS['phpgw_setup']->oProc->query(\n\t\t\t\t\"INSERT INTO phpgw_config (config_app,config_name,config_value) VALUES ('\".\n\t\t\t\t$conf['config_app'].\"','\".$conf['config_name'].\"','\".$conf['config_value'].\"')\");\n\t\t}\n\n\t\t$GLOBALS['phpgw_setup']->oProc->query(\"UPDATE languages SET available='Yes' WHERE lang_id='cs'\");\n\n\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.002';\n\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t}", "abstract protected function _updateConfiguration();", "public function getServiceConfig()\n {\n return array(\n 'factories' => array(\n 'Newsletter\\Model\\AdminConfigTable' => function($sm) {\n $tableGateway = $sm->get('AdminConfigTableGateway');\n $table = new AdminConfigTable($tableGateway);\n return $table;\n\t\t\t\t },\n\t\t\t\t 'AdminConfigTableGateway' => function ($sm) {\n $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n $resultSetPrototype = new ResultSet();\n $resultSetPrototype->setArrayObjectPrototype(new Config());\n return new TableGateway('admin_config', $dbAdapter, null, $resultSetPrototype);\n\t\t\t\t },\n\t\t\t\t 'Newsletter\\Model\\EmailsubscriptionTable' => function($sm) {\n $tableGateway = $sm->get('EmailsubscriptionTableGateway');\n $table = new EmailsubscriptionTable($tableGateway);\n return $table;\n\t\t\t\t },\n\t\t\t\t 'EmailsubscriptionTableGateway' => function ($sm) {\n $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n $resultSetPrototype = new ResultSet();\n $resultSetPrototype->setArrayObjectPrototype(new Emailsubscription());\n return new TableGateway('email_subscription', $dbAdapter, null, $resultSetPrototype);\n\t\t\t\t },\n\t\t\t ),\n\t\t\t);\n\t\t }", "public function exportConfiguration() {}", "public function actionGenerateModuleConfig()\n {\n $detectedModules = $this->actionDetectModules();\n\n $modules = Module::model()->findAll(new CDbCriteria(array(\n 'order' => 'name',\n 'condition' => 'enabled = true',\n )));\n $config = array();\n foreach ($modules as $module) {\n if (!isset($detectedModules[$module->name])) continue;\n $config[$module->name] = array(\n 'class' => $detectedModules[$module->name]\n );\n }\n $str = \"<?php\\nreturn \" . var_export($config, true) . \"\\n?>\";\n file_put_contents(Yii::getPathOfAlias('runtime.cache') . '/modules.php', $str);\n }", "public static function returnExtConfDefaults() {}", "protected function getMasterpassConfig()\n {\n return Mage::getModel('expercash/masterpass_config');\n }", "public function buildClassAliasMapFile() {}", "public function getServiceConfig()\n {\n return array(\n 'factories' => array(\n 'dbAdapter' => function($sm) {\n $config = $sm->get('config');\n $config = $config['db'];\n $dbAdapter = new DbAdapter($config);\n return $dbAdapter;\n },\n 'Plans\\Model\\DatabaseSql' => function($sm) {\n $dbAdapter = $sm->get('dbAdapter');\n $tablePlan = new DatabaseSql($dbAdapter);\n return $tablePlan; \n }, \n ),\n );\n }", "public function createLocalConfigurationFromFactoryConfiguration() {}", "protected function createVariantsMap()\n {\n return $this->variantsMap;\n }", "abstract protected function getMartyConfig(): array;", "protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }", "public function testUseMapping()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $cfg->setMapping(\"item\", ANAX_INSTALL_PATH . \"/test/config/test1.php\");\n $config = $cfg->load(\"item\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayHasKey(\"key1\", $config[\"config\"]);\n $this->assertContains(\"value1\", $config[\"config\"]);\n }", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "protected function _initPhpConfig()\n {\n }", "public function getConfigurationsMap()\n {\n $sel = $this->getAllConfigurations();\n $arr = array();\n foreach ($sel as $cf)\n $arr[$cf->identifier] = $cf->identifier;\n \n return $arr;\n }", "public function getServiceConfig()\n {\n \treturn array(\n\t\t\t'factories' => array(\n\t\t\t\t\t\n\t\t\t\t//models\n\t\t\t\t'Api\\Model\\Key' => function($sm) {\n\t\t\t\t\t$hash = $sm->get('Application\\Model\\Hash');\n\t\t\t\t\t$user = $sm->get('Api\\Model\\Users');\n\t\t\t\t\treturn new Key($hash, $user);\n\t\t\t\t},\t \n\t\t\t\t'Api\\Model\\Projects' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\treturn new Projects($adapter, $db);\n\t\t\t\t}, \n\t\t\t\t'Api\\Model\\Tasks' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\treturn new Tasks($adapter, $db);\n\t\t\t\t},\t \n\t\t\t\t'Api\\Model\\Users' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\t$role = $sm->get('Api\\Model\\Roles');\n\t\t\t\t\t$ud = $sm->get('Application\\Model\\User\\Data');\n\t\t\t\t\treturn new Users($adapter, $db, $role, $ud);\n\t\t\t\t},\t \n\t\t\t\t'Api\\Model\\Companies' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\treturn new Companies($adapter, $db);\n\t\t\t\t},\t \n\t\t\t\t'Api\\Model\\Options' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\treturn new Options($adapter, $db);\n\t\t\t\t},\t \n\t\t\t\t'Api\\Model\\Roles' => function($sm) {\n\t\t\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\t\t$db = $sm->get('SqlObject');\n\t\t\t\t\t$permission = $sm->get('Application\\Model\\Permissions');\n\t\t\t\t\treturn new Roles($adapter, $db, $permission);\n\t\t\t\t},\n\n\t\t\t\t//events\n\t\t\t\t'Api\\Event\\UserDataEvent' => function($sm) {\n\t\t\t\t\treturn new UserDataEvent(); \n\t\t\t\t},\n\t\t\t\t'Api\\Event\\ViewEvent' => function($sm) {\n\t\t\t\t\t$auth = $sm->get('AuthService');\n\t\t\t\t\t$user = $sm->get('Api\\Model\\Users');\n\t\t\t\t\t\n\t\t\t\t\treturn new ViewEvent($auth->getIdentity(), $user); \n\t\t\t\t},\n\t\t\t),\n \t);\n }", "abstract public function getConfig();", "public function getConfig()\n {\n return Mage::helper(\"meanbee_osd/config\");\n }", "public function getServiceConfiguration();", "protected static function config()\n {\n return [\n 'view' => ['viewRenderClass' => 'Ice:Php', 'layout' => ''],\n 'input' => [\n 'resources' => [\n 'default' => [\n 'modules' => [\n 'Ice' => [\n 'vendor_js' => [\n 'path' => 'js/vendor/',\n 'js' => ['-modernizr-2.8.3.min.js'],\n 'css' => [],\n 'isCopy' => false,\n ],\n 'vendor_css' => [\n 'path' => 'css/vendor/',\n 'js' => [],\n 'css' => ['empty.css'],\n 'isCopy' => false,\n ],\n 'vendor' => [\n 'path' => 'vendor/',\n 'js' => [],\n 'css' => [],\n 'isCopy' => false,\n ],\n 'common' => [\n 'path' => '',\n 'js' => [],\n 'css' => ['css/flags.css', 'css/preloader.css'],\n 'isCopy' => false,\n ],\n 'module' => [\n 'path' => 'Ice/',\n 'js' => ['Helper/String.js', 'Ui/Form.js', 'Ui/Menu.js', 'Ui/Data.js'],\n 'css' => [],\n 'isCopy' => false,\n ],\n ],\n ],\n// 'vendors' => [\n// 'jquery/jquery-ui' => [\n// 'jquery' => [\n// 'path' => '/',\n// 'js' => ['external/jquery/jquery.js', '-jquery-ui.min.js'],\n// 'css' => ['-jquery-ui.min.css', '-jquery-ui.structure.min.css', '-jquery-ui.theme.min.css'],\n// 'isCopy' => true,\n// ],\n// ],\n// 'twbs/bootstrap' => [\n// 'bootstrap' => [\n// 'path' => 'dist/',\n// 'js' => ['-js/bootstrap.min.js'],\n// 'css' => ['-css/bootstrap.min.css', '-css/bootstrap-theme.min.css'],\n// 'isCopy' => true,\n// 'css_replace' => ['url(../', 'url('],\n// ],\n// ],\n// ],\n ],\n ],\n 'js' => ['default' => []],\n 'css' => ['default' => []],\n 'routeName' => ['default' => ''],\n 'context' => ['default' => '/resource/']\n ],\n 'ttl' => 3600\n ];\n }", "public function configM4() {\n $ALIAS = strtoupper($this->alias);\n ob_start();\n ?>\ndnl Koda, <?=date(\"Y-m-d H:i:s\")?>.\n\nPHP_ARG_WITH(<?=$this->alias?>, for <?=$this->alias?> support,\n[ --with-<?=$this->alias?> Include <?=$this->alias?> support])\n\nif test \"$PHP_<?=$ALIAS?>\" != \"no\"; then\n\tPHP_ADD_INCLUDE(.)\n<? foreach($this->includes as $include): ?>\n PHP_ADD_INCLUDE(<?=$include?>)\n<? endforeach ?>\n\n PHP_NEW_EXTENSION(<?=$this->alias?>, \"<?=implode(\" \", $this->sources)?>\", $ext_shared)\nfi\n<?php\n return ob_get_clean();\n }", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "public function testComAdobeGraniteCompatrouterImplSwitchMappingConfig()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.compatrouter.impl.SwitchMappingConfig';\n\n $crawler = $client->request('POST', $path);\n }", "abstract protected function defineConfiguration();", "abstract protected function getConfig();", "protected function _initOldFieldsMap()\n {\n $this->_oldFieldsMap = Mage::helper('catalog')->getOldFieldMap();\n return $this;\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 }", "public function getConfMap()\n {\n return $this->confMap;\n }", "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}", "public function getServiceConfig() {\n return array(\n 'aliases' => array(\n 'Zend\\Authentication\\AuthenticationService' => 'dao.authentication.service'\n ),\n 'factories' => array(\n 'dao.authentication.simple' => new SimpleAuthService(),\n 'dao.authentication.god' => new GodAuthService(),\n 'dao.authentication.service' => new AuthenticationService()\n )\n );\n }", "private function prepareConfiguration()\n {\n $configuration = array();\n\n foreach ($this->configProvider->getIds() as $entityConfigId) {\n $className = $entityConfigId->getClassName();\n $fields = $this->configProvider->filter(\n function (ConfigInterface $fieldConfig) {\n return $fieldConfig->is('available_in_template');\n },\n $className\n );\n\n if (count($fields)) {\n $configuration[$className] = array();\n foreach ($fields as $fieldConfig) {\n $configuration[$className][] = 'get' . strtolower($fieldConfig->getId()->getFieldName());\n }\n }\n }\n\n return $configuration;\n }", "function virtualname_getConfigArray(){\n //INIT MODULE\n global $vname_admin, $vname_domains, $vname_nameservers, $vname_contacts, $vname_install;\n virtualname_init();\n //CHECK INSTALLATION\n $virtualnameInstall = $vname_install->check_install();\n //GET LANGUAGES\n $adminID = $_SESSION['adminid'];\n $configLang = $vname_admin->get_config_lang($adminID);\n //GET CUSTOM CLIENT\n $client_custom_fields = $vname_admin->get_config_clients_customfields();\n //GET ALL CUSTOM\n $custom_buttons = $vname_admin->custom_buttons($virtualnameInstall, $configLang);\n $configarray = array(\n 'FriendlyName' => array('Type' => 'System', 'Value'=> 'Virtualname - TCpanel', 'Description' =>'Virtualname - TCpanel'),\n 'Description' => array('Type' => 'System', 'Value'=> $configLang['name'].' <a href=\\'http://whmcs.virtualname.net\\' target=\\'_blank\\'>Virtualname</a> - v.'.$vname_admin->module_version, 'Description' =>'Module Domains Administration Virtualname - WHMCS'),\n 'Virtualname - TCpanel' => array('Type' => 'display', 'Description' => $configLang['description']),\n 'Module-Version' => array('Type' => 'display', 'Description' => 'v'.$vname_admin->module_version, 'value'=>$vname_admin->module_version, 'FriendlyName' => $configLang['moduleVersion']),\n 'APIKey' => array('Type'=> 'text', 'Description' => '', 'Size' => '50', 'FriendlyName' => 'APIKey'),\n 'autoRenew' => array('Type' => 'yesno', 'Description' => $configLang['autoRenew'], 'FriendlyName' => $configLang['autoRenewField']),\n 'hideicnumber' => array('Type' => 'yesno', 'Description' => $configLang['hideicnumber'], 'FriendlyName' => $configLang['hideicnumberField']),\n 'freeRegisterDomains' => array('Type' => 'yesno', 'Description' => $configLang['freeRegisterDomains'], 'FriendlyName' => $configLang['freeRegisterDomainsField']),\n 'freeRenewDomains' => array('Type' => 'yesno', 'Description' => $configLang['freeRenewDomains'], 'FriendlyName' => $configLang['freeRenewDomainsField']),\n 'templateVersion' => array('Type' => 'dropdown', 'Description' => $configLang['templateVersion'], 'Options' => 'six,five', 'Default' => 'six', 'FriendlyName' => $configLang['templateVersionField']),\n 'secureRenovation' => array('Type' => 'dropdown', 'Description' => $configLang['secureRenovation'], 'Options' => 'Disabled,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24', 'Default' => 'Disabled', 'FriendlyName' => $configLang['secureRenovationField'])\n );\n //CHECK IF TAX_ID CAN BE USED\n $check_enable_tax_id = $vname_admin->check_enable_customer_tax_id();\n if($check_enable_tax_id)\n $configarray = array_merge($configarray, array('taxid' => array('Type' => 'yesno', 'Description' => $configLang['taxid'], 'FriendlyName' => $configLang['taxidField'])));\n $configarray = array_merge($configarray, array(\n 'defaultvatnumber' => array('Type' => 'dropdown', 'Description' => $configLang['defaultvatnumber'], 'Options' => $client_custom_fields, 'Default' => 'Disabled', 'FriendlyName' => $configLang['defaultvatnumberField']),\n 'disablelocktlds' => array('Type' => 'textarea', 'Description' => $configLang['disablelocktlds'], 'Rows' => '3', 'Cols' => '50', 'Default' => 'es com.es org.es edu.es', 'FriendlyName' => $configLang['disablelocktldsField']),\n 'outboundTransferMailing' => array('Type' => 'yesno', 'Description' => $configLang['outboundTransferMailing'], 'FriendlyName' => $configLang['outboundTransferMailingField']),\n 'defaultNameserversError' => array('Type' => 'yesno', 'Description' => $configLang['defaultNameserversError'], 'FriendlyName' => $configLang['defaultNameserversErrorField']),\n 'disableAdvanceContacts' => array('Type' => 'yesno', 'Description' => $configLang['disableAdvanceContacts'], 'FriendlyName' => $configLang['disableAdvanceContactsField']),\n 'defaultDomainsMail' => array('Type' => 'text', 'Description' => $configLang['addDefaultDomainsMail'], 'FriendlyName' => $configLang['addDefaultDomainsMailField']),\n 'defaultAdminRoles' => array('Type' => 'dropdown', 'Description' => $configLang['defaultAdminRoles'], 'Options' => $custom_buttons['roles'], 'Default' => 'six', 'FriendlyName' => $configLang['defaultAdminRolesField']),\n 'validationNewClient' => array('Type' => 'yesno', 'Description' => $configLang['validationNewClient'], 'FriendlyName' => $configLang['validationNewClientField']),\n 'disableContactVerification'=> array('Type' => 'yesno', 'Description' => $configLang['disableContactVerification'], 'FriendlyName' => $configLang['disableContactVerificationField']),\n 'enableDomainRecords' => array('Type' => 'yesno', 'Description' => $configLang['enableDomainRecords'], 'FriendlyName' => $configLang['enableDomainRecordsField']),\n 'enableDomainLifecycle' => array('Type' => 'yesno', 'Description' => $configLang['enableDomainLifecycle'], 'FriendlyName' => $configLang['enableDomainLifecycleField']),\n 'devMode' => array('Type' => 'yesno', 'Description' => $configLang['devMode'], 'FriendlyName' => $configLang['devModeField']),\n 'debug' => array('Type' => 'yesno', 'Description' => $configLang['debug'], 'FriendlyName' => $configLang['debugField']),\n ));\n if($custom_buttons['warnings'])\n $configarray['check-warnings'] = array('Type' => 'display', 'Description' => $custom_buttons['warnings'], 'FriendlyName' => $configLang['checkWarnings']);\n if($custom_buttons['crons'])\n $configarray['crons'] = array('Type' => 'display', 'Description' => $custom_buttons['crons'], 'FriendlyName' => $configLang['crons']);\n if($custom_buttons['errors'])\n $configarray['errors'] = array('Type' => 'display', 'Description' => $custom_buttons['errors'], 'FriendlyName' => $configLang['errors']);\n if($custom_buttons['update'])\n $configarray['update-module'] = array('Type' => 'display', 'Description' => $custom_buttons['update'], 'FriendlyName' => $configLang['updateModule']);\n $configarray['install-virtualname'] = array('Type' => 'display', 'Description' => $custom_buttons['install'], 'FriendlyName' => $configLang['installVirtualname']);\n return $configarray;\n}", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "protected function getConfigContainer2Extra()\n {\n }", "protected function _getConfig()\n {\n return Mage::getSingleton('customgrid/column_renderer_config_collection');\n }", "protected function getConfiguration() {}", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "abstract protected function defineMapping();", "private function generateConfig()\n {\n if ('' == $this->config->getName()) {\n throw new \\InvalidArgumentException('No module name given');\n }\n $target = sprintf(\n '%s/app/code/%s/%s/%s/etc/config.xml',\n $this->config->getPath(),\n $this->config->getCodePool(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'config.xml', $target, array(\n 'config' => $this->config,\n ));\n \n \n $target = sprintf(\n '%s/app/etc/modules/%s_%s.xml',\n $this->config->getPath(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'Module.xml', $target, array(\n 'config' => $this->config,\n )); \n }", "public function getCustomerConfig();", "private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\t\t\t\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Specials products';\r\n }\r\n $response = Configuration::updateValue('FIELD_SPECIALPLS_NBR', 6);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_VERTICAL', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MAXITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MEDIUMITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLLDELAY', 4000);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_NAVIGATION', 0);\r\n\r\n return $response;\r\n }", "public function populateLocalConfiguration() {}", "abstract public function getConfigName();", "protected function baseConfigurationDefaults() {\n return array(\n 'id' => $this->getPluginId(),\n 'label' => '',\n 'cache' => DRUPAL_CACHE_PER_ROLE,\n );\n }", "public function getServiceConfig()\n {\n return array(\n 'invokables' => array(\n 'User\\Model\\User' => 'User\\Model\\User',\n ),\n 'factories' => array(\n 'User\\Mapper\\User' => function (ServiceManager $sm) {\n $mapper = new UserMapper($sm->get('Zend\\Db\\Adapter\\Adapter'));\n $mapper->setServiceManager($sm);\n\n return $mapper;\n },\n 'Zend\\Authentication\\Adapter\\DbTable' => function (ServiceManager $sm) {\n $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n $authAdapter = new AuthAdapter($dbAdapter, 'users', 'username', 'password', null);\n $select = $authAdapter->getDbSelect();\n $select->where(\"status = 0\");\n\n return $authAdapter;\n },\n 'Zend\\Authentication\\AuthenticationService' => function (ServiceManager $sm) {\n /** @var \\Zend\\Authentication\\AuthenticationService $authService */\n $authService = new \\Zend\\Authentication\\AuthenticationService(new SessionStorage('delifi'));\n return $authService;\n },\n )\n );\n }", "function phpgwapi_upgrade0_9_14_500()\n\t{\n\t\t$GLOBALS['phpgw_setup']->oProc->RenameTable('lang','phpgw_lang');\n\t\t$GLOBALS['phpgw_setup']->oProc->RenameTable('languages','phpgw_languages');\n\n\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.501';\n\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t}", "public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Image Grid', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Responsive image gallery', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_image_grid',\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--image-gallery',\n\t\t\t'admin_enqueue_js' => vcex_wpbakery_asset_url( 'js/backend-editor/vcex-image-gallery-view.min.js' ),\n\t\t\t'js_view' => 'vcexBackendViewImageGallery',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'params' => Shortcode::get_params(),\n\t\t);\n\t}", "private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }", "private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Featured product';\r\n }\r\n $response = Configuration::updateValue('FIELD_FEATUREDPSL_NBR', 8);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_CAT', (int)Context::getContext()->shop->getCategory());\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_VERTICAL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MAXITEM', 4);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MEDIUMITEM', 2);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_NAVIGATION', 1);\r\n\r\n return $response;\r\n }", "protected function _getAdditionalConfig()\n {\n $configuration = array();\n\n foreach ($this->getAllowProducts() as $simpleProduct) {\n $configuration['simple_skus'][$simpleProduct->getId()] = $simpleProduct->getSku();\n }\n\n return $configuration;\n }", "protected function createDoctrineConfiguration ()\n {\n if ((self::$cms_type == 'WebsiteBaker') && version_compare(self::$cms_version, '2.8.4', '>=')) {\n if (file_exists(WB_PATH.'/setup.ini.php')) {\n // WebsiteBaker 2.8.4\n $settings = parse_ini_file(WB_PATH.'/setup.ini.php', true);\n // get the database settings from the CMS\n $doctrine_config = array(\n 'DB_TYPE' => $settings['DataBase']['type'],\n 'DB_HOST' => $settings['DataBase']['host'],\n 'DB_PORT' => isset($settings['DataBase']['port']) ? $settings['DataBase']['port'] : '3306',\n 'DB_NAME' => $settings['DataBase']['name'],\n 'DB_USERNAME' => $settings['DataBase']['user'],\n 'DB_PASSWORD' => $settings['DataBase']['pass'],\n 'TABLE_PREFIX' => TABLE_PREFIX\n );\n }\n else {\n throw new \\Exception(\"Missing the constants with the DB settings!\");\n }\n }\n elseif(defined('CAT_VERSION') && version_compare(CAT_VERSION,'1.2','>=')) {\n $doctrine_config = CAT_Helper_DB::getConfig();\n }\n else {\n // get the database settings from the CMS\n $doctrine_config = array(\n 'DB_TYPE' => DB_TYPE,\n 'DB_HOST' => DB_HOST,\n 'DB_PORT' => (defined('DB_PORT')) ? DB_PORT : '3306',\n 'DB_NAME' => DB_NAME,\n 'DB_USERNAME' => DB_USERNAME,\n 'DB_PASSWORD' => DB_PASSWORD,\n 'TABLE_PREFIX' => TABLE_PREFIX\n );\n }\n if (! file_put_contents(WB_PATH . '/kit2/config/doctrine.cms.json', $this->JSONFormat->format($doctrine_config)))\n throw new \\Exception('Can\\'t write the configuration file for Doctrine!');\n return true;\n }", "protected function _getConfig()\n {\n $configFile = Mtool_Magento::getHomeDir() . DIRECTORY_SEPARATOR . self::CONFIG_FILE_NAME;\n\n try {\n $iniConfig = new Zend_Config_Ini($configFile);\n } catch (Zend_Config_Exception $e) {\n $iniConfig = $this->_createConfig($configFile);\n }\n\n if ((is_null($iniConfig->projects))\n || !($iniConfig->projects instanceof Zend_Config)\n ) {\n // no 'projects' in the config file\n $iniConfig = $this->_createConfig($configFile);\n } else {\n $projectConfigId = null;\n // find id of current project\n foreach ($iniConfig->projects->toArray() as $key => $_projectConfig) {\n if (is_array($_projectConfig)) {\n if ((isset($_projectConfig['path']))\n && ($_projectConfig['path'] == Mtool_Magento::getRoot())\n ) {\n $projectConfigId = $key;\n break;\n }\n }\n }\n\n if (!is_null($projectConfigId)) {\n $configs = $iniConfig->projects->{$projectConfigId}->toArray();\n } else {\n // no config for the current project\n $iniConfig = $this->_createConfig($configFile);\n }\n }\n if (!isset($configs['license_path'])) {\n $configs['license_path'] = '';\n }\n list($configs['license'], $configs['license_short']) = $this->_getLicenseStrings($configs['license_path']);\n return $configs;\n }", "protected function setKeyMapping(): array\n {\n return ['node-meta' => 'node_meta'];\n }", "abstract protected function configs(): array;", "function update_v14_to_v15() {\n\n echo \"- Update classmap.ser<br>\";\n try {\n Tools::createClassMap();\n } catch (Exception $e) {\n echo \"<span class='error_font'>Could not create classmap: \".$e->getMessage().\"</span><br/>\";\n exit;\n }\n\n $sqlScriptFilename = '../install/codevtt_update_v14_v15.sql';\n if (!file_exists($sqlScriptFilename)) {\n echo \"<span class='error_font'>SQL script not found:$sqlScriptFilename</span><br/>\";\n exit;\n }\n // execute the SQL script\n echo \"- Execute SQL script: $sqlScriptFilename<br>\";\n $retCode = Tools::execSQLscript2($sqlScriptFilename);\n if (0 != $retCode) {\n echo \"<span class='error_font'>Could not execSQLscript: $sqlScriptFilename</span><br/>\";\n exit;\n }\n}", "public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }", "abstract public static function createConfig(): Config;", "public function getExportMappings()\n {\n }", "public function defaultConfig();", "protected function _getDpgConfig()\n {\n $config = Mage::getSingleton('dpg/config');\n return $config->setStore($this->getStore());\n }", "public function getDtdMapping();", "function get_map(){\n return $this->customizer_map_array;\n }", "function getConfig(){\n\n return [\n\n \\Illuminate\\Contracts\\Http\\Kernel::class => LARAVELFLY_SERVICES['kernel'] ? [] : [\n\n 'middleware',\n\n /** depends\n * put new not safe properties here\n */\n // 'newProp1', 'newProp2',\n\n ],\n /* Illuminate\\Events\\EventServiceProvider::class : */\n 'events' => [\n 'listeners', 'wildcards', 'wildcardsCache', 'queueResolver',\n ],\n\n /* Illuminate\\Routing\\RoutingServiceProvider::class : */\n 'router' => [\n /** depends\n * Uncomment them if it's not same on each request. They may be changed by Route::middleware\n */\n // 'middleware','middlewareGroups','middlewarePriority',\n\n /** depends */\n // 'binders',\n\n /** depends */\n // 'patterns',\n\n\n /** not necessary to backup,\n * // 'groupStack',\n */\n\n /** not necessary to backup,\n * it will be changed during next request\n * // 'current',\n */\n\n /** not necessary to backup,\n * the ref to app('request') will be released during next request\n * //'currentRequest',\n */\n\n /* Illuminate\\Routing\\RouteCollection */\n 'obj.routes' => LARAVELFLY_SERVICES['routes'] ? [] : [\n 'routes', 'allRoutes', 'nameList', 'actionList',\n ],\n ], /* end 'router' */\n\n 'url' => [\n /* depends */\n // 'forcedRoot', 'forceScheme',\n // 'rootNamespace',\n // 'sessionResolver','keyResolver',\n // 'formatHostUsing','formatPathUsing',\n\n /** not necessary to backup,\n *\n * the ref to app('request') will be released during next request;\n * and no need set request for `url' on every request , because there is a $app->rebinding for request:\n * $app->rebinding( 'request', $this->requestRebinder() )\n *\n * // 'request',\n *\n * auto reset when request is updated ( setRequest )\n * // 'routeGenerator','cachedRoot', 'cachedSchema',\n *\n * same as 'request'\n * // 'routes'\n */\n ],\n\n\n /** nothing need to backup\n *\n * // 'redirect' => false,\n * // 'routes' => false,\n * // 'log' => false,\n */\n ];\n }", "public function getServiceConfig()\n {\n return [\n 'factories' => [\n AnswerController::class=>AnswerControllerFactory::class,\n PainelController::class=>PainelControllerFactory::class,\n Quiz::class=>QuizFactory::class,\n QuizRepository::class=>QuizRepositoryFactory::class,\n Question::class=>QuestionFactory::class,\n QuestionRepository::class=>QuestionRepositoryFactory::class,\n Answer::class=>AnswerFactory::class,\n AnswerRepository::class=>AnswerRepositoryFactory::class,\n AnsweredUser::class=>AnsweredUserFactory::class,\n AnsweredUserRepository::class=>AnsweredUserRepositoryFactory::class,\n Answeredinfo::class=>AnsweredinfoFactory::class,\n AnsweredinfoRepository::class=>AnsweredinfoRepositoryFactory::class,\n ]\n ];\n\n }", "public function getConfig()\n {\n return Mage::getModel(\"postident/config\");\n }", "protected static function configFactory() {\n return \\Drupal::configFactory();\n }", "public function getVariantConfig();", "public function getServiceConfigByName($name);", "public function GetConfigClass ();", "public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }", "public function getServiceConfiguration()\n {\n return array(\n 'aliases' => array(\n 'Doctrine\\ORM\\EntityManager' => 'doctrine.entitymanager.orm_default',\n ),\n 'factories' => array(\n 'DoctrineORMModule\\Form\\Annotation\\AnnotationBuilder' => function($sm) {\n return new \\DoctrineORMModule\\Form\\Annotation\\AnnotationBuilder(\n $sm->get('doctrine.entitymanager.orm_default')\n );\n },\n 'doctrine.connection.orm_default' => new CommonService\\ConnectionFactory('orm_default'),\n 'doctrine.configuration.orm_default' => new ORMService\\ConfigurationFactory('orm_default'),\n 'doctrine.driver.orm_default' => new CommonService\\DriverFactory('orm_default'),\n 'doctrine.entitymanager.orm_default' => new ORMService\\EntityManagerFactory('orm_default'),\n 'doctrine.eventmanager.orm_default' => new CommonService\\EventManagerFactory('orm_default'),\n )\n );\n }", "abstract protected function loadConfiguration($name);", "private function initVarConfMap()\n {\n\n // Set the global $confMapLocal\n switch ( true )\n {\n case( isset( $this->conf_view[ 'navigation.' ][ 'map.' ] ) ):\n // local configuration\n $this->confMap = $this->conf_view[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Local configuration in: views.' . $this->conf_path . '.navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // local configuration\n default:\n // global configuration\n $this->confMap = $this->pObj->conf[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Global configuration in: navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // global configuration\n }\n // Set the global $confMapLocal\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n\n return;\n }", "public function registrationParts()\n {\n return array(\n \"'config_class' => 'EE_{$this->addon_string->package()}_Config'\",\n \"'config_name' => 'EE_{$this->addon_string->package()}'\",\n );\n }", "function get_rescueme_minify_config()\n {\n // NOTE: add dependencies before dependents!\n return array\n (\n 'index.less' => array\n (\n '//css/bootstrap.min.css', \n '//admin/css/admin.css'\n ),\n 'index.js' => array\n (\n '//js/rescueme.js', \n '//js/jquery-1.9.1.min.js', \n '//js/less.min.js',\n '//js/bootstrap.min.js'\n ),\n 'admin.less' => array\n (\n '//css/bootstrap.min.css', \n '//admin/css/admin.css'\n ),\n 'admin.js' => array\n (\n '//js/rescueme.js', \n '//js/jquery-1.9.1.min.js', \n '//js/less.min.js', \n '//js/capslock.js',\n '//js/bootstrap.min.js',\n '//admin/js/admin.js'\n ),\n ); \n }", "private function init_old_config_columns()\n {\n if (!is_array($this->old_config_columns)) {\n $this->old_config_columns = array();\n $sql = 'SHOW COLUMNS FROM ' . geoTables::site_configuration_table;\n $result = $this->Execute($sql);\n if (!$result) {\n return false;\n }\n while ($row = $result->FetchRow()) {\n $this->old_config_columns[] = $row['Field'];\n }\n }\n }", "protected static function getConfigurationManager() {}", "function installConfigurationModule(){\n $query=\"CREATE TABLE `configuracion` (\n `id_configuracion` int(11) NOT NULL auto_increment,\n `nombre` varchar(50) NOT NULL,\n `valor` blob,\n `estado` int(11) NOT NULL,\n `tipo` int(11) NOT NULL default '0',\n `metadata` blob,\n `descripcion` varchar(150) NOT NULL,\n PRIMARY KEY (`id_configuracion`),\n UNIQUE KEY `nombre` (`nombre`)\n ) ENGINE=InnoDB;\";\n\n if(!createTable($query,\"configuracion\")) return false;\n installAudDataObject('configuracion');\n return upgradeConfigurationModule();\n}" ]
[ "0.58217305", "0.5610105", "0.5566681", "0.55555046", "0.55367494", "0.54744935", "0.53832763", "0.52744615", "0.52465624", "0.5223379", "0.5139399", "0.51373315", "0.5096815", "0.50923926", "0.50905895", "0.50872535", "0.5063715", "0.5035866", "0.5028861", "0.5022957", "0.500931", "0.50027", "0.4995739", "0.49954325", "0.4985524", "0.4974376", "0.49644804", "0.4954463", "0.49298197", "0.49269924", "0.49253225", "0.49174434", "0.4911581", "0.49050555", "0.49043572", "0.4897687", "0.48840797", "0.48831722", "0.48791906", "0.48767117", "0.48618433", "0.48576066", "0.48574302", "0.48539212", "0.4852657", "0.4850978", "0.48352098", "0.48344412", "0.48287788", "0.48225948", "0.48169315", "0.4814655", "0.48072803", "0.479789", "0.47967488", "0.47917327", "0.4788782", "0.4787403", "0.47868538", "0.4778515", "0.47765517", "0.47743672", "0.47524145", "0.47489196", "0.4741785", "0.4734894", "0.4728396", "0.47267836", "0.4726348", "0.47199777", "0.47194442", "0.4716684", "0.47116432", "0.47069314", "0.47066957", "0.46991327", "0.4696973", "0.46962592", "0.46954912", "0.469084", "0.46906853", "0.46843788", "0.46804127", "0.46790957", "0.4677941", "0.4676343", "0.46757987", "0.46714568", "0.467131", "0.4667606", "0.466325", "0.46575406", "0.46541163", "0.465247", "0.46491688", "0.46462324", "0.4643226", "0.4641524", "0.46409747", "0.4638848" ]
0.46411067
98
Create array object from coma separated value.
protected function _toArrayObject($value, $delimiter = ',') { $result = new ArrayObject(array()); $data = explode($delimiter, $value); if (is_array($data)): foreach ($data as $entry): $entry = trim($entry); if (!strlen($entry)) continue; $result->offsetSet($entry, $entry); endforeach; endif; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vcex_string_to_array( $value = array() ) {\n\n\tif ( empty( $value ) && is_array( $value ) ) {\n\t\treturn null;\n\t}\n\n\tif ( ! empty( $value ) && is_array( $value ) ) {\n\t\treturn $value;\n\t}\n\n\t$items = preg_split( '/\\,[\\s]*/', $value );\n\n\tforeach ( $items as $item ) {\n\t\tif ( strlen( $item ) > 0 ) {\n\t\t\t$array[] = $item;\n\t\t}\n\t}\n\n\treturn $array;\n\n}", "protected function getValueAsArray()\n {\n if(strpos($this->value, '|') > 1){\n $values = array_filter(explode(\"|\", $this->value));\n } else {\n $values = [$this->value];\n }\n return $values;\n }", "function string_to_array($array)\n{\n $arr = explode(',', $array);\n foreach($arr as $item)\n $result[$item] = $item;\n\n return $result;\n}", "public function createArray($str) {\n\t\t$str = substr($str, 0, -1);\n\t\treturn explode(',', $str);\n\t}", "static function toArray($var, $divider=',\\s*'){\n\t\treturn self::from($var, $divider);\n\t}", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "public function parse_array($value)\n\t{\n\t\tif ($value==null)\n\t\t\treturn array();\n\t\t\n\t\tif (is_array($value))\n\t\t\treturn $value;\n\t\t\t\n\t\t$value=trim($value,'{}');\n\t\t$result=explode(',',$value);\n\t\t\n\t\tfor($i=0; $i<count($result); $i++)\n\t\t\tif ($result[$i]=='NULL')\n\t\t\t\t$result[$i]=null;\n\t\t\t\t\n\t\treturn $result;\n\t}", "function makearray($mstrg) {\n\t\t// check if values are separated by comma ','.\n\t if ($this->havecomma($mstrg)) {\n\t \t$marr = explode(\",,\", $mstrg);\n\t }\n\t\treturn $marr;\n\t}", "private static function getArrayForTuple( $tuple ) {\n\t\treturn explode( Enum::VALUE_LABEL_SEPARATOR, $tuple );\n\t}", "public function getToArrayValues()\r\n\t\t{\r\n\t\t\t$obj = \t$this->getObject();\r\n\t\t\t$arrayValues = array();\r\n\t\t\tforeach ($obj as $key => $value) {\r\n\t\t\t\t$arrayValues[\":\".strtoupper($key)] = $value;\r\n\t\t\t}\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public function asArray() : array\n {\n return str_split($this->string);\n }", "public function toArray($itemDelimiter = '|', $valueDelimiter = '=')\n {\n $array = [];\n\n $values = explode($itemDelimiter, $this->value);\n\n foreach ($values as $k => $item) {\n\n $item = explode($valueDelimiter, $item);\n\n // If there is no key - use the original index.\n $array[count($item) > 1 ? $item[0] : $k] = count($item) > 1 ? $item[1] : $item[0];\n }\n\n return $array;\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "function to_array() {\r\n\t\t$out = array();\r\n\t\t\r\n\t\tforeach($this->input as $item) {\r\n\t\t\t$out[$item['name']] = $item['value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $out;\r\n\t}", "static function from($x, $divider=',\\s*'){\n\t\tif(is_string($x)){\n\t\t\treturn self::from_string($x, $divider);\n\t\t}elseif(is_object($x)){\n\t\t\treturn self::from_object($x);\n\t\t}else{\n\t\t\treturn (array)$x;\n\t\t}\n\t}", "public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }", "private static function parseArray($val)\n {\n $result = array();\n $openBrackets = 0;\n $openString = false;\n $openCurlyBraces = 0;\n $openLString = false;\n $buffer = '';\n\n $strLen = strlen($val);\n for($i = 0; $i < $strLen; $i++)\n {\n if($val[$i] == '[' && !$openString && !$openLString)\n {\n $openBrackets++;\n\n if($openBrackets == 1)\n {\n // Skip first and last brackets.\n continue;\n }\n }\n elseif($val[$i] == ']' && !$openString && !$openLString)\n {\n $openBrackets--;\n\n if($openBrackets == 0)\n {\n // Allow terminating commas before the closing bracket\n if(trim($buffer) != '')\n {\n $result[] = self::parseValue( trim($buffer) );\n }\n\n if (!self::checkDataType($result))\n {\n throw new Exception('Data types cannot be mixed in an array: ' . $buffer);\n }\n // Skip first and last brackets. We're finish.\n return $result;\n }\n }\n elseif($val[$i] == '\"' && $val[$i - 1] != \"\\\\\" && !$openLString)\n {\n $openString = !$openString;\n }\n elseif($val[$i] == \"'\" && !$openString) {\n $openLString = !$openLString;\n }\n elseif($val[$i] == \"{\" && !$openString && !$openLString) {\n $openCurlyBraces++;\n }\n elseif($val[$i] == \"}\" && !$openString && !$openLString) {\n $openCurlyBraces--;\n }\n \n if( ($val[$i] == ',' || $val[$i] == '}') && !$openString && !$openLString && $openBrackets == 1 && $openCurlyBraces == 0)\n {\n if ($val[$i] == '}') {\n $buffer .= $val[$i];\n }\n\n $buffer = trim($buffer);\n if (!empty($buffer)) {\n $result[] = self::parseValue($buffer);\n\n if (!self::checkDataType($result))\n {\n throw new Exception('Data types cannot be mixed in an array: ' . $buffer);\n }\n }\n $buffer = '';\n }\n else\n {\n $buffer .= $val[$i];\n }\n }\n\n // If we're here, something went wrong.\n throw new Exception('Wrong array definition: ' . $val);\n }", "public static function convertValue($value) {\n return carraya($value);\n }", "public function makeArrayFieldValue($value)\n {\n $value = $this->helper->unserializeValue($value);\n if (!$this->helper->isEncodedArrayFieldValue($value)) {\n $value = $this->helper->encodeArrayFieldValue($value);\n }\n\n return $value;\n }", "public function AsArray();", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format ['cname=value'......]\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return \"`$obj->name`=$value\";\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n return implode(\",\",$values_str);\n }", "public function getParts() {\n\n if (is_null($this->value)) {\n return array();\n }\n\n $delimiter = $this->getDelimiter();\n\n // split by any $delimiter which is NOT prefixed by a slash.\n // Note that this is not a a perfect solution. If a value is prefixed\n // by two slashes, it should actually be split anyway.\n //\n // Hopefully we can fix this better in a future version, where we can\n // break compatibility a bit.\n $compoundValues = preg_split(\"/(?<!\\\\\\)$delimiter/\", $this->value);\n\n // remove slashes from any semicolon and comma left escaped in the single values\n $compoundValues = array_map(\n function($val) {\n return strtr($val, array('\\,' => ',', '\\;' => ';'));\n }, $compoundValues);\n\n return $compoundValues;\n\n }", "function splitvalues($str)\n{\n\t$arr=array();\n\tif($str==\"\")\n\t{\n\t\t$arr[] = \"\";\n\t\treturn $arr;\n\t}\n\t$start=0;\n\t$i=0;\n\t$inquot=false;\n\twhile($i<=strlen($str))\n\t{\n\t\tif($i<strlen($str) && substr($str,$i,1)=='\"')\n\t\t\t$inquot=!$inquot;\n\t\telse if($i==strlen($str) || !$inquot && substr($str,$i,1)==',')\n\t\t{\n\t\t\t$val=substr($str,$start,$i-$start);\n\t\t\t$start=$i+1;\n\t\t\tif(strlen($val) && substr($val,0,1)=='\"')\n\t\t\t{\n\t\t\t\t$val=substr($val,1,strlen($val)-2);\n\t\t\t\t$val=str_replace('\"\"','\"',$val);\n\t\t\t}\n\t\t\t\n\t\t\tif( $val !== FALSE )\n\t\t\t$arr[]=$val;\n\t\t}\n\t\t$i++;\n\t}\n\treturn $arr;\n}", "public function convertItemArray() {}", "public function stringtoarray($stringa,$delimitatore=','){\n\t\treturn explode($delimitatore,$stringa);\n\t}", "function convert_basic_array($string, $delimitor, $separator)\n{\n\t$the_array = array();\n\t$row = explode($delimitor, $string);\n\tforeach($row AS $item)\n\t{\n\t\t$the_value = htmlentities(trim(strstr($item, $separator), $separator));\n\t\t\n\t\t$check_array = explode('**',$the_value);\n\t\tif(in_array('drillevent', $check_array))\n\t\t{\n\t\t\t$check_array[array_search('drillevent',$check_array)] = 'drillevent=';\n\t\t\t$the_value = implode('**', $check_array);\n\t\t}\n\t\t\n\t\tif($the_value == '_')\n\t\t{\n\t\t\t$the_value = '';\n\t\t}\n\t\t\n\t\t$the_array[strstr($item, $separator, TRUE)] = $the_value;\n\t}\n\t\n\treturn $the_array;\n}", "function csv_to_array($csv, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $terminator = \"\\n\") { \r\n $r = array(); \r\n $rows = explode($terminator,trim($csv)); \r\n $names = array_shift($rows); \r\n $names = str_getcsv($names,$delimiter,$enclosure,$escape); \r\n $nc = count($names); \r\n foreach ($rows as $row) { \r\n if (trim($row)) { \r\n $values = str_getcsv($row,$delimiter,$enclosure,$escape); \r\n if (!$values) $values = array_fill(0,$nc,null); \r\n $r[] = array_combine($names,$values); \r\n } \r\n } \r\n return $r; \r\n}", "abstract public function to_array();", "function protx_vsp_get_associative_array($separator, $input)\n\t{\n\t\tfor ($i=0; $i < count($input); $i++) {\n\t\t\t$splitAt = strpos($input[$i], $separator);\n\t\t\t$output[trim(substr($input[$i], 0, $splitAt))] = trim(substr($input[$i], ($splitAt+1)));\n\t\t}\n\t\treturn $output;\n\t}", "abstract public function data2Array($data);", "function deCadenaToArrayOpcionesCarrito( $string ){\n\t\t$options = array();\n\t\t$temp = explode('{',$string);\n\t\tfor( $i=1 ; $i<count($temp); $i++ ){\n\t\t\t$k = explode('}',$temp[$i]);\n\t\t\t$options[(int)$temp[$i]] = end($k);\n\t\t}\n\t\treturn $options;\n\t}", "public function parse_comma_field($value) {\n if (empty($value) && '0' !== $value) {\n return array();\n }\n\n $value = $this->unescape_data($value);\n return array_map('wc_clean', $this->wt_explode_values($value));\n }", "public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }", "public function __invoke(string $value) : array\n {\n if ($value !== '') {\n return $this->parseRawValue($value);\n }\n return [];\n }", "private function returnArrayElement($line) {\n\t//--\n\tif(strlen($line) <= 1) {\n\t\treturn array(array()); // weird ...\n\t} //end if\n\t//--\n\t$array = array();\n\t$value = trim(substr($line, 1));\n\t$value = $this->_toType($value);\n\t$array[] = $value;\n\t//--\n\treturn $array;\n\t//--\n}", "function insertArray($data) {\n\t\t$ar = array();\n\t\t$str = '';\n\t\t$str1 = '';\n\t\tforeach($data as $key=>$value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t{\n\t\t\t\t$str1 = $key;\n\t\t\t\t$str = '\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str1 = ','.$key;\n\t\t\t\t$str .=' ,\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t}\n\t\t$ar['fields'] = $str1;\n\t\t$ar['values'] = $str;\n\t\treturn $ar;\n\t}", "function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}", "function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}", "function toCustomerArray();", "public function getAsArray();", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "private function getDataItem(string $part): array\n {\n $item = explode('=', $part, 2);\n $item = array_map('rawurldecode', $item);\n $item += [null, null];\n\n return $item;\n }", "function mc_csv_to_array( $csv, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $terminator = \"\\n\" ) {\n\t$r = array();\n\t$rows = explode( $terminator, trim( $csv ) );\n\tforeach ( $rows as $row ) {\n\t\tif ( trim( $row ) ) {\n\t\t\t$values = explode( $delimiter, $row );\n\t\t\t$r[ $values[0] ] = ( isset( $values[1] ) ) ? str_replace( array( $enclosure, $escape ), '', $values[1] ) : $values[0];\n\t\t}\n\t}\n\n\treturn $r;\n}", "public static function toArray($values)\n {\n $values = preg_replace('#[^0-9]*#i', '', $values);\n\n // Create the rows\n $values = str_split($values, 9);\n\n // Create the columns\n foreach ($values as &$row) {\n $row = str_split($row);\n }\n\n return $values;\n }", "public static function getArray($str)\n\t{\n\t\t//Get rid of blank spaces\n\t\t$str = str_replace(\" \", \"\", $str);\n\t\t\n\t\treturn explode(\",\",$str);\t\t\n\t}", "static function fromArray($array)\n {\n return new self($array[0], $array[1], $array[2], $array[3], rtrim($array[4], PHP_EOL));\n }", "public function fromString(string $string): array;", "public static function transform(string $data, array $uniqueValues, string $separator = ','): array;", "private function T_ARRAY($value) {\n\t\t$_convert = array('('=>'{',\t')'=>'}',);\n\t\t$js = $this->parseUntil(array(';'), $_convert, true);\n\t\tif (strpos($js, ':') === false) {\n\t\t\t$this->tmp = -1;\n\t\t\t$js = preg_replace_callback ('/([{, \\t\\n])(\\'.*\\')(|.*:(.*))([,} \\t\\n])/Uis', array($this, 'cb_T_ARRAY'), $js);\n\t\t}\n\t\treturn $js;\n\t}", "public function bindArrayOfIds($value)\n {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n $value = array_map('trim', $value);\n $value = array_filter($value, 'is_numeric');\n\n return $value;\n }", "private function splitQueryValue($value): array\r\n {\r\n $data = explode('=', $value, 2);\r\n\r\n if (!isset($data[1])) {\r\n $data[] = null;\r\n }\r\n\r\n return $data;\r\n }", "function getArrayFromList($string) {\n\t\t$i = 0;\n\t\t#remove all leading and trailing spaces\n\t\t$string = trim($string);\n\t\t#find the first ocurrence of a comma\n\t\t$pos = strpos($string, \",\");\n\t\twhile(!($pos === false)) {\n\t\t\t#set the new starting position\n\t\t\t$firstpos = $pos + 1;\n\t\t\t#if the string is in the second position, set the first array value\n\t\t\t$lastpos = $pos;\n\t\t\t$array[$i] = substr($string, 0, $lastpos);\t\t\n\t\t\t#reduce the string to start from the new starting position. $firstpos\n\t\t\t$string = substr($string, $firstpos);\t\t\n\t\t\t$string = trim($string);\n\t\t\t#locate the first occurence of a comma in the string\n\t\t\t$pos = strpos($string, \",\");\n\t\t\t$i++;\n\t\n\t\t}\n\t\t$array[$i] = $string;\n\t\treturn $array;\n\t}", "function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\n\t$string2 = \"\";\n\t$total = count($in_array);\n\twhile ($start_pos < $total)\n\t{\n\t\t$string1 = $string1 . \"`\" . $in_array[$start_pos] . \"`\";\n\t\t$start_pos++;\n\t\t$string2 = $string2 . \"\\\"\" . $in_array[$start_pos] . \"\\\"\";\n\t\t$start_pos++;\n\t\tif ($start_pos < $total)\n\t\t{\n\t\t\t$string1 = $string1 . \", \";\n\t\t\t$string2 = $string2 . \", \";\n\t\t}\n\t}\n\tif ($start_pos == 2)\n\t{\t$return_string = \"(clanid, \" . $string1 . \") values (0, \" . $string2 . \")\";\t}\n\telse\n\t{\t$return_string = \"(\" . $string1 . \") values (\" . $string2 . \")\";\t}\n\treturn $return_string;\n}", "public function arrayToObject($array): static;", "function convertEnumToArray($enum)\n{\n\t$enum = str_replace(\"(\", \"\", $enum);\n\t$enum = str_replace(\")\", \"\", $enum);\n\t$enum = str_replace(\"'\", \"\", $enum);\n\t$arr = explode(\",\", $enum);\n\treturn $arr;\n}", "public static function decode( $value ) {\n\t\tif ( ! is_array( $value ) ) {\n\t\t\t$value = explode( ' ', $value );\n\t\t}\n\n\t\t$decoded_val = array();\n\t\tforeach ( $value as $_value ) {\n\t\t\tpreg_match( '/([-0-9]*)(.*)/', $_value, $matches );\n\t\t\t$cur_val = 0;\n\t\t\tif ( ! empty( $matches[1] ) ) {\n\t\t\t\t$cur_val = $matches[1];\n\t\t\t}\n\t\t\t$cur_units = '';\n\t\t\tif ( ! empty( $matches[2] ) ) {\n\t\t\t\t$cur_units = $matches[2];\n\t\t\t}\n\t\t\t$decoded_val[] = array(\n\t\t\t\t'val' => $cur_val,\n\t\t\t\t'units' => $cur_units,\n\t\t\t);\n\t\t}\n\n\t\treturn $decoded_val;\n\t}", "public function fromArray(array $arrayData);", "function parseCoordFromString($coord){\n $coord = trim($coord,\"[]\");\n $pieces = explode(\",\",$coord);\n $p1 = (double)$pieces[0];\n $p2 = (double)$pieces[1];\n\n return array($p1,$p2);\n\n }", "public function importArray($data);", "public function _parse_to_array($in) {\n\t\t$string = str_replace(' ', '', trim($in));\n\t\t\n\t\tif ( ! empty($string)) {\n\t\t\treturn (array) explode('|', $string);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "public function fromArray(array $data);", "public function fromArray(array $data);", "public static function fromArray(array $data);", "public function asArray()\n {\n $result = [];\n\n if (isset($this->a)) {\n $result['a'] = $this->a;\n }\n\n if (isset($this->b)) {\n $result['b'] = $this->b;\n } elseif (isset($this->f)) {\n $result['f'] = $this->f;\n } elseif (isset($this->rf)) {\n $result['rf'] = $this->rf;\n }\n\n if (isset($this->code)) {\n $result['code'] = $this->code;\n }\n\n if (isset($this->name)) {\n $result['name'] = $this->name;\n }\n\n return $result;\n }", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n $s = str_replace(\"{\", \"array('\", $s);\n $s = str_replace(\"}\", \"')\", $s); \n $s = str_replace(\",\", \"','\", $s); \n } else {\n $s = str_replace(\"{\", \"array(\", $s);\n $s = str_replace(\"}\", \")\", $s);\n }\n\t$ss = \"\\$retval = $s;\";\n eval($ss);\n\treturn $retval;\n}", "function stringToClassArray($coursesString='')\n\t{\n\t\t$array = array();\n\t\t$courses = explode(\";\", $coursesString);\n\t\tforeach ($courses as $key => $course) {\n\t\t\t$course = explode(\" \", $course);\n\t\t\tarray_push($array, $course);\n\t\t}\n\t\treturn $array;\n\t}", "function smarty_modifier_array ($str, $blnLabels = FALSE)\n{\n\t\n\t$arr\t= explode (',', $str);\n\t\n\tif ($blnLabels)\n\t{\n\t\t\n\t\t$arrTmp\t= array ();\n\t\t\n\t\tforeach ($arr as $strVal)\n\t\t{\n\t\t\t\n\t\t\t$arrTmp[$strVal]\t= $strVal;\n\t\t\t\n\t\t}\n\t\t\n\t\t$arr\t= $arrTmp;\n\t\t\n\t}\n\t\n\treturn $arr;\n\t\n}", "function arrayify_numerical($input)\n{\n $inputpos = $input;\n $inputpos = preg_replace(\"/[^0-9,-]/\", \"\", $inputpos);\n $explodeintoarray = explode(\",\", $inputpos);\n return $explodeintoarray;\n}", "private function processArray(array $parts, array $value, string $key): array\n {\n foreach ($value as $subValue) {\n $parts[] = $key . \"=\\\"\" . $subValue . \"\\\"\";\n }\n\n return $parts;\n }", "public function stringToArray(string $string): array;", "abstract protected function toArray();", "function tratar_cep($string){\n\n $rst = explode(',', $string);\n $arr = array();\n \n if(count($rst) < 5){\n # Sem complemento\n $arr['LOGRADOURO' ] = $rst[0];\n $arr['NUMERO' ] = $rst[1];\n $arr['COMPLEMENTO'] = NULL;\n $arr['BAIRRO' ] = $rst[2];\n $arr['CEP' ] = $rst[3];\n }else{\n # Com complemento\n $arr['LOGRADOURO' ] = $rst[0];\n $arr['NUMERO' ] = $rst[1];\n $arr['COMPLEMENTO'] = $rst[2];\n $arr['BAIRRO' ] = $rst[3];\n $arr['CEP' ] = $rst[4];\n }\n \n return $arr;\n}", "public function processField($arr){\n\t\t$return = array();\n\t\t$parts = explode(',', $arr);\n\t\t$seq = 0;\n\t\tfor($i=0; $i<count($parts); $i++){\n\t\t\tif('blank' == substr($parts[$i],0,5)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlist(,$list) = explode('_', $parts[$i])\t;\n\t\t\t//$list = str_replace('item_', '',$parts[$i]);\n\t\t\tlist($type, $fieldId) = explode('-',$list);\n\t\t\t$return[$type][$fieldId] = \tintval($seq);\n\t\t\t$seq++;\n\t\t}\n\n\t\treturn $return;\n\t}", "private function multi_byte_string_to_array()\n {\n $this->strings = array_values(\n array_filter(\n preg_split(\"//u\",$this->string),\n \"strlen\"\n )\n );\n }", "public function toArray()\n {\n $attributes = $this->getConfiguredAttributes();\n\n $values = [];\n\n foreach (explode(',', $attributes) as $attribute) {\n $values[$attribute] = str_replace(' ','', $attribute);\n }\n\n return $values;\n }", "function toArray() ;", "function toArray() ;", "public static function makeArray($value)\n {\n if(is_array($value))\n return $value;\n else\n return array($value);\n }", "protected function fromValueObjectToArray($key, $value)\n {\n return $value instanceof Arrayable ? $value->toArray() : $value->getNativeValue();\n }", "private function returnMappedValue($line) {\n\t//--\n\t$array = array();\n\t$key = $this->unquote(trim(substr($line, 0, -1)));\n\t$array[$key] = '';\n\t//--\n\treturn $array;\n\t//--\n}", "function csvToArray($file, $delimiter) { \n if (($handle = fopen($file, 'r')) !== FALSE) { \n $i = 0; \n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) { \n for ($j = 0; $j < count($lineArray); $j++) { \n $arr[$i][$j] = $lineArray[$j]; \n } \n $i++; \n } \n fclose($handle); \n } \n return $arr; \n}", "function to_json_array($stg){\n $result = str_replace(\"[\",\"\",$stg);\n $result = str_replace(\"]\",\"\",$result);\n $details_array = json_decode($result, true);\n return $details_array;\n}", "public function associativeStringArrayValue($key);", "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "public function getValues()\r\n {\r\n $values = $this->getValue();\r\n\r\n if (!is_array($values)) {\r\n $values = explode(',', $values);\r\n }\r\n\r\n if (!sizeof($values)) {\r\n return [];\r\n }\r\n\r\n $collection = $this->collectionFactory->create()\r\n ->addIdFilter($values);\r\n\r\n $options = [];\r\n foreach ($collection as $tag) {\r\n $options[] = $tag->getId();\r\n }\r\n\r\n return $options;\r\n }", "function strToArray(&$string, &$array){\r\n $array = explode(\"\\n\", $string);\r\n }", "function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}", "private function _toType($value) {\n\t//--\n\tif($value === '') {\n\t\treturn null;\n\t} //end if\n\t//--\n\t$first_character = $value[0];\n\t$last_character = substr($value, -1, 1);\n\t//--\n\t$is_quoted = false;\n\tdo {\n\t\tif(!$value) {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($first_character != '\"' && $first_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($last_character != '\"' && $last_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$is_quoted = true;\n\t} while (0);\n\t//--\n\tif($is_quoted) {\n\t\treturn strtr(substr($value, 1, -1), array ('\\\\\"' => '\"', '\\'\\'' => '\\'', '\\\\\\'' => '\\''));\n\t} //end if\n\t//--\n\tif(strpos($value, ' #') !== false && !$is_quoted) {\n\t\t$value = preg_replace('/\\s+#(.+)$/','',$value);\n\t} //end if\n\t//--\n\tif(!$is_quoted) {\n\t\t$value = str_replace('\\n', \"\\n\", $value);\n\t} //end if\n\t//--\n\tif($first_character == '[' && $last_character == ']') {\n\t\t// Take out strings sequences and mappings\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$value = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$value[] = $this->_toType($v);\n\t\t} //end foreach\n\t\treturn $value;\n\t} //end if\n\t//--\n\tif(strpos($value, ': ') !== false && $first_character != '{') {\n\t\t$array = explode(': ', $value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ', $array));\n\t\t$value = $this->_toType($value);\n\t\treturn array($key => $value);\n\t} //end if\n\t//--\n\tif($first_character == '{' && $last_character == '}') {\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t// Inline Mapping\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$array = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$SubArr = $this->_toType($v);\n\t\t\tif(empty($SubArr)) {\n\t\t\t\tcontinue;\n\t\t\t} //end if\n\t\t\tif(is_array ($SubArr)) {\n\t\t\t\t$array[key($SubArr)] = $SubArr[key($SubArr)]; continue;\n\t\t\t} //end if\n\t\t\t$array[] = $SubArr;\n\t\t} //end foreach\n\t\treturn $array;\n\t} //end if\n\t//--\n\tif((string)$value == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(strtolower($value) == 'null' || $value == '~') {\n\t\treturn null;\n\t} //end if\n\t//--\n\tif(is_numeric($value) && preg_match('/^(-|)[1-9]+[0-9]*$/', $value)){\n\t\t$intvalue = (int)$value;\n\t\tif($intvalue != PHP_INT_MAX) {\n\t\t\t$value = $intvalue;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\t/* this was added in v.0.5.1 but is unsafe !!\n\tif(is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {\n\t\t// Hexadecimal value.\n\t\treturn hexdec($value);\n\t} //end if\n\t*/\n\t//--\n\tif(in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y'))) {\n\t\treturn true;\n\t} //end if\n\t//--\n\tif(in_array(strtolower($value), array('false', 'off', '-', 'no', 'n'))) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(is_numeric($value)) {\n\t\tif((string)$value == '0') {\n\t\t\treturn 0;\n\t\t} //end if\n\t\tif(rtrim($value, 0) === $value) {\n\t\t\t$value = (float)$value;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\treturn $value;\n\t//-- $k\n}", "function answersArray($strInput)\t{\n\t\t$strLine=explode(chr(10),$strInput);\n\t\tforeach($strLine as $intKey => $strLineValue)\t{\n\t\t\t$strValue = explode('|',$strLineValue);\n\t\t\t$arrOutput[$intKey+1]=trim($strValue[0]);\n\t\t}\n\t\treturn $arrOutput;\n\t}", "function csvToArray($file, $delimiter) {\r\n\tif (($handle = fopen($file, 'r')) !== FALSE) {\r\n\t\t$i = 0;\r\n\t\twhile (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\r\n\t\t\tfor ($j = 0; $j < count($lineArray); $j++) {\r\n\t\t\t\t$arr[$i][$j] = $lineArray[$j];\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t}\r\n\treturn $arr;\r\n}", "function getcsv_custom2(&$value,$key){\n $value = str_getcsv($value,\".\",\"'\");\n}", "public function queryToArray()\n {\n $array = [];\n parse_str($this->query, $array);\n\n return $array;\n }", "function sizesToArray($string){\n $sizesArray = explode(',',$string);\n $returnArray = array();\n foreach($sizesArray as $size){\n $s =explode(':',$size);\n $returnArray[] = array('size'=> $s[0], 'price' => $s[1],'quantity' => $s[2],'threshold' => $s[3]);\n }\n return $returnArray;\n}" ]
[ "0.6867079", "0.6344522", "0.63187563", "0.6250074", "0.6224666", "0.61329406", "0.6033963", "0.5969988", "0.59363943", "0.59022635", "0.5795557", "0.5770473", "0.5745188", "0.5745188", "0.5745188", "0.5745188", "0.5745188", "0.5745188", "0.56893176", "0.5678477", "0.5660539", "0.56575525", "0.565475", "0.56004256", "0.5591596", "0.557703", "0.55618393", "0.5553663", "0.5512755", "0.5489471", "0.54711276", "0.54636157", "0.54562455", "0.54517925", "0.5450991", "0.5441962", "0.5409666", "0.54006684", "0.5396835", "0.5395653", "0.53934103", "0.53915906", "0.53915906", "0.5373063", "0.53621686", "0.5361698", "0.53557205", "0.53486574", "0.5314325", "0.5289688", "0.5280298", "0.5274454", "0.5269571", "0.52645725", "0.5258314", "0.5239026", "0.5238941", "0.52353567", "0.5220468", "0.52193975", "0.52069837", "0.520449", "0.51996416", "0.51814646", "0.51794297", "0.5165233", "0.51497686", "0.51497686", "0.5145331", "0.51414615", "0.5135694", "0.5117316", "0.5112861", "0.51098573", "0.50942504", "0.5090516", "0.5088041", "0.5087535", "0.50871027", "0.508438", "0.50806934", "0.50769234", "0.5067943", "0.5067943", "0.50625706", "0.50572836", "0.5055387", "0.5050747", "0.5046167", "0.50417817", "0.5039167", "0.5033467", "0.50310105", "0.5020957", "0.5014271", "0.5004509", "0.5001537", "0.49959254", "0.4994416", "0.49906257" ]
0.5785385
11
Check if COD Charge should be removed from order grand total
public function removeCODCharge() { return (1 == $this->getConfig('packages/remove_cod_charge')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function chkIfOrdDtlSubmnuDiscounted($order_id,$submnudish){\r \t\t$tmp_fnd=0;\r\t\t$order_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$submnudish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\r\t\t\r\t\tif($tmp_fnd>0)\r\t\t\treturn 1;\r\t\telse\r\t\t\treturn 0;\t\r }", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "protected function calculateGrandTotal()\n {\n $this->grandTotal = $this->subTotal + $this->gst + $this->unit->securityDeposit;\n }", "private function isTotalPaidEnoughForRefund(OrderInterface $order)\n {\n return !abs($this->priceCurrency->round($order->getTotalPaid()) - $order->getTotalRefunded()) < .0001;\n }", "function cfc_edd_replace_final_total() {\n\tremove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 );\n}", "function hankart_change_payment_gateway( $gateways ){\n if( WC()->cart->subtotal > 150 ){\n // then unset the 'cod' key (cod is the unique id of COD Gateway)\n unset( $gateways['cod'] );\n }\n return $gateways;\n}", "public function shouldRefund()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney < $paidMoney;\n }", "function field_collection_contributions_rules_complete_contribution($order) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items->getIterator() as $delta => $line_item_wrapper) {\n if (!isset($product_wrapper)) {\n isset($line_item_wrapper->commerce_product) ? $product_wrapper = $line_item_wrapper->commerce_product->value() : NULL;\n }\n }\n\n // Go over the price components to figure out donation and fee.\n foreach($order->commerce_order_total['und'][0]['data']['components'] as $delta => $component) {\n if($component['name'] === 'base_price') {\n $donation = $component['price']['amount'];\n }\n if ($component['name'] === 'fee') {\n $fee = $component['price']['amount'];\n }\n }\n\n\n // If the charity is paying the fee take that out of the donation.\n // @todo - Figure out how to automatically calculate the fee with and without the using paying it.\n if (!isset($fee)) {\n $fee = $donation * .1;\n $donation = $donation - $fee;\n }\n $donation = commerce_currency_amount_to_decimal($donation, commerce_default_currency());\n\n // get fields on the product\n // @todo - Ben - Figure out why the product wrapper can't access the field_collection values.\n $meter_item = field_get_items('commerce_product', $product_wrapper, 'field_donation_meter');\n $item_collection = field_collection_field_get_entity($meter_item[0]);\n $meter_wrapper = entity_metadata_wrapper('field_collection_item', $item_collection);\n\n // Add donation to total donations.\n // @todo - Ben - Get field_donation_current as an input from the rule setup.\n $current = $meter_wrapper->field_donation_current->value();\n\n // @todo - Ben - Get field_donation_goal as an input from the rule setup.\n $goal = $meter_wrapper->field_donation_goal->value();\n if (($current + $donation) > $goal) {\n $current = $goal;\n }\n else {\n $current += $donation;\n }\n $meter_wrapper->field_donation_current->set($current);\n $meter_wrapper->save();\n}", "public function hasDiscount(){\n return $this->_has(9);\n }", "public function getSubtotalRefunded();", "function get_total_discount() {\n\t\t\tif ($this->discount_total || $this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_total + $this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "public function delete()\n {\n if ($this->OrderExists()) { //NOT delete a cart which is associated with an order\n return false;\n }\n $uploaded_files = Db::getInstance()->executeS('\n\t\t\tSELECT cd.`value`\n\t\t\tFROM `'._DB_PREFIX_.'customized_data` cd\n\t\t\tINNER JOIN `'._DB_PREFIX_.'customization` c ON (cd.`id_customization`= c.`id_customization`)\n\t\t\tWHERE cd.`type`= 0 AND c.`id_cart`='.(int)$this->id\n );\n foreach ($uploaded_files as $must_unlink) {\n unlink(_PS_UPLOAD_DIR_.$must_unlink['value'].'_small');\n unlink(_PS_UPLOAD_DIR_.$must_unlink['value']);\n }\n Db::getInstance()->execute('\n\t\t\tDELETE FROM `'._DB_PREFIX_.'customized_data`\n\t\t\tWHERE `id_customization` IN (\n\t\t\t\tSELECT `id_customization`\n\t\t\t\tFROM `'._DB_PREFIX_.'customization`\n\t\t\t\tWHERE `id_cart`='.(int)$this->id.'\n\t\t\t)'\n );\n Db::getInstance()->execute('\n\t\t\tDELETE FROM `'._DB_PREFIX_.'customization`\n\t\t\tWHERE `id_cart` = '.(int)$this->id\n );\n if (!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'cart_cart_rule` WHERE `id_cart` = '.(int)$this->id)\n || !Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart` = '.(int)$this->id)) {\n return false;\n }\n return parent::delete();\n }", "public function isCreditCardPurchase()\n {\n return $this->payment_method->id != 1;\n }", "private function update_total_of_cart() {\n\t\t// Get products\n\t\t$products = $this->get_current_products();\n\n\t\t// Loop through and add subtotals\n\t\t$total = 0;\n\t\tforeach ($products as $product) {\n\t\t\t$total += $product[\"subtotal\"];\n\t\t}\n\n\t\t// Check if promo code attached and delete if total drops below minimum amount\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Yes, it does, check to see if still above minimum amount\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 2) {\n\t\t\t\tif ($total < $promo_code->minimum_amount) {\n\t\t\t\t\t$this->remove_promo_code();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update and save\n\t\t$this->cart_total = $total;\n\t\t$this->save();\n\t}", "public function needs_payment() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );\n\t}", "public function hasActdiscount(){\n return $this->_has(34);\n }", "public function isUnderTotal(ExecutionContext $context)\n {\n $this->ligne->getFreeTotal($credit, $debit, $this->id);\n\n $depassement = ($this->typeFacture->getSens() === true) ? $this->montant-$credit : $this->montant-$debit;\n\n if ($depassement > 0.001) { // compare with an epsilon!\n $context->addViolationAt('montant',\n 'Cette facture dépasse du total de la ligne de %montant% €',\n array('%montant%' => round($depassement, 2)),\n null);\n }\n }", "public function remove_promo_code() {\n\t $site_stats_helper = new SiteStatsHelper();\n if (Auth::guest()) {\n $site_stats_helper->promo_code_add_guest_removal($this->promo_code->id);\n } else {\n \t$site_stats_helper->promo_code_add_member_removal($this->promo_code->id);\n }\n\t\t\n\t\t// Revert back to old total\n\t\t$this->cart_total = $this->old_total;\n\n\t\t// Remove promo code\n\t\t$this->promo_code = \"\";\n\n\t\t// Update cart\n\t\t$this->save();\n\t}", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "function cf_order_valid_amount($params)\n\t{\n\t\t/* Insert: (grand_total - plan_total) < new_amount => error */\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->order_id) && !$params->order_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$order_id = $params->order_id;\n\t\tif (isset($params->is_plan) && $params->is_plan) {\n\t\t\t// $str = \"SELECT grand_total,\n\t\t\t\t// (\n\t\t\t\t\t// select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id\n\t\t\t\t// ) as plan_total \n\t\t\t\t// from cf_order t1 where t1.id = $order_id\";\n\t\t\t$str = \"SELECT (grand_total - (select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id)) as amount \n\t\t\t\tfrom cf_order t1 where t1.id = $order_id\";\n\t\t}\n\t\t$row = $this->db->query($str)->row();\n\t\t// if ($row->grand_total - $row->plan_total - $params->amount < 0) {\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t// $this->session->set_flashdata('message', $row->grand_total - $row->plan_total);\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t// if ($row->grand_total - $row->plan_total < $params->amount)\n\t}", "private function _calculateTotalDiscount($order){\n\t $storeCredit = $order->getCustomerBalanceAmount();\n\t $giftCardAmount = $order->getGiftCardsAmount();\n\t $totalDiscountAmount = $storeCredit + $giftCardAmount;\n\t return number_format($totalDiscountAmount, 2, '.', '');\n }", "public function sRiskCUSTOMERGROUPISNOT($user, $order, $value)\n {\n return $value != $user['additional']['user']['customergroup'];\n }", "public function getOtherCharges() { \n \n $result = 0;\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $purchaseData = DB::select('SELECT * FROM purchase_master WHERE is_deleted_status = \"N\" AND id = '.$purchaseIds.'');\n if (!empty($purchaseData)) {\n $otherCharges = !empty($purchaseData[0]->other_charges) ? $purchaseData[0]->other_charges : '0.00'; \n echo $otherCharges;\n }\n\n }", "function ihc_dont_pay_after_discount($level_id, $coupon, $level_arr, $update_coupon_count=FALSE){\n\tif (!empty($coupon)){\n\t\tif (isset($level_arr['access_type']) && $level_arr['access_type']!='regular_period'){\n\t\t\t//not reccurence\n\t\t\t$coupon_data = ihc_check_coupon($coupon, $level_id);\n\t\t\t$level_arr['price'] = ihc_coupon_return_price_after_decrease($level_arr['price'], $coupon_data, FALSE);\n\t\t\tif ($level_arr['price']==0){\n\t\t\t\tif ($update_coupon_count){\n\t\t\t\t\t//update coupon count\n\t\t\t\t\tihc_submit_coupon($coupon);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}", "function has_discount( $code ) {\n\t\t\tif (in_array($code, $this->applied_coupons)) return true;\n\t\t\treturn false;\n\t\t}", "public function deleteCreditCard()\n\t{\n\t\tif (isset($this->context->cookie->id_customer) && $this->context->cookie->id_customer)\n\t\t\treturn (int)Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'stripepro_customer WHERE id_customer = '.(int)$this->context->cookie->id_customer);\n\n\t\treturn 0;\n\t}", "public function isUnpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNPAID;\n }", "function correct_pamm_clients_statement($order_id,$acc_number,$summ)\n\t{\n\n\t return $this->db->where('pamm_clients_stat_acc_number',$acc_number)\n\t\t\t->where('pamm_clients_order_number',$order_id)\n\t\t\t->delete('pamm_clients_statement');\n\n\t}", "private function update_total_with_promo_code() {\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Make new old total\n\t\t\t$this->old_total = $this->cart_total;\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 1) {\n\t\t\t\t$percent_off = $promo_code->percent_off;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\t$amount_removed = $cart_total * $percent_off;\n\t\t\t\t$new_total = $cart_total - $amount_removed;\n\n\t\t\t\t// Update variables\n\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t// Update cart\n\t\t\t\t$this->save();\n\t\t\t} else {\n\t\t\t\t$dollars_off = $promo_code->dollars_off;\n\t\t\t\t$minimum_amount = $promo_code->minimum_amount;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\tif ($cart_total < $minimum_amount) {\n\t\t\t\t\treturn \"Cart total does not meet minimum requirement of $\" . $minimum_amount . \" for this promo code.\";\n\t\t\t\t} else {\n\t\t\t\t\t// Get new total\n\t\t\t\t\t$new_total = $cart_total - $dollars_off;\n\n\t\t\t\t\t// Update variables\n\t\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t\t// Create addition in stats helper\n\t $site_stats_helper = new SiteStatsHelper();\n\t if (Auth::guest()) {\n\t $site_stats_helper->promo_code_add_guest_addition($promo_code->id);\n\t } else {\n\t \t$site_stats_helper->promo_code_add_member_addition($promo_code->id);\n\t }\n\n\t\t\t\t\t// Update cart\n\t\t\t\t\t$this->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function removePurchaseDetail() { \n\n $result = 0;\n $purchaseDelIds = !empty($_GET['purchaseDelIds']) ? $_GET['purchaseDelIds'] : '';\n $totalss = !empty($_GET['totalss']) ? $_GET['totalss'] : '';\n $totalr = !empty($_GET['totalr']) ? $_GET['totalr'] : '';\n $otherChargess = !empty($_GET['otherChargess']) ? $_GET['otherChargess'] : '';\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $grandTotals = !empty($_GET['grandTotals']) ? $_GET['grandTotals'] : '';\n \n \n //if (!empty($purchaseDelIds)) {\n $purhaseModel = new PurhaseModel();\n $result = $purhaseModel->deletePurhaseDetails($purchaseDelIds,$purchaseIds,$totalss,$totalr,$otherChargess,$grandTotals);\n //}\n echo $result;\n\n \n }", "function confirmation() {\n global $cartID;\n global $cart_cgp_ID;\n global $customer_id;\n global $languages_id;\n global $order;\n global $order_total_modules;\n \n if (tep_session_is_registered('cartID')) {\n $insert_order = false;\n \n if (tep_session_is_registered('cart_cgp_ID')) {\n $order_id = substr($cart_cgp_ID, strpos($cart_cgp_ID, '-') + 1);\n \n $curr_check = tep_db_query(\"select currency from \" . TABLE_ORDERS . \" where orders_id = '\" . (int) $order_id . \"'\");\n $curr = tep_db_fetch_array($curr_check);\n \n if (($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_cgp_ID, 0, strlen($cartID)))) {\n $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = \"' . (int) $order_id . '\" limit 1');\n \n if (tep_db_num_rows($check_query) < 1) {\n tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = \"' . (int) $order_id . '\"');\n tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = \"' . (int) $order_id . '\"');\n tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = \"' . (int) $order_id . '\"');\n tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = \"' . (int) $order_id . '\"');\n tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = \"' . (int) $order_id . '\"');\n tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = \"' . (int) $order_id . '\"');\n }\n \n $insert_order = true;\n }\n } else {\n $insert_order = true;\n }\n \n if ($insert_order == true) {\n $order_totals = array();\n if (is_array($order_total_modules->modules)) {\n reset($order_total_modules->modules);\n foreach ($order_total_modules->modules as $value) {\n $class = substr($value, 0, strpos($value, '.'));\n if ($GLOBALS[$class]->enabled) {\n for ($i = 0, $n = sizeof($GLOBALS[$class]->output); $i < $n; $i ++) {\n if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {\n $order_totals[] = array(\n 'code' => $GLOBALS[$class]->code,\n 'title' => $GLOBALS[$class]->output[$i]['title'],\n 'text' => $GLOBALS[$class]->output[$i]['text'],\n 'value' => $GLOBALS[$class]->output[$i]['value'],\n 'sort_order' => $GLOBALS[$class]->sort_order\n );\n }\n }\n }\n }\n }\n \n $sql_data_array = array(\n 'customers_id' => $customer_id,\n 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],\n 'customers_company' => $order->customer['company'],\n 'customers_street_address' => $order->customer['street_address'],\n 'customers_suburb' => $order->customer['suburb'],\n 'customers_city' => $order->customer['city'],\n 'customers_postcode' => $order->customer['postcode'],\n 'customers_state' => $order->customer['state'],\n 'customers_country' => $order->customer['country']['title'],\n 'customers_telephone' => $order->customer['telephone'],\n 'customers_email_address' => $order->customer['email_address'],\n 'customers_address_format_id' => $order->customer['format_id'],\n 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],\n 'delivery_company' => $order->delivery['company'],\n 'delivery_street_address' => $order->delivery['street_address'],\n 'delivery_suburb' => $order->delivery['suburb'],\n 'delivery_city' => $order->delivery['city'],\n 'delivery_postcode' => $order->delivery['postcode'],\n 'delivery_state' => $order->delivery['state'],\n 'delivery_country' => $order->delivery['country']['title'],\n 'delivery_address_format_id' => $order->delivery['format_id'],\n 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],\n 'billing_company' => $order->billing['company'],\n 'billing_street_address' => $order->billing['street_address'],\n 'billing_suburb' => $order->billing['suburb'],\n 'billing_city' => $order->billing['city'],\n 'billing_postcode' => $order->billing['postcode'],\n 'billing_state' => $order->billing['state'],\n 'billing_country' => $order->billing['country']['title'],\n 'billing_address_format_id' => $order->billing['format_id'],\n 'payment_method' => $order->info['payment_method'],\n 'cc_type' => $order->info['cc_type'],\n 'cc_owner' => $order->info['cc_owner'],\n 'cc_number' => $order->info['cc_number'],\n 'cc_expires' => $order->info['cc_expires'],\n 'date_purchased' => 'now()',\n 'orders_status' => constant('MODULE_PAYMENT_CGP_' . $this->module_cgp_text . '_ORDER_INITIAL_STATUS_ID'),\n 'currency' => $order->info['currency'],\n 'currency_value' => $order->info['currency_value']\n );\n \n tep_db_perform(TABLE_ORDERS, $sql_data_array);\n \n $insert_id = tep_db_insert_id();\n \n for ($i = 0, $n = sizeof($order_totals); $i < $n; $i ++) {\n $sql_data_array = array(\n 'orders_id' => $insert_id,\n 'title' => $order_totals[$i]['title'],\n 'text' => $order_totals[$i]['text'],\n 'value' => $order_totals[$i]['value'],\n 'class' => $order_totals[$i]['code'],\n 'sort_order' => $order_totals[$i]['sort_order']\n );\n \n tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);\n }\n \n for ($i = 0, $n = sizeof($order->products); $i < $n; $i ++) {\n $sql_data_array = array(\n 'orders_id' => $insert_id,\n 'products_id' => tep_get_prid($order->products[$i]['id']),\n 'products_model' => $order->products[$i]['model'],\n 'products_name' => $order->products[$i]['name'],\n 'products_price' => $order->products[$i]['price'],\n 'final_price' => $order->products[$i]['final_price'],\n 'products_tax' => $order->products[$i]['tax'],\n 'products_quantity' => $order->products[$i]['qty']\n );\n \n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n \n $order_products_id = tep_db_insert_id();\n \n $attributes_exist = '0';\n if (isset($order->products[$i]['attributes'])) {\n $attributes_exist = '1';\n for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j ++) {\n if (DOWNLOAD_ENABLED == 'true') {\n $attributes_query = \"select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n left join \" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . \" pad\n on pa.products_attributes_id=pad.products_attributes_id\n where pa.products_id = '\" . $order->products[$i]['id'] . \"'\n and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '\" . $languages_id . \"'\n and poval.language_id = '\" . $languages_id . \"'\";\n $attributes = tep_db_query($attributes_query);\n } else {\n $attributes = tep_db_query(\"select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa where pa.products_id = '\" . $order->products[$i]['id'] . \"' and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"' and pa.options_id = popt.products_options_id and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '\" . $languages_id . \"' and poval.language_id = '\" . $languages_id . \"'\");\n }\n $attributes_values = tep_db_fetch_array($attributes);\n \n $sql_data_array = array(\n 'orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'products_options' => $attributes_values['products_options_name'],\n 'products_options_values' => $attributes_values['products_options_values_name'],\n 'options_values_price' => $attributes_values['options_values_price'],\n 'price_prefix' => $attributes_values['price_prefix']\n );\n \n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n \n if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {\n $sql_data_array = array(\n 'orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_filename' => $attributes_values['products_attributes_filename'],\n 'download_maxdays' => $attributes_values['products_attributes_maxdays'],\n 'download_count' => $attributes_values['products_attributes_maxcount']\n );\n \n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n }\n }\n }\n \n $cart_cgp_ID = $cartID . '-' . $insert_id;\n tep_session_register('cart_cgp_ID');\n }\n }\n }", "public function smart_coupons_discount_total_filters() {\n\t\t\tif ( WCS_SC_Compatibility::is_cart_contains_subscription() && WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t} else {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t\tglobal $current_screen;\n\t\t\t\tif ( ! empty( $current_screen ) && 'edit-shop_order' !== $current_screen ) {\n\t\t\t\t\tadd_filter( 'woocommerce_order_get_total', array( $this, 'smart_coupons_order_discounted_total' ), 10, 2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function get_discounts_before_tax() {\n\t\t\tif ($this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function filter_billing_fields( $billing_fields ) {\n if( ! is_checkout() ) return $billing_fields;\n\n $cart = WC()->cart->get_cart();\n\n // iterate through each item of the cart \n foreach ( $cart as $item_key => $values ) {\n $product = $values['data'];\n $price = $product->get_price();\n\n // if any cart items are greater than 0 end loop the rest of the function is dunzo\n if ($price > 0){\n $see_ya = 1;\n break;\n } \n }\n\n if($see_ya) return $billing_fields;\n\n $billing_fields['billing_phone']['required'] = false;\n return $billing_fields;\n}", "function line_allowance_charge_delete($args)\n {\n global $_lib;\n $query = \"delete from $this->line_allowance_charge_table where InvoiceLineAllowanceChargeID = \" . $args['InvoiceLineAllowanceChargeID'];\n return $_lib['db']->db_delete($query);\n }", "public function croll_tab_check_pd_no_confirm_pd() {\n\n //find and up status pd = 3\n $this -> load -> model('account/auto');\n $this -> load -> model('account/block');\n $query_rp = $this -> model_account_auto -> get_rp_pd();\n \n foreach ($query_rp as $key => $value) {\n \t // $this -> model_account_auto -> update_lock2_customer($value['customer_id']);\n \t$description ='You did not complete PD';\n \t$this -> model_account_block -> update_check_block_pd($value['customer_id'],$description, $value['pd_number']);\n \t $total = $this -> model_account_block -> get_total_block_id_pd($value['customer_id']);\n\t\t \tif (intval($total) === 2) {\n\t\t \t\t$this -> model_account_auto -> updateStatusCustomer($value['customer_id']);\n\t\t }\n }\n $this -> model_account_auto -> auto_find_pd_update_status_report();\n \n die();\n }", "public function eliminar_producto_total($producto)\n {\n\n $where = array(\"PROD_Codigo\" => $producto, \"COMPP_Codigo\" => $this->compania);\n $this->db->delete('cji_productocompania', $where);\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "function get_discounts_after_tax() {\n\t\t\tif ($this->discount_total) :\n\t\t\t\treturn cmdeals_price($this->discount_total); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function before_process() {\n\n global $order, $order_total_modules, $db;\n\n $myAction = '';\n\n if(isset($_GET['Action'])){\n\n $myAction = $_GET['Action'];\n if($myAction == 'CheckoutSuccess'\n && isset($_SESSION['CCBILL_AMOUNT'])\n && strlen('' . $_SESSION['CCBILL_AMOUNT']) > 2){\n\n $myDigest = $_SESSION['CCBILL_AMOUNT'];\n\n $tcSql = \"SELECT * FROM ccbill WHERE email = '\" . $order->customer['email_address'] . \"' AND amount = '\" . $myDigest . \"' AND success = 1 AND order_created = 0\";\n\n //die('sql: ' . $tcSql);\n\n $check_query = $db->Execute($tcSql);\n $rowCount = $check_query->RecordCount();\n\n //die('record count: ' . $rowCount);\n\n if($rowCount > 0){\n\n $tcSql = \"UPDATE ccbill SET order_created = 1 WHERE email = '\" . $order->customer['email_address'] . \"' AND amount = '\" . $myDigest . \"'\";\n\n $db->Execute($tcSql);\n\n unset($_SESSION['CCBILL_AMOUNT']);\n return true;\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if/else\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if/else\n\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if response is included\n\n\n }", "public function sc_order_get_discount_amount( $total, $coupon, $order ) {\n\t\t\t$discount = 0;\n\n\t\t\tif ( $coupon instanceof WC_Coupon && $order instanceof WC_Order ) {\n\t\t\t\t$coupon_amount = $coupon->get_amount();\n\t\t\t\t$discount_type = $coupon->get_discount_type();\n\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t$coupon_product_ids = $coupon->get_product_ids();\n\t\t\t\t$coupon_product_categories = $coupon->get_product_categories();\n\n\t\t\t\tif ( 'smart_coupon' === $discount_type ) {\n\n\t\t\t\t\t$calculated_total = $total;\n\n\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 || count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t$discount = 0;\n\t\t\t\t\t\t$line_totals = 0;\n\t\t\t\t\t\t$line_taxes = 0;\n\t\t\t\t\t\t$discounted_products = array();\n\n\t\t\t\t\t\t$order_items = $order->get_items( 'line_item' );\n\n\t\t\t\t\t\tforeach ( $order_items as $order_item_id => $order_item ) {\n\t\t\t\t\t\t\tif ( $discount >= $coupon_amount ) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $order_item['product_id'] );\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $order_item_id ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $order_item_id, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && count( array_intersect( $product_cats, $coupon_product_categories ) ) > 0 ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $order_item_id ) ) ? $order_item_id : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $order_item['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $order_item['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $order_item_id ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $order_item_id, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && in_array( $order_item['product_id'], $coupon_product_ids, true ) || in_array( $order_item['variation_id'], $coupon_product_ids, true ) ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $order_item_id ) ) ? $order_item_id : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $order_item['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $order_item['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$calculated_total = round( ( $line_totals + $line_taxes ), wc_get_price_decimals() );\n\n\t\t\t\t\t}\n\t\t\t\t\t$discount = min( $calculated_total, $coupon_amount );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $discount;\n\t\t}", "public function hasPrecost(){\n return $this->_has(25);\n }", "public function getPurchaseGrandTotal() {\n return $this->purchaseGrandtotal; \n }", "function process_payment($order_number, $order_total, &$d) {\n return true;\n }", "public static function bogo_apply_disc($order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt){\r \t//echo \"$order_id,$promotion_id,$prmdisc_id,$prmdisc_bogo_sbmnu,$prmdisc_bogo_sbmnu_dish,$prmdisc_bogo_qty,$disc_amt_type,$disc_amt\";\r\t\t//..Check if discount is with sub menu item is selected\r\t\tif(is_gt_zero_num($prmdisc_bogo_sbmnu_dish)){\r\t\t\t//..do nothing..because we already ahve submenudishid\r\t\t}else{\r\t\t //..Get all submenu dish ids from submenu..\r\t\t\t$rs_apl_disc_items= tbl_submenu_dishes::getSubMenuItems($prmdisc_bogo_sbmnu);\r\t\t\tif(is_not_empty($rs_apl_disc_items)){\r\t\t\t\t$prmdisc_bogo_sbmnu_dish=$rs_apl_disc_items;\r\t\t\t}else{\r\t\t\t\t$strOpMsg= \"No items found to apply discount\" ;\r\t\t\t\treturn 0;\r\t\t\t}\r\t\t}\t\t\r \t\t//...Check if the item is in the order detail\r\t\t$tmp_fnd=0;\r\t\t$ord_det_items=tbl_order_details::readArray(array(ORD_DTL_ORDER_ID=>$order_id,ORD_DTL_SBMENU_DISH_ID=>$prmdisc_bogo_sbmnu_dish,ORDPROM_DISCOUNT_AMT=>0),$tmp_fnd,1,0);\t\t\t\t\t\t\t\r\t\tif($tmp_fnd>0){\t\t \r\t\t\t//..item presents in order detail wihtout disocunt\r\t\t\t//..loop through the all the order items records\r\t\t\tforeach($ord_det_items as $order_itm){\r\t\t\t\t //..now check if the quantity >= disc qty\t\t\t\t\t \r\t\t\t\t if($order_itm[ORD_DTL_QUANTITY]>=$prmdisc_bogo_qty){\r\t\t\t\t \t //..Right item to apply discount\r\t\t\t\t\t //..Calculate discount amount\t\r\t\t\t\t\t$discount_amount=tbl_order_details::getDiscountAmnt($disc_amt_type,$disc_amt,$order_itm[ORD_DTL_PRICE]);\r\t\t\t\t\t//..Update the order detail with discount and promot\r\t\t\t\t\t$success=tbl_order_details::update_item_with_discount($order_itm[ORD_DTL_ID],$promotion_id,$prmdisc_id,$discount_amount);\t\r\t\t\t\t\t\t\t\t\t\t\t \r\t\t\t\t }\r\t\t\t}\r\t\t\tunset($ord_det_items);\t\r\t\t}else{\r\t\t\t$strOpMsg= \"Item not present in your order or alreday discounted\" ;\r\t\t}\t\r\t\treturn 1;\r }", "protected function hasRemainingDiscount()\n {\n return !$this->limited || $this->remaining > 0;\n }", "public function smart_coupons_order_discounted_total( $total = 0, $order = null ) {\n\n\t\t\tif ( ! $this->is_wc_gte_30() ) {\n\n\t\t\t\t$is_proceed = check_ajax_referer( 'calc-totals', 'security', false );\n\n\t\t\t\tif ( ! $is_proceed ) {\n\t\t\t\t\treturn $total;\n\t\t\t\t}\n\n\t\t\t\t$called_by = ( ! empty( $_POST['action'] ) ) ? wc_clean( wp_unslash( $_POST['action'] ) ) : ''; // phpcs:ignore\n\n\t\t\t\tif ( 'woocommerce_calc_line_taxes' !== $called_by ) {\n\t\t\t\t\treturn $total;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $order ) ) {\n\t\t\t\treturn $total;\n\t\t\t}\n\n\t\t\t$coupons = ( is_object( $order ) && is_callable( array( $order, 'get_items' ) ) ) ? $order->get_items( 'coupon' ) : array();\n\n\t\t\tif ( ! empty( $coupons ) ) {\n\t\t\t\tforeach ( $coupons as $coupon ) {\n\t\t\t\t\t$code = ( is_object( $coupon ) && is_callable( array( $coupon, 'get_code' ) ) ) ? $coupon->get_code() : '';\n\t\t\t\t\tif ( empty( $code ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$_coupon = new WC_Coupon( $code );\n\t\t\t\t\t$discount_type = ( is_object( $_coupon ) && is_callable( array( $_coupon, 'get_discount_type' ) ) ) ? $_coupon->get_discount_type() : '';\n\t\t\t\t\tif ( ! empty( $discount_type ) && 'smart_coupon' === $discount_type ) {\n\t\t\t\t\t\t$discount = ( is_object( $_coupon ) && is_callable( array( $_coupon, 'get_amount' ) ) ) ? $_coupon->get_amount() : 0;\n\t\t\t\t\t\t$applied_discount = min( $total, $discount );\n\t\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\t\t$coupon->set_discount( $applied_discount );\n\t\t\t\t\t\t\t$coupon->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$total = $total - $applied_discount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $total;\n\t\t}", "function js_remove_checkout_fields( $fields ) {\n if( ! is_checkout() ) return $fields;\n $cart = WC()->cart->get_cart();\n $total_price = 0;\n // iterate through each item of the cart \n foreach ( $cart as $item_key => $values ) {\n $product = $values['data'];\n $price = $product->get_price();\n $total_price += $price;\n }\n // if any cart items are greater than 0 end loop the rest of the function is dunzo\n if ($total_price > 0){\n return $fields;\n } \n\n // Billing fields\n unset( $fields['billing']['billing_company'] );\n unset( $fields['billing']['billing_phone'] );\n unset( $fields['billing']['billing_state'] );\n unset( $fields['billing']['billing_address_1'] );\n unset( $fields['billing']['billing_address_2'] );\n unset( $fields['billing']['billing_city'] );\n unset( $fields['billing']['billing_postcode'] );\n\n // Shipping fields\n unset( $fields['shipping']['shipping_company'] );\n unset( $fields['shipping']['shipping_phone'] );\n unset( $fields['shipping']['shipping_state'] );\n unset( $fields['shipping']['shipping_first_name'] );\n unset( $fields['shipping']['shipping_last_name'] );\n unset( $fields['shipping']['shipping_address_1'] );\n unset( $fields['shipping']['shipping_address_2'] );\n unset( $fields['shipping']['shipping_city'] );\n unset( $fields['shipping']['shipping_postcode'] );\n\n // Order fields\n unset( $fields['order']['order_comments'] );\n \n return $fields;\n}", "public function isExcludedWith($adjustmentCode);", "public function addremoveInsuranceToOrder(Request $request)\n {\n $InsuranceAmount = Config::get('constants.InsurancePrice');\n if ($request->flag == 1) {\n $getinsurableProds = $this->getAllOrderedHierableProds($request->orderRefId);\n if (count($getinsurableProds) > 0) {\n $insuranceCost = count($getinsurableProds) * $InsuranceAmount;\n $PreorderDetArr = $this->getPreOrderDetails($request->orderRefId);\n if (count($PreorderDetArr) > 0) {\n $result = DB::table($this->DBTables['Pre_Orders'])\n ->where('order_reference_id', '=', $request->orderRefId)\n ->update([\n 'total_amnt' => DB::raw('total_amnt - insurance_amnt')\n ]);\n DB::table($this->DBTables['Pre_Orders'])\n ->where('order_reference_id', '=', $request->orderRefId)\n ->update([\n 'insurance_amnt' => $insuranceCost,\n 'total_amnt' => DB::raw('total_amnt + ' . $insuranceCost)\n ]);\n }\n }\n\n } elseif ($request->flag == 2) {\n $PreorderDetArr = $this->getPreOrderDetails($request->orderRefId);\n if (count($PreorderDetArr) > 0 && $PreorderDetArr[0]->insurance_amnt > 0) {\n DB::table($this->DBTables['Pre_Orders'])\n ->where('order_reference_id', '=', $request->orderRefId)\n ->update([\n 'insurance_amnt' => 0.00,\n 'total_amnt' => DB::raw('total_amnt - ' . $PreorderDetArr[0]->insurance_amnt)\n ]);\n }\n\n }\n\n return '1';\n }", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "function reduceAddedByCouponsValueIfQuantityIsLess() {\r\n\t\tif(is_array($this->basket->basket_items)){\r\n\t\t\tforeach($this->basket->basket_items as $articleUid => $item) {\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid)) {\r\n\t\t\t\t\t#debug($item);\r\n\t\t\t\t}\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid) && count($item->tx_commercecoupons_addedbycouponid)>$item->quantity) {\r\n\t\t\t\t\t$new_addedByCoupons_value = $this->getFirstItemsOfArray($item->tx_commercecoupons_addedbycouponid, $item->quantity);\r\n\t\t\t\t\t$old_addedByCoupons_value = $item->tx_commercecoupons_addedbycouponid;\r\n\t\t\t\t\tif(is_array($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon)) {\r\n\r\n\t\t\t\t\t\t$removedItems = array_diff($old_addedByCoupons_value,$new_addedByCoupons_value);\r\n\t\t\t\t\t\t$this->removeItemsByValue($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon,$removedItems);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->basket->basket_items[$articleUid]->tx_commercecoupons_addedbycouponid = $new_addedByCoupons_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function check_cart_coupons() {\n\t\tforeach ( $this->get_applied_coupons() as $code ) {\n\t\t\t$coupon = new WC_Coupon( $code );\n\n\t\t\tif ( ! $coupon->is_valid() ) {\n\t\t\t\t$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );\n\t\t\t\t$this->remove_coupon( $code );\n\t\t\t}\n\t\t}\n\t}", "function get_cart_subtotal() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t// Display ex tax if the option is set, or prices exclude tax\n\t\t\tif ($this->display_totals_ex_tax || !$this->prices_include_tax) :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal_ex_tax );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && $this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->ex_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\t\n\t\t\telse :\n\t\t\t\t\n\t\t\t\t$return = cmdeals_price( $this->subtotal );\n\t\t\t\t\n\t\t\t\tif ($this->tax_total>0 && !$this->prices_include_tax) :\n\t\t\t\t\t$return .= ' <small>'.$cmdeals->countries->inc_tax_or_vat().'</small>';\n\t\t\t\tendif;\n\t\t\t\treturn $return;\n\t\t\t\n\t\t\tendif;\n\t\n\t\t}", "public function getGrandTotal();", "public function hasUnlimitedTotalCredit()\n\t{\n\t return $this->group->limit_totalemailslimit > 0\n\t ? false\n\t : true;\n\t}", "function order_contains_equal_plates_and_engravings($order) {\n if (!empty($order->commerce_line_items)) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $plates = 0;\n $engravings = 0;\n\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n if (!empty($line_item_wrapper->value()->commerce_product) && $line_item_wrapper->commerce_product->value()->type == 'plates') {\n $plates++;\n }\n\n if ($line_item_wrapper->value()->type == 'engraving') {\n $engravings++;\n }\n }\n\n // If there is an equal number\n if (($engravings + $plates == 0) || ($engravings == $plates)) {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }", "function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function cashierDeleteOPDDueCollection($id , $invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n // due collection info\n $collection_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n $total_payable = $collection_info->total_payable ;\n $total_discount = $collection_info->total_discount ;\n $total_rebate = $collection_info->total_rebate ;\n $total_payment = $collection_info->total_payment ;\n $bill_added_id = $collection_info->added_id ;\n $bill_tr_date = $collection_info->tr_date ;\n $bill_created_time = $collection_info->created_time ;\n $bill_created_at = $collection_info->created_at ;\n\n // get opd bill info\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n\n if($opd_status == '2'){\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash check\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Collection Amount. Please Delete This Collection After Available Pettycash');\n return Redirect::to('cashierOPDDueCollectionReport');\n exit();\n }\n }\n // check doctor discount\n $count_doctor_discount = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n if($count_doctor_discount > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This OPD Bill. First Delete Doctor Discount Of This Bill Then Try To Delete OPD Due Collection');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n exit();\n \n }\n\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n // reduce pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n\n $due_status = 2 ;\n // change opd bill status\n $data_pathlogy_due_status = array() ;\n $data_pathlogy_due_status['due_status'] = $due_status ;\n DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->update($data_pathlogy_due_status);\n \n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 5 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['opd_status'] = $opd_status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , OPD Due Collection Deleted Successfully');\n return Redirect::to('cashierOPDDueCollectionReport');\n }", "function cf_invoice_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->invoice_id) && !$params->invoice_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\tif (isset($params->is_plan) && $params->is_plan) {\n\t\t\t// $str = \"SELECT grand_total,\n\t\t\t\t// (\n\t\t\t\t\t// select coalesce(sum(amount),0) from cf_invoice_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id\n\t\t\t\t// ) as plan_total \n\t\t\t\t// from cf_invoice t1 where t1.id = $invoice_id\";\n\t\t\t$str = \"SELECT (grand_total - (select coalesce(sum(amount),0) from cf_invoice_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t}\n\t\t$row = $this->db->query($str)->row();\n\t\t// if ($row->grand_total - $row->plan_total - $params->amount < 0) {\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t// $this->session->set_flashdata('message', $row->grand_total - $row->plan_total);\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t// if ($row->grand_total - $row->plan_total < $params->amount)\n\t}", "public function remove_order( $order_id, $refund_id, $is_total_refund = false ) {\n\t\t$is_in_ga = get_post_meta( $refund_id, '_monsterinsights_refund_is_in_ga', true );\n\t\t$skip_ga = apply_filters( 'monsterinsights_ecommerce_undo_transaction_skip_ga', false, $order_id );\n\t\tif ( $is_in_ga === 'yes' || $skip_ga ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$order = wc_get_order( $order_id );\n\t\t$refund = ! empty( $refund_id ) ? wc_get_order( $refund_id ) : $order;\n\t\t$cart_contents = $refund->get_items();\n\n\t\t$atts = array(\n\t\t\t't' => 'event', \t\t// Type of hit\n\t\t\t'ec' => 'Orders', \t\t// Event Category\n\t\t\t'ea' => 'Refunded', \t\t// Event Action\n\t\t\t'el' => $order_id, \t\t// Event Label\n\t\t\t'ev' => -1 * round( $refund->get_amount() * 100 ), \t // Event Value\n\t\t\t'cid' => monsterinsights_get_client_id( $order_id ), \t\t// GA Client ID\n\t\t);\n\n\t\t$ee_atts = array(\n\t\t\t'pa' => 'refund', \t \t\t// Product Action\n\t\t\t'ti' => $order_id, \t\t \t\t// Transaction ID\n\t\t);\n\n\t\t// Declare items in cart\n\t\tif ( ! $is_total_refund ) {\n\t\t\t$items = array();\n\t\t\t$i = 1;\n\t\t\tforeach ( $cart_contents as $key => $item ) {\n\t\t\t\t// Refund lines with a negative total and a quantity of at least 1\n\t\t\t\tif ( $item['qty'] >= 1 && $refund->get_item_total( $item ) <= 0 ) {\n\t\t\t\t\t$items[\"pr{$i}id\"] = $key; \t // Product ID\n\t\t\t\t\t$items[\"pr{$i}qt\"] = $item->get_quantity(); // Product Quantity\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If we have line items, then we have an EE event\n\t\t\tif ( ! empty( $items ) ) {\n\t\t\t\t$atts = array_merge( $atts, $items );\n\t\t\t\t$atts = array_merge( $atts, $ee_atts );\n\t\t\t}\n\t\t} else {\n\t\t\t// If it's a full refund, then it's an EE event\n\t\t\t$atts = array_merge( $atts, $ee_atts );\n\t\t}\n\n\t\tif ( monsterinsights_get_option( 'userid', false ) ) {\n\t\t\t$atts['uid'] = $order->user_id; // UserID tracking\n\t\t}\n\n\t\tmonsterinsights_mp_track_event_call( $atts );\n\t\tupdate_post_meta( $refund_id, '_monsterinsights_refund_is_in_ga', 'yes' );\n\t}", "public function hasMoneycount(){\n return $this->_has(4);\n }", "public function getOutstandingAmountCustomer($gsaUid) {\n trace('[METHOD] '.__METHOD__);\n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $outstandingAmount=0;\n $outstandingItemArr = $gsaAccountingTransactionAccessorObj->selectInvoicesByCustomer($gsaUid, '04RE', true);\n foreach ($outstandingItemArr as $itemArr) {\n if (($itemArr['relatedDocNo'] && $this->isOutstanding($itemArr['paymentMethod'], $itemArr['relatedDocNo']) )||\n !$itemArr['relatedDocNo']) {\n $outstandingAmount = bcadd($outstandingAmount,$this->getOutstandingAmountInvoice($itemArr),$this->precision);\n trace($outstandingAmount,0,'$outstandingAmount');\n }\n } \n return $outstandingAmount;\n }", "public function refund(Varien_Object $payment, $amount)\n\t{\n\t\t$order = $payment->getOrder();\n\t\t$this->setStore($order->getStore()->getStoreId());\n\n\t\tif(!$this->helper->isKcoOrder($order))\n\t\t\treturn $this;\n\n\t\t$creditmemo = $payment->getCreditmemo();\n\t\t$invoice = $creditmemo->getInvoice();\n\t\t$klarnaInvoice = $invoice->getTransactionId();\n\n\t\t$products = array();\n\t\t$result = array();\n\t\t$totalRefund = false;\n\n\t\tif (abs($invoice->getGrandTotal() - $creditmemo->getGrandTotal()) < .0001)\n\t\t\t$totalRefund = true;\n\n\t\tforeach ($creditmemo->getAllItems() as $item){\n\t\t\t$invoiceItem = Mage::getResourceModel('sales/order_invoice_item_collection')\n\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t->setInvoiceFilter($invoice->getId())\n\t\t\t\t->addFieldToFilter('order_item_id', $item->getOrderItemId())\n\t\t\t\t->getFirstItem();\n\n\t\t\t$diff = $item->getQty() - $invoiceItem->getQty();\n\n\t\t\tif($diff > 0)\n\t\t\t\t$totalRefund = false;\n\n\t\t\tif($item->getQty() > 0 && !$item->getOrderItem()->isDummy())\n\t\t\t\t$products[$item->getSku()] = $item->getQty();\n\t\t}\n\n\t\tif($totalRefund){\n\t\t\t$result[] = $this->creditInvoice($klarnaInvoice)\n\t\t\t\t? \"Refunded Klarna invoice \" . $klarnaInvoice\n\t\t\t\t: \"Failed to refund Klarna invoice \" . $klarnaInvoice;\n\t\t}\n\t\telse{\n\t\t\t$fee = null;\n\t\t\tif($creditmemo->getAdjustment() < 0)\n\t\t\t\t$fee = abs($creditmemo->getAdjustment());\n\n\t\t\tif(!empty($products) || $creditmemo->getShippingAmount() > 0){\n\t\t\t\tif (abs($invoice->getShippingAmount() - $creditmemo->getShippingAmount()) < .0001)\n\t\t\t\t\t$products['shipping_fee'] = 1;\n\n\t\t\t\tif($fee != null){\n\t\t\t\t\t$response = $this->creditPart($klarnaInvoice, $products, $fee, $this->getConfig()->getReturnTaxRate());\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$response = $this->creditPart($klarnaInvoice, $products);\n\t\t\t\t}\n\n\t\t\t\tif($response){\n\t\t\t\t\t$t = \"Credited products: \";\n\t\t\t\t\tforeach($products as $key => $p){\n\t\t\t\t\t\t$t .= $key.\"(\".$p.\") \";\n\t\t\t\t\t}\n\t\t\t\t\t$result[] = $t;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$result[] = \"Failed to do partial refund\";\n\t\t\t\t}\n\n\t\t\t\tif($creditmemo->getShippingAmount() > 0 && !array_key_exists('shipping_fee', $products)){\n\t\t\t\t\t$result[] = $this->returnAmount($klarnaInvoice, $creditmemo->getShippingAmount(), Mage::helper('klarnaCheckout')->getShippingVatRate())\n\t\t\t\t\t\t? \"Refunded amount of \" . $creditmemo->getShippingAmount() . \" from shipment on Klarna invoice \" . $klarnaInvoice\n\t\t\t\t\t\t: \"Failed to refund amount of \" . $creditmemo->getShippingAmount() . \" from shipment on Klarna invoice \" . $klarnaInvoice;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creditmemo->getAdjustment() > 0){\n\t\t\t\t$result[] = $this->returnAmount($klarnaInvoice, $creditmemo->getAdjustment(), $this->getConfig()->getReturnTaxRate())\n\t\t\t\t\t? \"Refunded amount of \" . $creditmemo->getAdjustment() . \" on Klarna invoice \" . $klarnaInvoice\n\t\t\t\t\t: \"Failed to refund amount of \" . $creditmemo->getAdjustment() . \" on Klarna invoice \" . $klarnaInvoice;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($result)) {\n\t\t\tforeach($result as $msg){\n\t\t\t\t$order->addStatusHistoryComment($msg);\n\t\t\t}\n\t\t\t$order->save();\n\t\t}\n\n\t\treturn $this;\n\t}", "public function hasAmountsInc()\n {\n return $this->AmountsInc !== null;\n }", "public function buyer_cancel($order_id)\n {\n $changes = array('progress' => '0',\n 'shipping_costs' => 0.00000000,\n 'fees' => 0.00000000,\n 'confirmed_time' => '',\n 'buyer_public_key' => '');\n $this->db->where('id', $order_id);\n return $this->db->update('orders', $changes) == TRUE;\n }", "public function getGrandTotal()\n {\n return $this->getOrder()->getGrandTotal();\n }", "function totalVAT()\n {\n return false;\n }", "public function croll_tab_check_no_confirm_gd() {\n $this -> load -> model('account/auto');\n $this -> load -> model('account/block');\n $query_rp = $this -> model_account_block -> get_rp_gd_no_fn();\n \t //echo \"<pre>\"; print_r($query_rp); echo \"</pre>\"; die();\n foreach ($query_rp as $key => $value) {\n \t // $this -> model_account_auto -> update_lock2_customer($value['customer_id']);\n \t$description ='Change status from ACTIVE to FROZEN Reason: you did not complete GD';\n \t$this -> model_account_block -> insert_block_id_gd($value['customer_id'], $description, $value['gd_number']);\n \t$this -> model_account_block -> update_check_block_gd($value['id']);\n \t$total = $this -> model_account_block -> get_total_block_id_gd($value['customer_id']);\n \tif (intval($total) === 2) {\n \t\t$this -> model_account_auto -> updateStatusCustomer($value['customer_id']);\n \t}\n } \n die();\n }", "public function cashierDeleteOPDBill($invoice , $year_invoice , $daily_invoice ,$cashbook_id)\n {\n $pathology_tr_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->where('status',0)->first();\n\n $total_payable = $pathology_tr_info->total_payable ;\n $total_discount = $pathology_tr_info->total_discount ;\n $total_rebate = $pathology_tr_info->total_rebate ;\n $total_payment = $pathology_tr_info->total_payment ;\n\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n\n if($opd_status == '2'){\n $check_pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $check_current_pettycash_amt = $check_pettycash_amount->pettycash_amount ;\n if($check_current_pettycash_amt < $total_payment){\n Session::put('failed','Sorry ! Pettycash Amount Small Than Delete Bill Payment Amount. Please Delete This Bill After Available Pettycash');\n return Redirect::to('cashierOPDBillReport');\n exit();\n }\n }\n //check doctor discount of this invoice\n $doctor_discount_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',2)->count();\n if($doctor_discount_count > 0){\n Session::put('failed','Sorry ! Given Doctor Discount Of This OPD Bill. First Delete Doctor Discount Of This Bill Then Try To Delete OPD Bill');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n exit();\n }\n $due_collection_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',1)->count();\n if($due_collection_count > 0){\n Session::put('failed','Sorry ! Due Collection Of This OPD Bill. First Delete Due Collection Of This Bill Then Try To Delete OPD Bill');\n return Redirect::to('cashierOPDDueCollectionReport');\n exit();\n }\n $delete_count = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->whereNotIn('status',[0])->count();\n if($delete_count > 0){\n Session::put('failed','Sorry ! Delete Doctor Discount And Due Collection If You Given It. Manualy Check That And Try To Delete OPD Bill');\n return Redirect::to('cashierOPDBillReport');\n exit();\n } \n // get pathology bill info\n $pathology_info = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->first();\n $bill_added_id = $pathology_info->added_id ;\n $bill_tr_date = $pathology_info->bill_date ;\n $bill_created_time = $pathology_info->bill_time ;\n $bill_created_at = $pathology_info->created_at ;\n $doctor_id = $pathology_info->doctor_id ;\n $patient_id = $pathology_info->patient_id ;\n $due_status = $pathology_info->due_status ;\n\n $pathoogy_item = DB::table('opd_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->get();\n $itam = array();\n foreach ($pathoogy_item as $value_iteam) {\n $itam[] = $value_iteam->opd_fee_id ;\n }\n $item_implode = implode(',', $itam);\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n // petty cash update\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt - $total_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n\n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 6 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ;\n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = 1 ;\n $data_delete_pathology_bill['doctor_id'] = $doctor_id;\n $data_delete_pathology_bill['patient_id'] = $patient_id;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['opd_fee_id'] = $item_implode;\n $data_delete_pathology_bill['due_status'] = $due_status;\n $data_delete_pathology_bill['status'] = 0 ;\n $data_delete_pathology_bill['opd_status'] = $opd_status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // delete pathlogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',0)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',1)->delete();\n // delete pathlogy bill iteam\n DB::table('opd_bill_item')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n // delete pathlogy bill\n DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->where('cashbook_id',$cashbook_id)->delete();\n Session::put('succes','Thanks , OPD Bill Deleted Successfully');\n return Redirect::to('cashierOPDBillReport');\n\n }", "public function freePosCreditMemoOrCancellation($type,$amountNet, $taxCode, $docRecordId, $customerObj) {\n trace('[METHOD] '.__METHOD__);\n \n $gsaShopTransactionAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n if ($type == 'GU') {\n } else if ($type == 'ST'){ \n $posFieldsArr['GEWICHT'] = 0.0000;\n } \n\n\n // Freie Gutschrift\n $posFieldsArr = array(); // prepare continued position data: copy order confirmation position data to continued position data and change/overwrite relevant values\n $posFieldsArr['AUFINR'] = $docRecordId;\n $posFieldsArr['POSINR'] = 1;\n $posFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertTransactionDocPosition()\n $posFieldsArr['ALTAUFINR'] = 0; // not set\n $posFieldsArr['POSNR'] = '#001';\n $posFieldsArr['POSART'] = 'DF';\n $posFieldsArr['ADRINR'] = $customerObj->get_gsauid(); // Adress number from Customer\n $posFieldsArr['MENGE'] = 1.0000;\n $posFieldsArr['MENGE2'] = 1.0000;\n $posFieldsArr['MENGE3'] = 1.0000;\n $posFieldsArr['MENGE4'] = 1.0000;\n\n $posFieldsArr['RABATT'] = 0.0000;\n $posFieldsArr['ZU1'] = 0.0000;\n $posFieldsArr['ZU2'] = 0.0000;\n $posFieldsArr['EKPREIS'] = 0.0000;\n $posFieldsArr['EP'] = $amountNet;\n $posFieldsArr['GP'] = $amountNet;\n $posFieldsArr['USTSATZ'] = $taxCode; \n \n $posFieldsArr['VEINHEIT'] = 1.000;\n $posFieldsArr['PEINHEIT'] = 1.000;\n $posFieldsArr['LAGART'] = 0;\n $posFieldsArr['LEINHEIT'] = 1.000;\n \n $posFieldsArr['ZWSUMME'] = 0.0000;\n $posFieldsArr['MITGESRAB'] = 0;\n $posFieldsArr['MITSKONTO'] = 0;\n $posFieldsArr['FIXKOST1'] = 0.0000;\n $posFieldsArr['FIXKOST2'] = 0.0000;\n $posFieldsArr['FIXPROZ1'] = 0.0000;\n $posFieldsArr['FIXPROZ2'] = 0.0000;\n $posFieldsArr['USTEG'] = 0.0000;\n $posFieldsArr['USTAUSLAND'] = '00'; //TODO überprüfen\n $posFieldsArr['ZUSTEXT1'] = '';\n $posFieldsArr['ZUSTEXT2'] = '';\n $posFieldsArr['SONPREIS'] = 0;\n $posFieldsArr['ALTTEIL'] = 0;\n $posFieldsArr['PROVMANU'] = 0;\n $posFieldsArr['RGARANTIE'] = 0;\n $posFieldsArr['RREKLAMATION'] = 0;\n $posFieldsArr['RBEMERKUNG'] = '';\n $posFieldsArr['RKOSTENPFLICHT'] = 0;\n $posFieldsArr['RTEXTKUNDE'] = '';\n $posFieldsArr['RTEXTBERICHT'] = '';\n \n $posFieldsArr['NRESERVIERT'] = 1.0000;\n $posFieldsArr['NGEBUCHT'] = 0.0000;\n $posFieldsArr['GESPEICHERT'] = 1;\n $posFieldsArr['INSZAEHLER'] = bcmul($posFieldsArr['POSINR'],10000.0000,$this->precision); \n\n trace($posFieldsArr,0,'$posFieldsArr');\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $posRecordId = $gsaShopTransactionAccessorObj->insertTransactionDocPosition($posFieldsArr);\n }\n return $posRecordId;\n }", "public function validateMinimumAmount()\n {\n return !(Mage::getStoreConfigFlag('sales/minimum_order/active')\n && Mage::getStoreConfigFlag('sales/minimum_order/multi_address')\n && !$this->getQuote()->validateMinimumAmount());\n }", "protected function _remove($order_id){\n\t\t$resource = Mage::getSingleton('core/resource');\n\t\t$delete = $resource->getConnection('core_read');\n\t\t$order_table = $resource->getTableName('sales_flat_order_grid');\n\t\t$invoice_table = $resource->getTableName('sales_flat_invoice_grid');\n\t\t$shipment_table = $resource->getTableName('sales_flat_shipment_grid');\n\t\t$creditmemo_table = $resource->getTableName('sales_flat_creditmemo_grid');\n\t\t$sql = \"DELETE FROM \" . $order_table . \" WHERE entity_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $invoice_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $shipment_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $creditmemo_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\n\t\treturn true;\n\t}", "function no_bankrupt($cash, $cost) {\n\tif ($cash - $cost < 0) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function getCheckoutGrandTotal()\n {\n $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal();\n return $this->helper('affirm/util')->formatCents($total);\n }", "function remove_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"DELETE FROM preorder_customers WHERE prc_preorderID=$this->preorderID AND prc_customerID=$this->customerID\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "public function removeTotal($code)\n {\n unset($this->_totals[$code]);\n return $this;\n }", "function wcs_can_items_be_removed( $subscription ) {\n\t$allow_remove = false;\n\n\tif ( sizeof( $subscription->get_items() ) > 1 && $subscription->payment_method_supports( 'subscription_amount_changes' ) && $subscription->has_status( array( 'active', 'on-hold', 'pending' ) ) ) {\n\t\t$allow_remove = true;\n\t}\n\n\treturn apply_filters( 'wcs_can_items_be_removed', $allow_remove, $subscription );\n}", "public function calculatePartialFinalInstallmentCharge()\n\t{\n\t\tif (!$this->hasPartialFinalInstallmentCharge())\n\t\t{\n\t\t\t// The final installment will be the normal recursion charge \n\t\t\treturn $this->recursionCharge;\n\t\t}\n\t\t\n\t\t$intTimesToCharge = $this->getTimesToCharge();\n\t\tif ($intTimesToCharge < 1)\n\t\t{\n\t\t\tthrow new Exception_Assertion(__METHOD__ .\" - RecurringCharge (Id: {$this->id}, Account: {$this->account}, Service: {$this->service}) has calculated timesToCharge = '{$intTimesToCharge}', which should never be the case\", \"RecurringCharge object: \\n\". print_r($this, true), \"RecurringCharge Record Data Integrity Breach\");\n\t\t}\n\t\t\n\t\t$fltTotalChargedBeforeFinalInstallment = $this->recursionCharge * ($intTimesToCharge - 1);\n\t\t\n\t\treturn $this->minCharge - $fltTotalChargedBeforeFinalInstallment;\n\t}", "function _reconfirm_cheat_code()\n\t{\n\t\t//If discount is applied, do a conditional-check again\n\t\tif($this->cart->is_discount_applied())\n\t\t{\n\t\t\t$coupon = $this->cart->discount_info();\n\t\t\tif($this->_can_apply_code($coupon) == false)\n\t\t\t{\n\t\t\t\t$this->cart->remove_discount();\n\t\t\t}\n\t\t}\n\t}", "public function getSubtotalInclTax();", "public function clearOrderHasArticless()\n {\n $this->collOrderHasArticless = null; // important to set this to NULL since that means it is uninitialized\n }", "function remove_dependents() {\n\t\t/** todo\n\t\tforeach($this->has_many_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\n\t\t}\n\n\t\tforeach($this->has_one_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function getMinOrderTotal();", "function remove_added_to_cart_notice()\n\t{\n\t\tif ( is_page(24770) ) {\n\t\t\t$notices = WC()->session->get( 'wc_notices', array() );\n\t\t\t\n\t\t\tforeach ( $notices['success'] as $key => &$notice ) {\n\t\t\t\tif ( strpos( $notice, 'added to your' ) !== false ) {\n\t\t\t\t\t$added_to_cart_key = $key;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $notices['success'][ $added_to_cart_key ] );\n\t\t\t\n\t\t\tWC()->session->set( 'wc_notices', $notices );\n\t\t}\n\t}", "function tep_remove_order($order_id, $restock = false)\n{\n if ($restock == 'on')\n {\n $order_query = tep_db_query(\"select products_id, products_quantity from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n\n while ($order = tep_db_fetch_array($order_query))\n {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = products_quantity + \" . $order['products_quantity'] . \", products_ordered = products_ordered - \" . $order['products_quantity'] . \" where products_id = '\" . (int)$order['products_id'] . \"'\");\n }\n\n }\n\n tep_db_query(\"delete from \" . TABLE_ORDERS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_STATUS_HISTORY . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_TOTAL . \" where orders_id = '\" . (int)$order_id . \"'\");\n}", "function remove_all_discounts()\n\t\t{\n\t\t\t// The 'unset_discount()' function can accept an array of either discount ids or codes to delete more than one discount at a time.\n\t\t\t// Alternatively, if no data is submitted, the function will delete all discounts that are applied to the cart.\n\t\t\t// This example removes all discount data.\n\t\t\t// $this->flexi_cart->unset_userdata_discount(); // Can't remeber why this 'stock code' didn't work - said 'undefined method' or something\t\t\n\t\t\t$this->flexi_cart->unset_discount();\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\n\t\t}", "function is_renew_order_paid($original_order_id) {\n\t$sql = \"SELECT * from orders WHERE original_order_id='$original_order_id' AND status='renew_paid' \";\n\t$result = mysql_query ($sql) or die(mysql_error());\n\tif (mysql_num_rows($result)>0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "private function eliminarCita(){\n $query = \"UPDATE \" . $this->table . \" SET estado = 'Inactivo' WHERE CitaId = '\" . $this->idcita . \"'\";\n $resp = parent::nonQuery($query);\n if($resp >= 1 ){\n return $resp;\n }else{\n return 0;\n }\n }", "public function getOrderBaseGrandTotal(){\n return $this->_getData(self::ORDER_BASE_GRAND_TOTAL);\n }", "function removeFromCart ($productID, $amount) {\r\n if (checkCart()) {\r\n if (array_key_exists($productID, $_SESSION['cart'])) {\r\n if ($amount >= $_SESSION['cart'][$productID]['amount'] || $amount == 'all') {\r\n //remove item completely\r\n unset($_SESSION['cart'][$productID]);\r\n } else {\r\n //remove item partially\r\n $_SESSION['cart'][$productID]['amount'] = $_SESSION['cart'][$productID]['amount'] - $amount;\r\n }\r\n }\r\n }\r\n}", "private function deletePaymentStatus()\n {\n $sql = \"DELETE FROM s_core_states WHERE `group` = 'payment' AND\n id IN (1750, 1751, 1752, 1753)\";\n Shopware()->Db()->query($sql);\n $sql = \"DELETE FROM s_core_snippets WHERE name in ('in_review',\"\n . \"'pre_authorization_of_payment', 'payment_accepted', \"\n . \"'refund')\";\n Shopware()->Db()->query($sql);\n }", "public function get_stock_reduced( $order ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\treturn wc_string_to_bool( get_post_meta( $order_id, '_order_stock_reduced', true ) );\n\t}", "public function isRefunded()\n {\n return $this->getRefundedAmount()->isPositive();\n }" ]
[ "0.58459616", "0.5756552", "0.5663745", "0.5642548", "0.55631655", "0.5507907", "0.54799217", "0.5438417", "0.53999025", "0.53935003", "0.53867453", "0.5383847", "0.5383212", "0.5363042", "0.5340645", "0.5335025", "0.5326942", "0.5324717", "0.53183955", "0.530903", "0.5301217", "0.52816373", "0.5279193", "0.5274305", "0.5270435", "0.5256556", "0.5256477", "0.5248137", "0.5246497", "0.52458817", "0.5244683", "0.52290183", "0.52203566", "0.52198124", "0.52144724", "0.52020705", "0.5201098", "0.5192894", "0.5186932", "0.51803505", "0.5175753", "0.51746583", "0.517206", "0.516336", "0.51613724", "0.5160086", "0.5157446", "0.5157196", "0.5156142", "0.51508", "0.5145667", "0.51454234", "0.5145395", "0.51410055", "0.51390195", "0.51305026", "0.5127846", "0.5127216", "0.5115612", "0.51006275", "0.5095363", "0.5091513", "0.50894624", "0.50828445", "0.5081837", "0.50742155", "0.5069957", "0.5069058", "0.50676227", "0.5063244", "0.50622505", "0.50607634", "0.5060637", "0.505351", "0.50524503", "0.50512433", "0.50509953", "0.5043526", "0.5041735", "0.50381446", "0.5038113", "0.5033232", "0.5028778", "0.50207174", "0.5018871", "0.5018871", "0.5018871", "0.5018871", "0.5018871", "0.50165063", "0.5012939", "0.50122756", "0.50091714", "0.5007512", "0.50001913", "0.4998228", "0.4993731", "0.4989228", "0.49884957", "0.49789605" ]
0.7212978
0
get name of the logging file
public function getLogfile() { return self::LOG_FILE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Public Function LogFileName() {\n\t\treturn $this->logFileName;\n\t}", "private function getLoggerFile()\n {\n return $this->getLoggerFolder() . DIRECTORY_SEPARATOR . self::FILE_NAME;\n }", "function getLogFilename()\n {\n return $this->_props['LogFilename'];\n }", "private function getStreamName(){\n return Shopware()->Container()->getParameter('kernel.logs_dir') . \"/\" . $this->getFileName() . \"_\". Shopware()->Container()->getParameter('kernel.environment') . \".log\";\n }", "protected function getDefaultLogFileName() {}", "private static function getLogFile(): string\n {\n return \\sprintf(\n '%s/logs/log_report_%s.txt',\n \\dirname(__DIR__),\n \\date('d-m-Y')\n );\n }", "static public function getName()\n {\n return 'log';\n }", "protected function filename()\n {\n return 'playerBetFlowLogs';\n }", "protected function log_file() \n {\n return $this->ini['log'];\n }", "public function logFilePath();", "protected function logfile() {\n\t\treturn sprintf(\n\t\t\t'%s.createenv.%s.log',\n\t\t\t$this->Project()->Name,\n\t\t\t$this->ID\n\t\t);\n\t}", "public function getLogFilePath(): string\n {\n return $this->logger->getLogFilePath();\n }", "public function getLogfile($file)\n {\n switch ($file)\n {\n case Log::PHP:\n $filename = self::PHP_FILE;\n break;\n case Log::PERL:\n $filename = self::PERL_FILE;\n break;\n case Log::PERL_COMPLETE:\n $filename = self::PERL_COMPLETE_FILE;\n break;\n case Log::ERROR:\n $filename = self::ERROR_FILE;\n break;\n default:\n echo \"Unknown $file: \".$file;\n return;\n }\n if ($_SESSION['config']['logcompression'] == 1) {\n $filename .= '.gz';\n }\n return $filename;\n }", "public function getLogFile(): string\n\t{\n\t\treturn $this->logFile;\n\t}", "public function getFile($file)\n {\n $filename = '';\n switch ($file) {\n case self::PHP:\n $filename = $this->_paths->log . '/php.log';\n break;\n case self::PERL:\n $filename = $this->_paths->log . '/perl.log';\n break;\n case self::PERL_COMPLETE:\n $filename = $this->_paths->log . '/perlComplete.log';\n break;\n case self::ERROR:\n $filename = $this->_paths->log . '/phpError.log';\n }\n return $filename;\n }", "private static function get_log_file( string $file ) : string {\r\n\t\treturn Core::get_app_path( self::$directory, $file );\r\n\t}", "private function getFilePath()\n {\n return \\Application::dirLogs() . '/console.log';\n }", "public static function getDeprecationLogFileName() {}", "public static function getDeprecationLogFileName() {}", "public function getLogFilePath(){\n\n\t\treturn $this->_log_file_path; \n\t}", "public function getLogFilePath()\n {\n return $this->getSettingArray()[\"log_file_path\"];\n }", "private static function getLogFileName()\n\t{\n\t\tself::$log_file_subfix = date(\"Ymd\");\n\t\tself::$log_file = self::$log_path . DS . \"service_\" . self::$log_file_subfix . \".log\";\n\t\treturn TRUE;\n\t}", "public static function getFileName( $file ){\n\t\t$pathinfo \t\t\t= pathinfo( $file );\n\t\tlist( $name, $dir ) = array( $pathinfo['filename'], $pathinfo['dirname'] );\n\t\t$files \t\t\t\t= glob( $dir . '/' . $name . '*.log' );\n\t\tif( count( $files ) ){\t\t\t\n\t\t\tif( filesize( end( $files ) ) > self::MAX_SIZE ){\n\t\t\t\t$no = str_pad( count( $files ), 4, '0', STR_PAD_LEFT );\n\t\t\t\treturn $dir . '/' . $name . '_' . $no . '.log';\n\t\t\t}\n\t\t\treturn end( $files );\n\t\t}\n\t\treturn $file;\n\t}", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName');\n if (!$fileName) {\n $fileName = $this->getInfo('title');\n }\n if (!$fileName) {\n $fileName = Zend_Controller_Front::getInstance()->getRequest()->getParam('controller') . '-' . date(\"Ymd\");\n }\n return $fileName . '.csv';\n }", "private function getFilename($suffixinfilename = '')\n\t{\n\t global $conf;\n\n\t if (empty($conf->global->SYSLOG_FILE)) $tmp=DOL_DATA_ROOT.'/brs.log';\n\t else $tmp=str_replace('DOL_DATA_ROOT', DOL_DATA_ROOT, $conf->global->SYSLOG_FILE);\n\n\t if (! empty($conf->global->SYSLOG_FILE_ONEPERSESSION))\n\t {\n\t \tif ($conf->global->SYSLOG_FILE_ONEPERSESSION == 1)\t// file depend on session key name (Note that session name is same for all users and is not a per user value)\n\t \t{\n\t \t$suffixinfilename .= '_'.session_name();\n\t \t}\n\t \tif ($conf->global->SYSLOG_FILE_ONEPERSESSION == 2)\t// file depend on session value sor per user\n\t \t{\n\t \t\t$suffixinfilename .= '_'.session_name().'_'.$_SERVER[\"REMOTE_ADDR\"];\n\t \t}\n\t }\n\n\t return $suffixinfilename?preg_replace('/\\.log$/i', $suffixinfilename.'.log', $tmp):$tmp;\n\t}", "function getFilename()\n {\n return __FILE__;\n }", "public function getLogFile() {}", "public static function location()\r\n {\r\n $logDir = Mage::getBaseDir('var') . DIRECTORY_SEPARATOR . 'log';\r\n $logFile = $logDir . DIRECTORY_SEPARATOR . self::DEFAULT_FILE;\r\n\r\n return $logFile;\r\n }", "protected function filename () : string {\n return sprintf('%s/%s.csv', $this->instanceDirectory(), $this->guessName());\n }", "public function getFileName(){\n\t\t$filename = sprintf($this->format, $this->classname) . '.php';\n\t\t\n\t\treturn $filename;\n\t}", "public function getFilename()\n {\n return __FILE__;\n }", "protected function getConfigFileName() {\n return $this->sourceName.\"-\".$this->_cnfName;\n }", "public function logFileName(?string $postfix = null): ?string\n {\n if (($id = $this->getAttribute('id')) === null) {\n return null;\n }\n\n return app()->basePath() . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . $id . ($postfix ? \"_$postfix\" : null) . '.txt';\n }", "public static function getName()\n\t{\n\t\treturn self::$filename;\n\t}", "protected function filename()\n {\n return 'fieldagents_' . time();\n }", "public function getName()\n {\n return $this->_path['filename'];\n }", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public function fileName()\n {\n $date = Carbon::now()->format('Y_m_d_Hms');\n $name = Str::lower(Str::snake($this->className()));\n\n return \"{$date}_{$name}.php\";\n }", "protected function filename()\n {\n return 'IPI_Target_' . date('YmdHis');\n }", "public function get_log() {\r\n\t\treturn $this->get_file();\r\n\t}", "public static function filePath(string $log) : string\n {\n return app_path('logs', \"{$log}.log\");\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "public function getFileName()\n {\n return $this->language.'/'.strtolower($this->getName());\n }", "public function getJournalFilename(): string\n {\n return $_ENV['DB_JOURNAL_FILE'] ?? self::DEFAULT_FILE_NAME;\n }", "public function getLogPath() : string\n {\n return $this->logPath;\n }", "function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}", "function get_stored_file_name()\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering get_stored_file_name() method ...\");\n\t\t$log->debug(\"Exiting get_stored_file_name method ...\");\n\t\treturn $this->stored_file_name;\n\t}", "public function getProcessLogName()\n\t\t{\n\t\t\treturn $this->process_log_name;\n\t\t}", "protected function filename()\n {\n return 'Reports_' . date('YmdHis');\n }", "public function getLogPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_LOG);\r\n\t}", "protected function filename()\n {\n return 'Raffle_' . date('YmdHis');\n }", "private function getOutputFileName()\n {\n $formattedDate = date(self::DATE_FORMAT);\n $fileName = sprintf(self::FILE_NAME_PATTERN, $formattedDate);\n\n return $fileName;\n }", "protected function getFileName($prefix = '', $suffix = 'log')\n {\n $prefix = ($prefix) ? $prefix . '_' : '';\n $suffix = ($suffix) ? $suffix : 'log';\n\n return uniqid($prefix, true) . '.' . $suffix;\n }", "public static function getLogPath()\n\t{\n\t\treturn MHTTPD::$config['Paths']['logs'];\n\t}", "public function getFileName()\n {\n return $this->getParam('flowFilename');\n }", "protected function getLogFile()\n {\n return $this->logFile;\n }", "protected function filename()\n {\n return 'properties_' . time();\n }", "protected function filename()\n {\n return 'ticket_' . time();\n }", "public function name() {\n\t\t// @version 1.2.0 Use filename then fallback to path\n\t\t$path = $this->data('name') ?: $this->path();\n\n\t\treturn pathinfo($path, PATHINFO_FILENAME);\n\t}", "protected function initFilePath() {\n \n $result = $this->profiler->getLogsPath();\n \n $result .= $this->key.'.log';\n \n if ( !file_exists( $result ) ) {\n touch( $result );\n }\n \n return $result;\n }", "public function myFilename()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return $reflection->getFileName();\r\n }", "public function getConvertPackagesToRepositoryLogName()\n\t{\n\t\treturn($this->getPoolDir().'/convertPackagesToRepository.log');\n\t}", "protected function filename()\n {\n return 'history_' . time();\n }", "protected function filename()\n {\n return 'UserRequest_' . date('YmdHis');\n }", "public static function getCurrentErrorLog()\n {\n return ROOT . '/data/logs/log-' . date('Y-m-d') . '.log';\n }", "function getRawLogName()\n {\n return $this->_props['RawLogName'];\n }", "private static function getFileName()\n {\n return sprintf('Export %s.csv', Carbon::now()->toDateTimeString());\n }", "public function getFileName()\n {\n if (array_key_exists(\"fileName\", $this->_propDict)) {\n return $this->_propDict[\"fileName\"];\n } else {\n return null;\n }\n }", "public function getKnackLogFile();", "public function getName(){\n if ($this->file)\n return $this->file->getName();\n }", "protected function filename()\n {\n return 'Document_' . date('YeamdHis');\n }", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}", "function getLogName($login){\n\t$logName = $login;\n\treturn $logName;\n}", "public function get_filename()\n {\n }", "public function getFileName()\n {\n return \"{$this->getUserOS()}-{$this->getDriver()}{$this->getFileExtension()}\";\n }", "public function getFileName() {\n\t\treturn $this->_pidFile;\n\t}", "public function getLog()\n {\n return join_paths($this->getPath(), 'import.log');\n }", "protected function fileName() {\n\n\t\treturn 'newanime';\n\t}", "public function get_file_name() {\n\t\treturn $this->file;\n\t}", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "protected function getFileName() {\n return $this->_dateTime->format('YmdHis') . '.xml';\n }", "protected function filename()\n {\n return 'navigation_' . date('Ymdhis');\n }", "protected function filename() {\n return 'Passport_report_' . date('YmdHis');\n }", "private function nameReportFile(){\n $name= str_replace(' ','_',$this->nombrereporte).'_'.\n $this->id.'_'.h::userId().'_'.uniqid().'.'.$this->type;\n }", "protected function filename()\n {\n return 'emailtemplate_' . time();\n }", "protected function filename()\n {\n return 'owe_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'ReclassExport_' . time();\n }", "private function getFilePath(string $fileName)\n {\n return storage_path() . '/logs/log-delete/' . $fileName . '.log';\n }", "public function getLogPath()\n {\n return $this->_logPath;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFilename()\n {\n return 'test-file';\n }", "public function _getFileName()\n {\n return 'monitorTest';\n }", "protected function filename()\n {\n return 'Egreso_' . date('YmdHis');\n }", "public function fileName()\n {\n if (is_null($this->file_name)) {\n $this->file_name = $this->name . '_' . Carbon::now()->format('Y-m-d_H-i-s');\n }\n\n return rtrim($this->file_name, '.sql').'.sql';\n }", "protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }" ]
[ "0.7919541", "0.78711677", "0.78297055", "0.77744937", "0.7505389", "0.7427314", "0.73573995", "0.7340445", "0.73216915", "0.7269449", "0.72385895", "0.7212483", "0.711708", "0.70746166", "0.7028455", "0.7008729", "0.6993726", "0.69775844", "0.6974325", "0.6943558", "0.6940081", "0.68576664", "0.6833022", "0.6759123", "0.6747318", "0.6659179", "0.66590786", "0.6656962", "0.6651587", "0.6586607", "0.6553608", "0.6543096", "0.6539445", "0.6529781", "0.6524948", "0.6518382", "0.6503791", "0.6502585", "0.6500622", "0.6497788", "0.64970165", "0.648868", "0.64872926", "0.6467988", "0.6463716", "0.64325863", "0.6421861", "0.6402082", "0.6390004", "0.63875115", "0.6387407", "0.6355492", "0.6355453", "0.6350053", "0.634551", "0.634455", "0.6339652", "0.6334196", "0.63176596", "0.6317208", "0.63100535", "0.6309965", "0.63060725", "0.62981933", "0.6294626", "0.62922174", "0.62907344", "0.62879974", "0.6287252", "0.62865293", "0.6284491", "0.6284423", "0.62819105", "0.62744653", "0.62742025", "0.62611943", "0.6256585", "0.62498325", "0.62497264", "0.6245715", "0.6245715", "0.6243204", "0.62420815", "0.6234771", "0.6230145", "0.6230039", "0.6229851", "0.6228564", "0.62234384", "0.6219767", "0.6204155", "0.6204155", "0.6204155", "0.6204155", "0.6204155", "0.6196642", "0.61849254", "0.6183551", "0.6180747", "0.6180396" ]
0.723095
11
Get deactivated shipping methods for autocreate
public function getDisabledShippingMethods() { return $this->getConfig('packages/disabled_shipping_methods'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShippingMethods();", "public function getShippingMethods()\n {\n $array = array();\n foreach ($this->config as $key => $item) {\n if ($key == 'allowed_domestic_methods') {\n foreach ($item as $item_internal) {\n $array['Domestic'][] = $item_internal['name'];\n }\n }\n\n if ($key == 'allowed_international_methods') {\n foreach ($item as $item_internal) {\n $array['International'][] = $item_internal['name'];\n }\n }\n }\n return $array;\n }", "public function get_shipping_methods() {\n\t\treturn $this->shipping_methods;\n\t}", "public function getCartShippingMethod()\n {\n }", "public function getActiveMethods(){\n\n $activeCarriers = $this->shipmentConfig->getActiveCarriers();\n $methods = array();\n\n foreach($activeCarriers as $carrierCode => $carrierModel)\n {\n $carrierTitle =$this->scopeConfig->getValue('carriers/'.$carrierCode.'/title');\n\n if( $carrierMethods = $carrierModel->getAllowedMethods() )\n {\n foreach ($carrierMethods as $methodCode => $method)\n {\n $code= $carrierCode.'_'.$methodCode;\n $methods[]=array(\n 'label'=>$carrierTitle,\n 'value'=>$code\n );\n }\n }\n }\n\n return $methods; \n }", "public function getShipping();", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "public function getAvailablePaymentMethods ();", "public function getShippingMethod() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->shippingMethod;\r\n\t}", "public function toOptionArray()\n { \n $multipletableratesMethods = $this->getMultipletableratesMethods(); \n $defaultMethods = Mage::getModel('adminhtml/system_config_source_shipping_allmethods')->toOptionArray(true);\n\n //get rid of an empty entry\n unset($defaultMethods[0]); \n $methods = array_merge($multipletableratesMethods, $defaultMethods);\n return $methods;\n }", "protected function getAllAvailableMethods()\n {\n /* TODO get all available payment methods from toolbox */\n }", "public function getShippingMethod()\n {\n return $this->getOrder()->getShippingMethod();\n }", "function pb_hide_shipping_method_if_not_available( $rates ) {\n\t\n\t$api_result = include dirname(__FILE__).'/includes/availability.php';\t\n\n\tif ( ! isset($api_result[\"success\"]) ) return $rates;\n\t\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'porterbuddy-wc' === $rate->method_id ) {\n\t\t\tif ($api_result[\"success\"] === false || ! isset($api_result['data']['delivery']) ) {\n\t\t\t\tunset($rates[ $rate_id ]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $rates;\n}", "protected function _getShippingMethodsHtml()\n {\n return $this->_getHtmlByHandle('checkout_onepage_shippingmethod');\n }", "public function getAllowedMethods()\n {\n return [$this->_code => __($this->getConfigData(self::SHIPPING_NAME))];\n }", "public function getShippingMethod()\n {\n return $this->shippingMethod;\n }", "function register_shipping_method($methods)\n {\n $methods['legacy_pakkelabels_shipping_gls_business'] = 'Legacy_Pakkelabels_Shipping_GLS_Business';\n return $methods;\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function getAutoEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\t\n\t$autoEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoEnabledPaymentMethod() == \"y\" )\n\t\t{\n\t\t\tarray_push($autoEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\treturn $autoEnabledPaymentMethod;\n\t\n}", "function add_CDEK_shipping_method($methods)\n {\n $methods['CDEK_shipping_method'] = 'WC_CDEK_Shipping_Method';\n return $methods;\n }", "function my_hide_shipping_when_free_is_available( $rates ) {\n\t$free = array();\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'free_shipping' === $rate->method_id ) {\n\t\t\t$free[ $rate_id ] = $rate;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ! empty( $free ) ? $free : $rates;\n}", "public function getShippingDetails();", "public function getShippingInfo();", "public function getMapShippingTypes()\n {\n return $this->map_shipping_types;\n }", "public function getShippingRefunded();", "protected function _getShippingMethodsHtml() {\t\t\r\n\t\t//$this->_cleanLayoutCache();\r\n\t\t$layout = $this->getLayout();\r\n\t\t$update = $layout->getUpdate();\r\n\t\t$update->load('onestepcheckout_onestepcheckout_shippingmethod');\r\n\t\t$layout->generateXml();\r\n\t\t$layout->generateBlocks();\r\n\t\t$output = $layout->getOutput();\r\n\t\treturn $output;\r\n\t}", "public function getShippingMethodName();", "public function getAutocreatePaymentMethods()\n {\n return $this->_toArrayObject($this->getConfig(\n 'autocreate/autocreate_allowed-payments'));\n }", "public function getDefaultShippingMethod()\n {\n return $this->getHelperConfig()->getDefaultShippingMethod();\n }", "function shippingGatewayList()\n {\n $arrClms = array(\n 'pkShippingGatewaysID',\n 'ShippingTitle',\n );\n $argWhere = 'ShippingStatus=1';\n $varOrderBy = 'ShippingType ASC,ShippingTitle ASC ';\n $arrRes = $this->select(TABLE_SHIPPING_GATEWAYS, $arrClms, $argWhere);\n //pre($arrRes);\n return $arrRes;\n }", "public function deleteBackupShippingMethod()\n {\n return true;\n }", "public function getAutocreateAllowedPaymentMethods()\n {\n $path = 'intraship/autocreate/autocreate_allowed-payments';\n $methodCodes = Mage::getStoreConfig($path);\n if (null === $methodCodes) {\n $methodCodes = '';\n }\n return $methodCodes;\n }", "public function getCalculatorOptions()\n {\n return Driver::isShipping()->isConfigured()->orderBy('name')->lists('name', 'class');\n }", "public function shippingMethods($type){\n\n if ($type === 'free')\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n\n elseif ($type === 'inner')\n $shippingMethod = Setting::where('key', 'local_label')->first();\n\n elseif ($type === 'outer')\n $shippingMethod = Setting::where('key', 'outer_label')->first();\n else\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n\n return view('admin.settings.shippings.shipping', compact('shippingMethod'));\n\n }", "public static function getPaymentMethods()\n {\n return [\n static::MAIL,\n static::DIRECT_DEPOSIT,\n ];\n }", "public function getActiveVendorMethods($vendorId=0){\n \t$methods = Mage::getModel('csmultishipping/source_shipping_methods')->getMethods();\n \t$VendorMethods=array();\n \tif(count($methods) >0 ) {\n \t\t$vendorShippingConfig = $this->getShippingConfig($vendorId);\n \t\tforeach($methods as $code=>$method) {\n \t\t\t$model=Mage::getModel($method['model']);\n \t\t\t$key = strtolower(Ced_CsMultiShipping_Model_Vsettings_Shipping_Methods_Abstract::SHIPPING_SECTION.'/'.$code.'/active');\n \t\t\tif(isset($vendorShippingConfig[$key]['value']) && $vendorShippingConfig[$key]['value']){\n\t \t\t\t$fields = $model->getFields();\n\t \t\t\tif (count($fields) > 0) {\n\t \t\t\t\tforeach ($fields as $id=>$field) {\n\t\t \t\t\t\t$key = strtolower(Ced_CsMultiShipping_Model_Vsettings_Shipping_Methods_Abstract::SHIPPING_SECTION.'/'.$code.'/'.$id);\n\t\t \t\t\t\tif(isset($vendorShippingConfig[$key]))\n\t\t \t\t\t\t\t$VendorMethods[$code][$id] = $vendorShippingConfig[$key]['value'];\n\t \t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn $VendorMethods;\n \t}\n \telse \n \t\treturn $VendorMethods;\n }", "public function getFreeShipping() {\n return $this->item->getFreeShipping();\n }", "public function getShippingCanceled();", "public function load_shipping_methods( $package = array() ) {\n\n\t\t$this->unregister_shipping_methods();\n\n\t\t// Methods can register themselves through this hook\n\t\tdo_action( 'woocommerce_load_shipping_methods', $package );\n\n\t\t// Register methods through a filter\n\t\t$shipping_methods_to_load = apply_filters( 'woocommerce_shipping_methods', array(\n\t\t\t'WC_Shipping_Flat_Rate',\n\t\t\t'WC_Shipping_Free_Shipping',\n\t\t\t'WC_Shipping_International_Delivery',\n\t\t\t'WC_Shipping_Local_Delivery',\n\t\t\t'WC_Shipping_Local_Pickup'\n\t\t) );\n\n\t\tforeach ( $shipping_methods_to_load as $method ) {\n\t\t\t$this->register_shipping_method( $method );\n\t\t}\n\n\t\t$this->sort_shipping_methods();\n\n\t\treturn $this->shipping_methods;\n\t}", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public function getSellingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_selling_payment_method}}', ['order_id' => 'id']);\n }", "function get_item_shipping() {\n\t}", "public function register_method( $methods ) {\n\t\t$methods['enda_bundle_rate'] = 'ENDA_Woocommerce_Bundle_Shipping';\n\t\treturn $methods;\n\t}", "public function methods()\n {\n return collect(Paymentmethods::getList());\n }", "public function initShippingMethod()\n {\n $helper = Mage::helper('onestepcheckout/shipping');\n if (!$this->getQuote()->getShippingAddress()->getShippingMethod()) {\n $shippingRates = $helper->getShippingRates();\n if ((count($shippingRates) == 1)) {\n $currentShippingRate = current($shippingRates);\n if (count($currentShippingRate) == 1) {\n $shippingRate = current($currentShippingRate);\n $shippingMethod = $shippingRate->getCode();\n }\n } elseif ($lastShippingMethod = $helper->getLastShippingMethod()) {\n $shippingMethod = $lastShippingMethod;\n } elseif ($defaultShippingMethod = Mage::helper('onestepcheckout/config')->getDefaultShippingMethod()) {\n $shippingMethod = $defaultShippingMethod;\n }\n if (isset($shippingMethod)) {\n $this->getOnepage()->saveShippingMethod($shippingMethod);\n }\n }\n }", "public static function getDisabledMethods()\n {\n return array();\n }", "function getShipping()\n {\n return array('name'=>'test','cost'=>4.5);\n }", "public function getFreeShippingMethod($order) {\n global $currency, $language, $shipping;\n\n if (defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true')) {\n $pass = false;\n\n switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {\n case 'national':\n if ($order->delivery['country_id'] == STORE_COUNTRY) {\n $pass = true;\n }\n break;\n case 'international':\n if ($order->delivery['country_id'] != STORE_COUNTRY) {\n $pass = true;\n }\n break;\n case 'both':\n $pass = true;\n break;\n }\n }\n\n $freeShipping = ($pass == true) && ($order->info['subtotal'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER); //free shipping or not\n $this->freeShipping = $freeShipping;\n if ($freeShipping) {\n include_once(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');\n $shipping = array(\n 'id' => 'free_free',\n 'title' => FREE_SHIPPING_TITLE,\n 'cost' => 0\n );\n $shippingMethod = array();\n $shippingMethod['sm_id'] = 'free_free';\n $shippingMethod['title'] = FREE_SHIPPING_TITLE;\n $shippingMethod['price'] = 0;\n $shippingMethod['currency'] = $currency;\n $shippingMethod['description'] = sprintf(FREE_SHIPPING_DESCRIPTION, MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER);\n\n return array($shippingMethod);\n }\n\n return null;\n }", "public function getTotalShippingMethods() {\n\t\t$sql = \"SELECT COUNT(*) as total \n\t\t\t\tFROM \" . DB_PREFIX . \"ms_shipping_method\";\n\n\t\t$res = $this->db->query($sql);\n\t\treturn $res->row['total'];\n\t}", "public function all()\n {\n return $this->get('/sale/delivery-methods');\n }", "public function getActiveMethods();", "public function getShippingInvoiced();", "public function getShippingRates()\n {\n if (empty($this->_rates)) {\n $this->getShippingAddress()->collectShippingRates()->save();\n $groups = $this->getShippingAddress()->getGroupedAllShippingRates();\n\n return $this->_rates = $groups;\n }\n /* Don't show collect in store rate as an available option. */\n if (!Mage::getStoreConfig('carriers/collectinstore/onestep') && Mage::getStoreConfig('carriers/collectinstore/active') && array_key_exists('collectinstore', $this->_rates)) {\n unset($this->_rates['collectinstore']);\n }\n\n return $this->_rates;\n }", "private function get_methods_instance() {\n\n\t\treturn wc_customer_order_csv_export()->get_methods_instance();\n\t}", "public function calculate_shipping() {\n\t\t$this->shipping_methods = $this->needs_shipping() ? $this->get_chosen_shipping_methods( WC()->shipping->calculate_shipping( $this->get_shipping_packages() ) ) : array();\n\n\t\t$shipping_taxes = wp_list_pluck( $this->shipping_methods, 'taxes' );\n\t\t$merged_taxes = array();\n\t\tforeach ( $shipping_taxes as $taxes ) {\n\t\t\tforeach ( $taxes as $tax_id => $tax_amount ) {\n\t\t\t\tif ( ! isset( $merged_taxes[ $tax_id ] ) ) {\n\t\t\t\t\t$merged_taxes[ $tax_id ] = 0;\n\t\t\t\t}\n\t\t\t\t$merged_taxes[ $tax_id ] += $tax_amount;\n\t\t\t}\n\t\t}\n\n\t\t$this->set_shipping_total( array_sum( wp_list_pluck( $this->shipping_methods, 'cost' ) ) );\n\t\t$this->set_shipping_tax( array_sum( $merged_taxes ) );\n\t\t$this->set_shipping_taxes( $merged_taxes );\n\n\t\treturn $this->shipping_methods;\n\t}", "public function getShippingMethods($data = array()) {\n\t\n\t\t// Get current language ID\n\t\t/*$language_code = $this->session->data['language'];\n\t\t$this->load->model('localisation/language');\n\t\t$languages = $this->model_localisation_language->getLanguages();\n\t\t\n\t\tforeach ($languages as $language) {\n\t\t\tif ($language['code'] == $language_code) {\n\t\t\t\t$language_id = $language['language_id'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}*/\n\t\t$language_id = $this->config->get('config_language_id');\n\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM \" . DB_PREFIX . \"ms_shipping_method msm \n\t\t\t\tLEFT JOIN \" . DB_PREFIX . \"ms_shipping_method_description msmd \n\t\t\t\t\tON (msm.shipping_method_id = msmd.shipping_method_id) \n\t\t\t\tWHERE msmd.language_id = '\" . (int)$language_id/*$this->config->get('config_language_id')*/ . \"'\";\n\t\t\n\t\t$sort_data = array(\n\t\t\t'msmd.name'\n\t\t);\n\t\t\n\t\tif (isset($data['sort']) && in_array($data['sort'], $sort_data)) {\n\t\t\t$sql .= \" ORDER BY \" . $data['sort'];\n\t\t} else {\n\t\t\t$sql .= \" ORDER BY msmd.name\";\n\t\t}\n\t\t\n\t\tif (isset($data['order']) && ($data['order'] == 'DESC')) {\n\t\t\t$sql .= \" DESC\";\n\t\t} else {\n\t\t\t$sql .= \" ASC\";\n\t\t}\n\t\t\n\t\tif (isset($data['start']) || isset($data['limit'])) {\n\t\t\tif ($data['start'] < 0) {\n\t\t\t\t$data['start'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ($data['limit'] < 1) {\n\t\t\t\t$data['limit'] = 20;\n\t\t\t}\n\t\t\t\n\t\t\t$sql .= \" LIMIT \" . (int)$data['start'] . \",\" . (int)$data['limit'];\n\t\t}\n\t\t\n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->rows;\n\t}", "public function getAvailableTFAMethods()\n {\n $availableMethods = self::$tfaMethods;\n\n // Email\n $isTFAEmailEnabled = $this->isTFAEmailEnabled();\n $isEmailActivated = $this->isEmailActivated();\n if (\n false === $isTFAEmailEnabled ||\n false === $isEmailActivated\n ) {\n unset($availableMethods['email']);\n }\n\n // SMS\n $isTFASmsEnabled = $this->isTFASmsEnabled();\n $isMobileActivated = $this->isMobileActivated();\n if (\n false === $isTFASmsEnabled ||\n false === $isMobileActivated\n ) {\n unset($availableMethods['sms']);\n }\n\n // Authenticator\n $isTFAAuthenticatorEnabled = $this->isTFAAuthenticatorEnabled();\n $isTFAAuthenticatorActivated = $this->isTFAAuthenticatorActivated();\n $tfaAuthenticatorSecret = $this->getTFAAuthenticatorSecret();\n if (\n false === $isTFAAuthenticatorEnabled ||\n false === $isTFAAuthenticatorActivated ||\n empty($tfaAuthenticatorSecret)\n ) {\n unset($availableMethods['authenticator']);\n }\n\n // Recovery code\n $recoveryCodes = $this->getUserRecoveryCodes(true, true);\n if (empty($recoveryCodes)) {\n unset($availableMethods['recovery_code']);\n }\n\n return $availableMethods;\n }", "public function getShippingOptions()\n { \n $shipping_options = Shipping_option::where('company_id',Auth::id())->get(); \n \n return Datatables::of($shipping_options)\n ->addColumn('action', function ($shipping_option) {\n return '<a href=\"shipping-options/'. Hashids::encode($shipping_option->id).'/edit\" class=\"text-primary\" data-toggle=\"tooltip\" title=\"Edit Shipping Option\"><i class=\"fa fa-edit\"></i></a> \n <a href=\"javascript:void(0)\" class=\"text-danger btn-delete\" data-toggle=\"tooltip\" title=\"Delete Shipping Option\" id=\"'.Hashids::encode($shipping_option->id).'\"><i class=\"fa fa-trash\"></i></a>';\n })\n ->editColumn('id', 'ID: {{$id}}')\n ->rawColumns(['action'])\n ->make(true);\n \n }", "public function getShippingDescription();", "public function getShippingAndHandling(){\n return $this->_getData(self::SHIPPING_AND_HANDLING);\n }", "private function checkShippingMethods()\n {\n $methods = ShippingMethod::with('prices')->get();\n $errors = [];\n foreach ($methods as $method) {\n $basePrice = $method->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The shipping method \"%s\" has no price set for your default currency.',\n $method->name\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "public function getAllowedMethods()\n {\n return array(\n $this->_code . '_private' => Mage::getStoreConfig('carrier/vconnect_postnord_home/name'),\n $this->_code . '_commercial' => Mage::getStoreConfig('carrier/vconnect_postnord_business/name'),\n $this->_code . '_pickup' => Mage::getStoreConfig('carrier/vconnect_postnord_pickup/name'),\n $this->_code . '_mailbox' => Mage::getStoreConfig('carrier/vconnect_postnord_mailbox/name'),\n );\n }", "public function getShippingFields()\n {\n if (!isset($this->arrCache['shippingFields'])) {\n\n $this->arrCache['shippingFields'] = array_filter(array_map(\n function($field) {\n return $field['enabled'] ? $field['value'] : null;\n },\n $this->getShippingFieldsConfig()\n ));\n }\n\n return $this->arrCache['shippingFields'];\n }", "public function isAutoShipping(): bool;", "public function getPaymentMethods()\n {\n return $this->payment_methods;\n }", "public function getAllPaymentMethods($asArray = false) {\r\n $jsonMethods = array();\r\n $methods = array();\r\n $model = new Mage_Checkout_Block_Onepage_Payment_Methods();\r\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\r\n try {\r\n $selectedPaymentMethod = $quote->getPayment()->getData('method');\r\n } catch (Exception $e) {\r\n $this->logException($e, 'Get payment method');\r\n $this->_JSONencodeAndRespond(array(\"title\" => \"Error\", \"content\" => $e->getMessage()));\r\n return;\r\n }\r\n foreach ($model->getMethods() as $method) {\r\n $methodTitle = $method->getTitle();\r\n $methodCode = $method->getCode();\r\n if ($methodCode == \"paypal_express\") { // PayPal. Has logo and strange label text, override\r\n $methodTitle = \"PayPal\";\r\n }\r\n\r\n //eLabelz specific fix\r\n if ($methodCode == 'msp_cashondelivery') {\r\n $methodTitle .= \" – \" . Mage::helper('core')->currency($quote->getMspCashondeliveryInclTax(), true, false);\r\n }\r\n\r\n $m = array(\r\n 'type' => 'option',\r\n 'title' => $methodTitle,\r\n 'code' => $methodCode,\r\n 'price' => $this->getPaymentMethodPrice($methodCode),\r\n // Payment fee (price) is not available for standard payment methods, for extensions this need to be individualy coded\r\n 'image' => null,\r\n 'options' => $this->_getSuboptionsForPaymentMethod($methodCode),\r\n );\r\n $methods[] = $m;\r\n }\r\n if ($asArray)\r\n return $methods;\r\n $jsonMethods['payment_methods'] = $methods;\r\n\r\n return $jsonMethods;\r\n }", "public function getAllowedMethods()\n {\n \n \n \n return array( \n 'homedelivery' => $this->getConfigData('homedelivery'),\n \n 'matkahuolto' => $this->getConfigData('matkahuolto'),\n 'smartpost' => $this->getConfigData('smartpost'),\n \n \n \n 'chooseapostoffice' => $this->getConfigData('chooseapostoffice'), \n 'default' => $this->getConfigData('closestpostoffice'),\n \n );\n \n }", "public static function getPaymentMethods() {\n\n // return array(\n // self::PAYMENT_METHOD_PAY_PAL => 'Pay Pal',\n // self::PAYMENT_METHOD_MONEY_BOOKERS => 'Skrill',\n // self::PAYMENT_METHOD_WIRE_TRANSFER => 'Wiretransfer',\n // );\n\n $payment_methods = array();\n\n if(Option::getByName('payment_method_paypal')) \n $payment_methods[self::PAYMENT_METHOD_PAY_PAL] = 'Pay Pal';\n\n if(Option::getByName('payment_method_skrill')) \n $payment_methods[self::PAYMENT_METHOD_MONEY_BOOKERS] = 'Skrill';\n\n if(Option::getByName('payment_method_wiretransfer') && Option::getByName('wiretransfer_doc_path')) \n $payment_methods[self::PAYMENT_METHOD_WIRE_TRANSFER] = 'Wiretransfer';\n\n if(Option::getByName('payment_method_check')) \n $payment_methods[self::PAYMENT_METHOD_CHECK] = 'Check';\n\n if(Option::getByName('payment_method_no_payment')) \n $payment_methods[self::PAYMENT_METHOD_NO_PAYMENT] = 'No Payment';\n\n return $payment_methods;\n }", "public function methods(string $country = null)\n {\n $country = empty($country) ? $this->app->getCountry() : $country;\n return $this->http->get($this->app->getApiUrl(\"/sites/{$country}/shipping_methods\"));\n }", "public function getBuyingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_buying_payment_method}}', ['order_id' => 'id']);\n }", "public function sort_shipping_methods() {\n\n\t\t$sorted_shipping_methods = array();\n\n\t\t// Get order option\n\t\t$ordering \t= (array) get_option('woocommerce_shipping_method_order');\n\t\t$order_end \t= 999;\n\n\t\t// Load shipping methods in order\n\t\tforeach ( $this->shipping_methods as $method ) {\n\n\t\t\tif ( isset( $ordering[ $method->id ] ) && is_numeric( $ordering[ $method->id ] ) ) {\n\t\t\t\t// Add in position\n\t\t\t\t$sorted_shipping_methods[ $ordering[ $method->id ] ][] = $method;\n\t\t\t} else {\n\t\t\t\t// Add to end of the array\n\t\t\t\t$sorted_shipping_methods[ $order_end ][] = $method;\n\t\t\t}\n\t\t}\n\n\t\tksort( $sorted_shipping_methods );\n\n\t\t$this->shipping_methods = array();\n\n\t\tforeach ( $sorted_shipping_methods as $methods )\n\t\t\tforeach ( $methods as $method ) {\n\t\t\t\t$id = empty( $method->instance_id ) ? $method->id : $method->instance_id;\n\t\t\t\t$this->shipping_methods[ $id ] = $method;\n\t\t\t}\n\n\t\treturn $this->shipping_methods;\n\t}", "public function getAvailableDeliveryMethod() {\n\t\treturn $this->availableDeliveryMethod;\n\t}", "public function getShipping()\r\n {\r\n return $this->shipping;\r\n }", "function getCronEnabledPaymentMethods()\n{\n\t$registeredPaymentMethods = getRegisteredPaymentMethods();\n\t\n\t$cronEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoChargeEnabledPaymentMethod() == \"y\")\n\t\t{\n\t\t\tarray_push($cronEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\t$autoChargePaymentMethod = implode(\",\", $cronEnabledPaymentMethod);\n\t\n\treturn $autoChargePaymentMethod;\n}", "function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}", "public function shippingPaymentAction()\r\n {\r\n // Load payment options, select option and details\r\n $this->View()->sPayments = $this->getPayments();\r\n $this->View()->sFormData = array('payment' => $this->View()->sUserData['additional']['user']['paymentID']);\r\n $getPaymentDetails = $this->admin->sGetPaymentMeanById($this->View()->sFormData['payment']);\r\n\r\n $paymentClass = $this->admin->sInitiatePaymentClass($getPaymentDetails);\r\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\r\n $data = $paymentClass->getCurrentPaymentDataAsArray(Shopware()->Session()->sUserId);\r\n if (!empty($data)) {\r\n $this->View()->sFormData += $data;\r\n }\r\n }\r\n if ($this->Request()->isPost()) {\r\n $values = $this->Request()->getPost();\r\n $values['payment'] = $this->Request()->getPost('payment');\r\n $values['isPost'] = true;\r\n $this->View()->sFormData = $values;\r\n }\r\n\r\n $this->View()->sBasket = $this->getBasket();\r\n\r\n // Load current and all shipping methods\r\n $this->View()->sDispatch = $this->getSelectedDispatch();\r\n $this->View()->sDispatches = $this->getDispatches($this->View()->sFormData['payment']);\r\n\r\n $this->View()->sLaststock = $this->basket->sCheckBasketQuantities();\r\n $this->View()->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $this->View()->sShippingcostsDifference = $this->View()->sBasket['sShippingcostsDifference'];\r\n $this->View()->sAmount = $this->View()->sBasket['sAmount'];\r\n $this->View()->sAmountWithTax = $this->View()->sBasket['sAmountWithTax'];\r\n $this->View()->sAmountTax = $this->View()->sBasket['sAmountTax'];\r\n $this->View()->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $this->View()->sRegisterFinished = !empty($this->session['sRegisterFinished']);\r\n $this->View()->sTargetAction = 'shippingPayment';\r\n $this->View()->sKUZOOffer = true;\r\n if ($this->Request()->getParam('isXHR')) {\r\n return $this->View()->loadTemplate('frontend/s_k_u_z_o_offer/shipping_payment_core.tpl');\r\n }\r\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }", "public function getBaseShippingRefunded();", "public function getDeliveryMode()\n {\n }", "public function getCartShippingMethodID()\n {\n }", "public function getShippingType()\n {\n return $this->shippingType;\n }", "public function getAvailableCountries()\n {\n $availableCountries=array();\n $models=ShippingCosts::model()->findAll(array(\n 'select'=>'t.country_code',\n 'group'=>'t.country_code',\n 'distinct'=>true,\n 'condition'=>'t.shipping_method_id=:shipping_method_id',\n 'params'=>array(':shipping_method_id'=>$this->id),\n ));\n $availableCountries=CHtml::listData($models, 'country_code', 'country_code');\n return $availableCountries;\n }", "public function getShippingRate();", "function getRegisteredPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isUIEnabled() == 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\t\n}", "public function getMethod()\n {\n ShopgateLogger::getInstance()->log('# ' . __METHOD__, ShopgateLogger::LOGTYPE_DEBUG);\n if (is_null($this->_method) && is_object($this->_order)) {\n $this->_method = $this->_fetchMethod($this->_order);\n } else {\n if (is_null($this->_method) && is_null($this->_order)) {\n Mage::logException(new Exception('Error: model not initialized properly'));\n }\n }\n\n ShopgateLogger::getInstance()->log(\n \" Mapped shipping method is: '\" . $this->_method . \"'\",\n ShopgateLogger::LOGTYPE_DEBUG\n );\n\n return $this->_method;\n }", "public function prepareShippingTypeList() \n { \n return $this->shippingTypeEngine->prepareDatatableShippingTypeList();\n }", "public function getShippingOptionsApi()\n { \n if(\\Request::wantsJson()) \n {\n \n $shipping_options = Shipping_option::where('company_id', getComapnyIdByUser())->get(); \n \n $shipping_options->map( function ($shipping_option) {\n \n $shipping_option->default = ($shipping_option->id == companySettingValueApi('shipping_id') ? true : false);\n \n return $shipping_option;\n });\n \n $response['shipping_options'] = $shipping_options;\n $status = $this->successStatus;\n \n return response()->json(['result' => $response], $status);\n }\n }", "public function getDeliveryMode();", "public function getBaseShippingCanceled();", "public function index()\n {\n $data = $this->shippingMethodService->getAll();\n return view('shippingMethods.index', $data);\n }", "public function get_shipping_classes() {\n\t\tif ( empty( $this->shipping_classes ) ) {\n\t\t\t$classes = get_terms( 'product_shipping_class', array( 'hide_empty' => '0' ) );\n\t\t\t$this->shipping_classes = $classes && ! is_wp_error( $classes ) ? $classes : array();\n\t\t}\n\t\treturn $this->shipping_classes;\n\t}", "public function getShippingList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_shipping');\r\n\t\t$this->db->where('shipping_status', '1');\t\t\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getShippingMethods($countryID, $paymentID)\n {\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getItemShippingAddresses();", "public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}", "public function GeteBayExcludeShippingLocationDetails() {\r\n $verb = 'GeteBayDetails';\r\n $requestxml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\t\t\t<GeteBayDetailsRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">\r\n\t\t <RequesterCredentials>\r\n <eBayAuthToken>' . $this->token . '</eBayAuthToken> \r\n <!--DetailName>CountryDetails</DetailName-->\r\n <!--DetailName>RegionOfOriginDetails</DetailName-->\r\n <DetailName>ExcludeShippingLocationDetails</DetailName>\r\n </RequesterCredentials>\r\n\t\t\t</GeteBayDetailsRequest>';\r\n $session = new eBaySession('', $this->devID, $this->appID, $this->certID, $this->serverUrl, $this->compatabilityLevel, $this->siteID, $verb);\r\n $responseXml = $session->sendHttpRequest($requestxml);\r\n return XML_unserialize($responseXml);\r\n }", "public function getShippingMethod(): ShippingMethodInterface\n {\n if (!isset($this->shippingMethod)) {\n throw new LocalizedException(__('Shipping method is not defined for instance purchase.'));\n }\n return $this->shippingMethod;\n }" ]
[ "0.803053", "0.73456883", "0.7300754", "0.6889812", "0.6823805", "0.6745216", "0.66944313", "0.6672856", "0.659096", "0.6585735", "0.6537436", "0.64730334", "0.6464746", "0.63721323", "0.6321867", "0.6294316", "0.626244", "0.623811", "0.6237554", "0.6232432", "0.6231236", "0.6211866", "0.61989653", "0.61941874", "0.61786944", "0.6155323", "0.6133995", "0.6093613", "0.6074449", "0.6064017", "0.6054627", "0.60531455", "0.6039549", "0.59862274", "0.5978937", "0.59677666", "0.5966785", "0.59587187", "0.5938232", "0.5925883", "0.5924641", "0.5924288", "0.59235305", "0.5902232", "0.58975726", "0.5893025", "0.5891454", "0.58834714", "0.5871929", "0.5864385", "0.5840196", "0.5830817", "0.5786798", "0.578371", "0.5779415", "0.57768244", "0.5757862", "0.5755495", "0.5743163", "0.57399434", "0.57323086", "0.57277346", "0.57171476", "0.5715867", "0.5713696", "0.5713223", "0.57016015", "0.56939167", "0.5680761", "0.56721425", "0.5670142", "0.5666378", "0.5664322", "0.5649361", "0.5644124", "0.5637382", "0.5636393", "0.5634904", "0.56330407", "0.56273127", "0.5619938", "0.56194", "0.5617501", "0.56137383", "0.5611875", "0.5610601", "0.5602536", "0.5597828", "0.5593789", "0.55880105", "0.55849314", "0.5582126", "0.5580129", "0.55746645", "0.55746645", "0.55746645", "0.5569325", "0.5559119", "0.5556608", "0.55533874" ]
0.75101054
1
Check if shipping method is disabled
public function isAllowedShippingMethod($shippingCode) { $disabledShippingMethods = explode(",", $this->getDisabledShippingMethods()); if (in_array( $shippingCode, $disabledShippingMethods)): return false; else: return true; endif; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDisabledShippingMethods()\n {\n return $this->getConfig('packages/disabled_shipping_methods');\n }", "public function isAutoShipping(): bool;", "function is_product_disable_shipping( $product_id ) {\r\n\t$enabled = get_post_meta( $product_id, '_disable_shipping', true );\r\n\r\n\tif ( $enabled == 'yes' ) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "public function isValidShippingMethod($value){\n if(strcmp($value,\"dhl_normal_shipping_method\")\n || strcmp($value,\"dhl_service_point_shipping_method\")\n ) {\n return true;\n }\n return false;\n }", "public function enable_free_shipping() {\n\t\treturn 'yes' === $this->free_shipping;\n\t}", "public function isShipping()\n {\n return $this->product->isShipping();\n }", "function is_product_disable_shipping_weight( $product_id ) {\r\n $enabled = get_post_meta( $product_id, '_disable_shipping', true );\r\n\r\n if ( $enabled == 'yes' ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "function pb_hide_shipping_method_if_not_available( $rates ) {\n\t\n\t$api_result = include dirname(__FILE__).'/includes/availability.php';\t\n\n\tif ( ! isset($api_result[\"success\"]) ) return $rates;\n\t\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'porterbuddy-wc' === $rate->method_id ) {\n\t\t\tif ($api_result[\"success\"] === false || ! isset($api_result['data']['delivery']) ) {\n\t\t\t\tunset($rates[ $rate_id ]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $rates;\n}", "private function checkShippingMethods()\n {\n $methods = ShippingMethod::with('prices')->get();\n $errors = [];\n foreach ($methods as $method) {\n $basePrice = $method->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The shipping method \"%s\" has no price set for your default currency.',\n $method->name\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "public function getCartShippingMethod()\n {\n }", "function has_shipping_enabled_product( $products ) {\r\n\r\n\tforeach ( $products as $product ) {\r\n\t\tif ( !is_product_disable_shipping( $product['product_id'] ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}", "public function getShippingMethods();", "public function isAvailable(): bool\n {\n return isset(\n $this->paymentToken,\n $this->shippingAddress,\n $this->billingAddress,\n $this->shippingMethod\n ) && $this->shippingMethod->getAvailable();\n }", "public function is_disabled()\n {\n }", "public function getIsRequiredShipping()\n {\n $model = $this->_coreRegistry->registry('sales_subscription');\n $productId = $model->getSubProductId();\n $product = $this->productRepository->getById($productId);\n $productTypes = ['virtual', 'downloadable'];\n\n if ($product) {\n $productType = $product->getTypeId();\n if (!in_array($productType, $productTypes)) {\n return true;\n }\n }\n return false;\n }", "public function isDisabled() {}", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function is_available( $shipment = array() ) {\n\n\t\t// standard availability checks (is enabled, ship to is in admin-selected allowed countries, etc)\n\t\t$is_available = parent::is_available( $shipment );\n\n\n\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_2_6() ) {\n\n\t\t\t// it seems that in WC 2.6+ we do need to check if the shipping method is enabled,\n\t\t\t// otherwise it will appear enabled straight after activation {TZ 2016-05-26}\n\t\t\t$is_available = $this->is_enabled() && $is_available;\n\t\t}\n\n\t\treturn apply_filters( 'wc_shipwire_shipping_method_is_available', $is_available, $shipment, $this );\n\t}", "public function isDisabled();", "public function isDisabled();", "public function isDisabled();", "function is_shipping_enabled_for_seller( $seller_id ) {\r\n\t$enabled = get_user_meta( $seller_id, '_dps_shipping_enable', true );\r\n\r\n\tif ( $enabled == 'yes' ) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "public static function has_valid_delivery_method(): bool {\n return Simply_Static\\Options::instance()->get('delivery_method') === 'local';\n }", "public function isDisabled()\n {\n }", "function woocommerce_proceed_to_checkout(){\n\n $chosen_methods = WC()->session->get( 'chosen_shipping_methods' );\n $chosen_shipping = $chosen_methods[0];\n\n if ($chosen_shipping == null || $chosen_shipping == ''){\n echo \"<script>jQuery('.checkout-button').attr('disabled','disabled');</script>\";\n }\n\n }", "public function deleteBackupShippingMethod()\n {\n return true;\n }", "public function initShippingMethod()\n {\n $helper = Mage::helper('onestepcheckout/shipping');\n if (!$this->getQuote()->getShippingAddress()->getShippingMethod()) {\n $shippingRates = $helper->getShippingRates();\n if ((count($shippingRates) == 1)) {\n $currentShippingRate = current($shippingRates);\n if (count($currentShippingRate) == 1) {\n $shippingRate = current($currentShippingRate);\n $shippingMethod = $shippingRate->getCode();\n }\n } elseif ($lastShippingMethod = $helper->getLastShippingMethod()) {\n $shippingMethod = $lastShippingMethod;\n } elseif ($defaultShippingMethod = Mage::helper('onestepcheckout/config')->getDefaultShippingMethod()) {\n $shippingMethod = $defaultShippingMethod;\n }\n if (isset($shippingMethod)) {\n $this->getOnepage()->saveShippingMethod($shippingMethod);\n }\n }\n }", "public function getShippingMethod()\n {\n return $this->getOrder()->getShippingMethod();\n }", "public function check_shipping()\n\t{\n\t\tif((!isset($_SESSION['shipping']) || empty($_SESSION['shipping']))\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual'\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t\t&& $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if country of selected shipping address is not allowed\n\t\tif($_SESSION['sendto'] !== false \n\t\t && $_SESSION['cart']->content_type != 'virtual'\n\t\t && $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t && $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\tif($this->check_country_by_address_book_id($_SESSION['sendto']) == false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function getShippingMethod()\n {\n return $this->shippingMethod;\n }", "public function getShippingMethod() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->shippingMethod;\r\n\t}", "protected function shouldAddShippingInformation(): bool\r\n {\r\n if (DocumentTypes::requiresDelivery($this->documentType)) {\r\n return true;\r\n }\r\n\r\n return $this->useShipping === Boolean::YES;\r\n }", "protected function _getShippingAvailability()\n {\n $carriers = [];\n if ($this->getRma()) {\n $carriers = $this->_rmaData->getAllowedShippingCarriers($this->getRma()->getStoreId());\n }\n return !empty($carriers);\n }", "public function getDefaultShippingMethod()\n {\n return $this->getHelperConfig()->getDefaultShippingMethod();\n }", "public function getShippingCanceled();", "public function isShippingCarrierFilterEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_SHIPPING_ENABLE_CARRIER_FILTER);\n }", "function filter_shipping( $fields_array ) {\n\t\t\t$fields_array = array_replace($fields_array, $this->update_shipping);\n\t\t\treturn array_diff_key($fields_array, array_flip($this->disabled_shipping));\n\t\t}", "public function hasShippingOptions()\n {\n $product = $this->getProduct();\n return strlen($product->getMdlShipments());\n }", "public function is_available( $package = array() ) {\n global $woocommerce; \n\n if ( $this->enabled == \"no\" ) \n return false;\n \n if ( isset( $woocommerce->cart->cart_contents_total ) && isset( $this->min_amount ) && $this->min_amount && $this->min_amount > $woocommerce->cart->cart_contents_total ) \n return false;\n\n // Make sure method is available for shipping destination\n $country = isset( $package['destination']['country'] ) ? $package['destination']['country'] : $woocommerce->customer->get_shipping_country();\n $state = $woocommerce->customer->get_shipping_state();\n\n $ship_to_countries = '';\n\n if ( $this->availability == 'specific' ) {\n $ship_to_countries = $this->countries;\n } \n else {\n if ( get_option( 'woocommerce_allowed_countries' ) == 'specific' ) {\n $ship_to_countries = get_option( 'woocommerce_specific_allowed_countries' );\n }\n } \n \n if ( is_array( $ship_to_countries ) ) {\n if ( ! in_array( $country, $ship_to_countries ) ) {\n return false; \n } \n }\n \n $applicable_configurations = $this->get_destination_configurations( $country, $state ); \n\n // If there is no configuration that can be applied to this shipping destination, \n // this method is not available\n if ( count( $applicable_configurations ) == 0 ) {\n return false;\n }\n\n // Check whether each item in the cart has an applicable configuration\n $has_physical_products = false;\n\n foreach ($woocommerce->cart->get_cart() as $item ) {\n\n if ( $item['data']->needs_shipping() ) {\n\n $has_physical_products = true;\n\n $item_configurations = $this->get_item_configurations( $item, $applicable_configurations );\n\n if ( count( $item_configurations ) == 0 ) {\n return false;\n } \n } \n }\n\n return $has_physical_products;\n }", "public function _isEnabledShipmentsEmail()\r\n {\r\n return ($this->scopeConfig->getValue(self::EMAIL_SHIPMENTS)) ? true:false ;\r\n }", "public function getIsDisabled() {}", "public function getFreeShippingMethod($order) {\n global $currency, $language, $shipping;\n\n if (defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true')) {\n $pass = false;\n\n switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {\n case 'national':\n if ($order->delivery['country_id'] == STORE_COUNTRY) {\n $pass = true;\n }\n break;\n case 'international':\n if ($order->delivery['country_id'] != STORE_COUNTRY) {\n $pass = true;\n }\n break;\n case 'both':\n $pass = true;\n break;\n }\n }\n\n $freeShipping = ($pass == true) && ($order->info['subtotal'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER); //free shipping or not\n $this->freeShipping = $freeShipping;\n if ($freeShipping) {\n include_once(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');\n $shipping = array(\n 'id' => 'free_free',\n 'title' => FREE_SHIPPING_TITLE,\n 'cost' => 0\n );\n $shippingMethod = array();\n $shippingMethod['sm_id'] = 'free_free';\n $shippingMethod['title'] = FREE_SHIPPING_TITLE;\n $shippingMethod['price'] = 0;\n $shippingMethod['currency'] = $currency;\n $shippingMethod['description'] = sprintf(FREE_SHIPPING_DESCRIPTION, MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER);\n\n return array($shippingMethod);\n }\n\n return null;\n }", "function isDisabled()\n {\n return false;\n }", "public function getShipping();", "public function disableShopServices()\n {\n return true;\n }", "public function isShippingLabelsAvailable()\n {\n return true;\n }", "public function needs_shipping_address() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping_address', true === $this->needs_shipping() && ! wc_ship_to_billing_address_only() );\n\t}", "function my_hide_shipping_when_free_is_available( $rates ) {\n\t$free = array();\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'free_shipping' === $rate->method_id ) {\n\t\t\t$free[ $rate_id ] = $rate;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ! empty( $free ) ? $free : $rates;\n}", "public function testReturnsFalseInCollectRatesMethodWhenOggettoShippingMethodIsNotActive()\n {\n $modelCarrierMock = $this->getModelMock('oggetto_shipping/carrier', ['isActive']);\n\n $modelCarrierMock->expects($this->once())\n ->method('isActive');\n\n $this->replaceByMock('model', 'oggetto_shipping/carrier', $modelCarrierMock);\n\n $this->assertFalse($modelCarrierMock->collectRates(new Mage_Shipping_Model_Rate_Request));\n }", "public function isEnabledPdp()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_PDP);\n }", "public function isDisabled()\n {\n return false;\n }", "public function get_shipping_methods() {\n\t\treturn $this->shipping_methods;\n\t}", "public function canResetShippingDate()\n {\n $oOrder = oxNew(\"oxorder\");\n $blCan = false;\n if ($oOrder->load($this->getEditObjectId())) {\n $blCan = $oOrder->oxorder__oxstorno->value == \"0\" &&\n !($oOrder->oxorder__oxsenddate->value == \"0000-00-00 00:00:00\" || $oOrder->oxorder__oxsenddate->value == \"-\");\n }\n\n return $blCan;\n }", "public function getShippingMethods()\n {\n $array = array();\n foreach ($this->config as $key => $item) {\n if ($key == 'allowed_domestic_methods') {\n foreach ($item as $item_internal) {\n $array['Domestic'][] = $item_internal['name'];\n }\n }\n\n if ($key == 'allowed_international_methods') {\n foreach ($item as $item_internal) {\n $array['International'][] = $item_internal['name'];\n }\n }\n }\n return $array;\n }", "public function isDisabled()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED;\n }", "public function hasShipping() {\n\t\t$shipping = false;\n\n\t\tforeach ($this->getLines() as $product) {\n\t\t\tif (isset($product['shipping']) && $product['shipping']) {\n\t\t\t\t$shipping = true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $shipping;\n\t}", "public function isDisabled()\n\t{\n\t\treturn false;\n\t}", "public function isLowestShippingMultipleAssignmentMethod()\n {\n return ($this->getMultipleAssignmentMethodCode() == 'lowest_shipping') ? true : false;\n }", "public function isEnabled()\n\t{\n\t\t// note: don't use $this->_main->.. as it might not exist when this func is called.\n\t\treturn Mage::helper('shoptimally_upsalecoupons/main')->isEnabled();\n\t}", "public function getBaseShippingCanceled();", "private function isNegotiableShippingPriceSet()\n {\n $priceSet = false;\n $quoteId = $this->context->getRequest()->getParam('negotiableQuoteId');\n\n if ($quoteId) {\n try {\n $quote = $this->quoteRepository->get($quoteId, ['*']);\n\n if ($quote->getExtensionAttributes() !== null\n && $quote->getExtensionAttributes()->getNegotiableQuote() !== null\n && $quote->getExtensionAttributes()->getNegotiableQuote()->getShippingPrice()\n ) {\n $priceSet = true;\n }\n } catch (NoSuchEntityException $e) {\n // If no such entity, skip\n }\n }\n\n return $priceSet;\n }", "function is_shipping_taxable() {\n\t\tif (isset($this->data['tax_status']) && ($this->data['tax_status']=='taxable' || $this->data['tax_status']=='shipping')) return true;\n\t\treturn false;\n\t}", "public function getDispatchNoOrder()\r\n {\r\n return !empty(Shopware()->Config()->PremiumShippingNoOrder) && (empty($this->session['sDispatch']) || empty($this->session['sCountry']));\r\n }", "public function calculate_shipping( $package = [] ) {\n // First, we need to do some checks to make sure that this shipping method\n // is enabled and this users country is included / allowed. If one of these\n // is not true, just return false.\n // Is this shipping type enabled? If not, do nothing.\n $enabled = $this->get_option( 'enabled' );\n\n if ( $enabled == 'no' ) { return false; }\n if ( ! $this->is_tiered_allowed( $package ) ) { return false; }\n\n\n // If we get to this point, we can add this shipping method to the front\n // end and calculate the shipping rate!\n\n global $woocommerce;\n\n // Get all items from cart.\n $items = $woocommerce->cart->get_cart();\n $cart_total_items = 0;\n\n // Sum non-virtual (i.e. shippable) items\n foreach ( $items as $item ) {\n $product = wc_get_product( $item['product_id'] );\n if ( !$product->is_virtual() ) {\n $cart_total_items += $item['quantity'];\n }\n }\n\n // Set the base shipping fee.\n $shipping = $cart_total_items > 0 ? $this->get_option('basefee') : 0;\n\n // Override base fee with tiered fee if cart items are over the tier quantity.\n if ( $cart_total_items > $this->get_option( 'quantity' ) ) {\n\n // If the tier fee should be progressive, calculate the multiplier and add the tier fee * multiplier.\n if ( $this->get_option( 'progressive' ) == 'yes' ) {\n $multiplier = ceil( $cart_total_items / $this->get_option( 'quantity' ) ) - 1;\n $shipping += $this->get_option( 'tierfee' ) * $multiplier;\n }\n\n // If the tier fee is flat, simply add the tier fee.\n else {\n $shipping += $this->get_option( 'tierfee' );\n }\n }\n\n // Set the shipping rate.\n $rate = [\n 'label' => $this->title,\n 'cost' => $shipping,\n 'calc_tax' => 'per_item'\n ];\n\n $this->add_rate( $rate );\n }", "public function isDisabled(): bool\n {\n return ! $this->isEnabled();\n }", "function isDisabled()\n {\n return $this->_disabled;\n }", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "public function getShippingStatus()\n {\n return $this->status ?: '';\n }", "public function show_shipping() {\n\t\tif ( ! wc_shipping_enabled() || ! $this->get_cart_contents() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'yes' === get_option( 'woocommerce_shipping_cost_requires_address' ) ) {\n\t\t\tif ( ! $this->get_customer()->has_calculated_shipping() ) {\n\t\t\t\tif ( ! $this->get_customer()->get_shipping_country() || ( ! $this->get_customer()->get_shipping_state() && ! $this->get_customer()->get_shipping_postcode() ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_ready_to_calc_shipping', true );\n\t}", "public function getShippingMethodName();", "function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}", "public function getShippingType()\n {\n return $this->shippingType;\n }", "public function readyToShip()\n {\n $shipment = $this->getShipment(1);\n\n return $shipment && $shipment->address && $shipment->method;\n }", "public function isDefaultShippingAddress()\n {\n return $this->default_shipping == 'Y' ? true : false;\n }", "public function getDeliveryMode();", "public function isDisabled()\n {\n return parent::isDisabled();\n }", "public function getFreeShipping() {\n return $this->item->getFreeShipping();\n }", "protected function validateMethod() {\n\t\t$helperWS = Mage::helper('chronorelais/webservice');\n\n\t\t/* Chronorelais => test Si WS fonctionne */\n\t\tif($this->_checkRelaiWs) {\n\t\t\t$shippingAddress = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress();\n\t $webservice = $helperWS->getPointsRelaisByCp($shippingAddress->getPostcode());\n\t if($webservice === false) {\n\t return false;\n\t }\n\t\t}\n\n if($this->_checkContract) {\n $isAllowed = $helperWS->getMethodIsAllowed($this->_code);\n if($isAllowed === false) {\n return false;\n }\n }\n return true;\n\t}", "public function getDisabled(): bool;", "public function getDeliveryMode()\n {\n }", "public function getIpLockIsDisabled() {}", "public function getCartShippingMethodID()\n {\n }", "function es_has_coupon_free_shipping() {\n global $woocommerce;\n\n foreach ($woocommerce->cart->applied_coupons as $code) {\n $coupon = new WC_Coupon($code);\n if ($coupon->is_valid() === true) {\n if ($coupon->enable_free_shipping()) {\n return true;\n }\n }\n }\n\n return false;\n}", "static public function get_shipping_exist( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \tif( (int)$order->order_shipping > 0 ){\n\n \t\treturn true;\n\n \t}\n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\t\n\t\t\t\tif( !empty( $shippings ) ){\n\n\t\t\t\t\treturn true;\n\t\t\t\t} \t\n\n \t}\n\n \treturn false;\n\n \t}", "public static function isDisabled(): bool\n {\n return !empty(static::DISABLED);\n }", "public function isCatalogShippingVisible()\n {\n return (\n $this->isCatalogInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_SHIPPING)\n ) ? true : false;\n }", "public function setShippingRates(Order $draftOrder): bool;", "public function isIgnoreObserver(){\n\t\t$ignore = true;\n\t\t$data = Mage::app()->getRequest()->getParams();\n\t\tif (isset($data['echeck_dropship']) && $data['echeck_dropship'] == 1)$ignore = false;\n\t\treturn $ignore;\n\t}", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "public function isDisabled()\n {\n return !$this->enabled;\n }", "public function getGenShippingLabel(){\n\t\tif(null !== $this->getGenerateShippingLabel()){ //run only once\n\t\t\treturn $this->getGenerateShippingLabel();\n\t\t} //TODO: Review - should function calculate the flag whenever it is invoked?\n\t\tif(!isset($this->sellerPartner)){\n\t\t\t$errMsg = \"SellerPartner is not set for order: \" . $this->poNumber;\n\t\t\t$this->logger->LogError(\"NewOrder:getGenShippingLabel: \" . $errMsg);\n\t\t\tthrow new Exception($errMsg);\n\t\t}\n\t\t$db = new ediSqlNew($this->trader);\n\t\t$scacArr = $db->getCarrierShippingCodeInfo ( $this->getTrader()->getId (), $this->getShipmentCarrier () );\n\t\t$carrier = strtoupper($scacArr['partner_id']);\n\t\tif(strtoupper($this->sellerPartner->getGenShippingLabel()) == 'NO'){\n\t\t\t$this->setGenerateShippingLabel(false);\n\t\t}elseif ($carrier == \"FEDEX\" || $carrier == \"UPS\") {\n\t\t\t$this->setGenerateShippingLabel(true);\n\t\t}else{\n\t\t\t$this->setGenerateShippingLabel(false);\n\t\t}\n\t\treturn $this->getGenerateShippingLabel();\n\t}", "public function disabled($which)\n\t{\n\t\treturn in_array($which, $this->disabled);\n\t}", "public function enable_disable_billing(Request $request)\n {\n\n PaymentMethod::findOrFail($request->id)->update(['is_available' => ($request->status==\"true\" ? true : false)]);\n\n return response()->json(true);\n }", "public function isDisabled(): bool\n {\n return $this->disabled;\n }", "public function isCheckoutDisabled()\n {\n return $this->scopeConfig->getValue(\n self::CHECKOUT_DISABLE,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function needs_shipping() {\n\t\tif ( ! wc_shipping_enabled() || 0 === wc_get_shipping_method_count( true ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$needs_shipping = false;\n\n\t\tforeach ( $this->get_cart_contents() as $cart_item_key => $values ) {\n\t\t\tif ( $values['data']->needs_shipping() ) {\n\t\t\t\t$needs_shipping = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping );\n\t}", "public function is_enabled()\n {\n }", "public function isEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_TRANSACTIONAL_API_ENABLED);\n }", "public function getShippingInfo();", "function wp_tiered_shipping_init() {\n\n class WC_Tiered_Shipping extends WC_Shipping_Method {\n\n /**\n * __construct() {\n */\n public function __construct() {\n $this->id = 'tiered_shipping';\n $this->title = __( 'Tiered Flat Rate Shipping', $this->id );\n $this->method_title = __( 'Tiered flat rate shipping', $this->id );\n $this->description = __( 'A flat rate shipping method that adjusts depending on the number of products purchased.', $this->id );\n $this->init();\n }\n\n\n /**\n * init()\n *\n * Initialize all settings for this shipping method.\n *\n * @return void\n */\n public function init(): void {\n // Load the settings API\n $this->init_form_fields(); // Overridden below.\n $this->init_settings(); // This is part of the settings API. Loads settings you previously init.\n\n // Save settings.\n add_action( 'woocommerce_update_options_shipping_' . $this->id, [ $this, 'process_admin_options' ] );\n }\n\n\n /**\n * init_form_fields()\n *\n * Initialize settings form fields. This is part of the settings API, but\n * overridden here.\n *\n * @return void\n */\n public function init_form_fields() {\n global $woocommerce;\n\n $this->form_fields = [\n 'enabled' => [\n 'title' => __( 'Enabled/Disabled', $this->id ),\n 'type' => 'checkbox',\n 'label' => 'Enable this shipping method'\n ],\n\n 'usertitle' => [\n 'title' => __( 'Shipping method label', $this->id ),\n 'type' => 'text',\n 'description' => __( 'The label that is visible to the user.', $this->id ),\n 'default' => __( 'Tiered Flat Rate', $this->id )\n ],\n\n 'availability' => [\n 'title' => __( 'Availability', $this->id ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select availability',\n 'options' => [\n 'all' => 'All allowed countries',\n 'except' => 'All allowed countries, except...',\n 'specific' => 'Specific countries'\n ],\n 'default' => __( 'all', $this->id )\n ],\n\n 'countries' => [\n 'title' => __( 'Countries', $this->id ),\n 'type' => 'multiselect',\n 'class' => 'wc-enhanced-select',\n 'options' => $woocommerce->countries->countries,\n 'default' => __( '', $this->id )\n ],\n\n 'basefee' => [\n 'title' => __( 'Base shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Flat shipping fee that is applied automatically to the cart total for any number of items.', $this->id )\n ],\n\n 'tierfee' => [\n 'title' => __( 'Tier shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Additional shipping fee added to the base fee if the number of items in the cart exceeds a specified number.', $this->id )\n ],\n\n 'quantity' => [\n 'title' => __( 'Number of items to activate tier shipping fee', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Number of items in the cart needed to activate the additional tier shipping fee.', $this->id )\n ],\n\n 'progressive' => [\n 'title' => __( 'Incremental fee?', $this->id ),\n 'type' => 'checkbox',\n 'label' => __( 'Make the tiered shipping fee incremental' ),\n 'description' => __( 'If this option is checked, the tiered shipping fee will be applied incrementally in multiples of the tier item quantity; otherwise, the tiered shipping fee will be a flat fee if the cart is above the specified quantity.', $this->id )\n ]\n ];\n }\n\n\n /**\n * calculate_shipping()\n *\n * Calculate the shipping rate based on product type and number of items.\n *\n * @param array $package\n */\n public function calculate_shipping( $package = [] ) {\n // First, we need to do some checks to make sure that this shipping method\n // is enabled and this users country is included / allowed. If one of these\n // is not true, just return false.\n // Is this shipping type enabled? If not, do nothing.\n $enabled = $this->get_option( 'enabled' );\n\n if ( $enabled == 'no' ) { return false; }\n if ( ! $this->is_tiered_allowed( $package ) ) { return false; }\n\n\n // If we get to this point, we can add this shipping method to the front\n // end and calculate the shipping rate!\n\n global $woocommerce;\n\n // Get all items from cart.\n $items = $woocommerce->cart->get_cart();\n $cart_total_items = 0;\n\n // Sum non-virtual (i.e. shippable) items\n foreach ( $items as $item ) {\n $product = wc_get_product( $item['product_id'] );\n if ( !$product->is_virtual() ) {\n $cart_total_items += $item['quantity'];\n }\n }\n\n // Set the base shipping fee.\n $shipping = $cart_total_items > 0 ? $this->get_option('basefee') : 0;\n\n // Override base fee with tiered fee if cart items are over the tier quantity.\n if ( $cart_total_items > $this->get_option( 'quantity' ) ) {\n\n // If the tier fee should be progressive, calculate the multiplier and add the tier fee * multiplier.\n if ( $this->get_option( 'progressive' ) == 'yes' ) {\n $multiplier = ceil( $cart_total_items / $this->get_option( 'quantity' ) ) - 1;\n $shipping += $this->get_option( 'tierfee' ) * $multiplier;\n }\n\n // If the tier fee is flat, simply add the tier fee.\n else {\n $shipping += $this->get_option( 'tierfee' );\n }\n }\n\n // Set the shipping rate.\n $rate = [\n 'label' => $this->title,\n 'cost' => $shipping,\n 'calc_tax' => 'per_item'\n ];\n\n $this->add_rate( $rate );\n }\n\n\n /**\n * is_tiered_allowed()\n *\n * Determine if the tiered rate is allowed for this location.\n *\n * @param array $package\n */\n function is_tiered_allowed( $package = [] ) {\n $availability = $this->get_option( 'availability' );\n $user_country = $package['destination']['country'];\n $countries = $this->get_option( 'countries' );\n\n switch ( $availability ) {\n // Plugin availability is set to all countries.\n case 'all':\n return true;\n break;\n\n case 'specific':\n $in_allowed_country = false;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = true;\n break;\n }\n }\n\n return $in_allowed_country;\n break;\n\n case 'except':\n $in_allowed_country = true;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = false;\n break;\n }\n }\n\n return $in_allowed_country;\n }\n }\n\n }\n}" ]
[ "0.73548466", "0.72851133", "0.71839416", "0.71428865", "0.70839846", "0.706824", "0.7061846", "0.69155294", "0.68999326", "0.67868286", "0.66589653", "0.66584814", "0.6644975", "0.6638742", "0.6609674", "0.6588099", "0.6572114", "0.65700114", "0.6546634", "0.6546634", "0.6546634", "0.65113294", "0.6498189", "0.6438114", "0.6427122", "0.64220715", "0.6408669", "0.6394513", "0.6392664", "0.6369124", "0.63664746", "0.6363458", "0.63604593", "0.6332201", "0.6323766", "0.62751573", "0.622602", "0.62199974", "0.6204774", "0.6196205", "0.61591", "0.615219", "0.614793", "0.61449254", "0.61395705", "0.61366", "0.6123808", "0.6123751", "0.610796", "0.60974216", "0.6080495", "0.60715246", "0.6070694", "0.60597", "0.60568017", "0.60547626", "0.60280883", "0.6016157", "0.59879893", "0.5976476", "0.5975723", "0.59567034", "0.59556407", "0.59229296", "0.59160334", "0.5906092", "0.590168", "0.58934563", "0.58858716", "0.58691627", "0.5868666", "0.5857757", "0.5855935", "0.58545387", "0.5852755", "0.585272", "0.5849782", "0.5848848", "0.5842016", "0.58342963", "0.5830173", "0.5821646", "0.582015", "0.5817552", "0.5817307", "0.58164525", "0.58145845", "0.58142006", "0.57951844", "0.5792796", "0.57911813", "0.57853305", "0.5783536", "0.57766443", "0.5775039", "0.576937", "0.57626486", "0.5754862", "0.5751478", "0.5748191" ]
0.6957078
7
get allowed product types for weight calculation
public function getProductTypesForWeightCalculation() { return explode(",", $this->getConfig('packages/global_settings_weight_product_types')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_allowed_product_types() {\n\t\t$product_types = self::append_product_data(\n\t\t\tarray(\n\t\t\t\t'physical' => array(\n\t\t\t\t\t'label' => __( 'Physical products', 'woocommerce' ),\n\t\t\t\t\t'default' => true,\n\t\t\t\t),\n\t\t\t\t'downloads' => array(\n\t\t\t\t\t'label' => __( 'Downloads', 'woocommerce' ),\n\t\t\t\t),\n\t\t\t\t'subscriptions' => array(\n\t\t\t\t\t'label' => __( 'Subscriptions', 'woocommerce' ),\n\t\t\t\t\t'product' => 27147,\n\t\t\t\t),\n\t\t\t\t'memberships' => array(\n\t\t\t\t\t'label' => __( 'Memberships', 'woocommerce' ),\n\t\t\t\t\t'product' => 958589,\n\t\t\t\t),\n\t\t\t\t'bookings' => array(\n\t\t\t\t\t'label' => __( 'Bookings', 'woocommerce' ),\n\t\t\t\t\t'product' => 390890,\n\t\t\t\t),\n\t\t\t\t'product-bundles' => array(\n\t\t\t\t\t'label' => __( 'Bundles', 'woocommerce' ),\n\t\t\t\t\t'product' => 18716,\n\t\t\t\t),\n\t\t\t\t'product-add-ons' => array(\n\t\t\t\t\t'label' => __( 'Customizable products', 'woocommerce' ),\n\t\t\t\t\t'product' => 18618,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\treturn apply_filters( 'woocommerce_admin_onboarding_product_types', $product_types );\n\t}", "protected function getAllowedProductTypes() {\n\t\treturn array(\n\t\t\tCustomweb_Payment_Authorization_IInvoiceItem::TYPE_SHIPPING,\n\t\t\tCustomweb_Payment_Authorization_IInvoiceItem::TYPE_DISCOUNT,\n\t\t\tCustomweb_Payment_Authorization_IInvoiceItem::TYPE_FEE,\n\t\t\tCustomweb_Payment_Authorization_IInvoiceItem::TYPE_PRODUCT,\n\t\t);\n\t}", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "public function get_desired_types();", "public function getProductType();", "public function checkCategoryType(): array\n {\n $products = array();\n if ($_POST['hammer'] == 'true') {\n $products[] = \"Hammers\";\n }\n if ($_POST['heat'] == 'true') {\n $products[] = \"Heat Guns\";\n }\n if ($_POST['pliers'] == 'true') {\n $products[] = \"Pliers\";\n }\n if ($_POST['screw'] == 'true') {\n $products[] = \"Screwdrivers\";\n }\n if($_POST['span'] == 'true') {\n $products[] = \"Spanners and Wrenches\";\n }\n return $products;\n }", "public function getProductTypeAttribute()\n {\n return [self::LOAN, self::INSURANCE];\n }", "public static function returnAllowedInstallTypes() {}", "public function getWarehouseTypes();", "public function getProductType()\n {\n }", "public function getProductsBadType(): array\n {\n return [\n [\n new Product('Foo', 42.0, ProductTypeEnum::NON_FOOD()),\n new Product('Foo', 42.0, ProductTypeEnum::NON_FOOD()),\n ],\n ];\n }", "public function getProductTypes()\n {\n $pageIds = $this->database->getPageIdsRecursive(\n $this->controller->configModel->get('storageFolder'),\n $this->controller->configModel->get('recurseDepth')\n );\n if ($pageIds === false) {\n throw new \\tx_nclib_exception('label_error_no_pages_found', $this->controller);\n }\n $fields = 'DISTINCT producttype as productType';\n $startTime = $this->controller->dateFilter['iStartTime'];\n $endTime = $this->controller->dateFilter['iEndTime'];\n $where = array(\n 'producttype != \\'\\'',\n 'hidden=0',\n 'deleted=0',\n 'type=' . $this->getModelType(),\n 'publishdate >= ' . $startTime,\n 'publishdate <= ' . $endTime,\n sprintf('%s.pid in (%s)', $this->getTableName(), implode(',', $pageIds)),\n );\n $where = $this->database->getWhere($where);\n $orderBy = 'producttype';\n $groupBy = '';\n\n $this->database->clear();\n\n $records = $this->database->getQueryRecords($this->getTableName(), $fields, $where, $groupBy, $orderBy);\n if (!$records || !\\tx_nclib::isLoopable($records)) {\n return false;\n }\n $result = array();\n foreach ($records as $record) {\n $result[] = $record['productType'];\n }\n return $result;\n }", "public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}", "public function getPriceTypeAllowableValues()\n {\n return [\n self::PRICE_TYPE_0,\n self::PRICE_TYPE_1,\n self::PRICE_TYPE_2,\n ];\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "private static function getProductRules() {\n return array(\n 'price' => 'required',\n 'original_price' => 'required',\n 'quantity' => 'required',\n );\n }", "public function getCostTypeAllowableValues()\n {\n return [\n self::COST_TYPE_STAY,\n self::COST_TYPE_NIGHT,\n self::COST_TYPE_WEEK,\n self::COST_TYPE_PERSON_PER_NIGHT,\n self::COST_TYPE_ADULT_PER_NIGHT,\n self::COST_TYPE_PERSON_PER_NIGHT,\n self::COST_TYPE_USE,\n ];\n }", "public function getCarePersonWeightAllowableValues()\n {\n return [\n self::CARE_PERSON_WEIGHT_WENIGER_ALS_130KG,\n self::CARE_PERSON_WEIGHT_MEHR_ALS_130KG,\n self::CARE_PERSON_WEIGHT_NOCH_UNKLAR,\n ];\n }", "protected function getAvailableTypes() {\n return [\n 'miljoenennota' => 'miljoenennota',\n 'miljoenennota (bijlage)' => 'miljoenennota',\n 'voorjaarsnota' => 'voorjaarsnota',\n 'najaarsnota' => 'najaarsnota',\n 'belastingplan (vvw)' => 'belastingplan_voorstel_van_wet',\n 'belastingplan (mvt)' => 'belastingplan_memorie_van_toelichting',\n 'belastingplan (sb)' => 'belastingplan_staatsblad',\n 'financieel jaarverslag' => 'financieel_jaarverslag',\n 'financieel jaarverslag (bijlage)' => 'financieel_jaarverslag',\n 'sw' => 'voorstel_van_wet',\n 'sw (mvt)' => 'memorie_van_toelichting',\n 'owb' => 'memorie_van_toelichting',\n 'owb (wet)' => 'voorstel_van_wet',\n 'jv' => 'jaarverslag',\n '1supp' => 'memorie_van_toelichting',\n '1supp (wet)' => 'voorstel_van_wet',\n '2supp' => 'memorie_van_toelichting',\n '2supp (wet)' => 'voorstel_van_wet',\n 'isb (mvt)' => 'isb_memorie_van_toelichting',\n 'isb (wet)' => 'isb_voorstel_van_wet',\n ];\n }", "public static function getAllowedTypes();", "public function getAllowedTypes()\n {\n return ['VI', 'MC', 'AE', 'DI', 'JCB', 'UN', 'MI', 'DN', 'BCMC', 'HIPERCARD','ELO', 'TROY', 'DANKORT'];\n }", "public function getEnabledVariations(ProductInterface $product);", "function acf_wc_product_type_rule_type($choices) {\n // this will be a place to put all custom rules assocaited with woocommerce\n // the reason for checking to see if it exists or not first\n // is just in case another custom rule is added\n if (!isset($choices['Product'])) {\n $choices['Product'] = array();\n }\n // now add the 'Category' rule to it\n if (!isset($choices['Product']['product_cat'])) {\n // product_cat is the taxonomy name for woocommerce products\n $choices['Product']['product_cat_term'] = 'Product Category Term';\n }\n return $choices;\n }", "public function getAllowedTypes();", "public function getProductPriceType()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/base_price');\n }", "public static function getPriceTypes() {\n\t\treturn array(\n\t\t\tself::PRICE_TYPE_FIXED_PRICE => 'fixed_price',\n\t\t\tself::PRICE_TYPE_ONO => 'ono',\n\t\t\tself::PRICE_TYPE_FOR_FREE => 'for_free'\n\t\t);\n\t}", "protected function get_detected_products () {\n if ( $this->type == 'theme' ) {\n return $this->get_detected_theme();\n } elseif ( $this->type == 'plugin' ) {\n return $this->get_detected_plugins();\n } else {\n return array();\n }\n }", "public function getTargetType($type) {\n $retObj = array();\n switch ($type) {\n case 'Brand':\n $retObj[] = new ProductBrand($this->targetData);\n $retObj[] = new ProductBrand();\n \n return $retObj;\n break;\n case 'Condition':\n $retObj[] = new ProductCanonicalCondition($this->targetData);\n $retObj[] = new ProductCanonicalCondition();\n \n return $retObj;\n break;\n case 'Category':\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1', $this->targetData);\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1');\n \n return $retObj;\n break;\n case 'Channel':\n $retObj[] = new ProductChannel($this->targetData);\n $retObj[] = new ProductChannel();\n \n return $retObj;\n break;\n case 'Item ID':\n $retObj[] = new ProductOfferId($this->targetData);\n $retObj[] = new ProductOfferId();\n \n return $retObj;\n break;\n case 'Product type':\n $retObj[] = new ProductType('PRODUCT_TYPE_L1', $this->targetData);\n $retObj[] = new ProductType('PRODUCT_TYPE_L1');\n \n return $retObj;\n break;\n case 'Channel exclusivity':\n $retObj[] = new ProductChannelExclusivity($this->targetData);\n $retObj[] = new ProductChannelExclusivity();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_0':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_1':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_2':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_3':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_4':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n \n default:\n break;\n }\n }", "public function getProcessTypes() {\n return array(\n 'media_seller',\n 'ad_network',\n 'product',\n // Publisher is requested per publisher ID.\n 'publisher',\n );\n }", "public function getExcludedPurchaseTypes($Product){\n\t\t$excludedTypes = array();\n\t\tforeach($this->getContents() as $orderedProduct){\n\t\t\tif($Product->getProductsId() == $orderedProduct->getProductsId() && $Product->getId() != $orderedProduct->getId()){\n\t\t\t\tif($orderedProduct->getPurchaseType() == 'reservation'){\n\t\t\t\t\t$excludedTypes[] ='reservation';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $excludedTypes;\n\t}", "public function getProcurementTypeAllowableValues()\n {\n return [\n self::PROCUREMENT_TYPE_PURCHASE,\n self::PROCUREMENT_TYPE_ADJUSTMENT,\n self::PROCUREMENT_TYPE_TRANSFER,\n ];\n }", "public function getIneffective()\n {\n $xary = array();\n foreach ($this->ineffective as $info) {\n $xary[] = new Type($info->resource_id);\n }\n return $xary;\n }", "function hook_shipping_type() {\n $weight = variable_get('uc_quote_type_weight', array('small_package' => 0));\n\n $types = array();\n $types['small_package'] = array(\n 'id' => 'small_package',\n 'title' => t('Small Packages'),\n 'weight' => $weight['small_package'],\n );\n\n return $types;\n}", "public static function allowed_types()\n {\n return self::$allowed_types;\n }", "abstract protected function getWeightFeatures();", "public function getValidTypes()\n\t{\n\t\treturn array(\n\t\t\tself::TYPE_SINGLE=>Yii::t('payment', 'Ett LAN'),\n\t\t\tself::TYPE_SEASON=>Yii::t('payment', 'Säsong'),\n\t\t);\n\t}", "function fn_wishlist_get_carts(&$type_restrictions)\n{\n if (is_array($type_restrictions)) {\n $type_restrictions[] = 'W';\n }\n}", "public function getBillProductsAllowableValues()\n {\n return [\n self::BILL_PRODUCTS_BILLABLE,\n self::BILL_PRODUCTS_DO_NOT_BILL,\n self::BILL_PRODUCTS_NO_CHARGE,\n self::BILL_PRODUCTS_NO_DEFAULT,\n ];\n }", "function get_penalty_types() {\n\t$array = array(\n\t\t\t\"Abuse of officials\" \t=> 2,\n\t\t\t\"Aggressor penalty\"\t\t=> 2,\n\t\t\t\"Attempt to injure\"\t\t=> 2,\n\t\t\t\"Biting\"\t\t\t\t=> 2,\n\t\t\t\"Boarding\"\t\t\t\t=> 2,\n\t\t\t\"Butt-ending\"\t\t\t=> 2,\n\t\t\t\"Broken stick\"\t\t\t=> 2,\n\t\t\t\"Charging\"\t\t\t\t=> 2,\n\t\t\t\"Checking from behind\"\t=> 2,\n\t\t\t\"Illegal check to the head\" => 2,\n\t\t\t\"Clipping\" \t\t\t\t=> 2,\n\t\t\t\"Cross-checking\" \t\t=> 2,\n\t\t\t\"Delay of game\" \t\t=> 2,\n\t\t\t\"Diving\"\t\t\t\t=> 2,\n\t\t\t\"Elbowing\"\t\t\t\t=> 2,\n\t\t\t\"Eye-gouging\"\t\t\t=> 2,\n\t\t\t\"Fighting\"\t\t\t\t=> 5,\n\t\t\t\"Goaltender Interference\" => 2,\n\t\t\t\"Goaltender Leaving Crease\" => 2,\n\t\t\t\"Head-butting\" => 2,\n\t\t\t\"High-sticking (2 min)\" => 2,\n\t\t\t\"High-sticking (4 min)\" => 2,\n\t\t\t\"Holding\" => 2,\n\t\t\t\"Holding the stick\" => 2,\n\t\t\t\"Illegal Equipment\" => 2,\n\t\t\t\"Instigator penalty\" => 2,\n\t\t\t\"Interference\" => 2,\n\t\t\t\"Joining a fight\" => 10,\n\t\t\t\"Kicking\" => 5,\n\t\t\t\"Kneeing\" => 2,\n\t\t\t\"Leaving the Penalty Bench\" => 2,\n\t\t\t\"Playing with Too Many Sticks\" => 2,\n\t\t\t\"Roughing\" => 2,\n\t\t\t\"Secondary Altercation\" => 2,\n\t\t\t\"Slashing\" => 2,\n\t\t\t\"Slew Footing\" => 2,\n\t\t\t\"Spearing\" => 2,\n\t\t\t\"Starting the wrong lineup\" => 2,\n\t\t\t\"Substitution infraction (Illegal Substitution)\" => 2,\n\t\t\t\"Throwing Equipment\" => 2,\n\t\t\t\"Too many men on the ice\" => 2,\n\t\t\t\"Tripping\" => 2, \n\t\t\t\"Unsportsmanlike conduct\" => 2\n\t\t);\n\n\treturn $array;\n}", "public function auction_product_type( $types ) { \n\n\t\t$types[ 'auction' ] = __( 'Auction', 'wcvendors-pro-simple-auctions' );\n\n\t\treturn $types; \n\n\t}", "protected function _getAdditionalElementTypes()\n {\n $result = array(\n 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),\n 'weight' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_weight'),\n 'gallery' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_gallery'),\n 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),\n 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean'),\n 'textarea' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_helper_form_wysiwyg'),\n 'file' => Mage::getConfig()->getBlockClassName('teeth/adminhtml_catalog_product_helper_form_file'),\n );\n\n $response = new Varien_Object();\n $response->setTypes(array());\n Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response' => $response));\n\n foreach ($response->getTypes() as $typeName => $typeClass) {\n $result[$typeName] = $typeClass;\n }\n\n return $result;\n }", "public function getValidMarketOrderTypes()\n {\n return $this->getEndpoint('GetValidMarketOrderTypes');\n }", "protected function get_array_field_types() {\n\t\treturn array( 'multicheck' );\n\t}", "public static function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName('a.id', 'value'));\n\t\t$query->select($db->quoteName('a.name', 'text'));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\tif (JFactory::getUser()->guest) {\n\t\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t}\n\t\t\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList();\n\t}", "public function available_item_types()\n {\n }", "function getCompatibilityByWeight($searchee=array(), $candidate=array(), $type=1){\r\n\t\t$commonItems = 0;\r\n\t\t$sim = 0;\r\n\t\tforeach($searchee[\"MemberAttributeWeight\"] as $weight_searchee){\r\n\t\t\tforeach($candidate[\"MemberAttributeWeight\"] as $weight_candidate){\r\n\t\t\t\tif ($weight_searchee[\"attribute_id\"]==$weight_candidate[\"attribute_id\"]){\r\n\t\t\t\t\t$attribute = $this->controller->Attribute->find(\"first\", array(\"conditions\"=>array(\"Attribute.id\"=>$weight_candidate[\"attribute_id\"])));\r\n\t\t\t\t\t//if ($attribute[\"attribute_type_id\"]==$type){\r\n\t\t\t\t\t\t$commonItems++;\r\n\t\t\t\t\t\t$weight1 = $weight_searchee[\"weight\"];\r\n\t\t\t\t\t\t$weight2 = $weight_candidate[\"weight\"];\r\n\t\t\t\t\t\t$sim+=pow(($weight1-$weight2), 2);\r\n\t\t\t\t\t//}\t\t\t\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($commonItems>0){\r\n\t\t\t$sim = sqrt($sim/$commonItems);\r\n\t\t\t$sim = 1 - tanh($sim);\r\n\t\t\t$maxItems = min(count($searchee[\"MemberAttributeWeight\"]), count($candidate[\"MemberAttributeWeight\"]));\r\n\t\t\t$sim = $sim * ($commonItems/$maxItems);\r\n\t\t}\r\n\t\treturn $sim;\r\n\t}", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_SALES_ORDER,\n self::TYPE_SALES_INVOICE,\n self::TYPE_PURCHASE_ORDER,\n self::TYPE_PURCHASE_INVOICE,\n self::TYPE_RETURN_ORDER,\n self::TYPE_RETURN_INVOICE,\n self::TYPE_INVENTORY_TRANSFER_ORDER,\n self::TYPE_INVENTORY_TRANSFER_INVOICE,\n self::TYPE_REVERSE_CHARGE_ORDER,\n self::TYPE_REVERSE_CHARGE_INVOICE,\n self::TYPE_CUSTOMS_INVOICE,\n self::TYPE_CUSTOMS_ORDER,\n self::TYPE_ANY,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PACKAGE,\n self::TYPE_DOX,\n self::TYPE_PALLET,\n ];\n }", "public function getproduct_feathered()\n\t\t{\n\t\t\t$query = \"SELECT * FROM tbl_product WHERE type = '0'\";\n\t\t\t$result = $this->db->select($query);\n\t\t\treturn $result;\n\t\t}", "public function getConditionTypeAllowableValues()\n {\n return [\n self::CONDITION_TYPE_NEW_NEW,\n self::CONDITION_TYPE_NEW_OPEN_BOX,\n self::CONDITION_TYPE_NEW_OEM,\n self::CONDITION_TYPE_REFURBISHED_REFURBISHED,\n self::CONDITION_TYPE_USED_LIKE_NEW,\n self::CONDITION_TYPE_USED_VERY_GOOD,\n self::CONDITION_TYPE_USED_GOOD,\n self::CONDITION_TYPE_USED_ACCEPTABLE,\n self::CONDITION_TYPE_COLLECTIBLE_LIKE_NEW,\n self::CONDITION_TYPE_COLLECTIBLE_VERY_GOOD,\n self::CONDITION_TYPE_COLLECTIBLE_GOOD,\n self::CONDITION_TYPE_COLLECTIBLE_ACCEPTABLE,\n self::CONDITION_TYPE_CLUB_CLUB,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_IMPORT_DUTY,\n self::TYPE_SALES_TAX,\n self::TYPE_GST_VAT,\n self::TYPE_INPUT_TAXED,\n self::TYPE_CONSOLIDATED,\n self::TYPE_LUXURY_CAR_TAX,\n self::TYPE_WITHHOLDINGS_TAX,\n self::TYPE_NO_ABN_TFN,\n ];\n }", "public function getScalingResourceTypeAllowableValues()\r\n {\r\n return [\r\n self::SCALING_RESOURCE_TYPE_SCALING_GROUP,\r\n self::SCALING_RESOURCE_TYPE_BANDWIDTH,\r\n ];\r\n }", "public function getAllowedTypes()\n {\n return ['substition', 'protected', 'disabled', 'formatting'];\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_CART,\n self::TYPE_SINGLE_ITEM,\n self::TYPE_VOUCHER,\n self::TYPE_VENDOR,\n self::TYPE_TAG,\n ];\n }", "public function getWeightClass() {}", "public function getVolumeTypeAllowableValues()\r\n {\r\n return [\r\n self::VOLUME_TYPE_SSD,\r\n self::VOLUME_TYPE_GPSSD,\r\n self::VOLUME_TYPE_SAS,\r\n self::VOLUME_TYPE_SATA,\r\n self::VOLUME_TYPE_ESSD,\r\n self::VOLUME_TYPE_GPSSD2,\r\n self::VOLUME_TYPE_ESSD2,\r\n ];\r\n }", "public static function getTypes()\n {\n return [\n ModelRegistry::TRANSACTION => ModelRegistry::getById(ModelRegistry::TRANSACTION)->label,\n ModelRegistry::PRODUCT => ModelRegistry::getById(ModelRegistry::PRODUCT)->label,\n ];\n }", "public function getAllowedTypes()\n {\n $config = $this->_config;\n $enablematrix = array(\n 'saml20-sp' => array(\n 'enable' => $config->getBoolean('enable.saml20-sp', false),\n 'name' => 'SAML 2.0 SP',\n ),\n 'saml20-idp' => array(\n 'enable' => $config->getBoolean('enable.saml20-idp', false),\n 'name' => 'SAML 2.0 IdP',\n ),\n 'shib13-sp' => array(\n 'enable' => $config->getBoolean('enable.shib13-sp', false),\n 'name' => 'Shib 1.3 SP',\n ),\n 'shib13-idp' => array(\n 'enable' => $config->getBoolean('enable.shib13-idp', false),\n 'name' => 'Shib 1.3 IdP',\n ),\n );\n\n return $enablematrix;\n }", "public function render_products_type()\r\n {\r\n $current_product_type = isset($_REQUEST['product_type']) ? wc_clean(wp_unslash($_REQUEST['product_type'])) : false; // WPCS: input var ok, sanitization ok.\r\n $output = '<select name=\"product_type\" id=\"dropdown_product_type\"><option value=\"\">' . __('Filter by product type', 'woocommerce') . '</option>';\r\n\r\n foreach (wc_get_product_types() as $value => $label) {\r\n $output .= '<option value=\"' . esc_attr($value) . '\" ';\r\n $output .= selected($value, $current_product_type, false);\r\n $output .= '>' . esc_html($label) . '</option>';\r\n\r\n if ('simple' === $value) {\r\n $output .= '<option value=\"downloadable\" ';\r\n $output .= selected('downloadable', $current_product_type, false);\r\n $output .= '> ' . (is_rtl() ? '&larr;' : '&rarr;') . ' ' . __('Downloadable', 'woocommerce') . '</option>';\r\n\r\n $output .= '<option value=\"virtual\" ';\r\n $output .= selected('virtual', $current_product_type, false);\r\n $output .= '> ' . (is_rtl() ? '&larr;' : '&rarr;') . ' ' . __('Virtual', 'woocommerce') . '</option>';\r\n }\r\n }\r\n\r\n $output .= '</select>';\r\n echo $output; // WPCS: XSS ok.\r\n }", "protected abstract function operatorTypes();", "function ewtTypes($key = null){\n $types = array(\n 0 => '0', // NONE\n 1 => '0.01', // Goods\n 2 => '0.02', // Services\n 5 => '0.05',// professional or rent ( condition: annual fee is less than 720k in one year.)\n 15 => '0.15'// professional or rent ( condition: annual fee is greater or equal 720k in one year.)\n );\n if(!empty($key) || $key == '0'){\n if($key == '0'){\n $key = intval($key);\n }\n $types = $types[$key];\n }\n return $types;\n}", "function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}", "public function getProductType() {\n return $this->item->getProductType();\n }", "public function getPriceType()\n {\n return (int) $this->getConfig('extrafee/general/pricetype');\n }", "public function getGetValidLimitOrderTypes()\n {\n return $this->getEndpoint('GetValidLimitOrderTypes');\n }", "public function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\t//echo nl2br(str_replace('#__','pihps_',$query));\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList('id');\n\t}", "public function getImageTypeAllowableValues()\r\n {\r\n return [\r\n self::IMAGE_TYPE_BACKUP,\r\n self::IMAGE_TYPE_REPLICATION,\r\n ];\r\n }", "public function getSuperEffective()\n {\n $xary = array();\n foreach ($this->super_effective as $info) {\n $xary[] = new Type($info->resource_id);\n }\n return $xary;\n }", "public function getResistance()\n {\n $xary = array();\n foreach ($this->resistance as $info) {\n $xary[] = new Type($info->resource_id);\n }\n return $xary;\n }", "public static function getTypes(): array {\n\t\treturn ['pizza'];\n\t}", "public function getProcessingTypeAllowableValues()\n {\n return [\n self::PROCESSING_TYPE_ATM_WITHDRAW,\n self::PROCESSING_TYPE_BALANCE_INQUIRY,\n self::PROCESSING_TYPE_ECOMMERCE,\n self::PROCESSING_TYPE_MOTO,\n self::PROCESSING_TYPE_POS,\n self::PROCESSING_TYPE_PURCHASE_WITH_CASHBACK,\n self::PROCESSING_TYPE_RECURRING,\n self::PROCESSING_TYPE_TOKEN,\n ];\n }", "public function rules()\n {\n return [\n 'product.*.name' => 'string|min:1',\n 'product.*.description' => 'string',\n 'product.*.price' => 'integer|min:0',\n 'product.*.enabled' => 'boolean',\n ];\n }", "public function get_font_weight_choices() {\n\n\t\treturn array(\n\t\t\t'100' => esc_html__( 'Thin', 'dahztheme' ),\n\t\t\t'300' => esc_html__( 'Light', 'dahztheme' ),\n\t\t\t'400' => esc_html__( 'Normal', 'dahztheme' ),\n\t\t\t'500' => esc_html__( 'Medium', 'dahztheme' ),\n\t\t\t'700' => esc_html__( 'Bold', 'dahztheme' ),\n\t\t\t'900' => esc_html__( 'Ultra Bold', 'dahztheme' ),\n\t\t);\n\t}", "public function getVolumeTypeAllowableValues()\r\n {\r\n return [\r\n self::VOLUME_TYPE_SATA,\r\n self::VOLUME_TYPE_SAS,\r\n self::VOLUME_TYPE_SSD,\r\n self::VOLUME_TYPE_CO_PL,\r\n self::VOLUME_TYPE_UH_11,\r\n ];\r\n }", "private function processByType()\n {\n $query = $this->getQuery();\n $lenght = strlen($query);\n $percentages = self::$percentageCalculator;\n $cryptocurrency = self::$cryptocurrencyCalculator;\n $currency = self::$currencyCalculator;\n $pxemrem = self::$pxemremCalculator;\n $units = self::$unitsCalculator;\n $vat = self::$vatCalculator;\n $datastorage = self::$dataStorageCalculator;\n $processed = [];\n\n if ($units->shouldProcess($lenght)) {\n return $units->processQuery();\n }\n\n if ($percentages->shouldProcess($lenght)) {\n return $percentages->processQuery();\n }\n\n if ($pxemrem->shouldProcess($lenght)) {\n return $pxemrem->processQuery();\n }\n\n if ($vat->shouldProcess($lenght)) {\n return $vat->processQuery();\n }\n\n if ($datastorage->shouldProcess($lenght)) {\n return $datastorage->processQuery();\n }\n\n if ($currency->shouldProcess($lenght)) {\n return $currency->processQuery();\n }\n\n if ($cryptocurrency->shouldProcess($lenght)) {\n return $cryptocurrency->processQuery();\n }\n\n return $processed;\n }", "public function get_equipment_type();", "protected function getProductAttrCodeUseForSearchWeight()\n {\n if (null === $this->_productAttrCodeUseForSearchWeight) {\n $this->_productAttrCodeUseForSearchWeight = $this->_helper->getGeneralSetting('advanced/product_search_weight');\n }\n return $this->_productAttrCodeUseForSearchWeight;\n }", "private function getType($product)\n { \n $productTypes = $product->types;\n\n if(!$productTypes->isEmpty())\n {\n $typeName=NULL;\n\n foreach ($productTypes as $productType) {\n\n $typeName .= $productType->type_name . \"+\";\n }\n\n return trim($typeName,\"+\");\n\n }\n else\n {\n return NULL;\n }\n }", "protected function get_applicable_types()\n\t{\n\t\t$types = array();\n\n\t\tforeach ($this->types->get_all() as $id => $class)\n\t\t{\n\t\t\tif ($class->forum_robot && $class->forum_database)\n\t\t\t{\n\t\t\t\t$types[] = $id;\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PURCHASE,\nself::TYPE_REFUND,\nself::TYPE_PARTIAL_REFUND, ];\n }", "public function getAvailableAdTypes()\n {\n $query = \"SELECT ALL FROM adv_type WHERE is_available = 'y'\";\n return $this->getQueryData($query, $this->getConnection());\n }", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "function getAvailableTypes() {\n return array('public' => 'public microtext',\n 'private' => 'private microtext',\n 'book' => 'microbuilder book microtext' );\n }", "public function getProductPriceType()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/base_price', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function rules()\n\t{\n\t\t[$productType]\t= Arr::divide(config('products.products'));\n\t\treturn [\n\t\t\t'title'\t\t\t=> 'required|string|max:255',\n\t\t\t'description'\t=> 'nullable|string',\n\t\t\t'price'\t\t\t=> 'required|numeric|min:0',\n\t\t\t'product_type'\t=> 'required|in:'.Str::implode(',', $productType),\n\t\t\t'product_cat'\t=> 'required|in:'.Str::implode(',', [COUNTABLE, PERMANENT]),\n\t\t\t'entity_id'\t\t=> 'nullable|string'\n\t\t];\n\t}", "public function getCcAvailableTypes()\n {\n //Listando apenas cielo pois já contem todas as bandeiras\n $_types = Mage::getModel('gwap/source_cctypes_cielo')->toOptionArray();\n //$_types[] = Mage::getModel('gwap/source_cctypes_redecard')->toOptionArray();\n \n $types = array();\n foreach ($_types as $data) {\n if (isset($data['label']) && isset($data['value']) && $data['value']!='') {\n $types[substr_replace($data['value'],'',-2)] = $data['label'];\n }\n }\n \n if ($method = $this->getMethod()) {\n //Armazena os cartões habilitados nas duas operadoras\n $availableTypes = $method->getConfigData('cctypes_rcard');\n $availableTypes .= ','.$method->getConfigData('cctypes_cielo');\n \n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n $allTypes = array();\n // Remove 2 ultimos caracteres do cartão\n foreach($availableTypes as $substype){\n $allTypes[] = substr_replace($substype,'',-2);\n }\n //Compara com cartões disponíveis\n foreach ($types as $code=>$name) {\n if (!in_array($code, $allTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "function wpcf_get_active_custom_types() {\n $types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());\n foreach ($types as $type => $data) {\n if (!empty($data['disabled'])) {\n unset($types[$type]);\n }\n }\n return $types;\n}", "public function getTaxTypeAllowableValues()\n {\n $baseVals = [\n self::TAX_TYPE_CGST,\n self::TAX_TYPE_SGST,\n self::TAX_TYPE_CESS,\n self::TAX_TYPE_UTGST,\n self::TAX_TYPE_IGST,\n self::TAX_TYPE_MW_ST,\n self::TAX_TYPE_PST,\n self::TAX_TYPE_TVA,\n self::TAX_TYPE_VAT,\n self::TAX_TYPE_GST,\n self::TAX_TYPE_ST,\n self::TAX_TYPE_CONSUMPTION,\n self::TAX_TYPE_MUTUALLY_DEFINED,\n self::TAX_TYPE_DOMESTIC_VAT,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "protected function getPropertyTypeAttributes()\n {\n return array_merge(\n $this->getCommonAttributes(),\n array(\n 'multiple' => array('values' => array('*', 'mul', 'multiple'), 'variant' => true),\n 'queryops' => array('values' => array('qop', 'queryops'), 'variant' => true), // Needs special handling !\n 'nofulltext' => array('values' => array('nof', 'nofulltext'), 'variant' => true),\n 'noqueryorder' => array('values' => array('nqord', 'noqueryorder'), 'variant' => true),\n )\n );\n }", "public function get_item_types()\n\t{\n\t\treturn Plugins::filter( 'get_item_types', $this->item_types );\n\t}", "public static function getProductOptions()\n {\n return self::get('product') ?: [];\n }", "public function getSellerFulfillmentTypeAllowableValues()\n {\n return [\n self::SELLER_FULFILLMENT_TYPE_FBA,\n self::SELLER_FULFILLMENT_TYPE_MFN,\n self::SELLER_FULFILLMENT_TYPE_MFN_PRIME,\n self::SELLER_FULFILLMENT_TYPE_PRIME,\n ];\n }", "public function getFormTypeIdAllowableValues()\n {\n return [\n self::FORM_TYPE_ID_SALES_AND_USE,\n self::FORM_TYPE_ID_SALES,\n self::FORM_TYPE_ID_SELLERS_USE,\n self::FORM_TYPE_ID_LODGING,\n self::FORM_TYPE_ID_SALES_AND_LODGING,\n self::FORM_TYPE_ID_CONSUMER_USE,\n self::FORM_TYPE_ID_RESORT_AND_RENTAL,\n self::FORM_TYPE_ID_TOURIST_AND_RENTAL,\n self::FORM_TYPE_ID_PREPAYMENT,\n self::FORM_TYPE_ID_PREPAYMENT_ALLOWED,\n ];\n }", "function getDatatypes() {\n return ['Protein', 'Phenotype', 'Gene Expression', 'Nucleotide Sequence','Clinical Trials','Imaging Data','Morphology','Proteomics Data','Physiological Signals','Epigenetic Data','Data from Papers',\n 'Omics Data','Survey Data','Cell Signaling','Unspecified',];\n}", "public static function get_allowed_post_types(): array {\n\t\treturn array(\n\t\t\tLDLMS_Post_Types::get_post_type_slug( LDLMS_Post_Types::LESSON ),\n\t\t);\n\t}", "public function getOutputTypeAllowableValues()\n {\n return [\n self::OUTPUT_TYPE_STL,\n self::OUTPUT_TYPE_STEP,\n self::OUTPUT_TYPE_IGES,\n self::OUTPUT_TYPE_OBJ,\n self::OUTPUT_TYPE_SVF,\n self::OUTPUT_TYPE_SVF2,\n self::OUTPUT_TYPE_IFC,\n self::OUTPUT_TYPE_THUMBNAIL,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_1,\n self::TYPE_2,\n self::TYPE_3,\n ];\n }" ]
[ "0.7375922", "0.6834124", "0.67757416", "0.6615323", "0.6530937", "0.6524802", "0.64377016", "0.6414923", "0.6221979", "0.6195298", "0.60853755", "0.6047374", "0.60397077", "0.60080266", "0.59677815", "0.59677815", "0.59677815", "0.5897974", "0.58380723", "0.5827625", "0.5820272", "0.58192194", "0.5807477", "0.5806674", "0.57708794", "0.57305247", "0.57260436", "0.5724046", "0.57106924", "0.5706794", "0.5688334", "0.5686277", "0.5679233", "0.5678284", "0.5675917", "0.5672239", "0.5671692", "0.55821747", "0.55768234", "0.5563033", "0.55527973", "0.55388343", "0.5519278", "0.55113024", "0.54992485", "0.5493049", "0.5484735", "0.54768234", "0.54742956", "0.54728603", "0.546651", "0.54599833", "0.54577506", "0.54513973", "0.54490745", "0.5447341", "0.5436027", "0.54360026", "0.543009", "0.5421443", "0.54105955", "0.54027855", "0.53987867", "0.538768", "0.5370435", "0.53635406", "0.53603613", "0.5360269", "0.5341999", "0.5328214", "0.53220576", "0.53205085", "0.53140914", "0.5309707", "0.5302475", "0.53006274", "0.5297619", "0.5293922", "0.52937186", "0.5293105", "0.52874327", "0.5287039", "0.52869034", "0.52853423", "0.5280847", "0.52804226", "0.5278014", "0.5277735", "0.5274817", "0.526528", "0.526422", "0.5263562", "0.5238024", "0.52372676", "0.5233247", "0.52327585", "0.5232404", "0.5231721", "0.5227827", "0.5225579" ]
0.77937466
0
Carga los datos del fixture.
public function load(ObjectManager $manager) { $ushuaia = new Localidad(); $ushuaia->setNombre('Ushuaia'); $ushuaia->setCodigoPostal('9410'); $rioGrande = new Localidad(); $rioGrande->setNombre('Río Grande'); $rioGrande->setCodigoPostal('9420'); $manager->persist($ushuaia); $manager->persist($rioGrande); $manager->flush(); // Los objetos $ushuaia y $riogrande pueden ser referenciados por otros // fixtures que tengan un orden más alto, vía 'ushuaia' y 'riogrande'. $this->addReference('ushuaia', $ushuaia); $this->addReference('riogrande', $rioGrande); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixtureData() {\n\t\t$rows = array();\n\t\tfor($i = 0; $i < 50; $i++) {\n\t\t\t$rows[] = array(\n\t\t\t\t\"name\" => \"Test Item \".$i,\n\t\t\t\t\"popularity\" => $i,\n\t\t\t\t\"author\" => \"Test Author \".$i,\n\t\t\t\t\"description\" => str_repeat(\"lorem ipsum dolor est \",rand(3,20)),\n\n\t\t\t);\n\t\t}\n\t\treturn $rows;\n\t}", "protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }", "public function _fixtures()\n {\n return [\n\n 'base_date' => [\n 'class' => BaseDataFixture::class,\n 'dataFile' => codecept_data_dir() . 'base_data_data.php',\n ],\n\n ];\n }", "public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }", "abstract protected function getFixtures();", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => AdminUserFixture::class,\n 'dataFile' => codecept_data_dir() . 'admin_user.php',\n ],\n 'auth' => [\n 'class' => AuthItemFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_data.php',\n ],\n 'auth_child' => [\n 'class' => AuthItemChildFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_child_data.php',\n ],\n 'authAssignment' => [\n 'class' => AuthAssignmentFixture::class,\n 'dataFile' => codecept_data_dir() . 'auth_assigment_data.php',\n ],\n 'category' => [\n 'class' => CategoryFixture::class,\n 'dataFile' => codecept_data_dir() . 'category_data.php',\n ],\n 'category_company_type' => [\n 'class' => CategoryCompanyTypeFixture::class,\n 'dataFile' => codecept_data_dir() . 'category_company_type_data.php',\n ],\n 'company_type' => [\n 'class' => CompanyTypeFixture::class,\n 'dataFile' => codecept_data_dir() . 'company_type_data.php',\n ],\n\n ];\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => BookFixture::class,\n 'dataFile' => codecept_data_dir() . 'book.php'\n ],\n ];\n }", "public function _fixtures()\n\t{\n\t\treturn [\n\t\t\t'user' => [\n\t\t\t\t'class' => UserFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'login_data.php'\n\t\t\t],\n\t\t\t'models' => [\n\t\t\t\t'class' => ModelsFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'models.php'\n\t\t\t],\n\t\t\t'files' => [\n\t\t\t\t'class' => FilesFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'files.php'\n\t\t\t]\n\n\t\t];\n\t}", "public function setupFixtures()\n {\n if ($this->_fixtures === null) {\n $loadedFixtures = [];\n foreach ($this->fixtures() as $fixtureClass) {\n $loadedFixtures[$fixtureClass] = Yii::createObject($fixtureClass);\n }\n\n $this->_fixtures = $loadedFixtures;\n }\n }", "public function setUp()\n\t{\n\t\tparent::setUp();\n if(is_array($this->fixtures)){\n foreach($this->fixtures as $fixtureName=>$modelClass)\n {\n $tableName=WF_Table::model($modelClass)->tableName();\n $this->resetTable($tableName);\n $rows=$this->loadFixtures($modelClass, $tableName);\n if(is_array($rows) && is_string($fixtureName))\n {\n $this->_rows[$fixtureName]=$rows;\n if(isset($modelClass))\n {\n foreach(array_keys($rows) as $alias)\n $this->_records[$fixtureName][$alias]=$modelClass;\n }\n }\n }\n }\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => TicketsFixture::className(),\n 'dataFile' => codecept_data_dir() . 'tickets.php'\n ]\n ];\n }", "private function myLoadFixtures()\n {\n $em = $this->getDatabaseManager();\n\n // load fixtures\n $client = static::createClient();\n $classes = array(\n // classes implementing Doctrine\\Common\\DataFixtures\\FixtureInterface\n 'Demofony2\\AppBundle\\DataFixtures\\ORM\\FixturesLoader',\n );\n\n $this->loadFixtures($classes);\n }", "public function fixtures() \n {\n return [\n 'categories' => CategoryFixture::className(),\n ];\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'login_data.php',\n ],\n ];\n }", "protected function getFixtures()\n {\n return array(\n // __DIR__ . '/../../Resources/fixtures/majora_entitys.yml',\n );\n }", "protected function createFixtures()\n {\n // Due to a dubious bug(?) in doctrine - product types need to be loaded first.\n $typeFixtures = new LoadProductTypes();\n $typeFixtures->load($this->entityManager);\n $this->productType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ID);\n $this->addonProductType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ADDON_ID);\n\n $countries = new LoadCountries();\n $countries->load($this->entityManager);\n\n $this->contactTestData = new ContactTestData($this->container);\n\n $loadCurrencies = new LoadCurrencies();\n $loadCurrencies->load($this->entityManager);\n\n $this->currency = $this->getCurrencyRepository()->findByCode($this->defaultCurrencyCode);\n\n $unitFixtures = new LoadUnits();\n $unitFixtures->load($this->entityManager);\n $this->orderUnit = $this->getProductUnitRepository()->find(self::ORDER_UNIT_ID);\n\n $this->contentUnit = $this->getProductUnitRepository()->find(self::CONTENT_UNIT_ID);\n\n $taxClasses = new LoadTaxClasses();\n $taxClasses->load($this->entityManager);\n $this->taxClass = $this->getTaxClassRepository()->find(self::TAX_CLASS_ID);\n\n $countryTaxes = new LoadCountryTaxes();\n $countryTaxes->load($this->entityManager);\n\n $collectionTypes = new LoadCollectionTypes();\n $collectionTypes->load($this->entityManager);\n\n $mediaTypes = new LoadMediaTypes();\n $mediaTypes->load($this->entityManager);\n\n $attributeTypes = new LoadAttributeTypes();\n $attributeTypes->load($this->entityManager);\n $this->attributeType = $this->getAttributeTypeRepository()->find(self::ATTRIBUTE_TYPE_ID);\n\n $statusFixtures = new LoadProductStatuses();\n $statusFixtures->load($this->entityManager);\n $this->productStatus = $this->getProductStatusRepository()->find(Status::ACTIVE);\n $this->productStatusChanged = $this->getProductStatusRepository()->find(Status::CHANGED);\n $this->productStatusImported = $this->getProductStatusRepository()->find(Status::IMPORTED);\n $this->productStatusSubmitted = $this->getProductStatusRepository()->find(Status::SUBMITTED);\n\n $deliveryStatusFixtures = new LoadDeliveryStatuses();\n $deliveryStatusFixtures->load($this->entityManager);\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/card.yml',\n );\n }", "public function run()\n {\n $json = file_get_contents(\"database/dataseed/ViaticoSeed.json\");\n $json_data = json_decode($json,true);\n \tViaticos::truncate();\n\n foreach ($json_data as $viatico) {\n $viatico_ = new App\\Viaticos;\n $viatico_->id_reserva = $viatico['id_reserva'];\n $viatico_->rubro = $viatico['rubro'];\n $viatico_->cantidad = $viatico['cant'];\n $viatico_->val_unit = $viatico['val_unit'];\n $viatico_->save();\n }\n }", "public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }", "function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}", "protected function reloadDataFixtures()\n {\n $em = $this->getEntityManager();\n $loader = new Loader;\n foreach ($this->dataFixturePaths as $path) {\n $loader->loadFromDirectory($path);\n }\n $purger = new ORMPurger($em);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $this->fixturesReloaded = true;\n }", "public function getAllFixtures() { \r\n $uri = $this->payload->_links->fixtures->href;\r\n $response = file_get_contents($uri, false, stream_context_create($this->reqPrefs)); \r\n \r\n return json_decode($response);\r\n }", "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "protected function getFixtures()\n {\n return array(\n __DIR__ . '/../../Resources/fixtures/BlogArticle.yml',\n );\n }", "protected function _loadFixture($fixture)\n {\n $this->db->query(file_get_contents(\n NL_TEST_DIR.\"/tests/migration/fixtures/$fixture.sql\"\n ));\n }", "public function run()\n {\n $faker = Faker\\Factory::create('es_VE');\n $faker->addProvider(new \\Faker\\Provider\\Fakecar($faker));\n\n $clientes = $this->fetchAll('SELECT * FROM clientes');\n $vehiculos = $this->fetchAll('SELECT placa FROM vehiculos');\n $fecha = Carbon::now()->startOfMonth();\n\n $data = [];\n\n for($i=0; $i<200; $i++){\n $cliente_id = $faker->numberBetween($min = 1, $max = 398);\n $vehiculo_id = $faker->numberBetween($min = 1, $max = 200);\n //$fecha_reserva = $faker->dateTime();\n $fecha = Carbon::now()->subMonths(2);\n $fecha_reserva = $fecha->copy()->addDays($faker->numberBetween($min = 1, $max = 14));\n $fecha_regreso = $fecha->copy()->addDays($faker->numberBetween($min = 15, $max = 30));\n\n $data[] = [\n 'identificacion_cliente' => $clientes[$cliente_id]['cedula'],\n 'placa_vehiculo' => $vehiculos[$vehiculo_id]['placa'],\n 'fecha_reserva' => $fecha_reserva->toDateTimeString(),\n 'fecha_regreso' => $fecha_regreso->toDateTimeString(),\n 'seguro_vehiculo_id' => $faker->numberBetween($min = 1, $max = 3)\n ];\n }\n\n $this->insert('clientes_vehiculos', $data);\n \n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "public function testLoadAllFixtures(): void\n {\n $this->loadFixtures();\n $article = $this->getTableLocator()->get('Articles')->get(1);\n $this->assertSame(1, $article->id);\n $category = $this->getTableLocator()->get('Categories')->get(1);\n $this->assertSame(1, $category->id);\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n $faker = Factory::create('en_HK');\n\n for($i = 0 ; $i < 10 ; $i++){\n\n $offre = new Offres();\n $contrat = new Contrats();\n $contrattype = new ContratType();\n\n \n $array = ['CDD', 'CDI', 'FREE'];\n $contrat_array = $faker->randomElements($array);\n\n $array2 = ['plein', 'partiel'];\n $contrattype_array = $faker->randomElements($array2);\n\n\n \n $offre->setTitle($faker->sentence($nbWords = 2, $variableNbWords = true))\n ->setVille($faker->town)\n ->setDescription($faker->sentence($nbWords = 15, $variableNbWords = true))\n ->setAdresse($faker->streetAddress)\n ->setCodePostal($faker->postcode)\n ->setDateCreation($faker->dateTimeBetween($startDate = '-2 months', $endDate = '-15 days'))\n ->setContrat($contrat_array[0])\n ->setContratType($contrattype_array[0]);\n\n\n if ($contrat_array[0] == 'CDI') {\n $contrat->SetCDI(1)\n ->SetCDD(0)\n ->SetFREE(0);\n }\n else if ($contrat_array[0] == 'CDD') {\n $contrat->SetCDI(0)\n ->SetCDD(1)\n ->SetFREE(0);\n $offre->setFinMission($faker->dateTimeBetween($startDate = 'now', $endDate = '+6 months'));\n }\n else if ($contrat_array[0] == 'FREE') {\n $contrat->SetCDI(0)\n ->SetCDD(0)\n ->SetFREE(1);\n $offre->setFinMission($faker->dateTimeBetween($startDate = 'now', $endDate = '+6 months'));\n }\n\n\n if ($contrattype_array[0] == 'plein') {\n $contrattype->setPartiel(0)\n ->setPlein(1);\n }\n else if ($contrattype_array[0] == 'partiel') {\n $contrattype->setPartiel(1)\n ->setPlein(0);\n }\n \n $manager->persist($offre);\n $manager->persist($contrat);\n $manager->persist($contrattype);\n }\n\n $manager->flush();\n }", "public function getFixtures($id){\n $result = null;\n if($id!=null){\n /*\n * Si usamos doctrine:\n * $fixture = $em->getRepository('Demo:Fixtures')->find($id);\n * Busqueda por ID\n */\n $datos = $this->getObject('Fixtures');\n foreach($datos as $dato){\n if($dato->getId()== $id){\n $result = $dato;\n }\n }\n }else{\n /*\n * Si usamos doctrine:\n * $fixtures = $em->getRepository('Demo:Fixtures')->findAll();\n * Devuelves todos los Fixtures\n * */\n $result = $this->getObject('Fixtures');\n }\n return $result;\n }", "public function data()\n {\n return [\n 'name' => $this->faker->text,\n 'cast' => $this->faker->text,\n 'genere' => $this->faker->text,\n 'description' => $this->faker->paragraph,\n 'image' => $this->faker->text,\n ];\n }", "public function run()\n {\n $this->command->info('Data Di hapus');\n\n Admin::truncate();\n Pengguna::truncate();\n Transaksi::truncate();\n DetailTransaksi::truncate();\n Tracking::truncate();\n Kategori::truncate();\n SubKategori::truncate();\n\n $this->command->info('Data Sedang Dibuat');\n\n\n $admin = Admin::create([\n \t'id_admin' => AutoNumber::autoNumberAdmin('admin', 'id_admin', 'A'),\n \t'nama' => 'admin',\n \t'username' => 'admin',\n \t'password' => bcrypt('admin'),\n \t'jabatan' => 'admin',\n \t'img' => ''\n ]);\n\n $faker = Faker::create();\n foreach (range(1, 10) as $key => $value) {\n $this->command->info($key);\n $pengguna = new Pengguna;\n $pengguna->id_user = AutoNumber::autoNumberPengguna('pengguna', 'id_user', 'P');\n\n $transaksi = new Transaksi;\n $transaksi->kode_invoice = AutoNumber::autoNumberTransaksi('transaksi', 'kode_invoice', 'INV');\n $transaksi->id_user = $pengguna->id_user;\n $transaksi->total = 100000;\n $transaksi->status = 0;\n $transaksi->gambar_bukti = 'https://images.pexels.com/photos/9754/mountains-clouds-forest-fog.jpg?w=100&h=100&auto=compress&cs=tinysrgb';\n $transaksi->tanggal = date('Y-m-d');\n\n $detailTransaksi = new DetailTransaksi;\n $detailTransaksi->kode_invoice = $transaksi->kode_invoice;\n $detailTransaksi->nama_produk = 'Produk '. $key;\n $detailTransaksi->gambar_produk = $faker->imageUrl;\n $detailTransaksi->biaya_kirim = '100000';\n $detailTransaksi->subtotal = '100000';\n $detailTransaksi->caption = $faker->sentence;\n\n $subDetailTransaksi = new SubDetailTransaksi;\n $subDetailTransaksi->kode_detail = ++$key;\n $subDetailTransaksi->nama_bahan = 'Bahan '.$key;\n $subDetailTransaksi->jumlah = (1+$key);\n $subDetailTransaksi->subtotal = 50000;\n\n\n $tracking = new Tracking;\n $tracking->kode_invoice = $transaksi->kode_invoice;\n $tracking->pembelian_bahan_baku = 1;\n $tracking->cetak_kemasan = 0;\n $tracking->produksi = 0;\n $tracking->qc = 0;\n $tracking->pengiriman = 0;\n\n $pengguna->nama = $faker->firstName;\n $pengguna->username = $faker->username(2,10);\n $pengguna->email = $faker->email;\n $pengguna->whatsapp = $faker->phoneNumber;\n $pengguna->password = bcrypt('pengguna');\n $pengguna->status = 'Jabatan ' . $key;\n $pengguna->img = $faker->imageUrl;\n\n // kategori\n $kategori = new Kategori;\n $kategori->nama_kategori = 'Kategori '. $key;\n\n // sub kategori\n $subKategori = new SubKategori;\n $subKategori->id_kategori = $key;\n $subKategori->nama_subKategori = 'sub kategori '.$key;\n\n\n $kategori->save();\n $subKategori->save();\n $pengguna->save();\n $tracking->save();\n $detailTransaksi->save();\n $subDetailTransaksi->save();\n $transaksi->save();\n // Pengguna::create([\n // 'id_user' => AutoNumber::autoNumberPengguna('pengguna', 'id_user', 'P'),\n // 'nama' => $faker->name,\n // 'username' => $faker->username,\n // 'email' => $faker->email,\n // 'whatsapp' => $faker->phoneNumber,\n // 'password' => bcrypt($faker->password),\n // 'jabatan' => 'Jabatan ' . $key,\n // 'img' => $faker->imageUrl,\n // ]);\n }\n\n $this->command->info('Data Sudah dibuat');\n\n }", "protected function fixture(){\n $this->clearAll();\n \n $venue_id = $this->createVenue('Pool');\n \n $this->createUser('foo');\n\n\n $seller = $this->createUser('seller');\n \n $evt = $this->createEvent('Barcelona vs Real Madrid', $seller->id, $this->createLocation()->id, date('Y-m-d H:i:s', strtotime('+1 day')));\n $this->setEventId($evt, 'aaa');\n $this->setEventGroupId($evt, '0010');\n $this->setEventVenue($evt, $venue_id);\n $this->setEventOtherTaxes($evt, 'VAT', 17.5, 'barb4d0s');\n $this->catA = $this->createCategory('Category A', $evt->id, 25.00, 100);\n $catB = $this->createCategory('Category B', $evt->id, 10.00);\n $catC = $this->createCategory('Category C', $evt->id, 5.00);\n \n /*\n $loc = $this->createLocation();\n $evt = $this->createEvent('Water March', $this->seller->id, $loc->id, date('Y-m-d H:i:s', strtotime('+1 day')));\n $this->setEventId($evt, 'bbb');\n $this->createCategory('Zamora Branch', $evt->id, 14.00);\n \n $evt = $this->createEvent('Third Event', $this->seller->id, $loc->id, date('Y-m-d H:i:s', strtotime('+1 day')));\n $this->setEventId($evt, 'ccc');\n $this->createCategory('Heaven', $evt->id, 22.50);\n $this->createCategory('Limbo', $evt->id, 22.50);\n \n \n $this->seller = $this->createUser('seller2');\n $loc = $this->createLocation();\n $evt = $this->createEvent('Transformers Con', $this->seller->id, $loc->id, date('Y-m-d H:i:s', strtotime('+1 day')));\n $this->setEventId($evt, 'ttt');\n $this->createCategory('Autobots', $evt->id, 55.00);*/\n }", "public function loadData(ObjectManager $manager)\n {\n // $manager->persist($product);\n $this->createMany(50, \"abonne\", function($num){\n //\"abonne\" s'il est en clé étrangère dans une autre table\n //$num, quel numéro de boucle\n $prenom = $this->faker->firstName;\n $email = $prenom . \".\" . $this->faker->lastName . \"@yopmail.com\";\n return (new Abonne)->setPrenom($prenom)\n ->setEmail($email);\n });\n $manager->flush();\n }", "protected function postFixtureSetup()\n {\n }", "public function run()\n {\n $faker = Faker::create();\n $preUach = PreUach::all();\n $samples_temp = [];\n\n foreach ($preUach as $item)\n {\n\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'persona_matricula'=> $faker->lastName.' '. $faker->firstName,\n 'fecha_matricula'=>$faker->dateTimeBetween($startDate = '-5 months', $endDate = 'now')\n ]; \t\n }\n\n Declaracion::insert($samples_temp);\n \n }", "public function setUp() {\n\t\t$this->getConnection();\n\t\tforeach($this->fixtureData() as $row) {\n\t\t\t$record = new ExampleSolrActiveRecord();\n\t\t\tforeach($row as $attribute => $value) {\n\t\t\t\t$record->{$attribute} = $value;\n\t\t\t}\n\t\t\t$this->assertTrue($record->save());\n\t\t}\n\t}", "public static function loadProductFixtures(): void\n {\n include __DIR__ . '/../../../_files/productFixtures.php';\n }", "protected static function getFixtures()\n {\n return new ArrayCollection([\n new EavTypeFixture(),\n new EavAttributeFixture(),\n ]);\n }", "public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }", "public function setUp()\n {\n $this->loadFixtures([]);\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "public function setUp()\n {\n $this->reloadSchema();\n $this->reloadDataFixtures();\n }", "public function testDynamicFixture()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $fixture->load();\n $record = $fixture->getRecord('unit_test_2');\n \n $this->assertEquals(date(\"Y-m-d\"), $record['date_value']);\n }", "public function run()\n {\n $faker = Faker::create();\n $pregrado = Pregrado::all();\n $semestre = array('semestre_1', 'semestre_2', 'semestre_3','semestre_4','otro'); \n $samples_temp = [];\n\n foreach ($pregrado as $item)\n {\n\n\n $desde = $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now');\n $semestre_temp = $semestre[$faker->numberBetween($min = 0, $max = count($semestre)-1)];\n if($semestre_temp === 'otro'){\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'anio'=> $faker->numberBetween($min = 1990, $max = 2016) ,\n 'semestre'=> $semestre_temp,\n 'desde'=>$desde ,\n 'hasta'=>$faker->dateTimeBetween($startDate = $desde, $endDate = 'now'),\n 'financiamiento'=> $faker->numberBetween($min = 1, $max = 3),\n 'carrera'=> $faker->numberBetween($min = 1, $max = 500)\n ];\n }\n else{\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'anio'=> $faker->numberBetween($min = 1990, $max = 2016) ,\n 'semestre'=> $semestre_temp,\n 'desde'=>'' ,\n 'hasta'=>'',\n 'financiamiento'=> $faker->numberBetween($min = 1, $max = 3),\n 'carrera'=> $faker->numberBetween($min = 1, $max = 500)\n ];\n }\n \n\n \n }\n PrePostulacionUniversidad::insert($samples_temp);\n\n \n }", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "public function readTestData()\n {\n return $this->testData->get();\n }", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public function TemparioData(){\n\t\t$this->id = \"\"; \n\t\t$this->id_tempario = \"\";\n\t\t$this->descripcion = \"\";\n\t\t$this->tiempo = \"\";\n\t\n\t\t\n\t}", "public function getDatas()\n\t{\n\t\t$this->skeleton = $this->data[\"skeleton\"];\n\t\t$this->javascript = $this->data[\"javascript\"];\n\t\t$this->css = $this->data[\"css\"];\n\t\t$this->module = $this->data[\"module\"];\n\t\t$this->site = $this->data[\"site\"];\n\t}", "public static function loadStockFixtures(): void\n {\n include __DIR__ . '/../../../_files/stockFixtures.php';\n }", "public function getOrder()\n {\n return 100; //the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n return 1; //the order in which fixtures will be loaded\n }", "public function setUpFixtures($class_file = NULL) {\n\n $pattern = $this->fixturePath($class_file) . '/*.txt';\n\n foreach (glob($pattern) as $file) {\n $property = basename($file, '.txt');\n $this->{$property} = unserialize(file_get_contents($file));\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $solicitudCurso = PreNuSolicitudCurso::all();\n $asignatura = Asignatura::all(); \n $aceptado = array('si','no');\n $samples_temp = [];\n\n\t\tforeach ($asignatura as $item){\n\n $asigCodigo[] = $item->codigo;\n }\n foreach ($solicitudCurso as $item)\n {\n $num = $faker->numberBetween($min = 1, $max =6);\n \tfor($i = 0; $i < $num; $i ++){\n\n $samples_temp[] = [\n 'solicitud_curso' => $item->id,\n 'asignatura'=> $asigCodigo[$faker->unique->numberBetween($min = 0, $max = count($asigCodigo)-1)],\n 'observaciones'=>$faker->paragraph($nbSentences = 5, $variableNbSentences = true) ,\n 'aceptado'=>$aceptado[$faker->numberBetween($min = 0, $max = 1)]\n ];\n \t\t\n \t}\n \t\n }\n\n\n DetalleSolicitudCurso::insert($samples_temp);\n\n \n }", "public static function loadInventoryFixtures(): void\n {\n include __DIR__ . '/../../../_files/source_items_on_default_source.php';\n }", "abstract protected function loadData(ObjectManager $em);", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "private function getFixtureData($fixtures)\n {\n $teamFixtures = [];\n $now = new DateTime('now');\n foreach ($fixtures as $fixture) {\n $timeUntilKickoff = $now->diff(new DateTime($fixture['kickoff_time']))->format('%dd %hh %im');\n while (substr($timeUntilKickoff, 0, 1) === '0') {\n $timeUntilKickoff = substr($timeUntilKickoff, 3);\n }\n $fixtureData = [\n 'finished' => $fixture['finished_provisional'],\n 'started' => $fixture['started'],\n 'minutes' => $fixture['minutes'],\n 'time_until_kickoff' => $timeUntilKickoff\n ];\n\n $teamFixtures[$fixture['team_h']][] = $fixtureData;\n $teamFixtures[$fixture['team_a']][] = $fixtureData;\n }\n\n return $teamFixtures;\n }", "public function setUp()\n {\n $this->fixtures('articles');\n }", "protected function postFixtureRestore()\n {\n }", "public function testLoadDulicateFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Found duplicate fixture `core.Articles`');\n (new FixtureHelper())->loadFixtures(['core.Articles','core.Articles']);\n }", "public function loadFixtures($path) : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $em->getConnection()->exec('SET foreign_key_checks = 0');\n $loader = new Loader();\n $loader->loadFromDirectory($path);\n $purger = new ORMPurger($em);\n $purger->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $em->getConnection()->exec('SET foreign_key_checks = 1');\n }", "public function testFixturesSetup() {\n $this->assertCount(3, $this->databaseDumpFiles);\n }", "public function testLoad()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $this->assertEquals('0', $this->_countRecords());\n\n $fixture->load();\n $this->assertEquals('6', $this->_countRecords());\n }", "public function run()\n {\n // $data = [\n // [\n // 'nama' => 'Andi',\n // 'alamat' => 'JL. ABC No. 40',\n // 'created_at' => Time::now(),\n // 'updated_at' => Time::now()\n // ],\n // [\n // 'nama' => 'Lumine',\n // 'alamat' => 'JL. ABC No. 44',\n // 'created_at' => Time::now(),\n // 'updated_at' => Time::now()\n // ],\n // [\n // 'nama' => 'Diona',\n // 'alamat' => 'JL. ABC No. 50',\n // 'created_at' => Time::now(),\n // 'updated_at' => Time::now()\n // ]\n \n\n // ];\n $faker = \\Faker\\Factory::create('id_ID'); //parameter negara indonesia, agar datanya orang indo\n for($i=0; $i<100; $i++) { // ulang 100x\n\n $data = [\n 'nama' => $faker->name,\n 'alamat' => $faker->Address,\n 'created_at' => Time::createFromTimestamp($faker->unixTime()),//memformat datetime dari faker ke string agar gk eror\n 'updated_at' => Time::now()\n ];\n \n // Simple Queries\n // $this->db->query(\"INSERT INTO orang (nama, alamat, created_at, updated_at) VALUES(:nama:, :alamat:, :created_at:, :updated_at:)\", $data); // VALUES haru sama dgn key $data\n \n // Using Query Builder\n $this->db->table('orang')->insert($data); // digunakan jika hanya memasukkan satu data (jika looping pakai ini, jgn batch)\n // $this->db->table('orang')->insertBacth($data); // gunakan insertBatch untuk banyak data\n }\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n Produto::truncate();\n foreach(range(1,10) as $key =>$number) {\n $produto = Produto::create([\n \"pizzaria_id\" => random_int(1, 3),\n \"categoria_id\" => random_int(1, 6),\n \"nome\" => \"Produto {$key}\" ,\n \"imagem\" => \"\",\n \"descricao\" => $faker->text(),\n \"preco\" => random_int(1500, 50000)/10,\n \"quantidade\" => random_int(10, 100),\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 1000; $i++) {\n App\\TestData::create([\n 'username' => $faker->userName,\n 'name' => $faker->name,\n \n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $samples_temp = [];\n\n for($i = 0; $i < 100; $i++)\n {\n $samples_temp[] = [\n 'nombre' => $faker->name,\n 'email'=> $faker->email\n\n ];\n }\n Correo::insert($samples_temp);\n\n\n }", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function run()\n {\n $json = File::get(\"database/data/fuentes.json\");\n $data = json_decode($json);\n foreach ($data as $obj) {\n Fuente::create(array(\n 'nombre' => $obj->name,\n 'id_interno' => $obj->internal_id,\n 'id_externo' => $obj->external_id,\n 'contacto_fuente' => null,\n 'correo_fuente' => null,\n 'telefono1_fuente' => null,\n 'telefono2_fuente' => null,\n ));\n }\n }", "public function testGetFixture()\n {\n $this->assertNull(SeederTask::getFixtureFile());\n }", "public function run()\n {\n $faker = Faker::create();\n\n for ($i = 0; $i < 100; $i++) { \n \n $data = array(\n [\n 'id' => $i+1,\n 'nombre_empresa' => $faker->unique()->company(),\n 'descripcion' => $faker->paragraph($nbSentences = 3),\n 'horario' => $faker->paragraph($nbSentences = 1),\n 'telefono_1' => 987675+$i,\n 'telefono_2' => 987674+$i,\n 'correo' => $faker->unique()->email(),\n 'lat' => -12.0552172+(0.0000010+$faker->seed(1234)),\n 'lng' => -77.0802424+(0.0000010+$faker->seed(1234)),\n 'foto' => '//localhost:3000/assets/app/images/img.jpeg',\n 'direccion' => $faker->unique()->address(), \n 'extract' => $faker->paragraph($nbSentences = 1), \n 'id_services' => 1,\n 'created_at'=> new DateTime,\n 'updated_at'=> new DateTime \n ]\n );\n Locations::insert($data);\n }\n\n }", "public function run()\n {\n DB::table('adm_punicao')->truncate();\n\n $faker = Faker::create();\n\n foreach (range(1, 50) as $i) {\n Punicao::create([\n 'email_usuario' => $faker->name(),\n 'email_administrador' => $faker->email(),\n 'tipo' => $faker->word(),\n 'data_inicial' => $faker->date(),\n 'data_final' => $faker->date(),\n 'descricao' => $faker->sentence()\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n foreach (range(1, 500) as $index) {\n DB::table('daftar_pesertas')->insert([\n 'nis' => $faker->nis,\n 'nama' => $faker->nama,\n 'jenis_kelamin' => $faker->jenis_kelamin,\n 'tempat_lahir' => $faker->tempat_lahir,\n 'tanggal_lahir' => $faker->tanggal_lahir,\n 'alamat' => $faker->alamar,\n 'asal_sekolah' => $faker->asal_sekolah,\n 'kelas' => $faker->kelas,\n 'jurusan' => $faker->jurusan,\n ]);\n }\n }", "public function run(Faker $faker) {\n\n //Comunidad 1\n $fecha1 = new DateTime();\n $fecha2 = new DateTime();\n\n //Facturas Anuales\n DB::table('cont_gastos')->insert([\n ['id_comunidad' => 1,\n 'id_proveedor' => 2,\n 'concepto' => 'Seguro Resp. Civil',\n 'tipo_pago' => 'fijo',\n 'importe' => 300,\n 'fecha_factura' => $fecha1->setDate(2020, 3, 9),\n 'fecha_pago' => $fecha2->setDate(2020, 3, 11),\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')],\n ['id_comunidad' => 1,\n 'id_proveedor' => 4,\n 'concepto' => 'Reforma Fachada',\n 'tipo_pago' => 'variable',\n 'importe' => 2500,\n 'fecha_factura' => $fecha1->setDate(2020, 6, 28),\n 'fecha_pago' => null,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')]\n ]);\n\n $this->pagos_fijo(1, 7, 'Electricidad', 50, 70);\n $this->pagos_fijo(1, 3, 'Limpieza', 50, 70);\n $this->pagos_fijo(1, 6, 'Agua', 30, 50, 2);\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "private function loadGenerated(ObjectManager $em)\n {\n for ($i = 100; $i <= 130; $i++) {\n $fixture = new AlumniExperiences();\n\n $ref_aid = $this->getReference('alumni-anon-'.$i);\n\n $fixture\n ->setAlumni($em->merge($ref_aid))\n ->setOrganization('PT. '.$i)\n ->setDescription('Pekerjaan '.$i);\n\n $em->persist($fixture);\n }\n\n $em->flush();\n }", "private function getFixturesFromRegistry() : array\n {\n $fixtureRegistry = $this->getObjectManager()->create(FixtureRegistry::class);\n $fixtures = [];\n foreach ($fixtureRegistry->getFixtures() as $fixtureClassName) {\n $fixtures[] = $this->getObjectManager()->create(\n $fixtureClassName,\n ['fixtureModel' => $this]\n );\n }\n return $fixtures;\n }", "public function load(ObjectManager $manager)\n {\n // Fixtures are split into separate files\n }", "public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }", "protected function getDataSet()\n\t{\n\t\treturn $this->createXMLDataSet(dirname(__FILE__).'/_fixtures/DirectDeposit.fixture.xml');\n\t}", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "public function run()\n { \n $faker = \\Faker\\Factory::create();\n /*id = 1 */\n $Respel = new Respel();\n $Respel->RespelName = 'Trapos contaminados con hidrocarburos';\n $Respel->RespelDescrip = 'trapos contaminados con gasolina';\n $Respel->YRespelClasf4741 = 'Y10';\n $Respel->RespelIgrosidad = 'Inflamable';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '2';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '1';\n $Respel->SustanciaControladaTipo = '1';\n $Respel->SustanciaControladaNombre = 'Aceite combustible para motor- ACPM';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 2 */\n $Respel = new Respel();\n $Respel->RespelName = 'Gasolina ';\n $Respel->RespelDescrip = 'gasolina mezclada con otros componentes liquidos';\n $Respel->YRespelClasf4741 = 'Y14';\n $Respel->RespelIgrosidad = 'Toxico';\n $Respel->RespelEstado = 'Liquido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Revisado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '2';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = '';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 3 */\n $Respel = new Respel();\n $Respel->RespelName = 'residuos hospitalarios';\n $Respel->RespelDescrip = 'residuos de procesos medico-quirurgicos';\n $Respel->ARespelClasf4741 = 'A1010';\n $Respel->RespelIgrosidad = 'Patógeno - Infeccioso';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Pendiente';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '3';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 4 */\n $Respel = new Respel();\n $Respel->RespelName = 'canecas contaminadas con acido';\n $Respel->RespelDescrip = 'canecas y otros contaminadas con acido sulfurico';\n $Respel->YRespelClasf4741 = 'Y34';\n $Respel->RespelIgrosidad = 'Corrosivo';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '3';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '1';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaNombre = 'Ácido sulfúrico';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 5 */\n $Respel = new Respel();\n $Respel->RespelName = 'desperdicio de carnes procesadas';\n $Respel->RespelDescrip = 'productos carnicos en descomposicion resultante de la produccion de embutidos';\n $Respel->ARespelClasf4741 = 'A1010';\n $Respel->RespelIgrosidad = 'Toxico';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Revisado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '4';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 6 */\n $Respel = new Respel();\n $Respel->RespelName = 'desechos radiactivos';\n $Respel->RespelDescrip = 'desechos de la producción de energía usando isotopos radiactivos';\n $Respel->YRespelClasf4741 = 'Y14';\n $Respel->RespelIgrosidad = 'Radiactivo';\n $Respel->RespelEstado = 'Mezcla';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Incompleto';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '4';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 7 */\n $Respel = new Respel();\n $Respel->RespelName = 'Trapos sucios de acpm';\n $Respel->RespelDescrip = 'trapos y estopas contaminadas con ACPM';\n $Respel->YRespelClasf4741 = 'Y10';\n $Respel->RespelIgrosidad = 'Inflamable';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '5';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '1';\n $Respel->SustanciaControladaTipo = '1';\n $Respel->SustanciaControladaNombre = 'Aceite combustible para motor- ACPM';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 8 */\n $Respel = new Respel();\n $Respel->RespelName = 'medicamentos vencidos';\n $Respel->RespelDescrip = 'medicamentos varios vencidos';\n $Respel->YRespelClasf4741 = 'Y14';\n $Respel->RespelIgrosidad = 'Toxico';\n $Respel->RespelEstado = 'Liquido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Revisado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '5';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 9 */\n $Respel = new Respel();\n $Respel->RespelName = 'Aparatos de Tecnología';\n $Respel->RespelDescrip = 'residuos de procesos tecnológicos';\n $Respel->ARespelClasf4741 = '';\n $Respel->RespelIgrosidad = 'No peligroso';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Pendiente';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '6';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 10 */\n $Respel = new Respel();\n $Respel->RespelName = 'Cascos y botas usados';\n $Respel->RespelDescrip = 'N\\A';\n $Respel->RespelIgrosidad = 'No peligroso';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '6';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '1';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaNombre = 'Ácido sulfúrico';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 11 */\n $Respel = new Respel();\n $Respel->RespelName = 'embases con gases';\n $Respel->RespelDescrip = 'embases con gases producidos en proceso industrial';\n $Respel->ARespelClasf4741 = 'A1010';\n $Respel->RespelIgrosidad = 'Reactivo';\n $Respel->RespelEstado = 'Gaseoso';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Revisado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '7';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 12 */\n $Respel = new Respel();\n $Respel->RespelName = 'desechos radiactivos';\n $Respel->RespelDescrip = 'desechos de la producción de energía usando isotopos radiactivos';\n $Respel->YRespelClasf4741 = 'Y14';\n $Respel->RespelIgrosidad = 'Radiactivo';\n $Respel->RespelEstado = 'Mezcla';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Incompleto';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '7';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 13 */\n $Respel = new Respel();\n $Respel->RespelName = 'dotaciones y botas usados';\n $Respel->RespelDescrip = 'N\\A';\n $Respel->RespelIgrosidad = 'No peligroso';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '1';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '1';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaNombre = 'Ácido sulfúrico';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelPublic = '1';\n $Respel->FK_SubCategoryRP = 1;\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n \n /*id = 14 */\n $Respel = new Respel();\n $Respel->RespelName = 'EPPs';\n $Respel->RespelDescrip = 'elementos de proteccion usados';\n $Respel->YRespelClasf4741 = 'Y14';\n $Respel->RespelIgrosidad = 'Patógeno - Infeccioso';\n $Respel->RespelEstado = 'Mezcla';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Pendiente';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '1';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelPublic = '1';\n $Respel->FK_SubCategoryRP = 1;\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n\n /*id = 15 */\n $Respel = new Respel();\n $Respel->RespelName = 'residuos hospitalarios';\n $Respel->RespelDescrip = 'residuos de procesos medico-quirurgicos';\n $Respel->ARespelClasf4741 = 'A1010';\n $Respel->RespelIgrosidad = 'Patógeno - Infeccioso';\n $Respel->RespelEstado = 'Solido';\n $Respel->RespelHojaSeguridad = 'RespelHojaDefault.pdf';\n $Respel->RespelTarj = 'RespelTarjetaDefault.pdf';\n $Respel->RespelStatus = 'Aprobado';\n $Respel->RespelSlug = hash('sha256', time().rand().$Respel->RespelName);\n $Respel->RespelDelete = '0';\n $Respel->FK_RespelCoti = '3';\n $Respel->RespelFoto= 'RespelFotoDefault.png';\n $Respel->SustanciaControlada = '0';\n $Respel->SustanciaControladaTipo = '0';\n $Respel->SustanciaControladaDocumento = 'SustanciaControlDocDefault.pdf';\n $Respel->RespelDeclaracion = '1';\n $Respel->RespelPublic = '1';\n $Respel->FK_SubCategoryRP = 1;\n $Respel->RespelStatusDescription = 'Residuo cargado automaticamente en la base de datos de SisPRO';\n $Respel->save();\n }", "private function _loadDataToTemporaryTable(){\n\n }", "public function run()\n {\n ini_set('memory_limit', '-1');\n\n // Inisialisasi Faker\n $faker = Faker::create();\n\n // Membuat data dan disimpan ke dalam array\n for ($i = 1; $i <= 1000; $i++) {\n $diskonData[] = [\n 'id_diskon' => $i,\n 'diskon' => $faker->text(10),\n 'kuota' => $faker->numberBetween(0,100),\n 'potongan' => $faker->randomFloat(2,0,1),\n 'masa_berlaku' => $faker->dateTimeBetween('+2 days','+21 days'),\n ];\n echo 'Creating data: ' . $i . PHP_EOL;\n }\n\n // Membagi array menjadi chunk dengan ukuran 10.000/chunk\n $chunks = array_chunk($diskonData, 10000);\n\n // Melakukan insert data ke database per chunk\n foreach ($chunks as $chunk) {\n DB::table('diskon')->insertOrIgnore($chunk); // agar kalau violated integrity bisa skip ke row berikutnya\n echo 'Inserting data...' . PHP_EOL;\n }\n }", "public function TraspasoData(){\r\n\t\t$this->idorigen = \"\";\r\n\t\t$this->iddestino = \"\";\r\n\t\t$this->idusuario = \"\";\r\n\t\t$this->fecha = \"NOW()\";\r\n\r\n\t\t#Realizar el traspaso de cada producto\r\n\t\t$this->idtraspaso = \"\";\r\n\t\t$this->idproducto = \"\";\r\n\t\t$this->cantidad = \"\";\r\n\t}", "public function run()\n {\n $faker = Faker\\Factory::create();\n $limit = 100;\n $foreignPo = DB::table('users AS u')\n ->where('role', 'Project Owner')\n ->get();\n \n $minHarga = $faker->numberBetween(3, 7);\n for ($i=0; $i < $limit; $i++) { \n DB::table('projects')->insert([\n 'id_po' => $foreignPo[$faker->numberBetween(0, sizeof($foreignPo)-1)]->id,\n 'nama' => $faker->sentence($nbWords = 3, $variableNbWords = true),\n 'min_harga' => strval($minHarga) . '000000',\n 'max_harga' => strval($minHarga+$faker->numberBetween(1, 3)) . '000000',\n 'duration' => $faker->numberBetween(3, 7),\n 'desain' => $faker->numberBetween(0, 1),\n 'deskripsi' => $faker->paragraph($nbWords = 4, $variableNbWords = true)\n ]);\n }\n }", "protected function setUp()\n {\n $this->fixture = new Parameter();\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n for ($i = 1; $i <= 20; $i++) {\n DB::table('uangmasuk')->insert(\n [\n\n 'nis' => $faker->nis,\n 'nama_santri' => $faker->nama_santri,\n 'tgl_masuk' => $faker->tgl_masuk,\n 'kelas' => $faker->kelas,\n 'no_hp' => $faker->no_hp,\n 'spp' => $faker->spp,\n 'ekstra' => $faker->ekstra,\n 'buku' => $faker->buku,\n 'psb' => $faker->psb,\n 'tasyakuran' => $faker->tasyakuran,\n 'sumbangan_buku' => $faker->sumbangan_buku,\n 'ujian_1' => $faker->ujian_1,\n 'ujian_2' => $faker->ujian_2,\n 'un' => $faker->un,\n 'tunggakan' => $faker->tunggakan,\n 'total' => $faker->spp + $faker->ekstra + $faker->buku + $faker->psb + $faker->tasyakuran + $faker->sumbangan_buku + $faker->ujian_1 + $faker->ujian_2 + $faker->un + $faker->tunggakan\n\n ]\n );\n }\n }", "abstract public function prepareData();", "public function run()\n {\n $faker = Faker\\Factory::create('es_ES');\n\n for ($i=0;$i<50;$i++){\n $objeto = new \\App\\Objeto();\n $objeto->nombre = $faker->domainWord;\n $objeto->cantidad = $faker->numberBetween(0,100000);\n $objeto->save();\n }\n\n }", "public function run()\n {\n factory(DetalleOrden::class)->create([\n 'orden_id' => 1,\n 'producto_id' => 1,\n 'nombre' => 'Balón de Fútbol GOLTY',\n 'descripcion' => 'Balón de fútbol profesional N° 15',\n 'categoria' => 'Fútbol',\n 'precio' => 30000,\n 'cantidad' => 2,\n 'total_linea' => 60000\n ]);\n\n factory(DetalleOrden::class)->create([\n 'orden_id' => 1,\n 'producto_id' => 2,\n 'nombre' => 'Xbox One Slim',\n 'descripcion' => 'Consola de videojuegos Xbox One Slim 320GB',\n 'categoria' => 'Juegos Electrónicos',\n 'precio' => 1200000,\n 'cantidad' => 1,\n 'total_linea' => 1200000\n ]);\n\n factory(DetalleOrden::class)->create([\n 'orden_id' => 2,\n 'producto_id' => 3,\n 'nombre' => 'Zapatillas Nike Stretch',\n 'descripcion' => 'Zapatillas para ejercicio con tecnología Stretch',\n 'categoria' => 'Ejercicio',\n 'precio' => 150000,\n 'cantidad' => 1,\n 'total_linea' => 150000\n ]);\n\n factory(DetalleOrden::class)->create([\n 'orden_id' => 2,\n 'producto_id' => 1,\n 'nombre' => 'Balón de Fútbol GOLTY',\n 'descripcion' => 'Balón de fútbol profesional N° 15',\n 'categoria' => 'Fútbol',\n 'precio' => 30000,\n 'cantidad' => 1,\n 'total_linea' => 30000\n ]);\n\n factory(DetalleOrden::class)->create([\n 'orden_id' => 3,\n 'producto_id' => 2,\n 'nombre' => 'Xbox One Slim',\n 'descripcion' => 'Consola de videojuegos Xbox One Slim 320GB',\n 'categoria' => 'Juegos Electrónicos',\n 'precio' => 1200000,\n 'cantidad' => 2,\n 'total_linea' => 2400000\n ]);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n Log::info(\"Ejecuto seeder de tipos de listas\");\n $tiposListas = [\n [\n \"nombre\" => \"tipo_identificacion\",\n \"tipo_lista_id\" => \"TI\"\n ],\n [\n \"nombre\" => \"tipo_tercero\",\n \"tipo_lista_id\" => \"TT\"\n ],\n [\n \"nombre\" => \"departamento\",\n \"tipo_lista_id\" => \"DEP\"\n ],\n [\n \"nombre\" => \"ciudad\",\n \"tipo_lista_id\" => \"CI\"\n ],\n [\n \"nombre\" => \"tipo_contribuyente\",\n \"tipo_lista_id\" => \"TC\"\n ],\n ];\n\n TiposListas::insert($tiposListas);\n }", "public function load(ObjectManager $manager)\n {\n // Instance de la classe Faker avec un paramètre pour obtenir les données dans la langue souhaitée ->\n $faker = \\Faker\\Factory::create('fr_FR');\n\n // Création d'un tableau regroupant tous les faux utilisateurs ->\n $users = [];\n\n /*-------------------------------\n | CREATION D'UTILISATEURS |\n -------------------------------*/\n\n for ($m = 0; $m <= 10; $m++) {\n $user = new User();\n $user->setEmail($faker->email())\n ->setUsername($faker->name())\n ->setPassword($this->encoder->encodePassword($user, 'password'));\n\n $manager->persist($user);\n\n // Envoi de l'utilisateur vers le tableau ->\n $users[] = $user;\n } // EO for\n\n /*-------------------------------------------------------------------\n | CREATION DE CATEGORIES, D'ARTICLES, DE COMMENTAIRES ET DE LIKES |\n -------------------------------------------------------------------*/\n\n // Création de 3 fakes catégories ->\n for ($i = 1; $i <= 3; $i++) {\n $category = new Category();\n $category->setTitle($faker->sentence())\n ->setDescription($faker->paragraph());\n\n // Pour préparer la persistance des données ->\n $manager->persist($category);\n\n // Création de fakes articles à l'intérieur de ces catégories (entre 4 et 6) ->\n for ($j = 1; $j <= mt_rand(4, 6); $j++) {\n $article = new Article();\n $article->setTitle($faker->sentence())\n ->setContent($faker->paragraphs(5, true))\n ->setImage($faker->imageUrl(640, 480, 'Article illustration'))\n ->setCreatedAt($faker->dateTimeBetween('-6 months'))\n ->setCategory($category);\n\n $manager->persist($article);\n\n // Création de fakes commentaires pour ces articles (entre 4 et 10) ->\n for ($k = 1; $k <= mt_rand(4, 10); $k++) {\n $comment = new Comment();\n\n // Pour le createdAt du commentaire (forcément compris entre la date de création de l'article et aujourd'hui) ->\n $days = (new \\DateTime())->diff($article->getCreatedAt())->days;\n\n $comment->setAuthor($faker->name())\n ->setContent($faker->paragraphs(2, true))\n ->setCreatedAt($faker->dateTimeBetween('-' . $days . ' days'))\n ->setArticle($article);\n\n $manager->persist($comment);\n } // EO for\n\n // Création de fakes likes pour ces articles (entre 0 et 10) ->\n for ($l = 1; $l <= mt_rand(0, 10); $l++) {\n $like = new ArticleLike();\n $like->setArticle($article)\n ->setUser($faker->randomElement($users));\n\n $manager->persist($like);\n } // EO for\n\n } // EO for\n\n } // EO for\n\n /*-----------------------------\n | ENVOI DES FAUSSES DONNÉES |\n -----------------------------*/\n\n $manager->flush();\n\n }", "public function addFixtureEntity($entity): ?Fixture\n {\n $className = (new ReflectionClass($entity))->getShortName();\n $links = [];\n $config = self::CONFIG_WITH_PROPERTIES;\n\n $propertyAccessor = PropertyAccess::createPropertyAccessor();\n if (!$this->configEntities || array_key_exists($className, $this->configEntities) && sizeof($this->configEntities[$className]) === 0){\n // There is no config at all or there is one for this entity but it's empty\n $config = self::CONFIG_WITHOUT_PROPERTIES;\n $properties = (new ReflectionClass($entity))->getMethods(ReflectionMethod::IS_PUBLIC);\n } else if (!array_key_exists($className, $this->configEntities)) {\n // There is configEntities, and there is entities inside, but not this one, so we ignore it\n return null;\n } else {\n // We found a non empty configuration for this entity\n $properties = $this->configEntities[$className];\n }\n $fixtureData = [];\n foreach ($properties as $property) {\n try {\n if ($config === self::CONFIG_WITH_PROPERTIES) {\n $value = $propertyAccessor->getValue($entity, $property);\n } else {\n /* @var ReflectionMethod property*/\n if (strpos($property->name, 'get') !== 0 || $property->getNumberOfParameters()) {\n // We only took method that begin with 'get'\n continue;\n }\n $value = $entity->{$property->name}();\n $property = substr($property->name, 3, strlen($property->name) - 3);\n }\n if (is_scalar($value)) {\n // For a scalar value (int, string, bool), we just display it\n $fixtureData[$property] = $value;\n } else if (is_array($value)) {\n // For an array we just count the total\n $fixtureData[$property] = count($value);\n } else {\n // We are in an object context\n if (method_exists($value, '__toString')) {\n $fixtureData[$property] = $value->__toString();\n $propertyClassName = (new ReflectionClass($value))->getShortName();\n // Means that the object is one of the wanted class to be documented\n if (!$this->configEntities || array_key_exists($propertyClassName, $this->configEntities)) {\n $links[$property] = $propertyClassName . '-' . spl_object_id($value);\n }\n }\n }\n } catch (NoSuchPropertyException $exception) {\n // ignore this exception silently\n }\n }\n\n $fixture = $this->addFixture($className, $fixtureData, $className . '-' . spl_object_id($entity));\n if ($fixture && $links) {\n $fixture->setLinks($links);\n }\n\n return $fixture;\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "abstract public function getTestData(): array;", "protected function getPersistableDataArray() {}", "protected function getPersistableDataArray() {}" ]
[ "0.6727857", "0.65641034", "0.6500638", "0.6494129", "0.6448945", "0.6426078", "0.64013106", "0.63992083", "0.6395548", "0.63699156", "0.6353612", "0.63302237", "0.6321606", "0.63190424", "0.62917185", "0.6244777", "0.6202065", "0.61929417", "0.6192723", "0.60907376", "0.6072268", "0.60347575", "0.60175353", "0.6009354", "0.600835", "0.5994481", "0.5970778", "0.5966326", "0.5928039", "0.5911115", "0.5877538", "0.5857114", "0.58435893", "0.582831", "0.5770115", "0.57531", "0.5745703", "0.5739817", "0.5734965", "0.57251084", "0.5724199", "0.57223785", "0.5720152", "0.56990814", "0.5683932", "0.56597716", "0.56525946", "0.56432074", "0.56363386", "0.56345", "0.5630182", "0.5594127", "0.55758375", "0.55708766", "0.55655086", "0.55465466", "0.5540706", "0.5526286", "0.55153424", "0.5509105", "0.5506482", "0.54902554", "0.5485087", "0.5451781", "0.5444889", "0.5443853", "0.5431998", "0.5428808", "0.5428436", "0.54255575", "0.5422582", "0.5416573", "0.5407133", "0.5403432", "0.5400938", "0.5400932", "0.54005986", "0.5399426", "0.5390675", "0.53904366", "0.53873163", "0.5382908", "0.5382362", "0.5380989", "0.5372904", "0.5371973", "0.5370227", "0.53674906", "0.5367357", "0.53656906", "0.5364701", "0.5364465", "0.5360109", "0.53562313", "0.535261", "0.53494257", "0.53481984", "0.5346517", "0.534221", "0.5338142", "0.5338142" ]
0.0
-1
Merge the changes between two lines together and mark these changes.
private function mergeChanges( array $baseLines, array $changedLines, array $deleteColors = [null, null], array $insertColors = [null, null] ): array { $padding = str_repeat( ' ', max($this->maxLineMarkerWidth - strlen($this->options['equalityMarkers'][1]), 0) ); foreach ($baseLines as $lineKey => $line) { $iterator = 0; $baselineParts = preg_split('/\x00(.*?)\x01/', $line, -1, PREG_SPLIT_DELIM_CAPTURE); $changedLineParts = preg_split('/\x00(.*?)\x01/', $changedLines[$lineKey], -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($baselineParts as $partKey => &$part) { if ($iterator++ % 2) { // This part of the line has been changed. Surround it with user defined markers. $basePart = $this->options['deleteMarkers'][0] . $part . $this->options['deleteMarkers'][1]; $changedPart = ''; if (isset($changedLineParts[$partKey])) { $changedPart = $this->options['insertMarkers'][0] . $changedLineParts[$partKey] . $this->options['insertMarkers'][1]; } if ($this->options['cliColor']) { $colorize = new CliColors(); $basePart = $colorize->getColoredString($basePart, ...$deleteColors); if (!empty($changedPart)) { $changedPart = $colorize->getColoredString($changedPart, ...$insertColors); } } $part = $basePart . $changedPart; } } unset($part); $baseLines[$lineKey] = $this->options['equalityMarkers'][1] . $padding . '|' . implode('', $baselineParts); } return $baseLines; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function swapLines($line1, $line2) {\r\n\t\tif ($this->exists && $line1 !== null && $line2 !== null) {\r\n\t\t\t$lineData = $this->readByLine ();\r\n\t\t\t\r\n\t\t\t$inodes = new iArrayList ();\r\n\t\t\tfor($y = 0; $y < sizeof ( $lineData ); $y ++) {\r\n\t\t\t\t$inodes->add_iNode ( new iNode ( $lineData [$y], null, null, null ) );\r\n\t\t\t}\r\n\t\t\t$data1 = $inodes->getNode ( $line1 )->Data1;\r\n\t\t\t$data2 = $inodes->getNode ( $line2 )->Data1;\r\n\t\t\t$inodes->getNode ( $line1 )->Data1 = $data2;\r\n\t\t\t$inodes->getNode ( $line2 )->Data1 = $data1;\r\n\t\t\t$this->clearFile ();\r\n\t\t\tfor($y = 0; $y < $inodes->count; $y ++) {\r\n\t\t\t\t$this->writeToFile ( $inodes->getNode ( $y )->Data1 );\r\n\t\t\t}\r\n\t\t\t$inodes->__destruct ();\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function isLineChanged($v1, $v2) {\r\n $belongTo = new BelongTo();\r\n $lineV1 = $belongTo->getLines($v1);\r\n $lineV2 = $belongTo->getLines($v2);\r\n foreach ($lineV1 as $line1) {\r\n foreach ($lineV2 as $line2) {\r\n if ($line1 == $line2) return false;\r\n }\r\n }\r\n return true;\r\n }", "function Diff($from_lines, $to_lines) {\r\n $eng = new _DiffEngine;\r\n $this->edits = $eng->diff($from_lines, $to_lines);\r\n //$this->_check($from_lines, $to_lines);\r\n }", "function diff($from_lines, $to_lines)\n {\n }", "private function getLineBasedUnifiedDiff( $fromTextLines, $toTextLines ) {\n\t\t$formatter = new LineBasedUnifiedDiffFormatter();\n\t\t$formatter->insClass = ' class=\"mw-twocolconflict-diffchange\"';\n\t\t$formatter->delClass = ' class=\"mw-twocolconflict-diffchange\"';\n\n\t\treturn $formatter->format(\n\t\t\tnew Diff( $fromTextLines, $toTextLines )\n\t\t);\n\t}", "function addLines2Caddie($lines){\n $caddie = $this->getCaddie();\n $caddie['lines'] = array_merge($caddie['lines'], $lines);\n $this->consolidateCaddie($caddie);\n }", "protected function isLinesMergeable(string $oldLine, string $newLine, string $cleanLine): bool\n {\n $oldLine = str_replace(RendererConstant::HTML_CLOSURES_DEL, '', $oldLine);\n $newLine = str_replace(RendererConstant::HTML_CLOSURES_INS, '', $newLine);\n\n $sumLength = \\strlen($oldLine) + \\strlen($newLine);\n\n /** @var float the changed ratio, 0 <= value < 1 */\n $changedRatio = ($sumLength - (\\strlen($cleanLine) << 1)) / ($sumLength + 1);\n\n return $changedRatio <= $this->options['mergeThreshold'];\n }", "function MappedDiff($from_lines, $to_lines,\r\n $mapped_from_lines, $mapped_to_lines) {\r\n\r\n assert(sizeof($from_lines) == sizeof($mapped_from_lines));\r\n assert(sizeof($to_lines) == sizeof($mapped_to_lines));\r\n\r\n $this->Diff($mapped_from_lines, $mapped_to_lines);\r\n\r\n $xi = $yi = 0;\r\n // Optimizing loop invariants:\r\n // http://phplens.com/lens/php-book/optimizing-debugging-php.php\r\n for ($i = 0, $max = sizeof($this->edits); $i < $max; $i++) {\r\n $orig = &$this->edits[$i]->orig;\r\n if (is_array($orig)) {\r\n $orig = array_slice($from_lines, $xi, sizeof($orig));\r\n $xi += sizeof($orig);\r\n }\r\n\r\n $final = &$this->edits[$i]->final;\r\n if (is_array($final)) {\r\n $final = array_slice($to_lines, $yi, sizeof($final));\r\n $yi += sizeof($final);\r\n }\r\n }\r\n }", "function _shiftBoundaries($lines, &$changed, $other_changed)\n {\n }", "function _shift_boundaries ($lines, &$changed, $other_changed) {\r\n\t$i = 0;\r\n\t$j = 0;\r\n\r\n\tUSE_ASSERTS && assert('sizeof($lines) == sizeof($changed)');\r\n\t$len = sizeof($lines);\r\n\t$other_len = sizeof($other_changed);\r\n\r\n\twhile (1) {\r\n\t /*\r\n\t * Scan forwards to find beginning of another run of changes.\r\n\t * Also keep track of the corresponding point in the other file.\r\n\t *\r\n\t * Throughout this code, $i and $j are adjusted together so that\r\n\t * the first $i elements of $changed and the first $j elements\r\n\t * of $other_changed both contain the same number of zeros\r\n\t * (unchanged lines).\r\n\t * Furthermore, $j is always kept so that $j == $other_len or\r\n\t * $other_changed[$j] == false.\r\n\t */\r\n\t while ($j < $other_len && $other_changed[$j])\r\n\t\t$j++;\r\n\t\r\n\t while ($i < $len && ! $changed[$i]) {\r\n\t\tUSE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');\r\n\t\t$i++; $j++;\r\n\t\twhile ($j < $other_len && $other_changed[$j])\r\n\t\t $j++;\r\n }\r\n\r\n\t if ($i == $len)\r\n\t\tbreak;\r\n\r\n\t $start = $i;\r\n\r\n\t // Find the end of this run of changes.\r\n\t while (++$i < $len && $changed[$i])\r\n\t\tcontinue;\r\n\r\n\t do {\r\n\t\t/*\r\n\t\t * Record the length of this run of changes, so that\r\n\t\t * we can later determine whether the run has grown.\r\n\t\t */\r\n\t\t$runlength = $i - $start;\r\n\r\n\t\t/*\r\n\t\t * Move the changed region back, so long as the\r\n\t\t * previous unchanged line matches the last changed one.\r\n\t\t * This merges with previous changed regions.\r\n\t\t */\r\n\t\twhile ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {\r\n\t\t $changed[--$start] = 1;\r\n\t\t $changed[--$i] = false;\r\n\t\t while ($start > 0 && $changed[$start - 1])\r\n\t\t\t$start--;\r\n\t\t USE_ASSERTS && assert('$j > 0');\r\n\t\t while ($other_changed[--$j])\r\n\t\t\tcontinue;\r\n\t\t USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');\r\n }\r\n\r\n\t\t/*\r\n\t\t * Set CORRESPONDING to the end of the changed run, at the last\r\n\t\t * point where it corresponds to a changed run in the other file.\r\n\t\t * CORRESPONDING == LEN means no such point has been found.\r\n\t\t */\r\n\t\t$corresponding = $j < $other_len ? $i : $len;\r\n\r\n\t\t/*\r\n\t\t * Move the changed region forward, so long as the\r\n\t\t * first changed line matches the following unchanged one.\r\n\t\t * This merges with following changed regions.\r\n\t\t * Do this second, so that if there are no merges,\r\n\t\t * the changed region is moved forward as far as possible.\r\n\t\t */\r\n\t\twhile ($i < $len && $lines[$start] == $lines[$i]) {\r\n\t\t $changed[$start++] = false;\r\n\t\t $changed[$i++] = 1;\r\n\t\t while ($i < $len && $changed[$i])\r\n\t\t\t$i++;\r\n\r\n\t\t USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');\r\n\t\t $j++;\r\n\t\t if ($j < $other_len && $other_changed[$j]) {\r\n\t\t\t$corresponding = $i;\r\n\t\t\twhile ($j < $other_len && $other_changed[$j])\r\n\t\t\t $j++;\r\n }\r\n }\r\n } while ($runlength != $i - $start);\r\n\r\n\t /*\r\n\t * If possible, move the fully-merged run of changes\r\n\t * back to a corresponding run in the other file.\r\n\t */\r\n\t while ($corresponding < $i) {\r\n\t\t$changed[--$start] = 1;\r\n\t\t$changed[--$i] = 0;\r\n\t\tUSE_ASSERTS && assert('$j > 0');\r\n\t\twhile ($other_changed[--$j])\r\n\t\t continue;\r\n\t\tUSE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');\r\n }\r\n }\r\n }", "function _check ($from_lines, $to_lines) {\r\n if (serialize($from_lines) != serialize($this->orig()))\r\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\r\n if (serialize($to_lines) != serialize($this->_final()))\r\n trigger_error(\"Reconstructed final doesn't match\", E_USER_ERROR);\r\n\r\n $rev = $this->reverse();\r\n if (serialize($to_lines) != serialize($rev->orig()))\r\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\r\n if (serialize($from_lines) != serialize($rev->_final()))\r\n trigger_error(\"Reversed final doesn't match\", E_USER_ERROR);\r\n\r\n\r\n $prevtype = 'none';\r\n foreach ($this->edits as $edit) {\r\n if ( $prevtype == $edit->type )\r\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\r\n $prevtype = $edit->type;\r\n }\r\n\r\n $lcs = $this->lcs();\r\n trigger_error(\"Diff okay: LCS = $lcs\", E_USER_NOTICE);\r\n }", "private function renderDiff($lines1, $lines2): string\n {\n if (!is_array($lines1)) {\n $lines1 = explode(\"\\n\", $lines1);\n }\n if (!is_array($lines2)) {\n $lines2 = explode(\"\\n\", $lines2);\n }\n foreach ($lines1 as $i => $line) {\n $lines1[$i] = rtrim($line, \"\\r\\n\");\n }\n foreach ($lines2 as $i => $line) {\n $lines2[$i] = rtrim($line, \"\\r\\n\");\n }\n\n $renderer = new DiffRendererHtmlInline();\n $diff = new Diff($lines1, $lines2);\n\n return $diff->render($renderer);\n }", "public function check($from_lines, $to_lines) {\n if (serialize($from_lines) != serialize($this->orig())) {\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\n }\n if (serialize($to_lines) != serialize($this->closing())) {\n trigger_error(\"Reconstructed closing doesn't match\", E_USER_ERROR);\n }\n\n $rev = $this->reverse();\n if (serialize($to_lines) != serialize($rev->orig())) {\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\n }\n if (serialize($from_lines) != serialize($rev->closing())) {\n trigger_error(\"Reversed closing doesn't match\", E_USER_ERROR);\n }\n\n $prevtype = 'none';\n foreach ($this->edits as $edit) {\n if ( $prevtype == $edit->type ) {\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\n }\n $prevtype = $edit->type;\n }\n\n $lcs = $this->lcs();\n trigger_error('Diff okay: LCS = ' . $lcs, E_USER_NOTICE);\n }", "function Line($x1, $y1, $x2, $y2, $style = null) {\r\n if ($style)\r\n $this->SetLineStyle($style);\r\n parent::Line($x1, $y1, $x2, $y2);\r\n }", "public function saveAddedLines( mixed $lines );", "public function update_match_lines($id, $lines);", "public function commitOrderChanges(Mage_Sales_Model_Order $order)\r\n {\r\n $text = '';\r\n $labelPrefix = '';\r\n $helper = $this->getHelper();\r\n $store = $this->getStore($order);\r\n $this->setOrder($order);\r\n\r\n $changes = $this->getChanges($order);\r\n foreach ($this->_getAdditionalSources($order) as $code => $source) {\r\n if (!($source instanceof Varien_Object)) {\r\n continue;\r\n }\r\n\r\n $addChanges = $this->getChanges($source);\r\n\r\n if ($source instanceof Mage_Sales_Model_Order_Address) {\r\n foreach ($addChanges as $k => $change) {\r\n if ($source->getAddressType() == 'shipping') {\r\n $addChanges[$k]['label_prefix'] = $helper->__('Shipping') . ' ';\r\n } elseif ($source->getAddressType() == 'billing') {\r\n $addChanges[$k]['label_prefix'] = $helper->__('Billing') . ' ';\r\n }\r\n }\r\n }\r\n\r\n $changes = array_merge($changes, $addChanges);\r\n }\r\n\r\n foreach ($changes as $code => $diff) {\r\n $label = $labelPrefix . $this->_possibleChanges[$code];\r\n $labelPrefix = (isset($diff['label_prefix'])) ? $diff['label_prefix'] : '';\r\n\r\n $text .= $labelPrefix;\r\n $text .= $helper->__(\"%s has been changed from \\\"%s\\\" to \\\"%s\\\"\", $label, $diff['from'], $diff['to']);\r\n $text .= $this->eol();\r\n }\r\n\r\n if (count($this->_itemsChanges)) {\r\n foreach ($this->_itemsChanges as $item) {\r\n\r\n // Qty changes\r\n if (empty($item['qty_after'])) {\r\n $text .= $helper->__(\"\\\"%s\\\" has been removed from the order\", $item['name']) . $this->eol();\r\n } elseif (empty($item['qty_before'])) {\r\n $text .= $helper->__(\"\\\"%s\\\" has been added to the order (Qty: %s)\", $item['name'],\r\n $item['qty_after']) . $this->eol();\r\n } elseif ($item['qty_after'] > $item['qty_before']) {\r\n $qtyDiff = $item['qty_after'] - $item['qty_before'];\r\n $text .= $helper->__(\"%s item(s) of \\\"%s\\\" have been added to the order\", $qtyDiff,\r\n $item['name']) . $this->eol();\r\n } elseif ($item['qty_before'] > $item['qty_after']) {\r\n $qtyDiff = $item['qty_before'] - $item['qty_after'];\r\n $text .= $helper->__(\"%s item(s) of \\\"%s\\\" have been removed from the order\", $qtyDiff,\r\n $item['name']) . $this->eol();\r\n }\r\n\r\n // Price changes\r\n if (isset($item['price_after']) && isset($item['price_before']) && $item['price_after'] != $item['price_before']) {\r\n $text .= $helper->__(\"Price of \\\"%s\\\" has been changed from %s to %s\",\r\n $item['name'],\r\n $store->formatPrice($item['price_before'], false),\r\n $store->formatPrice($item['price_after'], false))\r\n . $this->eol();\r\n }\r\n\r\n // Discount changes\r\n if (isset($item['discount'])) {\r\n if ($item['discount'] == 1) {\r\n $text .= $helper->__(\"Discount for \\\"%s\\\" have been applied\", $item['name']) . $this->eol();\r\n } elseif ($item['discount'] == -1) {\r\n $text .= $helper->__(\"Discount of \\\"%s\\\" have been removed\", $item['name']) . $this->eol();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (empty($text)) {\r\n return $this;\r\n }\r\n\r\n // 0 - no one; 1 - only admin; 2 - notify all;\r\n /** @var int $notify */\r\n $notify = intval($this->getHelper()->isSendUpdateEmail());\r\n /** @var MageWorx_OrdersBase_Model_Logger $logger */\r\n $logger = Mage::getModel('mageworx_ordersbase/logger');\r\n $logger->log($text, $order, $notify);\r\n\r\n /** Begin: Update Grand total during order update from BE */\r\n if ($notify) {\r\n $order->sendOrderUpdateEmail($notify > 1, $text);\r\n }\r\n\r\n $cod = 0;\r\n $cod_base = 0;\r\n\r\n // Add COD value, if order has products and COD doesn't have any value\r\n if ($order->getTotalQtyOrdered() > 0 && !$order->getMspCashondelivery()) {\r\n $cod = $order->getMspCashondelivery();\r\n $cod_base = $order->getMspBaseCashondelivery();\r\n }\r\n\r\n $order->setGrandTotal($order->getGrandTotal() + $cod);\r\n $order->setBaseGrandTotal($order->getBaseGrandTotal() + $cod_base);\r\n $order->save();\r\n /** End: Update Grand total during order update from BE */\r\n\r\n return $this;\r\n }", "protected function mergeReplaceLines(string $oldLine, string $newLine): ?string\n {\n $delParts = $this->analyzeClosureParts(\n $oldLine,\n RendererConstant::HTML_CLOSURES_DEL,\n SequenceMatcher::OP_DEL,\n );\n $insParts = $this->analyzeClosureParts(\n $newLine,\n RendererConstant::HTML_CLOSURES_INS,\n SequenceMatcher::OP_INS,\n );\n\n // get the cleaned line by a non-regex way (should be faster)\n // i.e., the new line with all \"<ins>...</ins>\" parts removed\n $mergedLine = $newLine;\n foreach (ReverseIterator::fromArray($insParts) as $part) {\n $mergedLine = substr_replace(\n $mergedLine,\n '', // deletion\n $part['offset'],\n \\strlen($part['content']),\n );\n }\n\n // note that $mergedLine is actually a clean line at this point\n if (!$this->isLinesMergeable($oldLine, $newLine, $mergedLine)) {\n return null;\n }\n\n // before building the $mergedParts, we do some adjustments\n $this->revisePartsForBoundaryNewlines($delParts, RendererConstant::HTML_CLOSURES_DEL);\n $this->revisePartsForBoundaryNewlines($insParts, RendererConstant::HTML_CLOSURES_INS);\n\n // create a sorted merged parts array\n $mergedParts = [...$delParts, ...$insParts];\n usort(\n $mergedParts,\n // first sort by \"offsetClean\", \"order\" then by \"type\"\n static fn (array $a, array $b): int => (\n $a['offsetClean'] <=> $b['offsetClean']\n ?: $a['order'] <=> $b['order']\n ?: ($a['type'] === SequenceMatcher::OP_DEL ? -1 : 1)\n ),\n );\n\n // insert merged parts into the cleaned line\n foreach (ReverseIterator::fromArray($mergedParts) as $part) {\n $mergedLine = substr_replace(\n $mergedLine,\n $part['content'],\n $part['offsetClean'],\n 0, // insertion\n );\n }\n\n return str_replace(\"\\n\", '<br>', $mergedLine);\n }", "public function withLineCustomFields($ref1, $ref2 = null)\n {\n $li = $this->getMostRecentLineIndex();\n $this->_model['lines'][$li]['ref1'] = $ref1;\n if ($ref2) {\n $this->_model['lines'][$li]['ref2'] = $ref2;\n }\n\n return $this;\n }", "public function lineTo($x, $y) {}", "function line($x1, $y1, $x2, $y2)\r\n {\r\n $this->forcePen();\r\n echo \"$this->_canvas.drawLine($x1, $y1, $x2, $y2);\\n\";\r\n }", "public function __construct($from_lines, $to_lines) {\n $eng = new DiffEngine();\n $this->edits = $eng->diff($from_lines, $to_lines);\n //$this->_check($from_lines, $to_lines);\n }", "public function indentLines($startLine, $endLine);", "public function setAddLine1($val, $markChanged=true) {\n\t\t$this->addLine1 = $val;\n\t\tif( $markChanged ) $this->isChanged = true;\n\t}", "function cleanup_reformat($change) {\n\t\tif (!array_key_exists('add_lines', $change) && !array_key_exists('remove_lines', $change))\n\t\t\treturn $change;\n\t\t\n\t\tif (array_key_exists('remove_lines', $change))\n\t\tforeach($change['remove_lines'] as $key => $removed) {\n\t\t\t$removed = cleanup_line_reformat($removed);\n\t\t\t$found = empty($removed);\n\t\t\tif (!$found && array_key_exists('add_lines', $change)) {\n\t\t\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t\t\t$added = cleanup_line_reformat($added);\n\t\t\t\t\tif (empty($added)) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($removed == $added) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($found) unset($change['remove_lines'][$key]);\n\t\t}\n\t\t\n\t\t// Clean empty added lines\n\t\tif (array_key_exists('add_lines', $change))\n\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t$added = cleanup_line_reformat($added);\n\t\t\tif (empty($added))\n\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t}\n\t\treturn $change;\n\t}", "function &doneAddingLines() {\n $this->source = trim($this->source);\n\n return $this;\n }", "function diff($text1, $text2) {\n__autoload('TextDiff');\ninclude_once 'Text/Diff.php';\ninclude_once 'Text/Diff/Renderer.php';\ninclude_once 'Text/Diff/Renderer/unified.php';\n\n\n $vtext1 = chunk_split(strip_tags($text1, '<p><div>'), 1, \"\\n\");\n $vtext2 = chunk_split(strip_tags($text2, '<p><div>'), 1, \"\\n\");\n\n $vlines1 = str_split($vtext1, 2);\n $vlines2 = str_split($vtext2, 2);\n $text1 = str_replace(\"\\n\",\" \\n\",$text1);\n $text2 = str_replace(\"\\n\",\" \\n\",$text2);\n\n $vlines1 = explode(\" \", $text1);\n $vlines2 = explode(\" \", $text2);\n $diff = new Text_Diff($vlines1, $vlines2);\n $renderer = new Text_Diff_Renderer_inline();\n $html = html_entity_decode($renderer->render($diff));\n\n return preg_replace(array('#(<ins>|<del>)(<[^\\>]+>)#i', '#(</[^\\>]+>)(</ins>|</del>)#i'), '$2$1', $html);\n}", "public function newLinesWritten();", "public function markUnchanged();", "public function setTwoEnds()\n {\n $line = $this->getLine();\n $twoEnds[0] = $line[0][0];\n $twoEnds[1] = $line[count($line)-1][1];\n $this->twoEnds = $twoEnds;\n }", "function lineInterceptWithSet($line, $set) {\n $line1XStart = $line[0][0];\n $line1XEnd = $line[1][0];\n $line1YStart = $line[0][1];\n $line1YEnd = $line[1][1];\n\n\n foreach($set AS $item) {\n $line2XStart = $item[0][0];\n $line2XEnd = $item[1][0];\n $line2YStart = $item[0][1];\n $line2YEnd = $item[1][1];\n\n\n }\n return true;\n}", "function setLineBetweenColumns() {\t \r\n\t \t$this->lineBetweenColumns = true;\t\r\n\t}", "public function line($x1, $y1, $x2, $y2) {}", "public function merge() {}", "public function updateRootline() {}", "public function setLine2($line2)\n {\n $this->json()->line2 = $line2;\n }", "public function setLineJoin($lineJoin = self::LINE_JOIN_MITER) {}", "public function merge();", "function _check($from_lines, $to_lines)\n {\n }", "public function addLines($lines)\n {\n $this->lines += $lines;\n }", "protected function createDiff(array $a, array $b)\n\t{\n\t\t$indexA = 0;\n\t\t$indexB = 0;\n\t\t$result = array();\n\t\twhile ($indexA < count($a) || $indexB < count($b))\n\t\t{\n\t\t\tif (($indexA < count($a)) && (!$this->modifiedA[$indexA]) && ($indexB < count($b)) && (!$this->modifiedB[$indexB]))\n\t\t\t{\n\t\t\t\t// equal lines\n\t\t\t\t$indexA++;\n\t\t\t\t$indexB++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// maybe deleted and/or inserted lines\n\t\t\t\t$startA = $indexA;\n\t\t\t\t$startB = $indexB;\n\n\t\t\t\twhile ($indexA < count($a) && ($indexB >= count($b) || $this->modifiedA[$indexA]))\n\t\t\t\t{\n\t\t\t\t\t$indexA++;\n\t\t\t\t}\n\n\t\t\t\twhile ($indexB < count($b) && ($indexA >= count($a) || $this->modifiedB[$indexB]))\n\t\t\t\t{\n\t\t\t\t\t$indexB++;\n\t\t\t\t}\n\n\t\t\t\tif (($startA < $indexA) || ($startB < $indexB))\n\t\t\t\t{\n\t\t\t\t\t// store a new difference-item\n\t\t\t\t\t$result[] = array(\"startA\" => $startA, \"startB\" => $startB, \"deletedA\" => $indexA - $startA, \"insertedB\" => $indexB - $startB);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function addLines( mixed $lines );", "public static function addNewLineBetweenAnnotations(bool $should = true): void\n {\n static::$shouldAddNewLineBetweenAnnotations = $should;\n }", "public function markCompeted() {\n $this->status = self::COMPLETED;\n }", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "private function terminateLine()\n {\n if ($this->isInline) {\n $this->isInline = false;\n $this->writeToFile('<br>');\n }\n }", "private function getMarkedUpDiffText( array $unifiedDiff ) {\n\t\t$lastUser = $this->getArticle()->getPage()->getUserText();\n\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg( 'twoColConflict-diffchange-own-title' )->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['new'] .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg(\n\t\t\t\t\t\t\t\t'twoColConflict-diffchange-foreign-title',\n\t\t\t\t\t\t\t\t$lastUser\n\t\t\t\t\t\t\t)->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['old'] .\n\t\t\t\t\t\t\t'</div>';\n\n\t\t\t\t\t\tif ( !$this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$output .= \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-diffchange-same\">' .\n\t\t\t\t\t\t\t$this->addUnchangedText( $changeSet['copy'] ) .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "function process_nonmatches(&$output, &$text_old, &$text_new)\n\t{\n\t\t$s1 = sizeof($text_old);\n\t\t$s2 = sizeof($text_new);\n\n\t\tif ($s1 > 0 AND $s2 == 0)\n\t\t{\n\t\t\t// lines deleted\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), ''));\n\t\t}\n\t\telse if ($s2 > 0 AND $s1 == 0)\n\t\t{\n\t\t\t// lines added\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry('', implode(\"\\n\", $text_new)));\n\t\t}\n\t\telse if ($s1 > 0 AND $s2 > 0)\n\t\t{\n\t\t\t// substitution\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), implode(\"\\n\", $text_new)));\n\t\t}\n\n\t\t$text_old = array();\n\t\t$text_new = array();\n\t}", "private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}", "public function testPrependLinePrefix() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", false)->prependLine(\"World\", false);\n\n\t\t\t$this->assertEquals(\"\\nWorld\\nHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "private function getUnifiedDiff() {\n\t\t$currentText = $this->toEditText( $this->getCurrentContent() );\n\t\t$yourText = $this->textbox1;\n\n\t\t$currentLines = explode( \"\\n\", $currentText );\n\t\t$yourLines = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $yourText ) );\n\n\t\treturn $this->getLineBasedUnifiedDiff( $currentLines, $yourLines );\n\t}", "public function setLine2(?string $line2): self\n {\n $this->initialized['line2'] = true;\n $this->line2 = $line2;\n\n return $this;\n }", "public function merge($incoming)\n {\n }", "function vB_Text_Diff_Entry($data_old, $data_new)\n\t{\n\t\t$this->data_old = $data_old;\n\t\t$this->data_new = $data_new;\n\t}", "public function generateUnifiedDiff()\n {\n if ( ! $this->operations) {\n return \"\";\n }\n\n if ($this->lines === null) {\n $hunk = Hunk::forEmptyFile();\n return (string)$this->operations[0]->perform($hunk);\n }\n\n $hunks = array();\n\n foreach ($this->getLineGroups() as $lineGroup) {\n $start = min($lineGroup);\n $end = max($lineGroup);\n\n $hunk = Hunk::forLines($start, $end, $this->lines);\n\n foreach ($this->operations as $line => $operation) {\n if ( ! in_array($line, $lineGroup)) {\n continue;\n }\n\n $hunk = $operation->perform($hunk);\n }\n\n $hunks[] = $hunk;\n }\n\n $output = \"\";\n\n if ($this->path) {\n $output .= \"--- a/\" . $this->path . \"\\n\";\n $output .= \"+++ b/\" . $this->path . \"\\n\";\n }\n\n $output .= implode(\"\\n\", $hunks);\n\n return $output;\n }", "protected function lineToPdf(): void\n {\n $this->pdf->SetDrawColor($this->color['r'], $this->color['g'], $this->color['b']);\n $this->Line($this->x1, $this->y1, $this->x2, $this->y2);\n }", "public function _changed($orig, $closing)\n\t{\n\t\t$diff = new WordLevelDiff($orig, $closing);\n\t\t$del = $diff->orig();\n\t\t$add = $diff->closing();\n\n\t\t// Notice that WordLevelDiff returns HTML-escaped output.\n\t\t// Hence, we will be calling addedLine/deletedLine without HTML-escaping.\n\n\t\twhile ($line = array_shift($del))\n\t\t{\n\t\t\t$this->i++;\n\t\t\t$aline = array_shift($add);\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->deletedLine($line) . $this->addedLine($aline);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t// If any leftovers\n\t\tforeach ($add as $line)\n\t\t{\n\t\t\t$this->i++;\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->emptyLine() . $this->addedLine($line);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t//$this->i--;\n\t}", "public function sortLines(): self\n {\n usort($this->lines, function (Line $a, Line $b) {\n if ($a->getDate()->getTimestamp() === $b->getDate()->getTimestamp()) {\n return 0;\n }\n\n return $a->getDate()->getTimestamp() > $b->getDate()->getTimestamp()\n ? 1 : -1;\n });\n\n return $this;\n }", "public function setLine($line);", "private function appendLineToRewrites($line){\n\t\t$this->rewrites .= \"\\n\" . $line;\n\t}", "public function setCalloutLine($x1OrPoints, $y1 = null, $x2 = null, $y2 = null, $x3 = null, $y3 = null) {}", "public function calculate_lines(){\n\n\t\t$this->delete_existing_lines();\n\t\t$this->parse_participants_sex_count();\n\t\tif($this->event->type_of_play === 'gender'){\n\t\t\tif($this->event->singles_only == 0){\n\t\t\t\t$this->calculate_lines_gender();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->calculate_lines_gender_singles_only();\n\t\t\t}\n\t\t}\n\t\telse if($this->event->type_of_play === 'mixed'){\n\t\t\tif($this->event->singles_only == 0){\n\t\t\t\t$this->calculate_lines_mixed();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->calculate_lines_mixed_singles_only();\n\t\t\t}\n\t\t}\n\t\t$this->build_lines_aggregate_array();\n\t\t$this->lines->create_lines($this->event->id, $this->event->sets, $this->lines_aggregate_array);\n\n\t}", "function wtsCaddieToggleLine($ar){\n $p = new XParam($ar, array());\n $caddie = $this->getCaddie();\n $slineid = $p->get('lineid');\n\n if (!isset($caddie['lines'][$slineid]))\n return;\n $line = $caddie['lines'][$slineid];\n if (isset($line['options']) && isset($line['options']['lineToggleCallBack'])){\n if (($mngt = $this->getArticleMngt()) != NULL){\n $mngt->lineToggleCallBack($line['options']['lineToggleCallBack'], $line['options'], $caddie, $slineid);\n $this->consolidateCaddie($caddie);\n }\n }\n }", "protected function mergeNewRecordData()\n\t{\n\t\tif( !$this->auditObj && !$this->eventsObject->exists(\"AfterEdit\") )\n\t\t\treturn;\n\n\t\tforeach($this->getOldRecordData() as $f => $v)\n\t\t{\n\t\t\tif( !isset( $this->newRecordData[ $f ] ) )\n\t\t\t\t$this->newRecordData[ $f ] = $v;\n\t\t}\n\t}", "public function testPrependLineTerminate() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", true)->prependLine(\"World\", true);\n\n\t\t\t$this->assertEquals(\"World\\nHello\\n\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function setLine2(?string $line2): self\n {\n $this->line2 = $line2;\n\n return $this;\n }", "public function replaceLineWith($data, $line) {\r\n\t\tif ($this->exists && $data !== null && $line !== null) {\r\n\t\t\t$lineData = $this->readByLine ();\r\n\t\t\t$this->clearFile ();\r\n\t\t\t$lineData [$line] = $data . \"\\n\";\r\n\t\t\tfor($y = 0; $y < sizeof ( $lineData ); $y ++) {\r\n\t\t\t\t$this->writeToFile ( $lineData [$y] );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private function calculate_lines_mixed(){\n\n\t\t$single_lines = min($this->female_count, $this->male_count, $this->event->single_women_lines, $this->event->single_men_lines);\n\t\t$women_left_after_singles = $this->female_count - $single_lines;\n\t\t$men_left_after_singles = $this->male_count - $single_lines;\n\t\t$most_of_gender_available_for_doubles = min($women_left_after_singles, $men_left_after_singles);\n\t\t$extra_women = $women_left_after_singles - $most_of_gender_available_for_doubles;\n\t\t$extra_men = $men_left_after_singles - $most_of_gender_available_for_doubles;\n\t\t$double_lines = floor($most_of_gender_available_for_doubles / 2);\n\t\t$this->total_lines = $single_lines + $double_lines;\n\t\t$women_and_men_left_after_doubles = $most_of_gender_available_for_doubles % 2;\n\t\t$additional_women = $extra_women + $women_and_men_left_after_doubles;\n\t\t$additional_men = $extra_men + $women_and_men_left_after_doubles;\n\t\t$this->per_team_lines = array(array(\n\t\t\t'total_teams' => 1,\n\t\t\t'women_lines' => '-',\n\t\t\t'men_lines' => '-',\n\t\t\t'additional_women' => $additional_women,\n\t\t\t'additional_men' => $additional_men,\n\t\t\t'comb_lines' => '-',\n\t\t\t'total_lines' => $this->total_lines,\n\t\t\t'additional_players' => $additional_women + $additional_men,\n\t\t\t'mixed_singles' => $single_lines,\n\t\t\t'mixed_doubles' => $double_lines\n\t ), array(\n\t \t'total_teams' => 2\n\t\t), array(\n\t \t'total_teams' => 4\n\t\t), array(\n\t \t'total_teams' => 6\n\t\t), array(\n\t \t'total_teams' => 8\n\t\t), array(\n\t \t'total_teams' => 9\n\t\t), array(\n\t \t'total_teams' => 16\n\t\t), array(\n\t \t'total_teams' => 25\n\t\t));\n\n\t}", "protected function processLine($line, AbstractAdapter $source, AbstractAdapter $destination)\n\t{\n\t}", "public function getDiffHtml($a, $b)\n\t{\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$a, $matchA);\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$b, $matchB);\n\n\t\t$diffScript = $this->getDiffScript($matchA[2], $matchB[2]);\n\t\tif(count($diffScript) == 0)\n\t\t{\n\t\t\t// no difference found\n\t\t\treturn $a;\n\t\t}\n\n\t\t$positionA = 0;\n\n\t\t$result = '';\n\t\tforeach($diffScript as $diffItem)\n\t\t{\n\t\t\twhile($positionA < $diffItem['startA'])\n\t\t\t{\n\t\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t\t$positionA++;\n\t\t\t}\n\n\t\t\t//deleted items\n\t\t\tif($diffItem['deletedA'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchA[1][$positionA] . '<s style=\"color:red\">' . $matchA[2][$positionA];\n\t\t\t\tfor($i = 1; $i < $diffItem['deletedA']; $i++)\n\t\t\t\t\t$result .= $matchA[0][$positionA + $i];\n\n\t\t\t\t$result .= '</s>';\n\t\t\t\t$positionA = $positionA + $diffItem['deletedA'];\n\t\t\t}\n\n\t\t\tif($diffItem['insertedB'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchB[1][$diffItem['startB']] . '<b style=\"color:green\">' . $matchB[2][$diffItem['startB']];\n\t\t\t\tfor($i = 1; $i < $diffItem['insertedB']; $i++)\n\t\t\t\t\t$result .= $matchB[0][$diffItem['startB'] + $i];\n\n\t\t\t\t$result .= '</b>';\n\t\t\t}\n\t\t}\n\n\t\twhile($positionA < count($matchA[0]))\n\t\t{\n\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t$positionA++;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function addLineFill($where, $color, $startLineIndex, $endLineIndex) {\n\t\t$this->setProperty('chm', $this->encodeData(array($where, $color, $startLineIndex, $endLineIndex, 0),','), true);\n\t}", "public function setLines( mixed $lines );", "function diff2( $page1, $page2 ) {\n\t\t$page1 = split( \"\\n\", $page1 );\n\t\t$page2 = split( \"\\n\", $page2 );\n\t\t$z = new WikiDiff( $page1, $page2 );\n\t\tif( $z->isEmpty() ) {\n\t\t\t$html = '<hr /><br />['.tra(\"Versions are identical\").']<br /><br />';\n\t\t} else {\n\t\t\t//$fmt = new WikiDiffFormatter;\n\t\t\t$fmt = new WikiUnifiedDiffFormatter;\n\t\t\t$html = $fmt->format( $z, $page1 );\n\t\t}\n\t\treturn $html;\n\t}", "abstract protected function commit_changes($changes);", "public function setLineEndingStyles($first, $last) {}", "public function setLineEndingStyles($first, $last) {}", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function testLineIntrospectionWithCRLFLineEndings() {\n\t\t$tmpPath = Libraries::get(true, 'resources') . '/tmp/tests/inspector_crlf';\n\t\t$contents = implode(\"\\r\\n\", ['one', 'two', 'three', 'four', 'five']);\n\t\tfile_put_contents($tmpPath, $contents);\n\n\t\t$result = Inspector::lines($tmpPath, [2]);\n\t\t$expected = [2 => 'two'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines($tmpPath, [1,5]);\n\t\t$expected = [1 => 'one', 5 => 'five'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->_cleanUp();\n\t}", "protected function shouldReceiveSameLine()\n {\n $this->output->shouldReceive('sameLine')->andReturn($this->output);\n }", "function edithistory_merge()\n{\n\tglobal $db, $mybb, $source_user, $destination_user;\n\n\t$uid = array(\n\t\t\"uid\" => $destination_user['uid']\n\t);\t\n\t$db->update_query(\"edithistory\", $uid, \"uid='{$source_user['uid']}'\");\n}", "protected function updateLine($type, $val, $line) {\r\n\t\treturn $line;\r\n\t}", "public function updateLines()\n {\n\n $product = \\App\\Product::with('bomitems')->with('boms')->findOrFail( $this->product_id );\n $bomitem = $product->bomitem();\n $bom = $product->bom();\n\n if (!$bom) return $this;\n\n // Adjust Manufacturing batch size\n $nbt = ceil($this->planned_quantity / $product->manufacturing_batch_size);\n $order_quantity = $nbt * $product->manufacturing_batch_size;\n $this->update(['planned_quantity' => $order_quantity]);\n\n $order = $this;\n\n\n // Order lines\n\n // Destroy Order Lines\n if ($this->productionorderlines()->count())\n foreach( $this->productionorderlines as $line ) {\n $line->delete();\n }\n\n // BOM quantities\n $line_qty = $order_quantity * $bomitem->quantity / $bom->quantity;\n\n foreach( $bom->BOMlines as $line ) {\n \n $line_product = \\App\\Product::with('measureunit')->findOrFail( $line->product_id );\n\n $order_line = \\App\\ProductionOrderLine::create([\n 'type' => 'product',\n 'product_id' => $line_product->id,\n 'reference' => $line_product->reference,\n 'name' => $line_product->name, \n\n// 'base_quantity', \n 'required_quantity' => $line_qty * $line->quantity * (1.0 + $line->scrap/100.0), \n // Assume 1 product == 1 measure unit O_O\n 'measure_unit_id' => $line_product->measure_unit_id,\n// 'warehouse_id'\n ]);\n\n $order->productionorderlines()->save($order_line);\n }\n\n return $order;\n }", "function vB_Text_Diff($data_old, $data_new)\n\t{\n\t\t$this->data_old = preg_split('#(\\r\\n|\\n|\\r)#', $data_old);\n\t\t$this->data_old_len = sizeof($this->data_old);\n\n\t\t$this->data_new = preg_split('#(\\r\\n|\\n|\\r)#', $data_new);\n\t\t$this->data_new_len = sizeof($this->data_new);\n\t}", "function countAddedLines()\n {\n }", "private function traceLine() {\n $this->lineJump();\n $this->currentPage->rectangle(self::HMARGIN + $this->hOffset, $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset, $this->PAGE_WIDTH - 2*$this->hOffset - 2*self::HMARGIN, 1);\n $this->currentPage->stroke();\n }", "public function updateCommentLine( $line_id, $params = [] )\n {\n // Do the Mambo!\n $lineClass = $this->getClassName().'Line';\n $relation = 'document'; // strtolower($this->getClass());\n\n $document_line = ( new $lineClass() )->where($this->getClassSnakeCase().'_id', $this->id)\n ->with($relation)\n ->with($relation.'.customer')\n// ->with('product')\n// ->with('combination')\n ->findOrFail($line_id);\n\n\n // Customer\n $customer = $this->customer;\n $salesrep = $this->salesrep;\n \n // Currency\n $currency = $this->document_currency;\n\n\n $line_type = array_key_exists('line_type', $params) \n ? $params['line_type'] \n : $document_line->line_type;\n\n // Product\n // Consider \"not coded products\" only\n\n $reference = array_key_exists('reference', $params) \n ? $params['reference'] \n : $document_line->reference;\n\n $name = array_key_exists('name', $params) \n ? $params['name'] \n : $document_line->name;\n\n $cost_price = array_key_exists('cost_price', $params) \n ? $params['cost_price'] \n : $document_line->cost_price;\n\n // Tax\n $tax_id = array_key_exists('tax_id', $params) \n ? $params['tax_id'] \n : $document_line->tax_id;\n $tax = Tax::findOrFail($tax_id);\n $taxing_address = $this->taxingaddress;\n $tax_percent = $tax->getTaxPercent( $taxing_address );\n\n $sales_equalization = array_key_exists('sales_equalization', $params) \n ? $params['sales_equalization'] \n : $document_line->sales_equalization;\n\n // Price Policy\n $pricetaxPolicy = array_key_exists('prices_entered_with_tax', $params) \n ? $params['prices_entered_with_tax'] \n : $document_line->price_is_tax_inc;\n\n // Product Price\n// $price = $product->getPrice();\n// $unit_price = $price->getPrice();\n\n // Service Price\n $price = new Price($params['unit_customer_final_price'], $pricetaxPolicy, $currency);\n $price->applyTaxPercent( $tax_percent );\n// if ( $price->currency->id != $currency->id ) {\n// $price = $price->convert( $currency );\n// }\n $unit_price = $price->getPrice();\n\n // Calculate price per $customer_id now!\n // $customer_price = $product->getPriceByCustomer( $customer, $quantity, $currency );\n $customer_price = clone $price;\n\n // Is there a Price for this Customer?\n if (!$customer_price) return null; // Product not allowed for this Customer\n // What to do???\n\n // $customer_price->applyTaxPercent( $tax_percent );\n $unit_customer_price = $customer_price->getPrice();\n\n // Customer Final Price\n if ( array_key_exists('prices_entered_with_tax', $params) && array_key_exists('unit_customer_final_price', $params) )\n {\n $unit_customer_final_price = new Price( $params['unit_customer_final_price'], $pricetaxPolicy, $currency );\n\n $unit_customer_final_price->applyTaxPercent( $tax_percent );\n\n } else {\n\n $unit_customer_final_price = clone $customer_price;\n }\n\n // Discount\n $discount_percent = array_key_exists('discount_percent', $params) \n ? $params['discount_percent'] \n : $document_line->discount_percent;\n\n // Final Price\n $unit_final_price = clone $unit_customer_final_price;\n if ( $discount_percent ) \n $unit_final_price->applyDiscountPercent( $discount_percent );\n\n // Sales Rep\n $sales_rep_id = array_key_exists('sales_rep_id', $params) \n ? $params['sales_rep_id'] \n : $document_line->sales_rep_id;\n \n $commission_percent = array_key_exists('sales_rep_id', $params) && array_key_exists('commission_percent', $params) \n ? $params['commission_percent'] \n : $document_line->commission_percent;\n\n // Misc\n $notes = array_key_exists('notes', $params) \n ? $params['notes'] \n : $document_line->notes;\n\n\n // Build OrderLine Object\n $data = [\n // 'line_sort_order' => $line_sort_order,\n 'line_type' => $line_type,\n // 'product_id' => $product_id,\n // 'combination_id' => $combination_id,\n // 'reference' => $reference,\n // 'name' => $name,\n // 'quantity' => $quantity,\n // 'measure_unit_id' => $measure_unit_id,\n\n 'prices_entered_with_tax' => $pricetaxPolicy,\n \n 'cost_price' => $cost_price,\n 'unit_price' => $unit_price,\n 'unit_customer_price' => $unit_customer_price,\n 'unit_customer_final_price' => $unit_customer_final_price->getPrice(),\n 'unit_customer_final_price_tax_inc' => $unit_customer_final_price->getPriceWithTax(),\n 'unit_final_price' => $unit_final_price->getPrice(),\n 'unit_final_price_tax_inc' => $unit_final_price->getPriceWithTax(), \n // 'sales_equalization' => $sales_equalization,\n 'discount_percent' => $discount_percent,\n 'discount_amount_tax_incl' => 0.0, // floatval( $request->input('discount_amount_tax_incl', 0.0) ),\n 'discount_amount_tax_excl' => 0.0, // floatval( $request->input('discount_amount_tax_excl', 0.0) ),\n\n // 'total_tax_incl' => $quantity * $unit_final_price->getPriceWithTax(),\n // 'total_tax_excl' => $quantity * $unit_final_price->getPrice(),\n\n 'tax_percent' => $tax_percent,\n 'commission_percent' => $commission_percent,\n 'notes' => $notes,\n // 'locked' => 0,\n \n // 'customer_order_id',\n 'tax_id' => $tax->id,\n 'sales_rep_id' => $sales_rep_id,\n ];\n\n // More stuff\n if (array_key_exists('quantity', $params)) \n $data['quantity'] = $params['quantity'];\n \n\n if (array_key_exists('line_sort_order', $params)) \n $data['line_sort_order'] = $params['line_sort_order'];\n \n if (array_key_exists('notes', $params)) \n $data['notes'] = $params['notes'];\n \n\n if (array_key_exists('name', $params)) \n $data['name'] = $params['name'];\n \n if (array_key_exists('sales_equalization', $params)) \n $data['sales_equalization'] = $params['sales_equalization'];\n \n if (array_key_exists('measure_unit_id', $params)) \n $data['measure_unit_id'] = $params['measure_unit_id'];\n \n if (array_key_exists('sales_rep_id', $params)) \n $data['sales_rep_id'] = $params['sales_rep_id'];\n \n if (array_key_exists('commission_percent', $params)) \n $data['commission_percent'] = $params['commission_percent'];\n\n\n // Finishing touches\n $document_line->update( $data );\n\n\n // Good boy, bye then\n return $document_line;\n }", "public function addedLine($line, $colspan=0)\n\t{\n\t\treturn $this->wrapLine('+', 'diff-addedline', $line, $colspan);\n\t}", "public function markAsActive()\n {\n // Clean up end column and activate\n $this->active = true;\n $this->endsAt = null;\n\n return $this->save();\n }", "private function changed()\n {\n $this->isDirty = true;\n }", "public function actionBulkMarkRead() {\n\n if (Yii::$app->request->post('selection')) {\n\n $where = ['id' => Yii::$app->request->post('selection', [])];\n $this->modelViaClass::updateAll(['status_read' => $this->modelClass::STATUS_READ_OLD], $where);\n }\n }", "protected function updateRootLinesWithTranslations() {}", "public function merge($first, $second) {\n throw new UnsupportedOperationException();\n }", "public function saveQuote(Common $common, $originalLines = array()) {\n if ($originalLines) {\n foreach ($common->getCommonLines() as $commonLine) {\n foreach ($originalLines as $key => $toDel) {\n if ($toDel->getId() === $commonLine->getId()) {\n unset($originalLines[$key]);\n }\n }\n }\n\n // remove the relationship between the line and the common\n foreach ($originalLines as $line) {\n $this->getEntityManager()->remove($line);\n }\n }\n\n if (!$common->getQuote()) {\n throw new Exception('Common is not an quote');\n }\n elseif ($common->getQuote()->getStatus() > 0) {\n throw new Exception('Only quotes with status draft could be edited');\n }\n\n if (!$common->getQuote()->getNumber()) {\n // We get WRITE lock to avoid duplicated quote numbers\n $em = $this->getEntityManager();\n $em->getConnection()->exec('LOCK TABLE quote q0_ WRITE;');\n if (!$common->getQuote()->getNumber()) {\n if ($common->getQuote()->getCreated()) {\n $createdDate = $common->getQuote()->getCreated();\n }\n else {\n $createdDate = new \\DateTime();\n }\n $nextQuoteNumber = $this->getNextQuoteNumber($createdDate);\n $common->getQuote()->setNumber($nextQuoteNumber);\n }\n $em->persist($common);\n $em->flush();\n $em->getConnection()->exec('UNLOCK TABLES;');\n }\n $this->updateCustomerFromCommon($common);\n\n $em = $this->getEntityManager();\n // print count($common->getCommonLines());\n $em->persist($common);\n $em->flush();\n }", "public function applyDiff(Diff $diff);", "protected function updated()\n {\n $result = [];\n\n $diff = new Differ();\n\n $diff->setGranularity($this->granularity());\n\n foreach ($this->after as $key => $value) {\n if ($this->before[$key] == $this->after[$key]) {\n $result[] = [\n 'key' => $key,\n 'value' => $value,\n 'type' => 'equal',\n ];\n\n continue;\n }\n\n $diff->setRenderer(new Renderers\\Delete);\n\n $result[] = [\n 'key' => $key,\n 'value' => $diff->render($this->before[$key], $this->after[$key]),\n 'type' => 'delete',\n ];\n\n $diff->setRenderer(new Renderers\\Insert);\n\n $result[] = [\n 'key' => $key,\n 'value' => $diff->render($this->before[$key], $this->after[$key]),\n 'type' => 'insert',\n ];\n }\n\n return $result;\n }", "private function borraLineas() {\n $ok = true;\n\n $linea = new FemitidasLineas();\n $rows = $linea->cargaCondicion(\"IDLinea\", \"IDFactura='{$this->IDFactura}'\");\n unset($linea);\n foreach ($rows as $lineaFactura) {\n $lineaFactura = new FemitidasLineas($lineaFactura['IDLinea']);\n // Cambia estado linea albaran\n $lineaAlbaran = $lineaFactura->getIDLineaAlbaran();\n $lineaAlbaran->setIDEstado(2);\n $lineaAlbaran->save();\n // Borrar linea factura\n $lineaFactura->erase();\n }\n return $ok;\n }", "public function drawLine($X1, $Y1, $X2, $Y2, array $Format = [])\n {\n $R = isset($Format[\"R\"]) ? $Format[\"R\"] : 0;\n $G = isset($Format[\"G\"]) ? $Format[\"G\"] : 0;\n $B = isset($Format[\"B\"]) ? $Format[\"B\"] : 0;\n $Alpha = isset($Format[\"Alpha\"]) ? $Format[\"Alpha\"] : 100;\n $Ticks = isset($Format[\"Ticks\"]) ? $Format[\"Ticks\"] : null;\n $Cpt = isset($Format[\"Cpt\"]) ? $Format[\"Cpt\"] : 1;\n $Mode = isset($Format[\"Mode\"]) ? $Format[\"Mode\"] : 1;\n $Weight = isset($Format[\"Weight\"]) ? $Format[\"Weight\"] : null;\n $Threshold = isset($Format[\"Threshold\"]) ? $Format[\"Threshold\"] : null;\n\n if ($this->Antialias == false && $Ticks == null) {\n if ($this->Shadow && $this->ShadowX != 0 && $this->ShadowY != 0) {\n $ShadowColor = $this->allocateColor(\n $this->Picture,\n $this->ShadowR,\n $this->ShadowG,\n $this->ShadowB,\n $this->Shadowa\n );\n imageline(\n $this->Picture,\n intval($X1 + $this->ShadowX),\n intval($Y1 + $this->ShadowY),\n intval($X2 + $this->ShadowX),\n intval($Y2 + $this->ShadowY),\n $ShadowColor\n );\n }\n\n $Color = $this->allocateColor($this->Picture, $R, $G, $B, $Alpha);\n imageline($this->Picture, (int) $X1, (int) $Y1, (int) $X2, (int) $Y2, $Color);\n return 0;\n }\n\n $Distance = sqrt(($X2 - $X1) * ($X2 - $X1) + ($Y2 - $Y1) * ($Y2 - $Y1));\n if ($Distance == 0) {\n return -1;\n }\n\n /* Derivative algorithm for overweighted lines, re-route to polygons primitives */\n if ($Weight != null) {\n $Angle = $this->getAngle($X1, $Y1, $X2, $Y2);\n $PolySettings = [\"R\" => $R, \"G\" => $G, \"B\" => $B, \"Alpha\" => $Alpha, \"BorderAlpha\" => $Alpha];\n\n if ($Ticks == null) {\n $Points = [];\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $X1;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Y1;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $X1;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Y1;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $X2;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Y2;\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $X2;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Y2;\n\n $this->drawPolygon($Points, $PolySettings);\n } else {\n for ($i = 0; $i <= $Distance; $i = $i + $Ticks * 2) {\n $Xa = (($X2 - $X1) / $Distance) * $i + $X1;\n $Ya = (($Y2 - $Y1) / $Distance) * $i + $Y1;\n $Xb = (($X2 - $X1) / $Distance) * ($i + $Ticks) + $X1;\n $Yb = (($Y2 - $Y1) / $Distance) * ($i + $Ticks) + $Y1;\n\n $Points = [];\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $Xa;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Ya;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $Xa;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Ya;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $Xb;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Yb;\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $Xb;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Yb;\n\n $this->drawPolygon($Points, $PolySettings);\n }\n }\n\n return 1;\n }\n\n $XStep = ($X2 - $X1) / $Distance;\n $YStep = ($Y2 - $Y1) / $Distance;\n\n for ($i = 0; $i <= $Distance; $i++) {\n $X = $i * $XStep + $X1;\n $Y = $i * $YStep + $Y1;\n\n $Color = [\"R\" => $R, \"G\" => $G, \"B\" => $B, \"Alpha\" => $Alpha];\n\n if ($Threshold != null) {\n foreach ($Threshold as $Key => $Parameters) {\n if ($Y <= $Parameters[\"MinX\"] && $Y >= $Parameters[\"MaxX\"]) {\n if (isset($Parameters[\"R\"])) {\n $RT = $Parameters[\"R\"];\n } else {\n $RT = 0;\n }\n if (isset($Parameters[\"G\"])) {\n $GT = $Parameters[\"G\"];\n } else {\n $GT = 0;\n }\n if (isset($Parameters[\"B\"])) {\n $BT = $Parameters[\"B\"];\n } else {\n $BT = 0;\n }\n if (isset($Parameters[\"Alpha\"])) {\n $AlphaT = $Parameters[\"Alpha\"];\n } else {\n $AlphaT = 0;\n }\n $Color = [\"R\" => $RT, \"G\" => $GT, \"B\" => $BT, \"Alpha\" => $AlphaT];\n }\n }\n }\n\n if ($Ticks != null) {\n if ($Cpt % $Ticks == 0) {\n $Cpt = 0;\n if ($Mode == 1) {\n $Mode = 0;\n } else {\n $Mode = 1;\n }\n }\n\n if ($Mode == 1) {\n $this->drawAntialiasPixel($X, $Y, $Color);\n }\n $Cpt++;\n } else {\n $this->drawAntialiasPixel($X, $Y, $Color);\n }\n }\n\n return [$Cpt, $Mode];\n }", "protected function _setLinesToRequest()\n {\n $this->_request->setLines(array_values($this->_lines));\n }", "function bevelLine($color, $x1, $y1, $x2, $y2)\r\n {\r\n $resp = $this->forcePen();\r\n $resp .= $this->_getJavascriptVar() . \".strokeStyle = \\\"\" . $color . \"\\\";\\n\";\r\n $resp .= $this->drawLine(array($x1, $y1), array($x2, $y2));\r\n\r\n return $resp;\r\n }" ]
[ "0.6076014", "0.59134924", "0.5826788", "0.5675287", "0.56156725", "0.5589143", "0.5585625", "0.54690605", "0.54675555", "0.53808045", "0.5218481", "0.5103979", "0.50859463", "0.5049277", "0.50482506", "0.5021097", "0.50076723", "0.50005794", "0.4991256", "0.49322128", "0.49134493", "0.49085295", "0.49078095", "0.4898588", "0.48394856", "0.48372537", "0.48264557", "0.47888803", "0.4764899", "0.47296116", "0.47223306", "0.4699496", "0.46933755", "0.4684628", "0.46406847", "0.46234825", "0.4622401", "0.46217206", "0.46190083", "0.45969987", "0.45855963", "0.4578607", "0.45619923", "0.45181936", "0.4497288", "0.44866747", "0.4484269", "0.44812346", "0.44541085", "0.44502732", "0.4439366", "0.4433266", "0.4427613", "0.44121492", "0.44071645", "0.43974954", "0.43908876", "0.43902385", "0.4384003", "0.43805924", "0.43778053", "0.43526548", "0.43495762", "0.4336808", "0.4333453", "0.43286565", "0.43212873", "0.4316449", "0.43000066", "0.42999968", "0.42989826", "0.4295503", "0.42943344", "0.42919236", "0.42795974", "0.42794806", "0.4278547", "0.4278547", "0.427294", "0.4269771", "0.4268223", "0.42677727", "0.42656794", "0.42656347", "0.42627847", "0.42619556", "0.42353937", "0.42337185", "0.42332244", "0.42323887", "0.42236394", "0.42230043", "0.42209128", "0.4216148", "0.42122722", "0.42098734", "0.4208061", "0.41923457", "0.41899243", "0.41876334" ]
0.55994594
5
Should not show in JS side
function mytest($a, $b, $c = NULL) { var_dump(func_get_args()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function displayJavascript() {\n $this->javascript_is_displayed = TRUE ;\n }", "function showUploadNoJSPage() {\n\t\t\n\t\t$this->render($this->getTpl('uploadNojs', '/account'));\n\t}", "public function show_in_panel() {\n\t\treturn false;\n\t}", "private function render_no_js() {\n\t\t// Consent-based blocking requires JS to be enabled so we need to bail here if present.\n\t\tif ( $this->get_tag_blocked_on_consent_attribute() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$iframe_src = 'https://www.googletagmanager.com/ns.html?id=' . rawurlencode( $this->tag_id );\n\n\t\t?>\n\t\t<!-- <?php esc_html_e( 'Google Tag Manager (noscript) snippet added by Site Kit', 'google-site-kit' ); ?> -->\n\t\t<noscript>\n\t\t\t<iframe src=\"<?php echo esc_url( $iframe_src ); ?>\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>\n\t\t</noscript>\n\t\t<!-- <?php esc_html_e( 'End Google Tag Manager (noscript) snippet added by Site Kit', 'google-site-kit' ); ?> -->\n\t\t<?php\n\t}", "public function showDemo()\n {\n return false;\n }", "protected function renderAsJavascript() {}", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden() {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden() {\r\n return false;\r\n }", "function isHidden();", "function js_disabled() {\n\n }", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden(): bool\n {\n return false;\n }", "public function javascript_validation() {\n return false;\n }", "public function noscriptAction(){\n $this->_helper->layout()->setLayout('withoutlogin');\n \n }", "public function noscriptAction(){\n $this->_helper->layout()->setLayout('withoutlogin');\n \n }", "function javascript_validation() {\n return false;\n }", "public function display() {\n return false;\n }", "public function display() {\n return false;\n }", "public function js()\n {\n }", "function javascript_validation() {\n return false;\n }", "function javascript_validation() {\r\n return false;\r\n }", "public function validateNoJsValidation()\n {\n return true;\n }", "protected function _getInlineJavaScript()\n {\n return '';\n }", "public function preventsElementDisplay(): bool;", "public function js_1()\n {\n }", "public function getHidden(): bool;", "public function noScriptWarning() {\n\t\t$return = \"<noscript><h4>Sorry, this site currently requires Javascript to be enabled</h4></noscript>\";\n\t}", "function setDefaultWhenVisible() {\n $equations = array();\n list($branching_fields, ) = (function_exists('getBranchingFields')) ?\n getBranchingFields($_GET['page']) :\n \\DataEntry::getBranchingFields($_GET['page']);\n\n foreach ($branching_fields as $field => $equation) {\n list($equations[$field], ) = LogicTester::formatLogicToJS($equation, false, $_GET['event_id'], true);\n }\n\n // More current versions of REDCap do not have all js libraries loaded in time\n $this->setJsSetting('versionMod', version_compare(REDCAP_VERSION, '9.4.1', '>='));\n\n $this->setJsSetting('defaultWhenVisible', array('branchingEquations' => $equations));\n $this->includeJs('js/default_when_visible.js');\n }", "public function getInvisibleFlag() {}", "public function indikatorjsAction(){\n\t\theader('content-type : text/javascript');\n\t\t$this->render('indikatorjs');\n }", "public function getunmarkedAction ()\r\n {\r\n $this->_helper->viewRenderer->setNoRender(false);\r\n $this->_helper->layout()->enableLayout();\r\n }", "public function disableConcatenateJavascript() {}", "function dumpJavascript()\r\n {\r\n //Do nothing yet\r\n }", "public function hide();", "public function js();", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "static function renderJS()\n\t{\n\t\tforeach (self::$CallStack as $widget)\n\t\t{\n\t\t\tif (!$widget->jsRendered)\n\t\t\t{\n\t\t\t\tprint $widget . ';' . PHP_EOL;\n\t\t\t}\n\t\t}\n\t}", "function show(){\n\t}", "public static function use_inline_scripts(){\n return false;\n }", "public function hideExtraField()\n {\n $this->houses=false;\n $this->jobs_training=false;\n $this->motorcycles =false;\n $this->cars = false;\n $this->offices=false;\n $this->lands_plots=false;\n return;\n }", "public function unsetJavascript() {\n $this->javascript = false;\n }", "public function printNeededJSFunctions() {}", "public function setHidden(){\n $this->_hidden = true;\n }", "public function maybe_disable_scripts_notice() {\n\n\t\tif ( get_option( 'yourfitness_compile_all_scripts' ) && yourfitness_tt_is_compiler_dev_mode() )\n\t\t\techo '<br /><span>' . esc_html__( 'Scripts are not compiled in development mode.', 'your-fitness' ) . '</span>';\n\n\t}", "function show_wait_message()\n\t\t{\n\t\t\tif(!@is_object($GLOBALS['egw']->js))\n\t\t\t{\n\t\t\t\t$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');\n\t\t\t}\n\t\t\t$please_wait=lang('Please wait, task in progress ...');\n\t\t\t$GLOBALS['egw_info']['flags']['java_script'] .= '<script type=\"text/javascript\">\n\t\t\t\tdocument.write(\\'<DIV id=\"loading\"><BR><BR>\\'+\"'.$please_wait.'\" +\\'</DIV>\\');\n\t\t\t\tfunction hide_loading()\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"loading\").style.display=\"none\";\n\t\t\t\t}</script>';\n\t\t\t$GLOBALS['egw']->js->set_onload('hide_loading();');\n\t\t}", "public function canShowOnDemand () {\n return true;\n }", "public function _report_js_keyToFilter()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_key_to_filter_js');\n\t\t$filter_js->render(TRUE);\n\t}", "public function hide() {\n\t\treturn true;\n\t}", "public function hide() {\n\t\treturn true;\n\t}", "public function js_2()\n {\n }", "function showNoticeForm() {\n // nop\n }", "function fouc_protect_against () {\n ?>\n <style type=\"text/css\">\n .hidden {display:none;}\n </style>\n <script type=\"text/javascript\">\n jQuery('html').addClass('hidden');\n\t \n\t jQuery(document).ready(function($) {\t\t \n\t $('html').removeClass('hidden');\t \n\t }); \n </script>\n <?php\n\n}", "function hide()\n {\n $this->_hidden = true;\n }", "public static function renderNoticeWPFCMNotActive() {\n\t\t\tself::renderNotice( true );\n\t\t}", "public function ShowForm()\n {\n return false;\n }", "function use_custom_js() {\n if ( $this->addon->options['email_link_format'] === 'popup_form' ) { return true; }\n if ( $this->slplus->is_CheckTrue( $this->addon->options['disable_initial_directory'] ) ) { return true; }\n return false;\n }", "protected function generateJavascript()\n\t{\n\t}", "public function disableStaticPreview()\n {\n $this->staticPreview = false;\n }", "public function isVisitante(){ return false; }", "protected function before_filter()\n {\n if (Input::isAjax()) {\n View::template(null);\n }\n }", "function isHidden()\r\n\t{\r\n\t\t$db\t\t\t\t=& JFactory::getDBO();\r\n\t\tif ($db != $this->getDb()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parent::isHidden();\r\n\t}", "public function indikatorminjsAction(){\n\t\theader('content-type : text/javascript');\n\t\t$this->render('indikatorminjs');\n }", "protected function get_displayinmenublock() {\n return false;\n }", "private function dd_content_inline_js() {\n global $COURSE, $CFG;\n \n echo \"<script>\";\n echo \"dd_content_php['orientation'] = '\".$this->get_menu_oritentation().\"';\";\n echo \"</script>\";\n }", "public function getHiddenFlag() {}", "public function _report_js_filterReportsActionRemove()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_remove_js');\n\t\t$filter_js->render(TRUE);\n\t}", "public function getJavaScript() {}", "function show()\n {\n }", "public function showJsLibraryHint()\n\t{\n\t\tif ($_POST || Input::get('act') != 'edit')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if the user cannot access the layout module (see #6190)\n\t\tif (!$this->User->hasAccess('themes', 'modules') || !$this->User->hasAccess('layout', 'themes'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tSystem::loadLanguageFile('tl_layout');\n\t\tMessage::addInfo(sprintf($GLOBALS['TL_LANG']['tl_image_size']['picturefill'], $GLOBALS['TL_LANG']['tl_layout']['picturefill'][0]));\n\t}", "private function _noActionTaken()\n {\n $this->view->display($this->model);\n }", "function is_hidden() {\n trigger_error('Admin class does not implement method <strong>is_hidden()</strong>', E_USER_WARNING);\n return;\n }", "public function _report_js_filterReportsAction()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_js');\n\t\t$filter_js->render(TRUE);\n\t}", "function getjsOnBlur() {return $this->readjsOnBlur();}" ]
[ "0.6942006", "0.6593288", "0.6544588", "0.65249413", "0.6332477", "0.63088703", "0.62811774", "0.62811774", "0.62811774", "0.6256625", "0.6244852", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.62134504", "0.6204051", "0.6204051", "0.61930805", "0.61803156", "0.61607575", "0.61565495", "0.61565495", "0.61565495", "0.61565495", "0.61550546", "0.61469924", "0.6121047", "0.6121047", "0.6103779", "0.608799", "0.608799", "0.5986625", "0.5959681", "0.59546196", "0.5940152", "0.59321666", "0.59120435", "0.59110457", "0.59109116", "0.5878612", "0.5846895", "0.5829122", "0.58183515", "0.581784", "0.5811732", "0.58031327", "0.58029747", "0.57748806", "0.576909", "0.57689136", "0.5735584", "0.5728567", "0.5727484", "0.57231975", "0.57095075", "0.5705307", "0.56952024", "0.56917095", "0.56792766", "0.56757236", "0.5670424", "0.5637743", "0.5637743", "0.5634508", "0.5618346", "0.56109697", "0.5603663", "0.55984455", "0.5598323", "0.5596757", "0.55939716", "0.55879337", "0.55773866", "0.5574738", "0.5574255", "0.55733395", "0.5572398", "0.5568216", "0.55625385", "0.5559157", "0.5552461", "0.5549008", "0.5539107", "0.55307263", "0.55269164", "0.5516893", "0.5505375" ]
0.0
-1
$allsyslogfileparsed syslog array $lastlines to show the last elements in the $allsyslogfileparsed (most recent activities)
function showSyslog($allsyslogfileparsed, $lastlines) { $end = 0; if($lastlines==null) { $end = count($allsyslogfileparsed); } else{ $end = $lastlines; } for ($i = 0;$i < $end; $i++) { echo ' <tr>'; echo ' <td>'; echo $allsyslogfileparsed[$i]; echo ' </td>'; echo ' </tr>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function latest_entries()\n\t{\n\t\t// Recursively get a list of log files\n\t\t$logs = Kohana::list_files('logs');\n\n\t\t// Find the month directory name\n\t\t$log_year = array_pop( $logs );\n\t\t$log_month = array_pop( $log_year );\n\n\t\t// Build an array of log entries\n\t\t$entries = array();\n\t\tforeach($log_month as $day => $path)\n\t\t{\n\t\t\t$path = str_replace(APPPATH.'logs/', '', $path);\n\n\t\t\t// Create array of log entries and merge it in\n\t\t\t$entries = array_merge($entries, self::get_entries($path));\n\t\t}\n\n\t\treturn static::format_entries($entries);\n\t}", "protected function getLastLogEntryMessage() {}", "public function get_lastLogs(): string\n {\n // $content is a bin;\n\n $content = $this->_download('logs.txt');\n return $content;\n }", "public function last_entries()\n\t{\n\t\treturn $this->last_entries;\n\t}", "function listLastupdate() {\n //$fileList = glob(\"../blogs/*.md\");\n $fileList = glob(\"blogs/*.md\");\n array_multisort(\n array_map( 'filemtime', $fileList ),\n SORT_NUMERIC,\n SORT_DESC,\n $fileList\n );\n\n $resultList = array();\n\n foreach ($fileList as $filename) {\n $fp = fopen($filename, \"r\");\n $content = fread($fp, filesize($filename));\n fclose($fp);\n\n $contentSplit = explode('---', $content);\n $headers = Yaml::parse($contentSplit[0]);\n\n if( $headers['published'] == 'true' ) {\n $result = new stdClass;\n $result->title = $headers['title'];\n $result->content = Markdown::defaultTransform($contentSplit[1]);;\n $resultList[$filename] = $result;\n }\n }\n return $resultList;\n}", "function read_lastline_from_file($lastRunLog)\n{\n\t$line = '';\n\n\t$f = fopen($lastRunLog, 'r');\n\t$cursor = -1;\n\n \t// Trim trailing newline chars of the file\n \n\twhile ($char === \"\\n\" || $char === \"\\r\") \n\t{\n \tfseek($f, $cursor--, SEEK_END);\n \t$char = fgetc($f);\n\t}\n\n\t\t //Read until the start of file or first newline char\n\n\twhile ($char !== false && $char !== \"\\n\" && $char !== \"\\r\") \n\t{\n\t\t// Prepend the new char\n \t\n \t\t$line = $char . $line;\n \tfseek($f, $cursor--, SEEK_END);\n \t$char = fgetc($f);\n\t}\n\n\treturn $line;\n\t\n}", "public function lastLine(){\n return $this->file[array_key_last($this->file)] ?? '';\n }", "public function getLastLog () {\n return end($this->log);\n }", "public function getDownloadLogNewLines()\n\t{\n\t\treturn(HELPER_getNewLogLines($this->getPoolDir().'/aptDownload.log','getDownloadLogNewLines'.$this->getPoolName()));\n\t}", "public function lastBlog()\n {\n $chapitres = $this->chapitre->getLastBlog();\n $commentaires = $this->comment->lastComments();\n }", "function getFileContentsRaw($file = LACE_FILE)\r\n{\r\n\t$today = date('l');\r\n\t$dayString = '';\r\n $hourString = '';\r\n\t$finalOutput = '';\r\n\r\n\t// Read the file\r\n\t$fileContents = file($file);\r\n\r\n\tif(is_array($fileContents) && count($fileContents) > 0)\r\n\t{\r\n\t\t// We want logfiles in reverse order.\r\n\t\tif ($file != LACE_FILE)\r\n\t\t\t$fileContents = array_reverse($fileContents);\r\n\r\n\t\t// Create the proper HTML for each line\r\n\t\tforeach ($fileContents as $line)\r\n\t\t{\r\n\t\t\t// Turn the record into an array full of info\r\n\t\t\t$line = extractMessageArray($line);\r\n\r\n\t $output = '';\r\n\r\n\t // Check for new Day\r\n\t\t\tif ($file == LACE_FILE)\r\n\t\t\t{\r\n\t\t\t\tif ($line['day'] != $dayString)\r\n\t\t {\r\n\t\t $first = ($dayString == '') ? '*' : '';\r\n\t\t $dayString = $line['day'];\r\n\t\t $output .= 'date-'.$line['timestamp'].'||';\r\n\t\t $output .= $first.$line['date_full'].'||||';\r\n\t\t }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Logfiles don't have multiple days\r\n\t\t\t\tif($hourString == '')\r\n\t\t\t\t\t$output .= 'date||*' . $line['date_full'] . '||||';\r\n\t\t\t}\r\n\r\n // Check for new Hour\r\n if ( ($file == LACE_FILE && $line['day'] == $today\r\n \t&& $line['hour'] != $hourString)\r\n || ($file != LACE_FILE && $line['hour'] != $hourString) )\r\n {\r\n $first = ($hourString == '') ? '*' : '';\r\n \t$hourString = $line['hour'];\r\n \t$output .= 'hour-'.$line['hour'].'||'.$first.$hourString.':00||||';\r\n }\r\n\r\n // Check for Action\r\n $action = ($line['action']) ? '*' : '';\r\n $timestr = ($file == LACE_FILE)\r\n \t? 'Posted about '.$line['age'].' ago at '.$line['time']\r\n \t: $line['time'];\r\n\r\n $output .= $line['timestamp'].'||'.$timestr.'||'.$action.$line['name'];\r\n $output .= '||'.$line['text'].'||||';\r\n\r\n\t\t\t$finalOutput .= $output;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t// $fileContents array is empty\r\n\t{\r\n\t\t$finalOutput .= 'date||*' . date('l, d F Y') . '||||';\r\n\t\t$finalOutput .= time() . '|| ||!Lace||';\r\n\t\t$welcome = ($file == LACE_FILE)\r\n\t\t\t? 'Welcome to '.LACE_SITE_NAME.'. No one has said anything yet.'\r\n\t\t\t: 'The current log is empty.';\r\n\t\t$finalOutput .= (file_exists($file))\r\n\t\t\t? $welcome\r\n\t\t\t: 'Sorry, the file you asked for doesn\\'t exist.';\r\n\t}\r\n\r\n\treturn rtrim($finalOutput, '|');\r\n}", "private function logEntriesInDateRange() {\n\t\t// loop the discovered files\t\t\n\t\tforeach ($this->report['files'] as $file) {\n\t\t\t$handle = @fopen($file, \"r\");\n\t\t\tif ($handle) {\n\t\t\t\twhile (($buffer = fgets($handle, 4096)) !== false) {\n\t\t\t\t\t$this->Log->parseLogLine($buffer);\n\t\t\t\t\t// is it an log entry for the customer of interest?\n\t\t\t\t\tif ($this->Log->logLine['customer'] == $this->report['customer']) {\n\t\t\t\t\t\t// if the log entry is in the specific date range, save it\n\t\t\t\t\t\tif ($this->Log->meta['datetime'] >= $this->report['firstTime'] && $this->Log->meta['datetime'] <= $this->report['finalTime']) {\n\t\t\t\t\t\t\t$this->report['items'][$this->Log->logLine['id']]['Activity'][] = array_merge($this->Log->meta, $this->Log->logLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!feof($handle)) {\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n<br />\";\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}", "public function discoverOldestLogTime() {\n $this->autoRender = FALSE;\n $dir = LOGS.'Inventory/inventory/';\n if (!is_dir($dir)) {\n $dh = new Folder($dir, true, 0755);\n } else {\n $dh = new Folder($dir);\n }\n\n $dh->sort = TRUE;\n $files = $dh->find('.*\\.log');\n if(!empty($files)){\n preg_match('/inventory.(\\d+.\\d+)./', $files[0], $match);\n $this->report['startLimit'] = strtotime(preg_replace('/(\\d+).(\\d+)/','$2/1/$1', $match[1]));\n } else {\n $this->report['startLimit'] = time();\n }\n }", "function getLatestEntries()\n {\n global $_ARRAYLANG;\n\n $this->_objTpl->setTemplate($this->_strPageContent, true, true);\n\n //Show latest XX entries\n $arrEntries = $this->createEntryArray($this->_intLanguageId, 0, intval($this->_arrSettings['blog_block_messages']));\n if (count($arrEntries) > 0 && $this->_objTpl->blockExists('blogBlockEntries')) {\n $intRowClass = 1;\n\n foreach ($arrEntries as $intEntryId => $arrEntryValues) {\n $this->_objTpl->setVariable(array(\n 'TXT_BLOG_ENTRY_CATEGORIES' => $_ARRAYLANG['TXT_BLOG_HOME_CATEGORIES'],\n 'TXT_BLOG_ENTRY_TAGS' => $_ARRAYLANG['TXT_BLOG_HOME_KEYWORDS'],\n 'TXT_BLOG_ENTRY_VOTING' => $_ARRAYLANG['TXT_BLOG_HOME_VOTING'],\n 'TXT_BLOG_ENTRY_COMMENTS' => $_ARRAYLANG['TXT_BLOG_HOME_COMMENTS'],\n 'TXT_BLOG_ENTRY_LINK' => $_ARRAYLANG['TXT_BLOG_HOME_LINK']\n ));\n\n $this->_objTpl->setVariable(array(\n 'BLOG_ENTRY_ROWCLASS' => ($intRowClass % 2 == 0) ? 'row1' : 'row2',\n 'BLOG_ENTRY_ID' => $intEntryId,\n 'BLOG_ENTRY_DATE' => $arrEntryValues['time_created'],\n 'BLOG_ENTRY_AUTHOR_ID' => $arrEntryValues['user_id'],\n 'BLOG_ENTRY_AUTHOR_NAME' => $arrEntryValues['user_name'],\n 'BLOG_ENTRY_SUBJECT' => $arrEntryValues['subject'],\n 'BLOG_ENTRY_POSTED_BY' => $this->getPostedByString($arrEntryValues['user_name'], $arrEntryValues['time_created']),\n 'BLOG_ENTRY_POSTED_BY_ICON' => $this->getPostedByIcon($arrEntryValues['time_created']),\n 'BLOG_ENTRY_INTRODUCTION' => $this->getIntroductionText($arrEntryValues['translation'][$this->_intLanguageId]['content']),\n 'BLOG_ENTRY_CONTENT' => $arrEntryValues['translation'][$this->_intLanguageId]['content'],\n 'BLOG_ENTRY_CATEGORIES' => $this->getCategoryString($arrEntryValues['categories'][$this->_intLanguageId], true),\n 'BLOG_ENTRY_TAGS' => $this->getLinkedTags($arrEntryValues['translation'][$this->_intLanguageId]['tags']),\n 'BLOG_ENTRY_TAGS_ICON' => $this->getTagsIcon(),\n 'BLOG_ENTRY_COMMENTS' => $arrEntryValues['comments_active'].'&nbsp;'.$_ARRAYLANG['TXT_BLOG_HOME_COMMENTS'],\n 'BLOG_ENTRY_VOTING' => '&#216;&nbsp;'.$arrEntryValues['votes_avg'],\n 'BLOG_ENTRY_VOTING_STARS' => $this->getRatingBar($intEntryId),\n 'BLOG_ENTRY_LINK' => '<a href=\"index.php?section=Blog&amp;cmd=details&amp;id='.$intEntryId.'\" title=\"'.$arrEntryValues['subject'].'\">'.$_ARRAYLANG['TXT_BLOG_HOME_OPEN'].'</a>',\n 'BLOG_ENTRY_IMAGE' => ($arrEntryValues['translation'][$this->_intLanguageId]['image'] != '') ? '<img src=\"'.$arrEntryValues['translation'][$this->_intLanguageId]['image'].'\" title=\"'.$arrEntryValues['subject'].'\" alt=\"'.$arrEntryValues['subject'].'\" />' : ''\n ));\n\n $this->_objTpl->parse('blogBlockEntries');\n ++$intRowClass;\n }\n }\n\n //Show overview of categories\n $arrCategories = $this->createCategoryArray();\n\n if (count($arrCategories) > 0 && $this->_objTpl->blockExists('blogBlockCategories')) {\n //Collect active categories for the current language\n $arrCurrentLanguageCategories = array();\n foreach($arrCategories as $intCategoryId => $arrLanguageData) {\n if ($arrLanguageData[$this->_intLanguageId]['is_active']) {\n $arrCurrentLanguageCategories[$intCategoryId] = $arrLanguageData[$this->_intLanguageId]['name'];\n }\n }\n\n //Sort alphabetic\n asort($arrCurrentLanguageCategories);\n\n if (count($arrCurrentLanguageCategories)) {\n foreach($arrCurrentLanguageCategories as $intCategoryId => $strTranslation) {\n $this->_objTpl->setVariable(array(\n 'BLOG_CATEGORY_ID' => $intCategoryId,\n 'BLOG_CATEGORY_NAME' => $strTranslation,\n 'BLOG_CATEGORY_COUNT' => $this->countEntriesOfCategory($intCategoryId)\n ));\n $this->_objTpl->parse('blogBlockCategories');\n }\n }\n }\n\n //Also try to fill the other variables\n if ($this->searchKeywordInContent('BLOG_CALENDAR', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CALENDAR', $this->getHomeCalendar()); }\n if ($this->searchKeywordInContent('BLOG_TAG_CLOUD', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_TAG_CLOUD', $this->getTagCloud()); }\n if ($this->searchKeywordInContent('BLOG_TAG_HITLIST', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_TAG_HITLIST', $this->getHomeTagHitlist()); }\n if ($this->searchKeywordInContent('BLOG_CATEGORIES_SELECT', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CATEGORIES_SELECT', $this->getHomeCategoriesSelect()); }\n if ($this->searchKeywordInContent('BLOG_CATEGORIES_LIST', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CATEGORIES_LIST', $this->getHomeCategoriesList()); }\n\n return $this->_objTpl->get();\n }", "function getLastViewed();", "public function read_last_x_lines_of_log($number_of_lines = 10)\n\t{\n\t\tif(!$this->config->allow_write_to_log) return null;\n\t\t$fp = fopen($this->config->log_location, 'r');\n\n\t\t$idx = 0;\n\t\t$lines = array();\n\t\twhile(($line = fgets($fp)))\n\t\t{\n\t\t\t$lines[$idx] = $line;\n\t\t\t$idx = ($idx + 1) % $number_of_lines;\n\t\t}\n\n\t\t$p1 = array_slice($lines, $idx);\n\t\t$p2 = array_slice($lines, 0, $idx);\n\t\t$ordered_lines = array_merge($p1, $p2);\n\n\t\tfclose($fp);\n\n\t\treturn $ordered_lines;\n\t}", "public static function searchLastLogs( $number )\n {\n $logs = [];\n $req = Database::Select(\"SELECT * FROM log ORDER BY timestamp DESC LIMIT \" . $number);\n\n foreach ($req as $k) {\n\n $log = new self( $k->timestamp, $k->type, $k->content );\n array_push($logs, $log);\n }\n return $logs;\n }", "protected function getLogContentsAfterLastMarker()\n {\n $startTestMarker = 'test marker';\n\n $logContents = file_get_contents($this->findNewestLocalLogfile());\n\n $lastMarkerPosition = strrpos($logContents, $startTestMarker);\n\n $contentsAfterLastMarker = substr($logContents, $lastMarkerPosition);\n\n return $contentsAfterLastMarker;\n }", "public static function fetch_last($num) {\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM log ORDER BY `logid` DESC LIMIT \".intval($num));\n\t\t$query->execute();\n\t\t$rows = $query->fetchAll();\n\t\t$query->closeCursor();\n\t\t$result = array();\n\t\tforeach($rows as $row) {\n\t\t\t$o = new Log();\n\t\t\t$o->logid = $row['logid'];\n\t\t\t$o->time = $row['time'];\n\t\t\t$o->message = $row['message'];\n\t\t\t$o->level = $row['level'];\n\t\t\t$o->entity_path = $row['entity_path'];\n\t\t\t$o->judge_host = $row['judge_host'];\n\t\t\t$o->userid = $row['userid'];\n\t\t\t$o->ip = $row['ip'];\n\t\t\t$result[] = $o;\n\t\t}\n\t\treturn $result;\n\t}", "public function getLastLogCountLines() {\n return json_encode($this->setLastLogCountLines());\n }", "public function getLastNotices(): array\n {\n return $this->notices;\n }", "public function getLastCountsList(){\n return $this->_get(8);\n }", "function outputApplicationLog_JSON($lastNBytes)\n{\n\t$file = getConfigItem(\"logFile\");\n\t\n\t$sizeInBytes = filesize($file);\n\t\n\t$fh = fopen($file, 'r');\n\t\n\t$startBytes = $sizeInBytes - $lastNBytes;\n\tif($startBytes < 0) // start at the beginning if file is shorter than the length requested\n\t\t$startBytes = 0;\n\t\t\n\tfseek($fh, $startBytes);\n\t\n\t$results = array(\"logFileText\" => fread($fh, $lastNBytes));\n//appLog($results);\n\trestTools::sendResponse(json_encode($results), 200, JSON_MIME_TYPE);\n\t\n}", "function econsole_user_complete($course, $user, $mod, $econsole) {\r\n global $CFG;\r\n\r\n if ($logs = get_records_select(\"log\", \"userid='$user->id' AND module='econsole'\r\n AND action='view' AND info='$econsole->id'\", \"time ASC\")) {\r\n $numviews = count($logs);\r\n $lastlog = array_pop($logs);\r\n\r\n $strmostrecently = get_string(\"mostrecently\");\r\n $strnumviews = get_string(\"numviews\", \"\", $numviews);\r\n\r\n echo \"$strnumviews - $strmostrecently \".userdate($lastlog->time);\r\n\r\n } else {\r\n print_string(\"neverseen\", \"econsole\");\r\n }\r\n}", "protected function _show_logs()\n {\n $this->load->model('personallogs_model', 'logs');\n\n // load the text helper\n $this->load->helper('text');\n\n // fetch the last 5 personal logs\n $logs = $this->logs->get_log_list(5);\n\n if ($logs->num_rows() > 0) {\n $i = 1;\n $datestring = $this->options['date_format'];\n\n foreach ($logs->result() as $row) {\n $date = gmt_to_local($row->log_date, $this->timezone, $this->dst);\n\n $items[$i]['id'] = $row->log_id;\n $items[$i]['title'] = $row->log_title;\n $items[$i]['content'] = word_limiter(strip_tags($row->log_content, '<br><br/><br />'), 50);\n $items[$i]['date'] = mdate($datestring, $date);\n $items[$i]['author'] = $this->char->get_character_name($row->log_author_character, true, false, true);\n\n ++$i;\n }\n\n return $items;\n }\n\n return false;\n }", "function getLog(){\n\t\t$limit = 50; \n\t\treturn iterator_to_array( $this->db->log->find()->limit($limit)->sort(array(\"logDate\" => -1 )) );\n\t//db.log.find().limit(5).sort({\"encuesta.fechaCaptura\":-1}).pretty()\n\t}", "public function last(): array\n {\n return $this->single('date DESC');\n }", "public function getLast();", "public function getLast();", "protected function loadLastOpenedPages(): array\n\t{\n\t\treturn \\CUserOptions::GetOption(static::MODULE_ID, static::LAST_OPENED_OPTION_NAME, []);\n\t}", "function tail($filename, $num_lines) {\n $filesize = filesize($filename);\n $file = fopen($filename, \"r\");\n\n // int fseek ( resource $handle , int $offset [, int $whence ] )\n fseek($file, max(0, $filesize - (MAX_LINE_LENGTH * NUM_LINES)));\n $lines = array();\n while (!feof($file)) {\n $line = fgets($file);\n $lines[] = $line;\n }\n // keep only last $num_lines lines\n $last = $lines;\n if (sizeof($lines) > 100) {\n $last = array_slice($lines, -100);\n }\n fclose($file);\n return $last;\n}", "function _final() {\r\n $lines = array();\r\n\r\n foreach ($this->edits as $edit) {\r\n if ($edit->final)\r\n array_splice($lines, sizeof($lines), 0, $edit->final);\r\n }\r\n return $lines;\r\n }", "function printLogList($currentFile)\r\n{\r\n\t// Grab the filenames from the\r\n\t// log directory\r\n\t$recentLogs = array();\r\n\r\n\t$handle = opendir(LACE_LOGDIR);\r\n\twhile ($file = readdir($handle))\r\n\t{\r\n\t\tif($file == '.' || $file == '..' || $file == 'index.php')\r\n\t\t\tcontinue;\r\n\t\t$recentLogs[] = $file;\r\n\t}\r\n\tclosedir($handle);\r\n\r\n\t// Date preparations\r\n\t$today = date('d');\r\n\t$filemtime = filemtime(LACE_LOGFILE);\r\n\t$filedate = date('d', $filemtime);\r\n\r\n\tif ($today == $filedate)\r\n\t\t$day = 'Today';\r\n\telse if (date('d', time()-3600*24) == $filedate)\r\n\t\t$day = 'Yesterday';\r\n\telse\r\n\t\t$day = date('d F', $filemtime);\r\n\r\n\t// Print the list\r\n\t$output = \"<h4>View Logs</h4>\\n\";\r\n\t$output .= '<ul>'.\"\\n\";\r\n\r\n\tif (count($recentLogs) > 0)\r\n\t{\r\n\t\t$class = ($currentFile == LACE_LOGFILE) ? ' class=\"this\"' : '';\r\n\t\t$output .= '<li'.$class.'><a href=\"'.LACE_URL_REL.'logs/\"\r\n\t\t\ttitle=\"View '.$day.'\\'s Log\">'.$day.'</a></li>'.\"\\n\";\r\n\r\n\t\t// We just want the 'date' part of the filenames\r\n\t\t// so we can parse it, and also use it to\r\n\t\t// make pretty URLs\r\n\t\t$currentFile = str_replace('.dat', '', basename($currentFile));\r\n\r\n\t\t// Sort logs most recent first\r\n\t\tsort($recentLogs);\r\n\t\t$recentLogs = array_reverse($recentLogs);\r\n\r\n\t\tforeach($recentLogs as $log)\r\n\t\t{\r\n\t\t\t$log = str_replace('.dat', '', $log);\r\n\r\n\t\t\t// Pick out the date from the filename\r\n\t\t\t$m = substr($log, 0, 2);\r\n\t\t\t$d = substr($log, 2, 2);\r\n\t\t\t$y = substr($log, 4, 4);\r\n\t\t\t$date = date('d F', strtotime(\"$m/$d/$y\"));\r\n\r\n\t\t\t$title = (date('j') - 1 == (int)$d) ? 'Yesterday' : $date;\r\n\t\t\t$class = ($log == $currentFile) ?' class=\"this\"' : '';\r\n\r\n\t\t\t$output .= '<li'.$class.'><a href=\"'.LACE_URL_REL.'logs/';\r\n\t\t\t$output .= LACE_LOGS_DIRIFIED ? $log.'/' : '?date='.$log;\r\n\t\t\t$output .= '\" title=\"View log for '.$title.'\">'.$title.'</a></li>'.\"\\n\";\r\n\t\t}\r\n\t}\r\n\telse\r\n\t\t$output .= '<li>No logs.</li>';\r\n\r\n\t$output .= \"</ul>\\n\";\r\n\r\n\techo $output;\r\n}", "public function getLastEvents(){\n\t\t$sql = \"SELECT\n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color,\n\t\t\t\t\tevent_types.name as type_name\n\t\t\t\tFROM ag_events as events\n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type\n\t\t\t\torder by date_end DESC LIMIT 3;\";\n\t\t$user = $this->runRequest($sql);\n\t\treturn $user->fetchAll();\n\t}", "public function retrieve_last_log($login_id)\n {\n $this->db->where('login_id', $login_id);\n $this->db->order_by('id', 'desc');\n $result = $this->db->get('login_log', 1);\n return $result->row_array();\n }", "public function discoverNewestLogTime() {\n//\t\tdebug(date('F 1, Y', time()) . ' + 1 month -1 day');\n\t\t$this->report['endLimit'] = strtotime(date('F 1, Y', time()) . ' + 1 month -1 day');\n\t}", "protected function getLastPublishDate(): array {\n $lastPublishDate = $this->t('Not available');\n if ($this->node()->isNew()) {\n $lastPublishDate = $this->t('Not saved yet');\n }\n else {\n $revision = $this->nodeRevisionManager->loadLatestPublishedRevision($this->node());\n if (NULL !== $revision) {\n $lastPublishDate = $this->dateFormatter->format($revision->getChangedTime(), 'tieto_date');\n }\n }\n\n return [\n '#type' => 'container',\n '#weight' => 0,\n '#attributes' => [\n 'class' => [\n 'node-meta--last-publish-date',\n ],\n ],\n 'label' => [\n '#type' => 'html_tag',\n '#tag' => 'label',\n '#attributes' => [\n 'class' => [\n 'actions-info-label',\n 'actions-info--last-publish-date--label',\n ],\n ],\n '#value' => $this->t('Last publish date'),\n ],\n 'value' => [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#attributes' => [\n 'class' => [\n 'actions-info-value',\n 'actions-info--last-publish-date--value',\n ],\n ],\n '#value' => $lastPublishDate,\n ],\n ];\n }", "function _versioncontrol_git_log_parse_tags(&$logs) {\n $tags = array();\n while (($line = next($logs)) !== FALSE) {\n $tags[] = $branches[] = substr(trim($line), 51);\n }\n return $tags;\n}", "function leerLogDeFicheroApache() {\n $tama = filesize($this->fichero);\n $mane = fopen($this->fichero, \"rb\");\n $contenidos= fread($mane, $tama);\n\n $lineas = explode(\"\\n\",$contenidos);\n $result = array();\n\n foreach ($lineas as $linea) {\n if (strlen($lineas)!=strlen(eregi_replace(\"FATAL:\",\"\",$lineas))) {\n $result[] = array(_('Linea')=>$linea,_('Error')=>null,_('Tipo')=>_(\"[FATAL]\"),_('Fecha')=>null);\n } else {\n \t//TODO : PROCESAMIENTO DE LOS DATOS DEL LOG DE MYSQL\n $fecha =\"\";\n $error = substr($lineas,26,strlen($linea));\n preg_match(\"[\\[+[a-zA-Z0-9._/ ]+\\]]\", $error, $fecha, PREG_OFFSET_CAPTURE);\n $result[] = array(_('Linea')=>$linea,_('Tama')=>substr($lineas,0,26),_('Error')=>$error,_('Fecha')=>$fecha[0][0]);\n\n }\n }\n fclose($mane);\n return $result;\n }", "public function readMessages( $lastReadMessageDate )\n {\n $messages = $this->getMessages( $lastReadMessageDate, true ) ;\n $_lastReadMessageDate = $lastReadMessageDate ;\n if( count( $messages ) > 0 ) $_lastReadMessageDate = array_values( $messages )[ count( $messages ) - 1][ 'date' ] ;\n $res = [\n 'newMessages' => $messages,\n 'lastReadMessageDate' => $_lastReadMessageDate,\n ] ;\n $this->log( \"==> received \" . count( $messages ) . \" messages after date \" . $lastReadMessageDate . ', last message date is ' . $_lastReadMessageDate, ClLogger::LOG_DEBUG, __METHOD__ ) ;\n return $res ;\n }", "private function most_recently_modified_log_link() {\n\n\t\tglobal $updraftplus;\n\t\tlist($mod_time, $log_file, $nonce) = $updraftplus->last_modified_log();// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable\n\t\t\n\t\t?>\n\t\t\t<a href=\"?page=updraftplus&amp;action=downloadlatestmodlog&amp;wpnonce=<?php echo wp_create_nonce('updraftplus_download'); ?>\" <?php if (!$mod_time) echo 'style=\"display:none;\"'; ?> class=\"updraft-log-link\" onclick=\"event.preventDefault(); updraft_popuplog('');\"><?php _e('Download most recently modified log file', 'updraftplus');?></a>\n\t\t<?php\n\t}", "private function getLastNodes() {\n $last_five_nodes = array();\n if (\\Drupal::moduleHandler()->moduleExists('node')) {\n $result = db_select('node_field_data', 'n')\n ->fields('n', array('title', 'type', 'nid', 'created', 'langcode'))\n ->condition('n.created', REQUEST_TIME - 3600, '>')\n ->orderBy('n.created', 'DESC')\n ->range(0, 15)\n ->execute();\n\n $count = 0;\n foreach ($result as $record) {\n $last_five_nodes[$count]['url'] = \\Drupal::service('path.alias_manager')\n ->getAliasByPath('/node/' . $record->nid, $record->langcode);\n $last_five_nodes[$count]['title'] = $record->title;\n $last_five_nodes[$count]['type'] = $record->type;\n $last_five_nodes[$count]['created'] = $record->created;\n $count++;\n }\n }\n\n return $last_five_nodes;\n }", "public function getLastAudit();", "public function read_log($dt_date=null,$i_user_id=null)\r\n {\r\n try{\r\n $ret_=array();\r\n /**\r\n * Optional date value found then \r\n * Search all XML data for that date and list it\r\n */\r\n if($dt_date && !$i_user_id)\r\n {\r\n $s_log_file=date(\"Y-M\",strtotime($dt_date)).\".bin\";///saved as binary file. ex- 2010-Sep \r\n if(file_exists($this->log_path.$s_log_file))\r\n { \r\n $ret_=$this->read_logxml($this->log_path.$s_log_file,array(\"dt_log\"=>$dt_date));\r\n }\r\n }\r\n else{\r\n ////Get all files in the log directory///\r\n if ($handle = opendir($this->log_path)) \r\n { \r\n $tmp=array();\r\n /* This is the correct way to loop over the directory. */ \r\n while (false !== ($s_log_file = readdir($handle))) \r\n { \r\n if ($s_log_file != \".\" && $s_log_file != \"..\" && $s_log_file != \"index.html\") \r\n { \r\n //echo \"$s_log_file\\n\"; \r\n if($i_user_id)\r\n {\r\n $tmp=$this->read_logxml($this->log_path.$s_log_file,array(\"user_id\"=>$i_user_id)); \r\n $ret_=array_merge($ret_,$tmp);\r\n }\r\n else\r\n {\r\n $tmp=$this->read_logxml($this->log_path.$s_log_file);\r\n $ret_=array_merge($ret_,$tmp);\r\n }\r\n } \r\n \r\n }///end while \r\n\r\n closedir($handle); \r\n } \r\n ////end Get all files in the log directory///\r\n }///end else\r\n unset($dt_date,$i_user_id,$tmp,$handle,$s_log_file);\r\n return $ret_;\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "private function snapshotEntriesInDateRange() {\n\t\tforeach ($this->report['snapshot'] as $file) {\n\t\t\t$handle = @fopen($file, \"r\");\n\t\t\tif ($handle) {\n\t\t\t\twhile (($buffer = fgets($handle, 4096)) !== false) {\n\t\t\t\t\t$this->Log->parseLogLine($buffer);\n\t\t\t\t\t// is it an log entry for the customer of interest?\n\t\t\t\t\tif ($this->Log->logLine['customer'] == $this->report['customer']) {\n\t\t\t\t\t\t// if the log entry is in the specific date range, save it\n//\t\t\t\t\t\t\t$this->ddd($this->Log->meta, 'pre');\n//\t\t\t\t\t\tif ($this->Log->meta['datetime'] >= $this->report['firstTime'] && $this->Log->meta['datetime'] <= $this->report['finalTime']) {\n//\t\t\t\t\t\t\t$this->ddd($this->Log->meta, 'post');\n\t\t\t\t\t\t$this->report['items'][$this->Log->logLine['id']]['Snapshot'][] = array_merge($this->Log->meta, $this->Log->logLine);\n//\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!feof($handle)) {\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n<br />\";\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}", "public function get_recent_visitors_log() {\n\t\t$current_log = get_option(self::$ROLES_LOG_KEY);\n\t\t$current_log = $current_log ? json_decode($current_log, true) : array();\n\n\t\tif (!empty($current_log)) {\n\t\t\tglobal $wp_roles;\n\t\t\t$roles = $wp_roles->get_names();\n\t\t\t$roles['guest'] = __('Guest', 'minerva-kb');\n\n\t\t\t$current_log = array_map(function($entry) use ($roles) {\n\t\t\t\t$entry_roles = array_map(function($role) use ($roles) {\n\t\t\t\t\treturn isset($roles[$role]) ? $roles[$role] : $role; // replace keys with names, if available\n\t\t\t\t}, explode('%', $entry));\n\n\t\t\t\treturn implode('/', $entry_roles);\n\t\t\t}, $current_log);\n\t\t}\n\n\t\treturn $current_log;\n\t}", "public function last()\n {\n $last_posts = $this->posts_manager->listLasts(10);\n $this->render('last-posts', ['head'=>['title'=>'Les derniers articles', 'meta_description'=>''], 'page'=>'derniers-articles', 'last_posts'=>$last_posts]);\n }", "public function retrieve_new_log($limit = 10)\n {\n $this->db->order_by('lasttime', 'desc');\n $results = $this->db->get('login_log', $limit);\n return $results->result_array();\n }", "public function getLastPost() {\r\n $db = $this->dbConnect();\r\n $req = $db->query('SELECT id, title, content,adress_street, adress_city, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%imin%ss\\') AS date_creation_fr FROM articles ORDER BY date_creation DESC LIMIT 0, 1');\r\n\r\n return $req->fetchAll();\r\n }", "public static function parse($file) \n\t{\n $lines = file($file);\n\n $file_tmp = '';\n for($i=2;$i<count($lines);$i++) {\n $file_tmp .= $lines[$i];\n }\n\n\t\t$delimiter = \"***\";\n\n\t\t// Get the log file and remove the first 2 lines\n\t\t$log = str_replace(Kohana::FILE_SECURITY.\" ?>\".PHP_EOL.PHP_EOL, \"\", $file_tmp);\n\t\t$log = preg_replace(self::$date_regex, \"$delimiter\\\\0\", $log);\n\t\t$log = preg_split('/'.preg_quote($delimiter).'/', ltrim($log, $delimiter));\n\n\t\t$parsed = array();\n\n\t\tfor ($i = 0, $len = count($log); $i < $len; $i += 1)\n\t\t{\n\t\t\t$row = $log[$i];\n\n $data = self::split_entry($row);\n\n // And check for an error (which will have a stack trace)\n if ($data['type'] === 'error')\n {\n // Grab the next element in the array which contains the stack trace\n $i += 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isset($log[$i])){\n\t\t\t\t\t\t\t\t\t$strace = self::split_entry($log[$i]);\n\t\n\t\t\t\t\t\t\t\t\t//list($row, $trace) = explode(\"--\", $strace['log']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$tmp_tab = explode(\"--\", $strace['log']);\n\t\t\t\t\t\t\t\t\tif(isset($tmp_tab[1])) $trace = $tmp_tab[1]; else $trace = '';\n\t \n\t\t\t\t\t\t\t\t\t//$data['stacktrace'] = explode(PHP_EOL, rtrim($trace, PHP_EOL));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$trace = '';\n\t\t\t\t\t\t\t\t}\n $data['stacktrace'] = $trace;\n }\n\n $last_type = $data['type'];\n\n // And set the message\n $data['message'] = $data['log'];\n\n $parsed[] = $data;\n\t\t}\n\n return $parsed;\n\n\t}", "public function getLatest() {\n $db = new DataBase();\n\n $sql = 'SELECT * FROM AdminLog ORDER BY createdAt DESC LIMIT 100';\n\n $results = $db->select($sql);\n\n $adminLogs = array();\n foreach($results as $result) {\n $adminLog = new AdminLog();\n $adminLog->id = $result['id'];\n $adminLog->userID = $result['userID'];\n $adminLog->remoteAddr = $result['remoteAddr'];\n $adminLog->requestURI = $result['requestURI'];\n $adminLog->queryString = $result['queryString'];\n $adminLog->requestMethod = $result['requestMethod'];\n $adminLog->referer = $result['referer'];\n $adminLog->createdAt = $result['createdAt'];\n $adminLogs[] = $adminLog;\n }\n\n return $adminLogs;\n }", "function manynewposts_thread() {\n global $thread, $templates, $db, $mybb, $settings;\n\n $query = $db->query(\"\n SELECT\n dateline, pid\n FROM \" . TABLE_PREFIX . \"posts\n WHERE\n tid='\".$db->escape_string($thread['tid']).\"'\n \");\n\n $lastpost = array();\n $lastpost_pid = array();\n\n while($result=$db->fetch_array($query))\n {\n $lastpost[] = $result['dateline'];\n $lastpost_pid[$result['dateline']] = $result['pid'];\n }\n\n $query = $db->query(\"\n SELECT\n tr.dateline AS `tr_dateline`,\n fr.dateline AS `fr_dateline`\n FROM \" . TABLE_PREFIX . \"posts p\n LEFT JOIN\n \" . TABLE_PREFIX . \"threadsread tr\n ON\n tr.tid = p.tid\n LEFT JOIN\n \" . TABLE_PREFIX . \"forumsread fr\n ON\n fr.fid = p.fid\n WHERE\n tr.uid='\".$db->escape_string($mybb->user['uid']).\"' and\n fr.uid='\".$db->escape_string($mybb->user['uid']).\"'\n \");\n\n $userlastview = array();\n $userlastview_forum = array();\n\n while($result=$db->fetch_array($query))\n {\n $userlastview[] = $result['tr_dateline'];\n $userlastview_forum[] = $result['fr_dateline'];\n }\n\n $userlastview = (count($userlastview) > 0) ? max($userlastview) : 0;\n $userlastview_forum = (count($userlastview_forum) > 0) ? max($userlastview_forum) : 0;\n\n $timelimit = $userlastview + ($settings['threadreadcut'] * 24 * 60 * 60);\n $newlastpost = array();\n\n if($userlastview && $timelimit > TIME_NOW) {\n foreach ($lastpost as $lastpost_number) {\n if($lastpost_number > $userlastview_forum && $lastpost_number > $userlastview) {\n $newlastpost[] = $lastpost_number;\n }\n }\n }\n\n $count = count($newlastpost);\n\n if($count == 0) return;\n\n $posts = $count == 1 ? 'post':'posts';\n\n $lastseenpost_pid = $lastpost_pid[min($newlastpost)];\n $manynewposts = \"\";\n\n if($mybb->user['uid']) {\n if($count > 0) {\n $manynewposts = $templates->get('manynewposts');\n $manynewposts = str_replace(\"{newposts_link}\", \"./showthread.php?tid=\".$thread['tid'].\"&pid=\".$lastseenpost_pid.\"#pid\".$lastseenpost_pid, $manynewposts);\n $manynewposts = str_replace(\"{newposts}\", $count, $manynewposts);\n $manynewposts = str_replace(\"{posts}\", $posts, $manynewposts);\n }\n }\n $thread['manynewposts'] = $manynewposts;\n}", "public function getLastResponse()\r\n\t{\r\n\t\treturn array('headers' => $this->response_headers[count($this->response_headers)-1],\r\n\t\t'content' => $this->response_content);\r\n\t}", "function extractTargetedLines(){\r\n\tglobal $indir, $outdir, $infile, $bUseInputFile, $outfile, $separator;\r\n\tglobal $logfile, $failureLog, $sampleURL, $wgetWait;\r\n\tglobal $numStartQuery, $numQueryLimit;\r\n\tglobal $lineArray, $numLines, $targetLines, $numTargets; //array, values are set in calling script\r\n\r\n\t$strDebug = $separator . \"extractTargetedLines()\\n\";\r\n\r\n\tfillFileArrays(); //sets array contents and counts\r\n\r\n\t$strDebug .= \"\\nextractTargetedLines has input from: \" . $infile . \", has \" . $numLines . \" lines\\noutput to: \" . $outfile . \"\\n...next is loop\\n\";\r\n\techo $strDebug;\r\n\t//appendFile( $logfile, $strDebug );\r\n\r\n\tfor($c = 0; $c < $numLines; $c++){\r\n\t\t$data = \"\";\r\n\t\t$strDebug = \"\\nline \" . $c . \") \" . $lineArray[$c];\r\n\t\t//echo $strDebug;\r\n\t\tfor($p = 0; $p < $numTargets; $p++){\r\n\r\n\t\t\t/*\r\n\t\t\t//DEBUGGING\r\n\t\t\t$tPos = strpos($lineArray[$c], $targetLines[$p]);\r\n\t\t\t$bPos = ($tPos > -1);\r\n\t\t\techo \"\\n\\tposition of '\" . $targetLines[$p] . \"' in '\" . $lineArray[$c] . \"' is '\" . $tPos . \"', and bPos is now '\" . $bPos . \"'\";\r\n\t\t\t//UNCOMMENT FOR DEBUGGING\r\n\t\t\t*/\r\n\r\n\t\t\tif (strpos($lineArray[$c], $targetLines[$p]) != 0){ //USE THIS CONDITION IN LCchonAmerica/extractGenealogy functions\r\n\t\t\t//if (strpos($lineArray[$c], $targetLines[$p]) != 0){ //USE THIS CONDITION IN LCchonAmerica/extractHoldings functions\r\n\t\t\t//if (strpos($lineArray[$c], $targetLines[$p]) > -1){ //USE THIS CONDITION IN WNA/extractPubIDs: THIS MIGHT BREAK THE LCchonAmerica/extractHoldings functions\r\n\t\t\t\t$strDebug .= \"target \" . $p . \", \" . $targetLines[$p]. \" FOUND IN: \" . $lineArray[$c] . \"\\n\";\r\n\t\t\t\techo $strDebug;\r\n\r\n\t\t\t\t//$data = trim($lineArray[$c]) . \"\\n\";\r\n\t\t\t\t$data = $lineArray[$c];\r\n\t\t\t\t$data = preg_replace( '/ +/', ' ', $data); //this doesn't actually work to replace multiple spaces\r\n\r\n\t\t\t\t/*****************************************************************\r\n\t\t\t\t//force reading ahead to multiple lines of data (all data between targeted lines)\r\n\t\t\t\t\t- this section was pretty specialized for extractHoldings_step1.php but as long as nothing else matches readingBgnTag etc, is fine to use\r\n\t\t\t\t\t- for extractHoldings,\r\n\t\t\t\t*/\r\n\r\n\t\t\t\t\t/* //to get HOLDINGS dates\r\n\t\t\t\t\t$readingBgnTag = \"<ul class=\";\r\n\t\t\t\t\t$readingEndTag = \"</ul>\";\r\n\t\t\t\t\t*/\r\n\r\n\t\t\t\t/* //to get GENEALOGY info */\r\n\t\t\t\t$readingBgnTag = $targetLines[$p];\r\n\t\t\t\t$readingEndTag = \"</datafield>\";\r\n\r\n\r\n\t\t\t\t$bgnTagPos = strpos($lineArray[$c], $readingBgnTag );\r\n\t\t\t\t$strDebug .= \"\\tbgnTagPos start ='\" . $bgnTagPos . \"' in lineArray[\" . $c . \"] '\" . $lineArray[ $c ] . \"' \\n\";\r\n\t\t\t\tif ( $bgnTagPos > -1 ){ //force reading ahead for data between start and end strings\r\n\t\t\t\t\t$h = $c + 1; // next line index\r\n\t\t\t\t\t$strDebug .= \"\\nINTO THE IF with lineArray[h=\" . $h . \"], value:'\" . $lineArray[$h] . \"'\\n\";\r\n\r\n\t\t\t\t\tdo {\r\n\t\t\t\t\t\t$data .= $lineArray[$h];\r\n\t\t\t\t\t\t$endTagPos \t= strpos($lineArray[$h], $readingEndTag);\r\n\t\t\t\t\t\t$strDebug .= \"\\n\\t\\tDO - WHILE in lineArray[h=\" . $h . \"],\\t data=\" . $data . \",\\t...endTagPos=\" . $endTagPos;\r\n\t\t\t\t\t\tif ( $endTagPos > -1 ){ //we found readingEndTag\r\n\t\t\t\t\t\t\t$h = $numLines+1; //exit loop on next check\r\n\t\t\t\t\t\t\t$strDebug .= \"\\nendTagPos matched empty string: Now exit while: h=\" . $h . \", numLines=\" . $numLines . \", data='\" . $data . \"',\\t...\";\r\n\t\t\t\t\t\t\t$c++;\t//advance outer loop to get past targeted data area + continue with rest of file\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\techo $strDebug;\r\n\t\t\t\t\t\t//appendFile( $logfile, $strDebug );\r\n\t\t\t\t\t\t$h++;\r\n\t\t\t\t\t} while ($h < $numLines); //end do-while\r\n\t\t\t\t\t$strDebug .= \"\\nending the IF h=\" . $h . \",\\t data='\" . $data . \"',\\t...\";\r\n\t\t\t\t}//end if\r\n\t\t\t\t/*\r\n\t\t\t\t//force reading ahead for data between start and end strings\r\n\t\t\t\t*****************************************************************/\r\n\r\n\r\n\t\t\t//takeNap( 2 );\r\n\t\t\t//appendFile( $logfile, $strDebug );\r\n\t\t\t}//end if targetLines found\r\n\t\t}//end for each item in targetLines array\r\n\r\n\t\t$lineLength = strlen($data);\r\n\t\techo \"\\nline \" . $c . \") \" . $data;\r\n\t\tif (($data != \"\") && ($lineLength != 0)){\r\n\t\t\tappendFile( $outfile, $data );\r\n\t\t}\r\n\r\n\t\t//appendFile( $logfile, $strDebug . $separator );\r\n\r\n\t}//end for each line infile\r\n\techo $separator . $strDebug;\r\n}", "function econsole_user_outline($course, $user, $mod, $econsole) {\r\n if ($logs = get_records_select(\"log\", \"userid='$user->id' AND module='econsole'\r\n AND action='view' AND info='$econsole->id'\", \"time ASC\")) {\r\n\r\n $numviews = count($logs);\r\n $lastlog = array_pop($logs);\r\n\r\n $result = new object();\r\n $result->info = get_string(\"numviews\", \"\", $numviews);\r\n $result->time = $lastlog->time;\r\n\r\n return $result;\r\n }\r\n return NULL;\r\n}", "protected function saveLastOpenedPages(array $lastOpenedPages): void\n\t{\n\t\t\\CUserOptions::SetOption(static::MODULE_ID, static::LAST_OPENED_OPTION_NAME, $lastOpenedPages);\n\t}", "function getOldFileReports(&$user, &$timestamp)\n {\n return $this->db->query(\"SELECT user, last_mod, filesystem, value, `path` FROM offenders WHERE `timestamp` = ? AND user = ? AND noticeType = 'oldfile' ORDER BY value DESC\",array($timestamp,$user));\n\n }", "public function get_last_ten_entries()\r\n\t{\r\n\t\t$query = $this->db->get(\"email_workflow\", 10);\r\n\r\n\t\treturn $query->result();\r\n\t}", "public function getLogs() {\n\t\tif(check($this->_identifier)) {\n\t\t\tif($this->_limit > 0) {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" WHERE `log_identifier` = ? ORDER BY `log_id` DESC LIMIT ?\", array($this->_identifier, $this->_limit));\n\t\t\t} else {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" WHERE `log_identifier` = ? ORDER BY `log_id` DESC\", array($this->_identifier));\n\t\t\t}\n\t\t} else {\n\t\t\tif($this->_limit > 0) {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" ORDER BY `log_id` DESC LIMIT ?\", array($this->_limit));\n\t\t\t} else {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" ORDER BY `log_id` DESC\");\n\t\t\t}\n\t\t}\n\t\tif(is_array($result)) return $result;\n\t}", "public function getLastImported() {\n $last_imported = db_select('migrate_log', 'ml')\n ->fields('ml', array('endtime'))\n ->condition('machine_name', $this->machineName)\n ->isNotNull('endtime')\n ->orderBy('endtime', 'DESC')\n ->execute()\n ->fetchField();\n if ($last_imported) {\n $last_imported = date('Y-m-d H:i:s', $last_imported/1000);\n }\n else {\n $last_imported = '';\n }\n return $last_imported;\n }", "public static function getLastExecutedLines($length = NULL) {\r\n\t\t$dbgTrace = debug_backtrace();\r\n\t\t\r\n\t\tif($length == NULL) {\r\n\t\t\t$length = count($dbgTrace);\r\n\t\t} else {\r\n\t\t\t$length = min($length + 1, count($dbgTrace));\r\n\t\t}\r\n\t\t\r\n\t\t$lines = array();\r\n\t\tfor($dbgIndex = 1; $dbgIndex < $length; $dbgIndex++) {\r\n\t\t\t$dbgInfo = $dbgTrace[$dbgIndex];\r\n\t\t\t\r\n\t\t\t$lines[] = array('line' => $dbgInfo['line'],\r\n\t\t\t\t\t\t\t 'file' => $dbgInfo['file']);\r\n\t\t}\r\n\t\treturn $lines;\r\n\t}", "function getLastFound($lastFound)\n{\n\n $f = fopen(FOUND_FILE, 'r');\n if(!is_resource($f))\n throw new Exception(\"Error: can't open file \" . FOUND_FILE . \"!\");\n\n $matches = array();\n while( ($line = fgets($f)) !== false)\n $matches[] = $line;\n\n fclose($f);\n\n if(count($matches) < $lastFound)\n return false;\n else\n return $matches;\n}", "function getLastRecords($iLimit = 3) {\n $sRecords = '';\n $aRecords = $GLOBALS['MySQL']->getAll(\"SELECT * FROM `s178_guestbook` ORDER BY `id` DESC LIMIT {$iLimit}\");\n foreach ($aRecords as $i => $aInfo) {\n $sWhen = date('F j, Y H:i', $aInfo['when']);\n $sRecords .= <<<EOF\n<div class=\"record\" id=\"{$aInfo['id']}\">\n <p>Record from {$aInfo['name']} <span>({$sWhen})</span>:</p>\n <p>{$aInfo['description']}</p>\n</div>\nEOF;\n }\n return $sRecords;\n}", "function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {\n\tglobal $wpdb;\n\n\tif ( ! empty( $deprecated ) )\n\t\t_deprecated_argument( __FUNCTION__, 'MU' ); // never used\n\n\treturn $wpdb->get_results( $wpdb->prepare( \"SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d\", get_current_network_id(), $start, $quantity ), ARRAY_A );\n}", "public function get_access_log($date_arr = array())\n {\n $log_array = array();\n $access_log_folder = $this->config->item('admin_access_log_path');\n foreach ($date_arr as $value) {\n $log_floder = $access_log_folder . $value.\"/\";\n $file = $log_floder . \"log-ws.txt\";\n if (is_file($file)) {\n $file = fopen($file, \"r\");\n $i = 0;\n while (!feof($file)) {\n $line[$i] = array_diff_key(explode('~~', fgets($file)), [2 => '', 4 => '', 5 => '']);\n\n //assigning keys to log array\n $flipped = array_flip($line[$i]);\n foreach ($flipped as $k => $v) {\n $flipped[$k] = ($v === 0 ? 'vIPAddress' : ($v === 1 ? 'vRequestUri' : ($v === 3 ? 'dAccessDate' : ($v === 6 ? 'vPlatform' : ($v === 7 ? 'vBrowser' : ($v === 8 ? 'tInputParams' : $v))))));\n }\n $corrected[] = array_flip($flipped);\n $i++;\n }\n $log_array[$value] = array_filter(array_map('array_filter', $corrected));\n unset($corrected);\n }\n }\n return $log_array;\n }", "function conv_log_filter_lite($logfile, $nentries, $tail, $pfbdenycnt, $pfbpermitcnt, $pfbmatchcnt) {\n\tglobal $pfb, $rule_list, $filterfieldsarray;\n\t$fields_array\t= array();\n\t$denycnt\t= $permitcnt = $matchcnt = 0;\n\t$logarr\t\t= '';\n\n\tif (file_exists($logfile)) {\n\t\t// Collect filter.log entries\n\t\texec(\"/usr/local/sbin/clog {$logfile} | {$pfb['grep']} -v '\\\"CLOG\\\"\\|\\\"\\033\\\"' | {$pfb['grep']} 'filterlog:' | /usr/bin/tail -r -n {$tail}\", $logarr);\n\t} else {\n\t\t return;\n\t}\n\n\tif (!empty($logarr) && !empty($rule_list['id'])) {\n\t\tforeach ($logarr as $logent) {\n\n\t\t\t$pfbalert\t= array();\n\t\t\t$flog\t\t= explode(' ', $logent);\n\t\t\t// Remove 'extra space' from single date entry (days 1-9)\n\t\t\tif (empty($flog[1])) {\n\t\t\t\tarray_splice($flog, 1, 1);\n\t\t\t}\n\t\t\t$rule_data\t= explode(',', $flog[5]);\n\n\t\t\t// Skip alert if rule is not a pfBNG alert\n\t\t\tif (!in_array($rule_data[3], $rule_list['id'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$pfbalert[0]\t\t= $rule_data[3];\t// Rulenum\n\t\t\t$pfbalert[1]\t\t= $rule_data[4];\t// Realint\n\t\t\t$pfbalert[3]\t\t= $rule_data[6];\t// Act\n\t\t\t$pfbalert[4]\t\t= $rule_data[8];\t// Version\n\n\t\t\tif ($pfbalert[4] == 4) {\n\t\t\t\t$pfbalert[5]\t= $rule_data[15];\t// Protocol ID\n\t\t\t\t$pfbalert[6]\t= $rule_data[16];\t// Protocol\n\t\t\t\t$pfbalert[7]\t= $rule_data[18];\t// SRC IP\n\t\t\t\t$pfbalert[8]\t= $rule_data[19];\t// DST IP\n\t\t\t\t$pfbalert[9]\t= $rule_data[20];\t// SRC Port\n\t\t\t\t$pfbalert[10]\t= $rule_data[21];\t// DST Port\n\t\t\t\t$pfbalert[11]\t= $rule_data[23];\t// TCP Flags\n\t\t\t} else {\n\t\t\t\t$pfbalert[5]\t= $rule_data[13];\t// Protocol ID\n\t\t\t\t$pfbalert[6]\t= $rule_data[12];\t// Protocol\n\t\t\t\t$pfbalert[7]\t= $rule_data[15];\t// SRC IP\n\t\t\t\t$pfbalert[8]\t= $rule_data[16];\t// DST IP\n\t\t\t\t$pfbalert[9]\t= $rule_data[17];\t// SRC Port\n\t\t\t\t$pfbalert[10]\t= $rule_data[18];\t// DST Port\n\t\t\t\t$pfbalert[11]\t= $rule_data[20];\t// TCP Flags\n\t\t\t}\n\n\t\t\tif ($pfbalert[5] == 6 || $pfbalert[5] == 17) {\n\t\t\t\t// skip\n\t\t\t} else {\n\t\t\t\t$pfbalert[9] = $pfbalert[10] = $pfbalert[11] = '';\n\t\t\t}\n\n\t\t\t$pfbalert[99] = \"{$flog[0]} {$flog[1]} {$flog[2]}\"; // Date/Timestamp\n\n\t\t\t// Skip repeated alerts \n\t\t\tif (\"{$pfbalert[1]}{$pfbalert[3]}{$pfbalert[7]}{$pfbalert[8]}{$pfbalert[10]}\" == $previous_alert) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$pfbalert[2] = convert_real_interface_to_friendly_descr($rule_data[4]);\t\t\t\t\t// Friendly Interface Name\n\t\t\t$pfbalert[6] = str_replace('TCP', 'TCP-', strtoupper($pfbalert[6]), $pfbalert[6]) . $pfbalert[11];\t// Protocol Flags\n\n\t\t\t// If alerts filtering is selected, process filters as required.\n\t\t\tif ($pfb['filterlogentries'] && !pfb_match_filter_field($pfbalert, $filterfieldsarray)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($pfbalert[3] == 'block') {\n\t\t\t\tif ($denycnt < $pfbdenycnt) {\n\t\t\t\t\t$fields_array['Deny'][] = $pfbalert;\n\t\t\t\t\t$denycnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($pfbalert[3] == 'pass') {\n\t\t\t\tif ($permitcnt < $pfbpermitcnt) {\n\t\t\t\t\t$fields_array['Permit'][] = $pfbalert;\n\t\t\t\t\t$permitcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($pfbalert[3] == 'unkn(%u)') {\n\t\t\t\tif ($matchcnt < $pfbmatchcnt) {\n\t\t\t\t\t$fields_array['Match'][] = $pfbalert;\n\t\t\t\t\t$matchcnt++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Exit function if sufficinet matches found.\n\t\t\tif ($denycnt >= $pfbdenycnt && $permitcnt >= $pfbpermitcnt && $matchcnt >= $pfbmatchcnt) {\n\t\t\t\tunset($pfbalert, $logarr);\n\t\t\t\treturn $fields_array;\n\t\t\t}\n\n\t\t\t// Collect details for repeated alert comparison\n\t\t\t$previous_alert = \"{$pfbalert[1]}{$pfbalert[3]}{$pfbalert[7]}{$pfbalert[8]}{$pfbalert[10]}\";\n\t\t}\n\t\tunset($pfbalert, $logarr);\n\t\treturn $fields_array;\n\t}\n}", "function _versioncontrol_git_log_parse_branches(&$logs) {\n $branches = array();\n while (($line = next($logs)) !== FALSE) {\n $branches[] = substr(trim($line), 52);\n }\n return $branches;\n}", "public function getnewevents_allforadded($userid, $lastemail, $ignoreminordocuments) {\n\t\t// first get all events for subjects added after last emailing\n\t\t$this->isirdb->where('users_watches.date_add > \"'. $lastemail .'\"', '', false);\n\n\t\tif ($ignoreminordocuments == true) {\n\t\t\t$this->isirdb->where('spis_data.is_document_minor', false);\n\t\t}\n\t\t\n\t\t$this->_prepareNewEventsSelect($userid, false, false);\n\n\t\t$tempNewlyAdded = $this->isirdb->get('users_watches')->result_array();\n\n\t\t// then get changes since the last emailing for subjects added before last emailing\n\t\t$this->isirdb->where('spis_data.publishdate > \"'. $lastemail .'\"', '', false);\n\n\t\tif ($ignoreminordocuments == true) {\n\t\t\t$this->isirdb->where('spis_data.is_document_minor', false);\n\t\t}\n\n\t\t$this->isirdb->order_by('spis_data.publishdate');\n\t\t$this->_prepareNewEventsSelect($userid, false, true);\n\n\t\t$temp = $this->isirdb->get('users_watches')->result_array();\n\t\t\n\t\treturn $this->_mergeEvents($tempNewlyAdded, $temp);\n\t}", "protected function readLog()\n\t{\n\n\t $smart = Params::get('smart');\n\n\t\tforeach ($this->reader->getLines() as $entry)\n\t\t{\n\n\t\t\t$entry = Model_LogParser::parseLogEntry(\n\t\t\t\t$entry,\n\t\t\t\t$this->log_info['current_timezone'],\n\t\t\t\t$this->log_info['to_timezone'],\n\t\t\t\t$this->log_info['dateformat'],\n $smart\n\t\t\t);\n\n\t\t\t// Parse entry\n\t\t\tif (!$entry)\n\t\t\t\tcontinue;\n\n\t\t\t// Ignore levels\n\t\t\tif (!empty($this->log_info['ignore_levels']) && in_array($entry['level'], $this->log_info['ignore_levels']))\n\t\t\t\tcontinue;\n\n\t\t\t// Add hostname\n\t\t\t$entry['hostname'] = $this->log_info['hostname'];\n\n\t\t\t// Display entries when verbose mode is used\n\t\t\tif ($this->log_info['verbose'])\n\t\t\t\t$this->console->json($entry);\n\n\n\t\t\t// Send to sender\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->sender->send($this->log_info['index'], $entry);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$this->console->error('Unable to send logs ' . $e->getMessage());\n\t\t\t}\n\n\t\t}\n\n\n\t}", "function actionParse( $date, $logs ) {\n\t\tglobal $content;\n\t\t\n\t\tif( strlen( $date ) == 5 ) {\n\t\t\t$parseddate = '0' . substr( $date, 0, 1 ) . '/' . substr( $date, 1 );\n\t\t}\n\t\telse {\n\t\t\t$parseddate = substr( $date, 0, 2 ) . '/' . substr( $date, 2 );\n\t\t}\n\t\t\n\t\t$ret = $content->get_config_vars( 'duringdate', $parseddate );\n\t\t\n\t\t$ret .= \"<ul>\";\n\t\t\n\t\tforeach( $logs as $type => $count ) {\n\t\t\tswitch( $type ) {\n\t\t\t\tcase 'modify':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmodify', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'protect':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphprotect', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'unprotect':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphunprotect', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmove' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move_redir':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmoveredir' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move_prot':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmoveprot' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphdelete' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'restore':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphundelete' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$ret .= \"</ul>\";\n\t\t\n\t\treturn htmlentities( $ret );\n\t\n\t}", "public function getLastLine()\n {\n $buffer = $this->getBuffer();\n $lines = preg_split('/\\r\\n|\\r|\\n/', $buffer);\n return array_pop($lines);\n }", "public function getLastFiles()\n {\n echo json_encode($this->galery->getLastFiles());\n }", "private final function logLastWSResponse() {\t\n\t\t\n\t\tprint \"\\n\\nResponse Header: \\n\". $this->__getLastResponseHeaders();\n\t\tprint \"\\nResponse: \\n\". $this->__getLastResponse().\"\\n\";\t\t\n\t}", "public static function getLastRunEnd(array $definition) {\n $state = \\Drupal::state();\n $key = self::getStateKey($definition) . '.end';\n return $last = $state->get($key, 0);\n }", "public function selectLastNews()\n {\n $query = \"SELECT description FROM \" . static::TABLE . \" ORDER BY news_date ASC LIMIT 3\";\n\n return $this->pdo->query($query)->fetchAll();\n }", "public function getLastItem() {}", "public function getLastItem() {}", "public function getLastLog() {\n return json_encode($this->setLastLog());\n }", "public function getLogs()\n {\n $lines = array();\n foreach ($this->logs as $l)\n $lines[] = $l[0] . \" \" . Logger::fillPlaceholders($l[1], $l[2]);\n $this->logs = array();\n return $lines;\n }", "protected function getInfoLastUpdated(): array {\n return [\n '#type' => 'container',\n '#weight' => 1,\n '#attributes' => [\n 'class' => [\n 'actions-info--last-update',\n ],\n ],\n 'label' => [\n '#type' => 'html_tag',\n '#tag' => 'label',\n '#attributes' => [\n 'class' => [\n 'actions-info-label',\n 'actions-info--last-update--label',\n ],\n ],\n '#value' => $this->t('Last update'),\n ],\n 'value' => [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#attributes' => [\n 'class' => [\n 'actions-info-value',\n 'actions-info--last-update--value',\n ],\n ],\n '#value' => $this->dateFormatter->format($this->node()->getChangedTime(), 'tieto_date'),\n ],\n ];\n }", "function readLog()\n {\n $file = fopen(\"../log.txt\", \"r\");\n\n while (!feof($file)) {\n $text = fgets($file);\n $line = explode('_', $text);\n\n if (isset($line[1])){\n if (!isset($log[$line[0]]))\n $log[$line[0]] = [];\n\n array_push($log[$line[0]], $line[1]);\n }\n }\n\n fclose($file);\n\n return $log;\n }", "public static function getPostLastList()\n {\n $db = Db::getConnection();\n $PostLastList = [];\n\n $result = $db->query('SELECT id_publ, name, text, author, date, number_of_comments \n FROM publication ORDER BY date DESC LIMIT 5');\n\n $i = 0;\n while($row = $result->fetch()) {\n $PostLastList[$i]['id_publ'] = $row['id_publ'];\n $PostLastList[$i]['name'] = $row['name'];\n $PostLastList[$i]['date'] = $row['date'];\n $PostLastList[$i]['text'] = $row['text'];\n $PostLastList[$i]['author'] = $row['author'];\n $PostLastList[$i]['number_of_comments'] = $row['number_of_comments'];\n $i++;\n }\n\n return $PostLastList;\n }", "public function getLastPage() {}", "public function getStatusLogMessages() {\n foreach($this->statusLogs as $log) {\n $log = explode(\",\", $log);\n $logMessage = &$log[0];\n $logTimestamp = &$log[1];\n $this->statusLogMessages[] = array($this->statusTemplates[ $logMessage ], date(\"Y:m:d h:i:s\", $logTimestamp));\n }\n\n return $this->statusLogMessages;\n }", "protected function postProcessLog( array $logs )\n {\n return $logs;\n }", "static public function logAll()\r\n\t{\r\n\t\t$db = false; $origin = __CLASS__.'::'.__FUNCTION__;\r\n\t\t$lines = func_get_args();\r\n\t\tif ($db) {\r\n\t\t\tvar_dump($origin, 'LINES', $lines, 'COUNT', count($lines) );\r\n\t\t}\r\n\t\tif (1 > count($lines) ) { // aucun argument !\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$tab = array();\r\n\t\t$last = count($lines)-1;\r\n\r\n\t\t$priorities = self::getPriorities();\r\n\t\t// var_dump('prio', $lines[$last]);\r\n\t\t$p = NULL; $priority = $lines[$last];\r\n\t\tif (self::isValidPriority($priority) ) {\r\n\t\t\t$p = $lines[$last];\r\n\t\t\tunset($lines[$last]);\r\n\t\t}\r\n\t\tforeach ($lines AS $v) {\r\n\t\t\tself::log($v, $p);\r\n\t\t}\r\n\t}", "function getLatestReport($path){\n\t#$path = \"./reports\";\n\n\t$latest_ctime = 0;\n\t$latest_filename = '';\n\n\t$d = dir($path);\n\twhile (false !== ($entry = $d->read())) {\n\t\t$filepath = \"{$path}/{$entry}\";\n\t\t// could do also other checks than just checking whether the entry is a file\n\t\tif (is_file($filepath) && filectime($filepath) > $latest_ctime) {\n\t\t\t$latest_ctime = filectime($filepath);\n\t\t\t$latest_filename = $entry;\n\t \t}\n\t}\t\n\n\treturn $path . \"/\" . $latest_filename;\n\t// now $latest_filename contains the filename of the file that changed last\n}", "public function getLastDate() {\n $this->getSeriesSortedByDate();\n $lastDate= end( $this->seriesSortedByDate )[ FileManager::HEADER_DATE ];\n return strtotime( $lastDate );\n }", "public function getLastPage();", "function recent_activities() {\n $this->skip_layout = $this->request->isAsyncCall();\n\n $this->smarty->assign(array(\n 'grouped_activities' => group_by_date(ActivityLogs::findActiveProjectsActivitiesByUser($this->logged_user, 20), $this->logged_user),\n ));\n }", "public function last(&$filePointer, $baseyear = 0) \n {\n $nmea = new NMEA0183Message();\n $zda = new NMEA0183_ZDA();\n $unixd = new NMEA0183_UNIXD();\n $unixd = new UHDAS_PYRTM();\n $rmc = new NMEA0183_RMC();\n \n $line = '';\n // Read file backwards line-by-line until ZDA, UNIXD, or RMC message is\n // found.\n for ($x_pos=0; fseek($filePointer, $x_pos, SEEK_END) !== -1; $x_pos--) {\n \n $char = fgetc($filePointer);\n \n if ($char === \"\\n\") {\n \n if ($line != '') {\n \n // Skip forward to beginning of NMEA message on line.\n $newline = strstr(trim($line), '$'); \n $line = $newline;\n $nmea->init($line);\n $NavRec = preg_split('/\\,/', $nmea->data);\n if (preg_match('/^\\$.{2}ZDA$/', $NavRec[0]) && count($NavRec) >= 6) { \n $zda->init($NavRec);\n $this->year = $zda->year;\n $this->month = $zda->month;\n $this->day = $zda->day;\n $this->hh = $zda->hh;\n $this->mm = $zda->mm;\n $this->ss = $zda->ss;\n // $date_format = \"%4d-%02d-%02dT%02d:%02d:%02dZ\";\n // echo \"zda: \",sprintf(\n // $date_format, $zda->year, $zda->month, $zda->day, \n // $zda->hh, $zda->mm, $zda->ss\n // ),\"\\n\"; \n if ($zda->year != \"\" && $zda->month != \"\"&& $zda->day != \"\" && $zda->hh != \"0\" && $zda->mm != \"0\" && $zda->ss != \"0\") {\n break;\n }\n\n } elseif (preg_match('/^\\$UNIXD$/', $NavRec[0])) {\n $unixd->init($baseyear, $NavRec);\n $this->year = $unixd->year;\n $this->month = $unixd->month;\n $this->day = $unixd->day;\n $this->hh = $unixd->hh;\n $this->mm = $unixd->mm;\n $this->ss = $unixd->ss;\n\n if ($zda->year != \"\" && $zda->month != \"\"&& $zda->day != \"\" && $zda->hh != \"0\" && $zda->mm != \"0\" && $zda->ss != \"0\") {\n break;\n }\n } elseif (preg_match('/^\\$PYRTM$/', $NavRec[0])) {\n $pyrtm->init($NavRec);\n $this->year = $pyrtm->year;\n $this->month = $pyrtm->month;\n $this->day = $pyrtm->day;\n $this->hh = $pyrtm->hh;\n $this->mm = $pyrtm->mm;\n $this->ss = $pyrtm->ss;\n\n if ($zda->year != \"\" && $zda->month != \"\"&& $zda->day != \"\" && $zda->hh != \"0\" && $zda->mm != \"0\" && $zda->ss != \"0\") {\n break;\n }\n\n } else if (preg_match('/^\\$.{2}RMC$/', $NavRec[0])) {\n $rmc->init($NavRec);\n $this->year = $rmc->year;\n $this->month = $rmc->month;\n $this->day = $rmc->day;\n $this->hh = $rmc->hh;\n $this->mm = $rmc->mm;\n $this->ss = $rmc->ss;\n // $date_format = \"%4d-%02d-%02dT%02d:%02d:%02dZ\";\n // echo \"rmc: \",sprintf(\n // $date_format, $rmc->year, $rmc->month, $rmc->day,\n // $rmc->hh, $rmc->mm, $rmc->ss\n // ), \"\\n\"; \n if ($zda->year != \"\" && $zda->month != \"\"&& $zda->day != \"\" && $zda->hh != \"0\" && $zda->mm != \"0\" && $zda->ss != \"0\") {\n break;\n }\n } // end checking string type\n \n // Reset $line:\n $line = $char;\n \n } // end if ($line != '')\n \n } // end if ($char === \"\\n\")\n \n // Add character to line:\n $line = $char . $line;\n \n } // end for(): read file backwards line-by-line\n \n }", "public function loadLastMessage($lastId) :array {\n\n $chatModel = new ChatModel();\n return $chatModel->getLastMessage($lastId); \n \n }", "function getLastMsg($channel, $nb)\n {\n if ($this->hasErrors())\n return array();\n \n // to be sure the $nb params is a positive number\n if (! ($nb >= 0))\n $nb = 10;\n \n // to get the channel recipient name\n // @todo must use another function to get a private message last messages\n $channel = pfcCommand_join :: GetRecipient($channel);\n \n $ct = pfcContainer :: Instance();\n $lastmsg_id = $ct->getLastId($channel);\n $lastmsg_raw = $ct->read($channel, $lastmsg_id - $nb);\n return $lastmsg_raw;\n }", "public function getLastBundleStat( $user, $bundleHash ) {\n\t\t$dbr = MWEchoDbFactory::getDB( DB_SLAVE );\n\n\t\t$res = $dbr->selectRow(\n\t\t\tarray( 'echo_notification' ),\n\t\t\tarray( 'notification_read_timestamp', 'notification_bundle_display_hash' ),\n\t\t\tarray(\n\t\t\t\t'notification_user' => $user->getId(),\n\t\t\t\t'notification_bundle_hash' => $bundleHash\n\t\t\t),\n\t\t\t__METHOD__,\n\t\t\tarray( 'ORDER BY' => 'notification_timestamp DESC', 'LIMIT' => 1 )\n\t\t);\n\t\treturn $res;\n\t}", "public static function endAll(){\n\t\treturn self::end(count(self::$tag_log));\n\t}", "public function getLastPost($lastPost)\n\t{\n\t\t$data = explode('#', $lastPost);\n\t\t\n\t\t$objLastPost = new ilForumPost($data[2]);\t\n\n\t\t// limit the message-size\n\t\t$message = $this->prepareText($objLastPost->getMessage(), 2);\n\t\t\n\t\tif (strpos($message, $this->txtQuote2) > 0)\n\t\t{\n\t\t\t$viewPos = strrpos($message, $this->txtQuote2) + strlen($this->txtQuote2);\n\t\t\t$message = substr($message, $viewPos);\t\t\t\t\n\t\t}\n\t\t\n\t\tif (strlen($message) > 40)\n\t\t{\n\t\t\t$message = substr($objLastPost->getMessage(), 0, 37).'...';\n\t\t}\n\t\t\n\t\t$result[\"pos_message\"] = $result[\"pos_message\"];\n\t\n\t\t// convert date\n\t\t$objLastPost->setCreateDate($this->convertDate($objLastPost->getCreateDate()));\n\t\t\t\t\n\t\treturn $objLastPost;\n\t}", "public function getRecentlyViewedItems()\n\t{\n\t\t$recentlyViewed = new Zend_Session_Namespace('recentlyViewed'); // Creating a new session with namespace\n\t\tif(!empty($recentlyViewed->recentlyViewedObject))\n\t\t{\t\n\t\t\techo '<div class=\"recentviewd\"><label id=\"recentviewtext\">Recently viewed</label><ul>';\n\t\t\t$rvSize = 0;\n\t\t\tif(sizeof($recentlyViewed->recentlyViewedObject) > 3)\n\t\t\t\t$rvSize = 3;\n\t\t\telse\n\t\t\t\t$rvSize = sizeof($recentlyViewed->recentlyViewedObject);\n\t\t\t\n\t\t\t$menuName = '';\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tfor($i=0;$i<$rvSize;$i++)\n\t\t\t{\n\t\t\t\t$pagesplit = explode(\"!@#\",$recentlyViewed->recentlyViewedObject[$i]);\n\t\t\t\t$pagesplitName = $pagesplit[0]; \n\t\t\t\t$pagesplitLink = $pagesplit[1];\n\n\t\t\t\t/* Instead of url - display menu name for each list item*/\n\t\t\t\tif($pagesplitName != 'dashboard' && $pagesplitName != 'welcome' && $pagesplitName != 'viewsettings')\n\t\t\t\t{\n\t\t\t\t\t$selectQuery1 = \"select m.menuName from main_menu m where m.url = '/\".$pagesplitName.\"'\";\n\t\t\t\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t\t\t\t$sql=$db->query($selectQuery1);\n\t\t\t\t\t$resultarray = $sql->fetchAll();\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($resultarray))\n\t\t\t\t\t\t$menuName = ucfirst($resultarray[0]['menuName']);\n\t\t\t\t\telse $menuName = ucfirst($pagesplitName);\n\t\t\t\t}\n\t\t\t\telse $menuName = ucfirst($pagesplitName);\n\t\t\t\t/* Display of add, edit or view in each list item */\n\t\t\t\t$urldata = explode(\"/\",$pagesplitLink);\n\t\t\t\tif(isset($urldata[3]))\n\t\t\t\t{\n\t\t\t\t\tif($urldata[3] == 'add')\n\t\t\t\t\t\t$menuName .= '-Add';\n\t\t\t\t\telse if($urldata[3] == 'edit')\n\t\t\t\t\t\t$menuName .= '-Edit';\n\t\t\t\t\telse if($urldata[3] == 'view')\n\t\t\t\t\t\t$menuName .= '-View';\n\t\t\t\t\telse if($urldata[3] == 'viewsettings')\n\t\t\t\t\t\t$menuName = 'Settings';\n\t\t\t\t\telse if($urldata[3] == 'viewprofile')\n\t\t\t\t\t\t$menuName = 'Profile';\n\t\t\t\t\telse if($urldata[3] == 'changepassword')\n\t\t\t\t\t\t$menuName = 'Change password';\n\t\t\t\t}\t\t\t\t\t\t\t \n\t\t\t\techo '<li><span id=\"redirectlink\" onclick =\"redirecttolink(\\''.$pagesplitLink.'\\',\"\");\">'.$menuName.'</span><a href=\"javascript:void(0);\" onClick=\"closetab(this,\\''.$pagesplitName.'\\',\\''.$pagesplitLink.'\\')\"></a></li>';\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t} \n\t\t$tmpPageLink = explode(\"/\",$_SERVER['REQUEST_URI']); \n\t\t$pageName = $tmpPageLink[2];\n\t\t$pageLink = $_SERVER['REQUEST_URI'];\n\t\t$a= 'index';\n\t\t\n\t\tif(isset($recentlyViewed->recentlyViewedObject))\n\t\t{\n\t\t\t\n\t\t\tif(sizeof($recentlyViewed->recentlyViewedObject) > 3 && $pageLink != BASE_URL && !in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject))\n\t\t\t{\n\t\t\t\tarray_shift($recentlyViewed->recentlyViewedObject);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tif($pageName != 'public')\n\t\t\t{\n\t\t\t\tif(!in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($pageLink != BASE_URL)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($recentlyViewed->recentlyViewedObject,$pageName.\"!@#\".$pageLink);\n\t\t\t\t\t}\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$recentlyViewed->recentlyViewedObject = array();\n\t\t\t\n\t\t\tif($pageLink != BASE_URL && !in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject)) \n\t\t\t\tarray_push($recentlyViewed->recentlyViewedObject,$pageName.\"!@#\".$pageLink);\n\t\t\t\n\t\t}\n\t\t\n\n\t\techo '</ul></div>';\n\t}", "private function logsInWeekRange() {\n\t\t$dir = LOGS.'Inventory/inventory/';\n\t\t$this->report['files'] = array();\n\n\t\t// Open a known directory, and proceed to read its contents\n\t\tif (is_dir($dir)) {\n\t\t\t$dh = new Folder($dir);\n\t\t\t$dh->sort = TRUE;\n//\t\t\t$st = $this->startYear;\n//\t\t\t$sm = $this->startMonth;\n//\t\t\t$ey = $this->endYear;\n//\t\t\t$em = $this->endMonth;\n\t\t\t\n\t\t\t$files = $dh->find('.*\\.log');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$name = preg_replace('/inventory\\.(\\d+)\\.[\\d]+\\.(\\d+)\\.log/', '+$2 week 1/1/$1 -1 week', $file);\n\t\t\t\tif (stristr($file, 'inventory') && strtotime($name) >= $this->report['firstWeekTime'] && strtotime($name) <= $this->report['finalWeekTime']) {\n\t\t\t\t\t$this->report['files'][] = $dir . $file;\n\t\t\t\t}\n\t\t\t}\n//\t\t\tclosedir($dh);\n//\t\t\tforeach ($files as $file) {\n//\t\t\t\t$this->report['files'][] = $file;\n//\t\t\t}\n//\t\t\tif ($dh = opendir($dir)) {\n//\t\t\t\t// walk it\n//\t\t\t\twhile (($file = readdir($dh)) !== false) {\n//\t\t\t\t\t// make a date string from the log file name\n//\t\t\t\t\t$name = preg_replace('/inventory\\.(\\d+)\\.[\\d]+\\.(\\d+)\\.log/', '+$2 week 1/1/$1 -1 week', $file);\n//\n//\t\t\t\t\t// if the log file is within the requested range of weeks, save the file name for later processing\n//\t\t\t\t\tif (stristr($file, 'inventory') && strtotime($name) >= $this->report['firstWeekTime'] && strtotime($name) <= $this->report['finalWeekTime']) {\n//\t\t\t\t\t\t$this->report['files'][] = $dir . $file;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tclosedir($dh);\n//\t\t\t}\n\t\t}\n\t\t\n\t\t$dir = LOGS.'Inventory/snapshot/';\n\t\t$this->report['snapshot'] = array();\n\t\t\n\t\t// Open a known directory, and proceed to read its contents\n\t\tif (is_dir($dir)) {\n\t\t\tif ($dh = opendir($dir)) {\n\t\t\t\t// walk it\n\t\t\t\twhile (($file = readdir($dh)) !== false) {\n\t\t\t\t\t\t$name = preg_replace('/snapshot.(\\d+).(\\d+).log/', '$2/1/$1', $file);\n//\t\t\t\t\t\t$this->ddd($name, 'Snapshot File Name');\n//\t\t\t\t\t\t$this->ddd(strtotime($name), 'String to time $name');\n//\t\t\t\t\t\t$this->ddd(date('F j, Y', $this->report['firstTime']), 'firstTime');\n//\t\t\t\t\t\t$this->ddd($this->report['firstTime'] - MONTH, 'first time minus month');\n\t\t\t\t\t\tif (stristr($file, 'snapshot') && strtotime($name) >= ($this->report['firstSnapshot']) && strtotime($name) <= $this->report['finalTime']) {\n\t\t\t\t\t\t\t$n = (count($this->report['snapshot']) > 0) ? 1 : 0;\n\t\t\t\t\t\t\t$this->report['snapshot'][$n] = $dir . $file;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dh);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// finish directory loop\n\t}", "function sf_build_lastposts()\n{\n\tglobal $wpdb;\n\n\t$forums = sf_get_forums_all(true);\n\tif($forums)\n\t{\n\t\tforeach($forums as $forum)\n\t\t{\n\t\t\tsf_build_forum_index($forum->forum_id);\n\t\t}\n\t}\n\n\t$topics = sf_get_topics_all(true);\n\tif($topics)\n\t{\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\tsf_build_post_index($topic->topic_id, $topic->topic_slug);\n\t\t}\n\t}\n\treturn;\n}", "function find_last_entries(){\n\t$server = \"localhost\";\n\t$username = \"root\";\n\t$password = \"\";\n\t$database = \"01_php_blog_project\";\n\n\n\t$db = mysqli_connect($server, $username, $password, $database);\n\n\t$sql = \"SELECT e. *, c.name_cat FROM entries e INNER JOIN categories c ON e.ID_cat = c.ID_cat ORDER BY e.ID_ent DESC LIMIT 4\";\n\n\t$entries = mysqli_query($db, $sql);\n\n\t$result = array();\n\n\tif ($entries && mysqli_num_rows($entries) >= 1){\n\t\t$result = $entries;\n\t}\n\n\treturn $result;\n}" ]
[ "0.5882909", "0.5554039", "0.55377895", "0.54450005", "0.54389924", "0.54378563", "0.54226613", "0.53997064", "0.53455466", "0.52576035", "0.5255578", "0.5247258", "0.52306324", "0.5201719", "0.51947576", "0.5159814", "0.51528233", "0.5144834", "0.5143237", "0.51316226", "0.51082695", "0.50793856", "0.5070999", "0.50623393", "0.5003634", "0.5000647", "0.497638", "0.4966721", "0.4966721", "0.49598595", "0.4949833", "0.4949068", "0.49409366", "0.4905645", "0.4899624", "0.48764113", "0.48729777", "0.48677933", "0.48648068", "0.4862654", "0.48336747", "0.4822251", "0.48095232", "0.4808055", "0.48017645", "0.47945908", "0.4777915", "0.47767603", "0.47648174", "0.4762509", "0.47542435", "0.4753214", "0.47416914", "0.47391018", "0.47344282", "0.4730721", "0.4730008", "0.47258288", "0.4722983", "0.4722445", "0.47207308", "0.47183648", "0.47057158", "0.46916494", "0.4683103", "0.46689665", "0.46676102", "0.46653205", "0.46617466", "0.46539003", "0.46490002", "0.4643363", "0.46343178", "0.46121496", "0.46116617", "0.46099606", "0.46099606", "0.46087188", "0.46083137", "0.46014795", "0.46007535", "0.45980608", "0.45971587", "0.45926192", "0.4589133", "0.45872328", "0.45857242", "0.45849854", "0.45795667", "0.45653838", "0.45620582", "0.45608267", "0.45604867", "0.45577502", "0.45438418", "0.45432496", "0.45402676", "0.45395854", "0.45387846", "0.4536875" ]
0.7252055
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { $id = $this->route('category'); $rules = [ 'name' => 'required|string|min:1|max:150|unique:categories,name,' . $id, 'slug' => 'required|string|min:1|max:170|unique:categories,slug,' . $id, 'is_active' => 'boolean|nullable', ]; return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Get the request's data from the request.
public function getData() { $data = $this->only(['name','slug','details']); if($this->input('is_active')==null){ $data['is_active']=0; }else{ $data['is_active']=1; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRequestData();", "public function getRequestData()\n {\n return json_decode($this->requestData);\n }", "private function getRequest() {\n return json_decode(request()->getContent(), true);\n }", "public function getRequestData(Request $request) {\n return $request->all();\n }", "public function getData()\n\t{\n if ( is_string($this->_data) ) {\n return $this->_data; \n }\n\t\telse \n return $this->_internal_request->to_postdata();\n\t}", "public function readHttpRequest(){\n\t\t\t$incomingFormData = file_get_contents('php://input');\n\t\t\t\n\t\t\treturn $incomingFormData;\n\t\t\t}", "public function getRequest()\n {\n return $this->data->request;\n }", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "protected function getRequestData()\n {\n if ($this->requestData) {\n return $this->requestData;\n }\n\n $body = $this->getRequest()->getRawBody();\n try {\n $data = Zend_Json::decode($body);\n } catch (Zend_Exception $e) {\n $this->setErrorResponse('Broken JSON provided with request');\n }\n\n $this->requestData = $data;\n\n return $this->requestData;\n }", "function getData()\n {\n $method = $this->getMethod();\n $return = null;\n if ($method == 'GET') {\n $return = $_GET;\n } else if ($method == 'POST') {\n $return = $_POST;\n }\n\n return $return;\n }", "public function getAppData(Request $request) {\n $content = $request->getContent();\n $dataer = (object) $this->decodeObjectAction($content);\n $app_data = $dataer->reqObj;\n $req_obj = $app_data;\n return $req_obj;\n }", "public function getAppData(Request $request) {\n $content = $request->getContent();\n $dataer = (object) $this->decodeObjectAction($content);\n $app_data = $dataer->reqObj;\n $req_obj = $app_data;\n return $req_obj;\n }", "protected function getRequestPayload(Request $request)\n {\n $requestData = null;\n\n if (str_starts_with($request->headers->get('Content-Type'), 'application/json')) {\n $content = $request->getContent();\n if (! empty($content)) {\n $requestData = json_decode($content, true);\n }\n } else {\n $requestData = $request->request->all();\n }\n\n return $requestData;\n }", "public function readHttpRequest() {\n $incomingFormData = file_get_contents('php://input');\n\n return $incomingFormData;\n }", "public function getData()\n {\n return $this->getRequestParams();\n }", "public function getData()\n {\n return $this->getRequestParams();\n }", "public static function requestPayload() {\n return json_decode(file_get_contents('php://input'), true);\n }", "protected function getData(Request $request, $key = NULL) {\n return $key ? $request->request->get($key) : $request->request->all();\n }", "function getDataFromRequest( &$data ) {\n\n\t\t$requestVar = KRequest::getInt($this->propertyName, NULL);\n\n\t\tif (empty($requestVar)) {\n\t\t\t$data->{$this->propertyName} = NULL;\n\t\t}\n\t\telse {\n\t\t\t$data->{$this->propertyName} = $requestVar;\n\t\t}\n\n\t}", "private static function getData()\n {\n static $data = null;\n\n // Only parse once\n if ($data === null) {\n $content_type = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;\n if ($pos = strpos($content_type, ';')) {\n $content_type = substr($content_type, 0, $pos);\n }\n\n switch ($content_type) {\n case 'multipart/form-data':\n default:\n $data = $_REQUEST;\n break;\n case 'application/x-www-form-urlencoded':\n parse_str(file_get_contents('php://input'), $data);\n break;\n case 'application/json':\n $data = json_decode(file_get_contents('php://input'), true);\n break;\n case 'application/xml':\n case 'text/xml':\n $data = (array)simplexml_load_string(file_get_contents('php://input'));\n $data = array_map('trim', $data);\n break;\n }\n }\n\n return $data;\n }", "private function getRequestData()\n {\n $request = Shopware()->Front()->Request();\n\n return array(\n 'Class' => get_class($request),\n 'Module' => $request->getModuleName(),\n 'Controller' => $request->getControllerName(),\n 'Action' => $request->getActionName(),\n 'IP' => $request->getClientIp(),\n 'Http host' => $request->getHttpHost(),\n 'Request uri' => $request->getRequestUri(),\n 'Scheme' => $request->getScheme(),\n 'Server' => $request->getServer(),\n 'Base url' => $request->getBaseUrl(),\n 'Base url (raw)' => $request->getBaseUrl(true),\n 'Parameters' => $request->getParams(),\n 'Path information' => $request->getPathInfo(),\n 'Base path' => $request->getBasePath(),\n 'Header' => (function_exists('getallheaders')) ? getallheaders() : array(),\n );\n }", "public function getRequest()\n {\n return $this->get(self::_REQUEST);\n }", "protected function getRequestData()\n {\n return \\Includes\\Utils\\ArrayManager::filterByKeys(\n \\XLite\\Core\\Request::getInstance()->getData(),\n array('paymentStatus', 'shippingStatus', 'adminNotes')\n );\n }", "function getRequestInfo()\n\t{\n\t\treturn json_decode(file_get_contents('php://input'), true);\n\t}", "public function request(){\n\t\t$request = file_get_contents('php://input');\n\t\treturn json_decode($request,true);\n\t}", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "protected function _request() {\n\t\treturn $this->_container->request;\n\t}", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}", "function getRequest() {\n\t\treturn $this->m_request;\n\t}", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "function getRequest() {\n return $this->request;\n }", "static function getData( $verb ) {\n\t\tif ( in_array( $verb, array( 'put', 'delete' ) ) ) {\n\t\t\treturn json_decode(file_get_contents(\"php://input\"), true );\t\t\t\t\n\t\t} else\n\t\t\treturn $_REQUEST;\n\t}", "protected function getRequest() {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getDataRequest()\n {\n /** @var Core_Entity_Request $dataRequest */\n $dataRequest = $this->_requestClass;\n return new $dataRequest(\n array(\n Core_Entity_Model_Abstract::CONSTRUCT_STORAGE => $this->getStorage()\n )\n );\n }", "protected function getRequest()\n {\n return $this->req;\n }", "protected function getRequest() {\n\t\treturn $this->request;\n\t}", "public function getRequest() {\n return $this->_request;\n }", "public function request()\n\t{\n\t\treturn $this->request;\n\t}", "public function get_request()\n\t{\n\t\treturn $this->request;\n\t}", "public function get_request()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n {\n return $this->req;\n }", "public function getRequest(){\n \n return $this->request;\n \n }", "public function getRequest() {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->_request;\n }", "public function getRequest()\n {\n return $this->_request;\n }", "public function request()\n {\n return $this->request;\n }", "public function request()\n {\n return $this->request;\n }", "public function request()\r\n {\r\n return $this->request;\r\n }", "public function getRequest() {\n\t\treturn $this->request;\n\t}", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequestData($key = null)\n {\n if (null === $key) {\n return $this->_request;\n }\n return isset($this->_request[$key]) ? $this->_request[$key] : null;\n }", "function getRequest() {\n\t\treturn $this->Request;\n\t}", "public function getRequest() {\n return $this->request;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "protected function loadRequestData(Request $request)\n {\n try {\n $content = (string)$request->getContent();\n if (!empty($content)) {\n return \\Safe\\json_decode($content, true);\n } else {\n $content = $request->query->all();\n return $content;\n }\n } catch (\\Exception $exception) {\n return [];\n }\n }", "protected function getPostData(Request $request) {\n\t\tif (!isset($this->postData)) {\n\t\t\t$body = $request->Body;\n\t\t\t/** @var array $postVars */\n\t\t\t$postVars = $request->Post();\n\n\t\t\tif (isset($postVars['model'])) {\n\t\t\t\t$this->postData = json_decode($postVars['model'], true);\n\t\t\t} elseif (!empty($postVars)) {\n\t\t\t\t$this->postData = $postVars;\n\t\t\t} elseif (strlen($body) > 0) {\n\t\t\t\t$this->postData = json_decode($body, true);\n\t\t\t} else {\n\t\t\t\t$this->postData = [];\n\t\t\t}\n\t\t}\n\t\treturn $this->postData;\n\t}", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "function getRequestData() {\n $data = [];\n $data['method'] = $_SERVER['REQUEST_METHOD'];\n $data['url'] = decodeRequestUri($_SERVER['REQUEST_URI']);\n\n $uri_parts = parse_url($data['url']);\n $path_parts = explode('/', $uri_parts['path']);\n\n // get parts from path\n foreach($path_parts as $idx => $param) {\n if($idx == 1) {\n $data['action'] = !empty($param) ? $param : \"desktop\";\n }\n \n if($idx > 1) {\n $data['params'][$idx - 2] = $param;\n }\n }\n\n // fill params with _GET data\n if(!empty($data['params_get'])) {\n $data['params_get'] = array_merge($data['params_get'], $_GET);\n } else {\n $data['params_get'] = $_GET;\n };\n\n // get login and token\n if(empty($_COOKIE['token'])) {\n $data['login'] = '';\n $data['token'] = '';\n } else {\n $data['login'] = $_COOKIE['login'];\n $data['token'] = $_COOKIE['token'];\n }\n\n // get body data (POST, PUT)\n $data['body'] = file_get_contents('php://input');\n\n return $data;\n}", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest() {\n return $this->Request;\n }", "public function incomingRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function get_request_content();", "public static function getRequestBody() {}" ]
[ "0.7878552", "0.7596317", "0.72482127", "0.72383344", "0.7216153", "0.7031932", "0.6975315", "0.6974759", "0.6968044", "0.69648653", "0.695869", "0.695869", "0.69457877", "0.6942062", "0.69363654", "0.69363654", "0.6928604", "0.69274276", "0.691439", "0.6893435", "0.6818454", "0.6814697", "0.6795691", "0.678322", "0.67565626", "0.6748305", "0.6693425", "0.66704583", "0.66456354", "0.660954", "0.65479535", "0.6515679", "0.65129316", "0.651147", "0.651027", "0.651027", "0.651027", "0.651027", "0.6504185", "0.6504166", "0.6494221", "0.6490155", "0.64825374", "0.64719194", "0.64719194", "0.64699304", "0.64677876", "0.6465694", "0.64572644", "0.64572644", "0.6453645", "0.6453645", "0.6447107", "0.64454913", "0.6442486", "0.6442486", "0.6440567", "0.64369977", "0.6436077", "0.6427737", "0.6427737", "0.6427737", "0.6419211", "0.6415625", "0.64035994", "0.64035994", "0.64035994", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6397436", "0.6380526", "0.63588476", "0.63588476", "0.63588476", "0.63588476", "0.63588476", "0.63588476", "0.63588476", "0.63588476", "0.6317508", "0.6311424", "0.63047045", "0.6300721" ]
0.0
-1
Get list of capabilities.
public function getCapabilities(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_capabilities() {\n\t\treturn array_keys( $this->capabilities );\n\t}", "function getCapabilities() {\n return $this->capabilities;\n }", "public function getCapabilities() {\n return [];\n }", "public function getCapabilities()\n {/*{{{*/\n return $this->_capability;\n }", "public function getCapabilities() {}", "public function getCapabilities() {}", "public function getCapabilitiesAttribute()\n {\n return [];\n }", "public function getCapabilities()\n {\n return array(\n 'create' => true,\n 'delete' => false,\n 'send' => true,\n 'receive' => true,\n 'deleteMessage' => true,\n 'getQueues' => true,\n 'count' => true,\n 'isExists' => true\n );\n }", "protected function get_all_capabilities(): array {\n\t\treturn array_merge(\n\t\t\tTaxonomy_Base::DEFAULT_CAPABILITIES,\n\t\t\t$this->story_post_type->get_caps(),\n\t\t);\n\t}", "function getCapabilities() ;", "private function get_core_caps() {\n $capabilities = array();\n\n // TODO: see easy-digital-downloads plugin source codes for example implementation.\n\n return $capabilities;\n }", "public function get_capabilities() {\n\t\treturn array( WPML_Manage_Translations_Role::CAPABILITY, 'manage_options' );\n\t}", "public function getCapabilities(): array\n {\n return [\n ResolverProvider::class => CoreResolverProvider::class,\n DownloaderProvider::class => CoreDownloaderProvider::class,\n PatcherProvider::class => CorePatcherProvider::class,\n CommandProviderCapability::class => CommandProvider::class,\n ];\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities()\n {\n return [\n \\Composer\\Plugin\\Capability\\CommandProvider::class => CommandProvider::class,\n ];\n }", "public static function members_get_capabilities( $caps ) {\r\n return array_merge($caps, array(\"gravityforms_constantcontact\", \"gravityforms_constantcontact_uninstall\"));\r\n }", "function vitero_get_extra_capabilities() {\n return array();\n}", "static public function GetKoeCapabilities() {\n if (isset(self::$koeCapabilites)) {\n return self::$koeCapabilites;\n }\n return array();\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }", "protected function get_option_types_capabilities() {\n\t\t$capabilities = [];\n\t\t$option_types = papi_get_all_entry_types( [\n\t\t\t'type' => 'option'\n\t\t] );\n\n\t\tforeach ( $option_types as $option_type ) {\n\t\t\t$capabilities[] = empty( $option_type->capability ) || ! is_string( $option_type->capability ) ? 'manage_options' : $option_type->capability;\n\t\t}\n\n\t\treturn array_unique( $capabilities );\n\t}", "function cicleinscription_get_extra_capabilities() {\n return array();\n}", "public function get_role_caps()\n {\n }", "function roshine_get_extra_capabilities() {\n return array();\n}", "public function getServerExtList()\n {\n return $this->server_caps;\n }", "public function getRequestedCapabilities(): ?array\n {\n return $this->requestedCapabilities;\n }", "public function get_capability() {\n\t\t//Cache capability in the session so this command is not used repeatedly\n\t\tif (isset(\\GO::session()->values['GO_IMAP'][$this->server]['imap_capability'])) {\n\t\t\t$this->capability=\\GO::session()->values['GO_IMAP'][$this->server]['imap_capability'];\n\t\t}else {\n\t\t\tif(!isset($this->capability)){\n\t\t\t\t$command = \"CAPABILITY\\r\\n\";\n\t\t\t\t$this->send_command($command);\n\t\t\t\t$response = $this->get_response();\n\t\t\t\t$this->capability = implode(' ', $response);\n\t\t\t}\n\t\t\t$this->capability = \\GO::session()->values['GO_IMAP'][$this->server]['imap_capability'] = implode(' ', $response);\t\t\t\n\t\t}\n\t\treturn $this->capability;\n\t}", "function xmlrpc_server_get_capabilities() {\n return array(\n 'xmlrpc' => array(\n 'specUrl' => 'http://www.xmlrpc.com/spec',\n 'specVersion' => 1\n ),\n 'faults_interop' => array(\n 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',\n 'specVersion' => 20010516\n ),\n 'system.multicall' => array(\n 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',\n 'specVersion' => 1\n ),\n 'introspection' => array(\n 'specUrl' => 'http://scripts.incutio.com/xmlrpc/introspection.html',\n 'specVersion' => 1\n )\n );\n}", "function carton_get_core_capabilities() {\n\t$capabilities = array();\n\n\t$capabilities['core'] = array(\n\t\t\"manage_carton\",\n\t\t\"view_carton_reports\"\n\t);\n\n\t$capability_types = array( 'product', 'shop_order', 'shop_coupon', 'shop_discount' );\n\n\tforeach( $capability_types as $capability_type ) {\n\n\t\t$capabilities[ $capability_type ] = array(\n\n\t\t\t// Post type\n\t\t\t\"edit_{$capability_type}\",\n\t\t\t\"read_{$capability_type}\",\n\t\t\t\"delete_{$capability_type}\",\n\t\t\t\"edit_{$capability_type}s\",\n\t\t\t\"edit_others_{$capability_type}s\",\n\t\t\t\"publish_{$capability_type}s\",\n\t\t\t\"read_private_{$capability_type}s\",\n\t\t\t\"delete_{$capability_type}s\",\n\t\t\t\"delete_private_{$capability_type}s\",\n\t\t\t\"delete_published_{$capability_type}s\",\n\t\t\t\"delete_others_{$capability_type}s\",\n\t\t\t\"edit_private_{$capability_type}s\",\n\t\t\t\"edit_published_{$capability_type}s\",\n\n\t\t\t// Terms\n\t\t\t\"manage_{$capability_type}_terms\",\n\t\t\t\"edit_{$capability_type}_terms\",\n\t\t\t\"delete_{$capability_type}_terms\",\n\t\t\t\"assign_{$capability_type}_terms\"\n\t\t);\n\t}\n\n\treturn $capabilities;\n}", "public function getSearchCapabilities()\n\t{\n\t\treturn $this->getHandler()->getSearchCapabilities();\n\t}", "function wysija_capabilities($capabilities) {\n $model_config = WYSIJA::get('config', 'model');\n if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php') && $model_config->getValue('premium_key')) {\n $tmp = array();\n $is_added_stats_dashboard = false;\n foreach ($capabilities as $role => $capability) {\n $tmp[$role] = $capability;\n if ($role === 'subscribers') { // add this setting, right below Subscribers setting\n $tmp['stats_dashboard'] = array(\n 'label' => __('Who can view the statistics page?', WYSIJA)\n );\n $is_added_stats_dashboard = true;\n }\n }\n\n if (!$is_added_stats_dashboard) {// if Subscribers setting is not available, by default, put it at the bottom\n $tmp['stats_dashboard'] = array(\n 'label' => __('Who can view the statistics page?', WYSIJA)\n );\n }\n $capabilities = $tmp;\n }\n return $capabilities;\n }", "protected function getCapability()\n\t{\n\t\treturn self::CAPABILITY;\n\t}", "function get_caps($imap_stream) {\n return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);\n}", "protected function internalGetCapabilities()\n {\n if ($this->capabilities !== null) {\n return $this->capabilities;\n }\n\n if (version_compare('3.0.3', phpversion('memcache')) <= 0) {\n // In ext/memcache v3.0.3:\n // Scalar data types (int, bool, double) are preserved by get/set.\n // http://pecl.php.net/package/memcache/3.0.3\n //\n // This effectively removes support for `boolean` types since\n // \"not found\" return values are === false.\n $supportedDatatypes = [\n 'NULL' => true,\n 'boolean' => false,\n 'integer' => true,\n 'double' => true,\n 'string' => true,\n 'array' => true,\n 'object' => 'object',\n 'resource' => false,\n ];\n } else {\n // In stable 2.x ext/memcache versions, scalar data types are\n // converted to strings and must be manually cast back to original\n // types by the user.\n //\n // ie. It is impossible to know if the saved value: (string)\"1\"\n // was previously: (bool)true, (int)1, or (string)\"1\".\n // Similarly, the saved value: (string)\"\"\n // might have previously been: (bool)false or (string)\"\"\n $supportedDatatypes = [\n 'NULL' => true,\n 'boolean' => 'boolean',\n 'integer' => 'integer',\n 'double' => 'double',\n 'string' => true,\n 'array' => true,\n 'object' => 'object',\n 'resource' => false,\n ];\n }\n\n $this->capabilityMarker = new stdClass();\n $this->capabilities = new Capabilities(\n $this,\n $this->capabilityMarker,\n [\n 'supportedDatatypes' => $supportedDatatypes,\n 'supportedMetadata' => [],\n 'minTtl' => 1,\n 'maxTtl' => 0,\n 'staticTtl' => true,\n 'ttlPrecision' => 1,\n 'useRequestTime' => false,\n 'expiredRead' => false,\n 'maxKeyLength' => 255,\n 'namespaceIsPrefix' => true,\n ]\n );\n\n return $this->capabilities;\n }", "function fetch_context_independent_capabilities() {\n\n //only CONTEXT_SYSTEM capabilities here or it will break the hack in fetch_context_capabilities()\n $contextindependentcaps = array(\n 'moodle/site:accessallgroups'\n );\n\n $records = array();\n\n foreach ($contextindependentcaps as $capname) {\n $record = get_record('capabilities', 'name', $capname);\n array_push($records, $record);\n }\n return $records;\n}", "function exchange_get_user_caps() {\n\treturn array(\n\t\t'list_users',\n\t\t'edit_users',\n\t\t'create_users',\n\t\t'add_users',\n\t\t'remove_users',\n\t\t'promote_users',\n\t);\n}", "public function cap()\n {\n\n return get_option('wpsearchconsole_capability');\n }", "public function getTheSupports();", "public function getFilterCapabilities()\n\t{\n\t\treturn $this->getHandler()->getFilterCapabilities();\n\t}", "public static function capabilities($capabilities)\n\t{\n\t\t$capabilities['MailPress_write_edit_fromemail'] = array(\t'name'\t=> __('Edit fromemail', MP_TXTDOM),\n\t\t\t\t\t\t\t\t\t\t'group'\t=> 'mails'\n\t\t);\n\t\treturn $capabilities;\n\t}", "function contactmod_get_extra_capabilities() {\n return array();\n}", "function fetch_context_capabilities($context) {\n\n global $CFG;\n\n $sort = 'ORDER BY contextlevel,component,id'; // To group them sensibly for display\n\n switch ($context->contextlevel) {\n\n case CONTEXT_SYSTEM: // all\n $SQL = \"select * from {$CFG->prefix}capabilities\";\n break;\n\n case CONTEXT_PERSONAL:\n $SQL = \"select * from {$CFG->prefix}capabilities where contextlevel = \".CONTEXT_PERSONAL;\n break;\n\n case CONTEXT_USER:\n $SQL = \"SELECT * \n FROM {$CFG->prefix}capabilities \n WHERE contextlevel = \".CONTEXT_USER;\n break;\n\n case CONTEXT_COURSECAT: // all\n $SQL = \"select * from {$CFG->prefix}capabilities\";\n break;\n\n case CONTEXT_COURSE: // all\n $SQL = \"select * from {$CFG->prefix}capabilities\";\n break;\n\n case CONTEXT_GROUP: // group caps\n break;\n\n case CONTEXT_MODULE: // mod caps\n $cm = get_record('course_modules', 'id', $context->instanceid);\n $module = get_record('modules', 'id', $cm->module);\n\n $SQL = \"select * from {$CFG->prefix}capabilities where contextlevel = \".CONTEXT_MODULE.\"\n and component = 'mod/$module->name'\";\n break;\n\n case CONTEXT_BLOCK: // block caps\n $cb = get_record('block_instance', 'id', $context->instanceid);\n $block = get_record('block', 'id', $cb->blockid);\n\n $SQL = \"select * from {$CFG->prefix}capabilities where (contextlevel = \".CONTEXT_BLOCK.\" AND component = 'moodle')\n OR (component = 'block/$block->name')\";\n break;\n\n default:\n return false;\n }\n\n if (!$records = get_records_sql($SQL.' '.$sort)) {\n $records = array();\n }\n\n/// the rest of code is a bit hacky, think twice before modifying it :-(\n\n // special sorting of core system capabiltites and enrollments\n if (in_array($context->contextlevel, array(CONTEXT_SYSTEM, CONTEXT_COURSECAT, CONTEXT_COURSE))) {\n $first = array();\n foreach ($records as $key=>$record) {\n if (preg_match('|^moodle/|', $record->name) and $record->contextlevel == CONTEXT_SYSTEM) {\n $first[$key] = $record;\n unset($records[$key]);\n } else if (count($first)){\n break;\n }\n }\n if (count($first)) {\n $records = $first + $records; // merge the two arrays keeping the keys\n }\n } else {\n $contextindependentcaps = fetch_context_independent_capabilities();\n $records = array_merge($contextindependentcaps, $records);\n }\n\n return $records;\n\n}", "public static function getModulesCapableOf($capability = 'user')\n {\n if (!isset(self::$cache['modcache'])) {\n self::$cache['modcache'] = array();\n }\n\n if (!isset(self::$cache['modcache'][$capability]) || !self::$cache['modcache'][$capability]) {\n self::$cache['modcache'][$capability] = array();\n $mods = self::getAllMods();\n foreach ($mods as $key => $mod) {\n if (isset($mod['capabilities'][$capability])) {\n self::$cache['modcache'][$capability][] = $mods[$key];\n }\n }\n }\n\n return self::$cache['modcache'][$capability];\n }", "function tquiz_get_extra_capabilities() {\n return array();\n}", "static public function get_capabilities($capabilities_groups = array(), $overrides = array()){\n $capabilities = array();\n if(!$capabilities_groups || !is_array($capabilities_groups) || empty($capabilities_groups)){\n $capabilities_groups = array_keys(self::$capabilities);\n }\n\n if($capabilities_groups){\n foreach ($capabilities_groups as $group_key) {\n if( isset(self::$capabilities[$group_key]))\n $capabilities = array_merge($capabilities, self::$capabilities[$group_key]);\n }\n }\n\n if($overrides && is_array($overrides)){\n $capabilities = array_merge($capabilities, $overrides);\n }\n\n return $capabilities;\n }", "function randomstrayquotes_get_extra_capabilities() {\n return array();\n}", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public static function getCapabilitiesOf($module)\n {\n $modules = self::getAllMods();\n if (array_key_exists($module, $modules)) {\n return $modules[$module]['capabilities'];\n }\n return false;\n }", "public function check_capabilities()\n {\n }", "public function get_capability($cap) {\n\n $cap = strtoupper($cap);\n\n /*\n * Supported capability?\n */\n if (!in_array($cap, $this->imap_capabilities)) {\n /*\n * Not found!\n */\n return FALSE;\n } elseif (is_array($this->imap_capabilities[$cap]) && count($this->imap_capabilities[$cap]) > 0) {\n /*\n * Key / value pairs found: return supported capability properties\n */\n return $this->imap_capabilities[$cap];\n } else {\n /*\n * Supported\n */\n return TRUE;\n }\n }", "public function getCapabilitiesTable(): string\n {\n return $this->wpDatabase->prefix . 'capabilities';\n }", "function braincert_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "public function getRequiredCapability(): string;", "public function getDrivers()\n {\n return DriverList::getAvailableDrivers();\n }", "public static function capabilities( $capabilities )\r\n\t{\r\n\t\t$capabilities['MailPress_write_edit_fromemail'] = array( \t'name'\t=> __( 'Edit fromemail', 'MailPress' ),\r\n\t\t\t\t\t\t\t\t\t\t'group'\t=> 'mails'\r\n\t\t );\r\n\t\treturn $capabilities;\r\n\t}", "function custom_capabilities( $allcaps ) {\n\t// If you can manage options, you can use SST.\n\tif ( ! empty( $allcaps['manage_options'] ) ) {\n\t\t$allcaps['authenticate_sst'] = true;\n\t}\n\n\treturn $allcaps;\n}", "public static function getAvailableDrivers()\n {\n return array_keys(self::$_driverMap);\n }", "function dllc_get_extra_capabilities() {\n return array();\n}", "function add_capability( $capabilities ) {\n\n $capabilities[ self::$capability ] = __( 'Manage Admin Tools', 'wpp' );\n\n return $capabilities;\n }", "function annotation_get_extra_capabilities() {\n return array();\n}", "public static function list_browsers()\n {\n return self::$browsers;\n }", "public function getDrivers()\n {\n return $this->drivers;\n }", "public static function list_devices()\n {\n return self::$devices;\n }", "protected static final function getUserAgentStats () {\r\n if (count (self::$objUserAgentCapability) == 0) {\r\n // Set the PHPUserAgentSniffer object;\r\n $userAgentPHPCapabilityObject = new phpSniff;\r\n\r\n // Get information back from it!\r\n self::$objUserAgentCapability['browser_properties'] = $userAgentPHPCapabilityObject->property ();\r\n self::$objUserAgentCapability['browser_features'] = $userAgentPHPCapabilityObject->_feature_set;\r\n self::$objUserAgentCapability['browser_quirks'] = $userAgentPHPCapabilityObject->_quirks;\r\n\r\n // Do return ...\r\n return self::$objUserAgentCapability;\r\n } else {\r\n \t// Do return ...\r\n return self::$objUserAgentCapability;\r\n }\r\n }", "public function getSupportedFeatures()\n {\n return $this->supported_features;\n }", "public function supportedDrivers(): array\n {\n return $this->drivers;\n }", "public function getDrivers(): array\n {\n return $this->drivers;\n }", "public static function get_scope_capabilities( $scope ) {\n\treturn explode(' ', $scope);\n }", "function role_context_capabilities($roleid, $context, $cap='') {\n global $CFG;\n\n $contexts = get_parent_contexts($context);\n $contexts[] = $context->id;\n $contexts = '('.implode(',', $contexts).')';\n\n if ($cap) {\n $search = \" AND rc.capability = '$cap' \";\n } else {\n $search = '';\n }\n\n $SQL = \"SELECT rc.*\n FROM {$CFG->prefix}role_capabilities rc,\n {$CFG->prefix}context c\n WHERE rc.contextid in $contexts\n AND rc.roleid = $roleid\n AND rc.contextid = c.id $search\n ORDER BY c.contextlevel DESC,\n rc.capability DESC\";\n\n $capabilities = array();\n\n if ($records = get_records_sql($SQL)) {\n // We are traversing via reverse order.\n foreach ($records as $record) {\n // If not set yet (i.e. inherit or not set at all), or currently we have a prohibit\n if (!isset($capabilities[$record->capability]) || $record->permission<-500) {\n $capabilities[$record->capability] = $record->permission;\n }\n }\n }\n return $capabilities;\n}", "public static function assign_capabilities() {\n global $wp_roles;\n if (!isset($wp_roles)) {\n $wp_roles = new WP_Roles();\n }\n\n $all_roles = $wp_roles->roles;\n foreach ($all_roles as $role_name => $role_info) {\n $role = get_role($role_name);\n\n if (is_multisite()) {\n // Multisite, only super admin should be able to disable security checks\n self::map_capability($role, $role_info, array('install_plugins', 'manage_network_plugins'), 'disable_h5p_security');\n }\n else {\n // Not multisite, regular admin can disable security checks\n self::map_capability($role, $role_info, 'install_plugins', 'disable_h5p_security');\n }\n self::map_capability($role, $role_info, 'manage_options', 'manage_h5p_libraries');\n self::map_capability($role, $role_info, 'edit_others_pages', 'install_recommended_h5p_libraries');\n self::map_capability($role, $role_info, 'edit_others_pages', 'edit_others_h5p_contents');\n self::map_capability($role, $role_info, 'edit_posts', 'edit_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_others_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_h5p_results');\n }\n\n // Keep track on how the capabilities are assigned (multisite caps or not)\n update_option('h5p_multisite_capabilities', is_multisite() ? 1 : 0);\n }", "function get_post_type_capabilities($args)\n {\n }", "public function provideAgents()\n {\n return [\n\n [\n 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.360',\n [\n 'browserEngine' => 'Blink',\n 'browserVersion' => '63.0',\n 'browserVersionMajor' => 63,\n 'browserVersionMinor' => 0,\n 'browserVersionPatch' => null,\n ],\n ],\n [\n 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.',\n [\n 'isTablet' => true,\n ]\n ],\n [\n 'NotGonaMatchMe',\n [\n 'isMobile' => null,\n 'isTablet' => null,\n 'isDesktop' => null,\n 'browserEngine' => null,\n ],\n ],\n ];\n }", "function dataform_get_extra_capabilities() {\n return array('moodle/site:accessallgroups',\n 'moodle/site:viewfullnames',\n 'moodle/rating:view',\n 'moodle/rating:viewany',\n 'moodle/rating:viewall',\n 'moodle/rating:rate',\n 'moodle/comment:view',\n 'moodle/comment:post',\n 'moodle/comment:delete');\n}", "public function getCmdList()\n {\n return $this->get(self::CMDLIST);\n }", "private static function roles_caps(): array {\n\n $all_caps = [\n 'create',\n 'edit',\n 'edit_others',\n 'publish',\n 'read_private',\n 'delete',\n 'delete_private',\n 'delete_published',\n 'delete_others',\n 'edit_private',\n 'edit_published',\n ];\n\n $most_caps = [\n 'edit',\n 'publish',\n 'delete',\n 'delete_published',\n 'edit_published',\n ];\n\n $few_caps = [\n 'edit',\n 'delete',\n ];\n\n return [\n 'administrator' => $all_caps,\n 'editor' => $all_caps,\n 'author' => $most_caps,\n 'contributor' => $few_caps,\n ];\n\n }", "function bigbluebuttonbn_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "public function getOsFeatures() : array\n {\n return $this->osFeatures;\n }", "public function getAvailabilities()\n {\n return $this->availabilities;\n }", "public function getAvailabilities()\n {\n return $this->availabilities;\n }", "public function getPrivileges(): array\n {\n return $this->privileges;\n }", "public function getCaptureList()\n {\n return $this->captureList;\n }", "public function getSupport() {\n $pdoStat = PdoMedProjet::$conn->prepare('SELECT * FROM supports');\n $pdoStat->execute();\n return $pdoStat->fetchAll();\n }", "function pati_initialize_capabilities(){\r\n $admin = get_role( 'administrator' );\r\n $subscriber = get_role( 'subscriber' );\r\n $editor = get_role( 'editor' ); \r\n\r\n /**\r\n * General Capability for the Ticket CRUD Operations\r\n */\r\n $admin->add_cap('edit_ticket');\r\n $admin->add_cap('edit_tickets');\r\n $admin->add_cap('read_ticket');\r\n $admin->add_cap('delete_ticket');\r\n $admin->add_cap('edit_others_tickets');\r\n $admin->add_cap('publish_tickets');\r\n $admin->add_cap('read_private_tickets');\r\n $admin->add_cap('delete_private_tickets');\r\n $admin->add_cap('delete_published_tickets');\r\n $admin->add_cap('delete_others_tickets');\r\n $admin->add_cap('edit_private_tickets');\r\n $admin->add_cap('edit_published_tickets');\r\n $admin->add_cap('assign_ticket');\r\n\r\n /**\r\n * Capabilities for the Editor User\r\n */\r\n $editor->add_cap('edit_ticket');\r\n $editor->add_cap('edit_tickets');\r\n $editor->add_cap('read_ticket');\r\n $editor->add_cap('delete_ticket');\r\n $editor->add_cap('edit_others_tickets');\r\n $editor->add_cap('publish_tickets');\r\n $editor->add_cap('read_private_tickets');\r\n $editor->add_cap('delete_private_tickets');\r\n $editor->add_cap('delete_published_tickets');\r\n $editor->add_cap('delete_others_tickets');\r\n $editor->add_cap('edit_private_tickets');\r\n $editor->add_cap('edit_published_tickets');\r\n $editor->add_cap('assign_ticket');\r\n\r\n /**\r\n * Additional Capabilities for Subscriber\r\n */\r\n $subscriber->add_cap('edit_ticket');\r\n $subscriber->add_cap('read_ticket');\r\n $subscriber->add_cap('edit_tickets');\r\n}", "public function abilities()\n {\n if (!$this->abilities) {\n $this->abilities = array();\n foreach (monsterToAbility::select('ability', 'description')->where('mid', '=', $this->id)->get() as $m) {\n $this->abilities[$m->ability] = $m->description;\n }\n }\n return $this->abilities;\n }", "function DoctorAppointment_role_caps() {\n $roles = array('receptionist');\n \n // Loop through each role and assign capabilities\n foreach($roles as $the_role) { \n\n $role = get_role($the_role);\n \n $role->add_cap( 'read' );\n $role->add_cap( 'read_DoctorAppointment');\n $role->add_cap( 'read_private_DoctorAppointments' );\n $role->add_cap( 'edit_DoctorAppointment' );\n $role->add_cap( 'edit_DoctorAppointments' );\n $role->add_cap( 'edit_others_DoctorAppointments' );\n $role->add_cap( 'edit_published_DoctorAppointments' );\n $role->add_cap( 'publish_DoctorAppointments' );\n $role->add_cap( 'delete_others_DoctorAppointments' );\n $role->add_cap( 'delete_private_DoctorAppointments' );\n $role->add_cap( 'delete_published_DoctorAppointments' );\n \n \n \n }\n}", "function unilabel_get_extra_capabilities() {\n return ['moodle/site:accessallgroups'];\n}" ]
[ "0.81106424", "0.7967423", "0.7917203", "0.7859275", "0.78188664", "0.78188664", "0.7346471", "0.7289835", "0.71859294", "0.7108761", "0.71053296", "0.70945436", "0.7040538", "0.68440497", "0.68440497", "0.68440497", "0.68440497", "0.68440497", "0.68440497", "0.68440497", "0.6825875", "0.677184", "0.66698045", "0.6615465", "0.65646464", "0.65646464", "0.65646464", "0.65646464", "0.65646464", "0.65646464", "0.65646464", "0.65532464", "0.6526271", "0.64937186", "0.6447721", "0.641429", "0.639472", "0.63590413", "0.6275602", "0.6222043", "0.6217349", "0.61748177", "0.61638916", "0.604675", "0.6024852", "0.60000986", "0.5998166", "0.59464246", "0.59028447", "0.5869701", "0.58613276", "0.58498025", "0.5845962", "0.5843122", "0.58026266", "0.5736939", "0.57313085", "0.57311344", "0.57311344", "0.57311344", "0.57287526", "0.57178396", "0.5675562", "0.5658467", "0.5651114", "0.564725", "0.564124", "0.563485", "0.5605659", "0.55734676", "0.55388093", "0.55230165", "0.54815406", "0.5480717", "0.5477307", "0.54609036", "0.5458395", "0.5457139", "0.54103625", "0.5386531", "0.5383068", "0.5382666", "0.53770685", "0.535149", "0.53321075", "0.53098077", "0.5274306", "0.52669156", "0.5251714", "0.525137", "0.52263", "0.52154326", "0.52154326", "0.52015615", "0.519852", "0.5187577", "0.5179271", "0.51659036", "0.5162702", "0.5155758" ]
0.7533796
6
Set a list of capabilities.
public function setCapabilities(array $capabilities): WpUserRoleInterface;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCapabilities( $capabilities = NULL ){\n\t\tif($capabilities) $this->args['capabilities'] = $capabilities;\n\t}", "public function setRequestedCapabilities(array $capabilitiesList)\n {\n $this->setRequestedStaticCapabilities($capabilitiesList);\n $this->setRequestedVirtualCapabilities($capabilitiesList);\n }", "public static function assign_capabilities() {\n global $wp_roles;\n if (!isset($wp_roles)) {\n $wp_roles = new WP_Roles();\n }\n\n $all_roles = $wp_roles->roles;\n foreach ($all_roles as $role_name => $role_info) {\n $role = get_role($role_name);\n\n if (is_multisite()) {\n // Multisite, only super admin should be able to disable security checks\n self::map_capability($role, $role_info, array('install_plugins', 'manage_network_plugins'), 'disable_h5p_security');\n }\n else {\n // Not multisite, regular admin can disable security checks\n self::map_capability($role, $role_info, 'install_plugins', 'disable_h5p_security');\n }\n self::map_capability($role, $role_info, 'manage_options', 'manage_h5p_libraries');\n self::map_capability($role, $role_info, 'edit_others_pages', 'install_recommended_h5p_libraries');\n self::map_capability($role, $role_info, 'edit_others_pages', 'edit_others_h5p_contents');\n self::map_capability($role, $role_info, 'edit_posts', 'edit_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_others_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_h5p_contents');\n self::map_capability($role, $role_info, 'read', 'view_h5p_results');\n }\n\n // Keep track on how the capabilities are assigned (multisite caps or not)\n update_option('h5p_multisite_capabilities', is_multisite() ? 1 : 0);\n }", "public function setRequestedCapabilities(?array $requestedCapabilities): self\n {\n $this->requestedCapabilities = $requestedCapabilities;\n\n return $this;\n }", "public function setSupports(array $supports)\n {\n $this->supports = $supports;\n }", "public function setRequestedVirtualCapabilities(array $virtualCapabilitiesList)\n {\n $capabilitiesList = [];\n foreach ($virtualCapabilitiesList as $capabilityName) {\n if ($this->hasVirtualCapability($capabilityName)) {\n $capabilitiesList[] = $capabilityName;\n }\n }\n $this->requestedVirtualCapabilities = $capabilitiesList;\n }", "public static function capabilities( $capabilities )\r\n\t{\r\n\t\t$capabilities['MailPress_write_edit_fromemail'] = array( \t'name'\t=> __( 'Edit fromemail', 'MailPress' ),\r\n\t\t\t\t\t\t\t\t\t\t'group'\t=> 'mails'\r\n\t\t );\r\n\t\treturn $capabilities;\r\n\t}", "function ps_imagemanager_add_capabilities($caps) {\n\tunset($caps[array_search('ImageManager Upload', $caps)]);\n\tunset($caps[array_search('ImageManager MkDir', $caps)]);\n\n\t// add role\n\t$upload_files = array_search('upload_files', $caps); //Prior to PHP 4.2.0, array_search() returns NULL on failure instead of FALSE.\n\tif ($upload_files == FALSE || $upload_files == NULL) {\n\t\t$caps[] = 'upload_files';\n\t}\n\t$make_directory = array_search('make_directory', $caps);\n\tif ($make_directory == FALSE || $make_directory == NULL) {\n\t\t$caps[] = 'make_directory';\n\t}\n\t$edit_image = array_search('edit_image', $caps);\n\tif ($edit_image == FALSE || $edit_image == NULL) {\n\t\t$caps[] = 'edit_image';\n\t}\t\n\t$delete_image = array_search('delete_image', $caps);\n\tif ($delete_image == FALSE || $delete_image == NULL) {\n\t\t$caps[] = 'delete_image';\n\t}\n\treturn $caps;\n}", "public function setCapability($capability) {\n $this->args['capability'] = $capability;\n }", "public static function capabilities($capabilities)\n\t{\n\t\t$capabilities['MailPress_write_edit_fromemail'] = array(\t'name'\t=> __('Edit fromemail', MP_TXTDOM),\n\t\t\t\t\t\t\t\t\t\t'group'\t=> 'mails'\n\t\t);\n\t\treturn $capabilities;\n\t}", "public function add_caps_to_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\n\t\t$administrator = get_role( 'administrator' );\n\t\t$editor = get_role( 'editor' );\n\t\t$author = get_role( 'author' );\n\t\t$contributor = get_role( 'contributor' );\n\n\t\tif ( $administrator instanceof WP_Role ) {\n\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t$administrator->add_cap( $cap );\n\t\t\t}\n\t\t}\n\n\t\tif ( $editor instanceof WP_Role ) {\n\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t$editor->add_cap( $cap );\n\t\t\t}\n\t\t}\n\n\t\tif ( $author instanceof WP_Role ) {\n\t\t\t$author->add_cap( $all_capabilities_raw['edit_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['edit_published_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['delete_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['delete_published_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['publish_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['assign_terms'] );\n\t\t}\n\n\t\tif ( $contributor instanceof WP_Role ) {\n\t\t\t$contributor->add_cap( $all_capabilities_raw['edit_posts'] );\n\t\t\t$contributor->add_cap( $all_capabilities_raw['delete_posts'] );\n\t\t\t$contributor->add_cap( $all_capabilities_raw['assign_terms'] );\n\t\t}\n\n\t\t/**\n\t\t * Fires when adding the custom capabilities to existing roles.\n\t\t *\n\t\t * Can be used to add the capabilities to other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_add_capabilities', $all_capabilities );\n\t}", "public function getCapabilitiesAttribute()\n {\n return [];\n }", "public function add_custom_capabilities(){\n\t\t$roles = array( 'editor', 'administrator' );\n\t\t// Loop through each role and assign capabilities\n\t\tforeach($roles as $the_role) { \n\t\t\t$role = get_role($the_role);\n\t\t\t// Post Type\n\t\t\t$role->add_cap( 'edit_person' );\n\t\t\t$role->add_cap( 'read_person' );\n\t\t\t$role->add_cap( 'delete_person' );\n\t\t\t$role->add_cap( 'edit_people' );\n\t\t\t$role->add_cap( 'edit_others_people' );\n\t\t\t$role->add_cap( 'publish_people' );\n\t\t\t$role->add_cap( 'read_private_people' );\n\t\t\t// Taxonomy\n\t\t\t$role->add_cap( 'manage_person_roles' );\n\t\t}\n\t}", "public function add_capabilties_to_roles()\n {\n $post_type_object = get_post_type_object($this->name);\n global $wp_roles;\n $roles = array('administrator');\n foreach( (array)$post_type_object->cap as $capability ){\n foreach( $roles as $role_name ){\n $role = get_role($role_name);\n $role->add_cap($capability);\n }\n }\n }", "public static function members_get_capabilities( $caps ) {\r\n return array_merge($caps, array(\"gravityforms_constantcontact\", \"gravityforms_constantcontact_uninstall\"));\r\n }", "public function set_admin_caps(){\n\t\t\t\n\t\t\t$caps = $this->set_caps( $this->cpt_args );\n\t\t\t\n\t\t\t$admin = get_role( 'administrator' );\n\n\t\t\tforeach( $caps as $cap ){\n\t\t\t\tif( !$admin->has_cap( $cap ) )\n\t\t\t\t\t$admin->add_cap( $cap );\n\t\t\t}\n\t\t}", "public function setSupports($supports = array('title','editor','thumbnail')){\n\t\t$this->supports = $supports;\n\t}", "static public function set_core_roles_capabilities(){\n stablish_capabilities('administrator', TA_Roles_Plugin::get_capabilities() );\n\n stablish_capabilities('subscriber', TA_Roles_Plugin::get_capabilities(array(\n 'comments_pre_aproved',\n )) );\n\n stablish_capabilities('editor', TA_Roles_Plugin::get_capabilities(array(\n 'portada',\n 'micrositio_home',\n 'article_section_edit',\n 'article_place_edit',\n 'article_tema_edit',\n 'article_tag',\n 'article_author',\n 'article_micrositio',\n 'article_micrositio_edit',\n 'menus',\n 'articles_edit',\n 'articles_publish',\n 'media_uploads',\n 'ed_impresa',\n 'fotogaleria',\n 'taller',\n 'memberships',\n 'mailtrain',\n 'comments',\n 'extra',\n 'comments_pre_aproved',\n )) );\n }", "function psp_add_role_caps()\n{\n $roles = array('manager');\n\n // Loop through each role and assign capabilities\n foreach ($roles as $the_role) {\n\n $role = get_role($the_role);\n\n $role->add_cap('read');\n $role->add_cap('create_cpt_project');\n $role->add_cap('create_private_cpt_project');\n $role->add_cap('read_cpt_project');\n $role->add_cap('read_private_cpt_project');\n $role->add_cap('edit_cpt_project');\n $role->add_cap('edit_published_cpt_project');\n $role->add_cap('publish_cpt_project');\n $role->add_cap('delete_private_cpt_project');\n $role->add_cap('delete_published_cpt_project');\n\n }\n}", "function add_capability( $capabilities ) {\n\n $capabilities[ self::$capability ] = __( 'Manage Admin Tools', 'wpp' );\n\n return $capabilities;\n }", "public function setRequestedStaticCapabilities(array $staticCapabilitiesList)\n {\n $capabilitiesList = [];\n foreach ($staticCapabilitiesList as $capabilityName) {\n if ($this->hasStaticCapability($capabilityName)) {\n $capabilitiesList[] = $capabilityName;\n }\n }\n $this->requestedStaticCapabilities = $capabilitiesList;\n }", "public function setDrivers()\n {\n foreach ($this->getDriverList() as $driverName) {\n $this->setDriver($driverName);\n }\n }", "function custom_capabilities( $allcaps ) {\n\t// If you can manage options, you can use SST.\n\tif ( ! empty( $allcaps['manage_options'] ) ) {\n\t\t$allcaps['authenticate_sst'] = true;\n\t}\n\n\treturn $allcaps;\n}", "function pati_initialize_capabilities(){\r\n $admin = get_role( 'administrator' );\r\n $subscriber = get_role( 'subscriber' );\r\n $editor = get_role( 'editor' ); \r\n\r\n /**\r\n * General Capability for the Ticket CRUD Operations\r\n */\r\n $admin->add_cap('edit_ticket');\r\n $admin->add_cap('edit_tickets');\r\n $admin->add_cap('read_ticket');\r\n $admin->add_cap('delete_ticket');\r\n $admin->add_cap('edit_others_tickets');\r\n $admin->add_cap('publish_tickets');\r\n $admin->add_cap('read_private_tickets');\r\n $admin->add_cap('delete_private_tickets');\r\n $admin->add_cap('delete_published_tickets');\r\n $admin->add_cap('delete_others_tickets');\r\n $admin->add_cap('edit_private_tickets');\r\n $admin->add_cap('edit_published_tickets');\r\n $admin->add_cap('assign_ticket');\r\n\r\n /**\r\n * Capabilities for the Editor User\r\n */\r\n $editor->add_cap('edit_ticket');\r\n $editor->add_cap('edit_tickets');\r\n $editor->add_cap('read_ticket');\r\n $editor->add_cap('delete_ticket');\r\n $editor->add_cap('edit_others_tickets');\r\n $editor->add_cap('publish_tickets');\r\n $editor->add_cap('read_private_tickets');\r\n $editor->add_cap('delete_private_tickets');\r\n $editor->add_cap('delete_published_tickets');\r\n $editor->add_cap('delete_others_tickets');\r\n $editor->add_cap('edit_private_tickets');\r\n $editor->add_cap('edit_published_tickets');\r\n $editor->add_cap('assign_ticket');\r\n\r\n /**\r\n * Additional Capabilities for Subscriber\r\n */\r\n $subscriber->add_cap('edit_ticket');\r\n $subscriber->add_cap('read_ticket');\r\n $subscriber->add_cap('edit_tickets');\r\n}", "public function getCapabilities(): array\n {\n return [\n ResolverProvider::class => CoreResolverProvider::class,\n DownloaderProvider::class => CoreDownloaderProvider::class,\n PatcherProvider::class => CorePatcherProvider::class,\n CommandProviderCapability::class => CommandProvider::class,\n ];\n }", "public function setCapability($name, $value) {\r\n\t\tif (!self::hasSession()) {\r\n\t\t\t$this->capabilities[$name] = $value;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function wysija_capabilities($capabilities) {\n $model_config = WYSIJA::get('config', 'model');\n if (WYSIJA::is_plugin_active('wysija-newsletters-premium/index.php') && $model_config->getValue('premium_key')) {\n $tmp = array();\n $is_added_stats_dashboard = false;\n foreach ($capabilities as $role => $capability) {\n $tmp[$role] = $capability;\n if ($role === 'subscribers') { // add this setting, right below Subscribers setting\n $tmp['stats_dashboard'] = array(\n 'label' => __('Who can view the statistics page?', WYSIJA)\n );\n $is_added_stats_dashboard = true;\n }\n }\n\n if (!$is_added_stats_dashboard) {// if Subscribers setting is not available, by default, put it at the bottom\n $tmp['stats_dashboard'] = array(\n 'label' => __('Who can view the statistics page?', WYSIJA)\n );\n }\n $capabilities = $tmp;\n }\n return $capabilities;\n }", "public function getCapabilities() {\n return [];\n }", "function DoctorAppointment_role_caps() {\n $roles = array('receptionist');\n \n // Loop through each role and assign capabilities\n foreach($roles as $the_role) { \n\n $role = get_role($the_role);\n \n $role->add_cap( 'read' );\n $role->add_cap( 'read_DoctorAppointment');\n $role->add_cap( 'read_private_DoctorAppointments' );\n $role->add_cap( 'edit_DoctorAppointment' );\n $role->add_cap( 'edit_DoctorAppointments' );\n $role->add_cap( 'edit_others_DoctorAppointments' );\n $role->add_cap( 'edit_published_DoctorAppointments' );\n $role->add_cap( 'publish_DoctorAppointments' );\n $role->add_cap( 'delete_others_DoctorAppointments' );\n $role->add_cap( 'delete_private_DoctorAppointments' );\n $role->add_cap( 'delete_published_DoctorAppointments' );\n \n \n \n }\n}", "public function setAttributeList(array $attribute_list): void;", "public function setCapabilityType($type = 'post'){\n\t\t$this->capabilityType = $type;\n\t}", "protected function get_all_capabilities(): array {\n\t\treturn array_merge(\n\t\t\tTaxonomy_Base::DEFAULT_CAPABILITIES,\n\t\t\t$this->story_post_type->get_caps(),\n\t\t);\n\t}", "function update_custom_order_capability_settings(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\t}\n\n\tif( isset( $_POST[ 'custom_post_order_capabilities' ] ) ){\n\n\t\t$roles_can_order_posts = $_POST[ 'custom_post_order_capabilities' ];\n\n\n\t\t$all_roles = new WP_Roles();\n\n\n\t\tforeach( $all_roles->roles as $key => $role ){\n\t\t\tif( in_array( $key, $roles_can_order_posts ) ){\n\n\t\t\t\t$role_add = get_role( $key );\n\t\t\t\t$role_add->add_cap( 'order_posts', true );\n\n\t\t\t} else{\n\n\t\t\t\t$role_remove = get_role( $key );\n\t\t\t\t$role_remove->remove_cap( 'order_posts', true );\n\t\t\t}\n\t\t}\n\n\t}\n}", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function getCapabilities() {}", "public function getCapabilities() {}", "public function remove_caps_from_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\t\t$all_capabilities = array_filter(\n\t\t\t$all_capabilities,\n\t\t\tstatic fn( $value ) => 'read' !== $value\n\t\t);\n\t\t$all_roles = wp_roles();\n\t\t$roles = array_values( (array) $all_roles->role_objects );\n\t\tforeach ( $roles as $role ) {\n\t\t\tif ( $role instanceof WP_Role ) {\n\t\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t\t$role->remove_cap( $cap );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires when removing the custom capabilities from existing roles.\n\t\t *\n\t\t * Can be used to remove the capabilities from other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_remove_capabilities', $all_capabilities );\n\t}", "public function getCapabilities(): array;", "public function setTraits(array $traits);", "public function set_caps( $a ){\n\t\t\t\n\t\t\t$caps = array(\n\t\t\t\t\t'publish_posts' => 'publish_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_posts' => 'edit_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_others_posts' => 'edit_others_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_posts' => 'delete_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_others_posts' => 'delete_others_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'read_private_posts' => 'read_private_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_post' => 'edit_'.$a[ 'cap_post' ],\n\t\t\t\t\t'delete_post' => 'delete_'.$a[ 'cap_post' ],\n\t\t\t\t\t'read_post' => 'read_'.$a[ 'cap_post' ],\n\t\t\t\t\t'read' => 'read_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_private_posts' => 'edit_private_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_published_posts' => 'edit_published_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_published_posts' => 'delete_published_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_private_posts' => 'delete_private_'.$a[ 'cap_posts' ]\n\t\t\t\t);\n\t\t\t\t\n\t\t\treturn $caps;\n\t\t}", "public function get_capabilities() {\n\t\treturn array( WPML_Manage_Translations_Role::CAPABILITY, 'manage_options' );\n\t}", "function vitero_get_extra_capabilities() {\n return array();\n}", "public function setWhitelist(array $whitelist): void\n {\n $this->whitelist = $whitelist;\n }", "public function setArray(array $list);", "function getCapabilities() ;", "function roshine_get_extra_capabilities() {\n return array();\n}", "public function setAttrList($attrList) {\n\t$this->attrList = $attrList;\n }", "function _post_type_meta_capabilities($capabilities = \\null)\n {\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n PhabricatorPolicyCapability::CAN_EDIT,\n );\n }", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public final function check_capabilities()\n {\n }", "public function add_caps() {\n global $wp_roles;\n\n // TODO: see easy-digital-downloads plugin source codes for example implementation.\n }", "function getCapabilities() {\n return $this->capabilities;\n }", "public function check_capabilities()\n {\n }", "public function set_features (array $features) {\n $this->features = $features;\n }", "public function setCharities(array $charities) {\n $this->getElement('charities')->addMultiOptions($charities);\n }", "public static function addAccessCapability() {\n foreach (wp_roles()->role_objects as $name => $role) {\n if (in_array($name, static::getAccessibleRoles())) {\n $role->add_cap('admin_access');\n }\n }\n }", "public function getCapabilities()\n {/*{{{*/\n return $this->_capability;\n }", "public function setSupportedLocales(array $locales): void\n {\n $this->supportedLocales = $locales;\n }", "function update_capabilities($component='moodle') {\n\n $storedcaps = array();\n\n $filecaps = load_capability_def($component);\n $cachedcaps = get_cached_capabilities($component);\n if ($cachedcaps) {\n foreach ($cachedcaps as $cachedcap) {\n array_push($storedcaps, $cachedcap->name);\n // update risk bitmasks and context levels in existing capabilities if needed\n if (array_key_exists($cachedcap->name, $filecaps)) {\n if (!array_key_exists('riskbitmask', $filecaps[$cachedcap->name])) {\n $filecaps[$cachedcap->name]['riskbitmask'] = 0; // no risk if not specified\n }\n if ($cachedcap->riskbitmask != $filecaps[$cachedcap->name]['riskbitmask']) {\n $updatecap = new object();\n $updatecap->id = $cachedcap->id;\n $updatecap->riskbitmask = $filecaps[$cachedcap->name]['riskbitmask'];\n if (!update_record('capabilities', $updatecap)) {\n return false;\n }\n }\n\n if (!array_key_exists('contextlevel', $filecaps[$cachedcap->name])) {\n $filecaps[$cachedcap->name]['contextlevel'] = 0; // no context level defined\n }\n if ($cachedcap->contextlevel != $filecaps[$cachedcap->name]['contextlevel']) {\n $updatecap = new object();\n $updatecap->id = $cachedcap->id;\n $updatecap->contextlevel = $filecaps[$cachedcap->name]['contextlevel'];\n if (!update_record('capabilities', $updatecap)) {\n return false;\n }\n }\n }\n }\n }\n\n // Are there new capabilities in the file definition?\n $newcaps = array();\n\n foreach ($filecaps as $filecap => $def) {\n if (!$storedcaps ||\n ($storedcaps && in_array($filecap, $storedcaps) === false)) {\n if (!array_key_exists('riskbitmask', $def)) {\n $def['riskbitmask'] = 0; // no risk if not specified\n }\n $newcaps[$filecap] = $def;\n }\n }\n // Add new capabilities to the stored definition.\n foreach ($newcaps as $capname => $capdef) {\n $capability = new object;\n $capability->name = $capname;\n $capability->captype = $capdef['captype'];\n $capability->contextlevel = $capdef['contextlevel'];\n $capability->component = $component;\n $capability->riskbitmask = $capdef['riskbitmask'];\n\n if (!insert_record('capabilities', $capability, false, 'id')) {\n return false;\n }\n\n // Do we need to assign the new capabilities to roles that have the\n // legacy capabilities moodle/legacy:* as well?\n if (isset($capdef['legacy']) && is_array($capdef['legacy']) &&\n !assign_legacy_capabilities($capname, $capdef['legacy'])) {\n notify('Could not assign legacy capabilities for '.$capname);\n }\n }\n // Are there any capabilities that have been removed from the file\n // definition that we need to delete from the stored capabilities and\n // role assignments?\n capabilities_cleanup($component, $filecaps);\n\n return true;\n}", "public function setRequirements($requirements)\n {\n $this->requirements = $requirements;\n }", "function mb_add_capabilities( $posttype ) {\n\t// gets the author role\n\t$role = get_role( 'administrator' );\n\n\t// adds all capabilities for a given post type to the administrator role\n\t$role->add_cap( 'edit_' . $posttype . 's' );\n\t$role->add_cap( 'edit_others_' . $posttype . 's' );\n\t$role->add_cap( 'publish_' . $posttype . 's' );\n\t$role->add_cap( 'read_private_' . $posttype . 's' );\n\t$role->add_cap( 'delete_' . $posttype . 's' );\n\t$role->add_cap( 'delete_private_' . $posttype . 's' );\n\t$role->add_cap( 'delete_published_' . $posttype . 's' );\n\t$role->add_cap( 'delete_others_' . $posttype . 's' );\n\t$role->add_cap( 'edit_private_' . $posttype . 's' );\n\t$role->add_cap( 'edit_published_' . $posttype . 's' );\n}", "public function getCapabilities()\n {\n return [\n \\Composer\\Plugin\\Capability\\CommandProvider::class => CommandProvider::class,\n ];\n }", "public function SetAccept (array $accept = []);", "public function get_capabilities() {\n\t\treturn array_keys( $this->capabilities );\n\t}", "public function setAllowedAttributes(array $allowedAttributes);", "public function grant_edit_post_capability_for_changeset($caps, $cap, $user_id, $args)\n {\n }", "function producto_meta_cap( $caps, $cap, $user_id, $args ) {\n\tif ( 'edit_producto' == $cap || 'delete_producto' == $cap || 'read_producto' == $cap ) {\n\t\t$post = get_post( $args[0] );\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\t/* Set an empty array for the caps. */\n\t\t$caps = array();\n\t}\n\n\t/* If editing a producto, assign the required capability. */\n\tif ( 'edit_producto' == $cap ) {\n\t\tif ( $user_id == $post->post_author )\n\t\t\t$caps[] = $post_type->cap->edit_posts;\n\t\telse\n\t\t\t$caps[] = $post_type->cap->edit_others_posts;\n\t}\n\n\t/* If deleting a producto, assign the required capability. */\n\telseif ( 'delete_producto' == $cap ) {\n\t\tif ( $user_id == $post->post_author )\n\t\t\t$caps[] = $post_type->cap->delete_posts;\n\t\telse\n\t\t\t$caps[] = $post_type->cap->delete_others_posts;\n\t}\n\n\t/* If reading a private producto, assign the required capability. */\n\telseif ( 'read_producto' == $cap ) {\n\n\t\tif ( 'private' != $post->post_status )\n\t\t\t$caps[] = 'read';\n\t\telseif ( $user_id == $post->post_author )\n\t\t\t$caps[] = 'read';\n\t\telse\n\t\t\t$caps[] = $post_type->cap->read_private_posts;\n\t}\n\n\t/* Return the capabilities required by the user. */\n\treturn $caps;\n}", "public function bulkSet(array $args = array()) {\n foreach ($args as $argName => $arg) {\n $this->__set($argName, $arg);\n }\n }", "public function setAllowedOptions (...$options);", "public function setRoles(array $roles);", "public function setExtensionAttributes(MultipleWishlistItemExtensionInterface $extensionAttributes);", "function carton_get_core_capabilities() {\n\t$capabilities = array();\n\n\t$capabilities['core'] = array(\n\t\t\"manage_carton\",\n\t\t\"view_carton_reports\"\n\t);\n\n\t$capability_types = array( 'product', 'shop_order', 'shop_coupon', 'shop_discount' );\n\n\tforeach( $capability_types as $capability_type ) {\n\n\t\t$capabilities[ $capability_type ] = array(\n\n\t\t\t// Post type\n\t\t\t\"edit_{$capability_type}\",\n\t\t\t\"read_{$capability_type}\",\n\t\t\t\"delete_{$capability_type}\",\n\t\t\t\"edit_{$capability_type}s\",\n\t\t\t\"edit_others_{$capability_type}s\",\n\t\t\t\"publish_{$capability_type}s\",\n\t\t\t\"read_private_{$capability_type}s\",\n\t\t\t\"delete_{$capability_type}s\",\n\t\t\t\"delete_private_{$capability_type}s\",\n\t\t\t\"delete_published_{$capability_type}s\",\n\t\t\t\"delete_others_{$capability_type}s\",\n\t\t\t\"edit_private_{$capability_type}s\",\n\t\t\t\"edit_published_{$capability_type}s\",\n\n\t\t\t// Terms\n\t\t\t\"manage_{$capability_type}_terms\",\n\t\t\t\"edit_{$capability_type}_terms\",\n\t\t\t\"delete_{$capability_type}_terms\",\n\t\t\t\"assign_{$capability_type}_terms\"\n\t\t);\n\t}\n\n\treturn $capabilities;\n}", "function cicleinscription_get_extra_capabilities() {\n return array();\n}", "public function setList($list = array())\n {\n if (!is_array($list)) {\n $list = ArrayUtils::iteratorToArray($list);\n }\n\n $this->list = $list;\n }", "private function _validate_capabilities($capabilities) {\n\t\tforeach ($capabilities as $capability) {\n\t\t\tif (!current_user_can($capability)) {\n\t\t\t\treturn $this->_generic_error_response('insufficient_permission');\n\t\t\t}\n\t\t}\n\t}", "function assign_legacy_capabilities($capability, $legacyperms) {\n\n $legacyroles = get_legacy_roles();\n\n foreach ($legacyperms as $type => $perm) {\n\n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n\n if (!array_key_exists($type, $legacyroles)) {\n error('Incorrect legacy role definition for type: '.$type);\n }\n\n if ($roles = get_roles_with_capability($legacyroles[$type], CAP_ALLOW)) {\n foreach ($roles as $role) {\n // Assign a site level capability.\n if (!assign_capability($capability, $perm, $role->id, $systemcontext->id)) {\n return false;\n }\n }\n }\n }\n return true;\n}", "public function setWhiteListAccess (Array $list=NULL)\n {\n $this->_white_list = $list;\n }", "public function setMeetingCapability($val)\n {\n $this->_propDict[\"meetingCapability\"] = $val;\n return $this;\n }", "public function setCredentials(array $credentials);", "public function setTraits(Collection $traits): void\n {\n $this->traits = $traits;\n }", "public function setModifiers(int $modifiers): void\n {\n $this->modifiers = $modifiers;\n }", "public function setQualifiers($qualifiers)\n {\n $this->qualifiers = $qualifiers;\n }", "function rordb_register_cap_groups() {\n\tmembers_register_cap_group(\n\t\t'rordb',\n\t\tarray(\n\t\t\t'label' => __( 'RoRdb', 'rordb-textdomain' ),\n\t\t\t'caps' => array(\n \"rordb_edit_settings\",\n\n \"rordb_view_items\",\n \"rordb_edit_items\",\n \"rordb_create_items\",\n\n \"rordb_view_categories\",\n \"rordb_edit_categories\",\n \"rordb_create_categories\",\n\n \"rordb_view_locations\",\n \"rordb_edit_locations\",\n \"rordb_create_locations\",\n\n \"rordb_view_claimgroups\",\n \"rordb_edit_claimgroups\",\n \"rordb_create_claimgroups\",\n ),\n\t\t\t'icon' => 'dashicons-database',\n\t\t\t'priority' => 10\n\t\t)\n\t);\n}", "function _parseCapability($data)\n {\n $data = preg_split('/\\r?\\n/', $data, -1, PREG_SPLIT_NO_EMPTY);\n\n for ($i = 0; $i < count($data); $i++) {\n if (preg_match('/^\"([a-z]+)\"( \"(.*)\")?$/i', $data[$i], $matches)) {\n switch (strtolower($matches[1])) {\n case 'implementation':\n $this->_capability['implementation'] = $matches[3];\n break;\n\n case 'sasl':\n $this->_capability['sasl'] = preg_split('/\\s+/', $matches[3]);\n break;\n\n case 'sieve':\n $this->_capability['extensions'] = preg_split('/\\s+/', $matches[3]);\n break;\n\n case 'starttls':\n $this->_capability['starttls'] = true;\n break;\n }\n }\n }\n }", "public function add_user_capabilities() {\n\t\tglobal $wp_roles;\n\n\t\tif ( ! isset( $wp_roles ) && class_exists( 'WP_Roles' ) ) {\n\t\t\t$wp_roles = new WP_Roles();\n\t\t}\n\n\t\t// it's fine if this gets executed more than once\n\t\tif ( is_object( $wp_roles ) ) {\n\t\t\t$wp_roles->add_cap( 'shop_manager', 'manage_woocommerce_csv_exports' );\n\t\t\t$wp_roles->add_cap( 'administrator', 'manage_woocommerce_csv_exports' );\n\t\t}\n\t}", "static public function get_capabilities($capabilities_groups = array(), $overrides = array()){\n $capabilities = array();\n if(!$capabilities_groups || !is_array($capabilities_groups) || empty($capabilities_groups)){\n $capabilities_groups = array_keys(self::$capabilities);\n }\n\n if($capabilities_groups){\n foreach ($capabilities_groups as $group_key) {\n if( isset(self::$capabilities[$group_key]))\n $capabilities = array_merge($capabilities, self::$capabilities[$group_key]);\n }\n }\n\n if($overrides && is_array($overrides)){\n $capabilities = array_merge($capabilities, $overrides);\n }\n\n return $capabilities;\n }", "public function set_features( $features ) {\n $f = explode( ',', $features );\n foreach ( $f as $feature ) {\n $feature = trim( $feature );\n $this->features[$feature] = true;\n }\n }", "function adleex_resource_define_cap() {\n\t$admin = get_role('administrator');\n\t$admin->add_cap('delete_resources');\n\t$admin->add_cap('edit_resources');\n\t$admin->add_cap('publish_resources');\n\t$admin->add_cap('edit_published_resources');\n\t$admin->add_cap('delete_published_resources');\n\t$admin->add_cap('read_private_resources');\n\t$admin->add_cap('edit_private_resources');\n\t$admin->add_cap('delete_private_resources');\n\t$admin->add_cap('edit_others_resources');\n\t$admin->add_cap('delete_others_resources');\n}", "public function getCapabilities() {\n return array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n }" ]
[ "0.75796396", "0.7272651", "0.64051837", "0.61294776", "0.61006236", "0.60004026", "0.5818892", "0.58180034", "0.58172846", "0.57906073", "0.5781193", "0.575423", "0.5682005", "0.5677002", "0.5590783", "0.55517733", "0.5548962", "0.55208313", "0.55114424", "0.55077374", "0.54672974", "0.5457172", "0.54543877", "0.54308146", "0.53882504", "0.5379642", "0.5373458", "0.5368139", "0.5352394", "0.5328583", "0.52925235", "0.5290114", "0.52726245", "0.52535015", "0.52535015", "0.52535015", "0.52406037", "0.52406037", "0.51755875", "0.51534224", "0.51431406", "0.5102368", "0.5070975", "0.50377136", "0.5010676", "0.49921712", "0.49868163", "0.49826062", "0.49692342", "0.49635357", "0.4955096", "0.4955096", "0.4955096", "0.4955096", "0.4955096", "0.4955096", "0.4955096", "0.49447554", "0.49447554", "0.49447554", "0.49431145", "0.49237522", "0.49231106", "0.4917871", "0.4914276", "0.49090895", "0.49082452", "0.48845866", "0.48844102", "0.48552513", "0.48535222", "0.4849734", "0.48418784", "0.4822176", "0.48195297", "0.48171332", "0.4811329", "0.48078674", "0.48075882", "0.48027065", "0.47834295", "0.47456622", "0.47406814", "0.47287652", "0.47108486", "0.4702035", "0.46773055", "0.4649791", "0.4649277", "0.46392632", "0.46375954", "0.46260783", "0.4624784", "0.46244413", "0.46224663", "0.46212122", "0.46209115", "0.46192366", "0.45994624", "0.45988038" ]
0.6133436
3
Run the database seeds.
public function run() { //web guard $permissions = [ ['name' => 'View', 'module' => 'Teams', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Add', 'module' => 'Teams', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Edit', 'module' => 'Teams', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Delete', 'module' => 'Teams', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'View', 'module' => 'Players', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Add', 'module' => 'Players', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Edit', 'module' => 'Players', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Delete', 'module' => 'Players', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'View', 'module' => 'Users', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Add', 'module' => 'Users', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Edit', 'module' => 'Users', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Delete', 'module' => 'Users', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'View', 'module' => 'Schedules', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Add', 'module' => 'Schedules', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Edit', 'module' => 'Schedules', 'created_at' => date('Y-m-d H:i:s')], ['name' => 'Delete', 'module' => 'Schedules', 'created_at' => date('Y-m-d H:i:s')] ]; foreach ($permissions as $permission) { $checkIfExist = Permission::where('name', $permission['name']) ->where('module', $permission['module']) ->first(); if (!$checkIfExist) { Permission::insert($permission); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Run the database seeds.
public function run() { ProofResidense::create(['name' => 'Ration Card']); ProofResidense::create(['name' => 'Voter ID Card']); ProofResidense::create(['name' => 'Passport']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Override charge, WXML messages cannot be billed
function setCharge($inCharge) { return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProcessChargeAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Charge amount notifications inform you that a customer has been\n * charged for either the full amount or a partial amount of an\n * order. A <charge-amount-notification> contains the order number\n * that Google assigned to the order, the value of the most recent\n * charge to the customer and the total amount that has been\n * charged to the customer for the order. Google Checkout will send a\n * <charge-amount-notification> after charging the customer.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <charge-amount-notification> to your internal systems that\n * process this order data.\n */\n SendNotificationAcknowledgment();\n}", "public function charging(): void\n {\n $this->capacity = 1;\n }", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function checkChargesAction()\n\t\t{\n\t\t\t// Start cron.\n\t\t\t$this->getHelper( 'admin' )\n\t\t\t\t->startCronTask( 'charge-checker' );\n\t\t\t// Process charges.\n\t\t\t$charges = Table::_( 'charges' )->fetchAll( array (\n\t\t\t\t'status = ?' => 'active'\n\t\t\t) );\n\t\t\tif ( count( $charges ) ) {\n\t\t\t\tforeach ( $charges as $charge ) {\n\t\t\t\t\t// Charge local data.\n\t\t\t\t\t$shop = Table::_( 'shops' )->get( $charge->shop_id );\n\t\t\t\t\t$user = Table::_( 'users' )->getUserByShop( $shop->id );\n\t\t\t\t\t$token = Table::_( 'credentials' )->getForPlugin( $charge->plugin_id, $user->id )->api_key;\n\t\t\t\t\t// Get shopify charge data.\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$apiName = 'recurring_application_charge';\n\t\t\t\t\t\t$response = $this->getHelper( 'ShopifyApi' )\n\t\t\t\t\t\t\t->initialize( $shop->name, $token )\n\t\t\t\t\t\t\t->get( $apiName . 's', $charge->charge_id )\n\t\t\t\t\t\t\t;\n\t\t\t\t\t} catch ( Exception $ex ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset ( $response->$apiName ) ) {\n\t\t\t\t\t\t// Update status.\n\t\t\t\t\t\tif ( $charge->status != $response->$apiName->status ) {\n\t\t\t\t\t\t\t$charge->status = $response->$apiName->status;\n\t\t\t\t\t\t\t$charge->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Insert bill if new.\n\t\t\t\t\t\t$billingDate = strtotime( $response->$apiName->billing_on );\n\t\t\t\t\t\t$bill = Table::_( 'chargesBills' )->hasBill( $response->$apiName );\n\t\t\t\t\t\tif ( ( $charge->status == 'active' ) && ( time() > $billingDate ) && !$bill ) {\n\t\t\t\t\t\t\tTable::_( 'chargesBills' )->bill( $response->$apiName );\n\t\t\t\t\t\t\t// Extend paid till date.\n\t\t\t\t\t\t\t$instance = Table::_( 'plugins' )->getInstance( $shop->id, $charge->plugin_id );\n\t\t\t\t\t\t\t$instance->paid_till = date( 'Y-m-d H:i:s', $billingDate + ( SECONDS_PER_DAY * 30 ) );\n\t\t\t\t\t\t\t$instance->save();\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\t// Stop cron.\n\t\t\t$this->getHelper( 'admin' )\n\t\t\t\t->stopCronTask( 'charge-checker' );\n\t\t}", "public function charges();", "function ProcessChargebackAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Chargeback amount notifications inform you that a customer\n * has initiated a chargeback against an order and that Google Checkout\n * has approved the chargeback. A <chargeback-amount-notification>\n * contains the order number that Google assigned to the order,\n * the value of the most recent chargeback against the order\n * and the total amount that has been charged back against the\n * order. Google Checkout will send a <chargeback-amount-notification>\n * after approving the chargeback.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <chargeback-amount-notification> to your internal systems that\n * process this order data.\n */\n SendNotificationAcknowledgment();\n}", "public function charge($requestParameters = array());", "function bill_recharge() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$wallet_category = '4';\n\t\t// 4- Cashback\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\n\t\tif ($wt_category == '11') {\n\t\t\t$wt_desc = 'PaY Bill';\n\t\t}\n\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no',$bill_consumer_no);\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\tif ($wallet_amount >= $bill_amount) {\n\t\t\t\t\t\t//$transaction_id='5454';\n\t\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\n\t\t\t\t\t\tif ($recharge) {\n\n\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\t\t// change status of bill///\n\t\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" . $mobile;\n\n\t\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\t\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\n\t\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\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$user_wallet = $wallet_amount - $bill_amount + $coupon_amount;\n\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $bill_amount - $coupon_amount;\n\t\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\n\t\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Bill Pay Successfully\", \"bill_recharge_id\" => $recharge, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount, 'wallet_amount' => $user_wallet, 'bill_pay_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Pay bill failed\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pay_amount = $recharge_amount - $wallet_amount;\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Not sufficent amount in your wallet\", 'wallet_amount' => $wallet_amount, 'bill_amount' => $bill_amount, 'payble_amount' => $pay_amount);\n\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\texit();\n\t\t\t\t\t\t//$add=$this->add_money_recharge($recharge_user_id,$recharge_amount,$recharge_transaction_id);\n\t\t\t\t\t\t//$this->recharge();\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function perBill()\n\t{\n\t\t$this->restart( 'shop/finish' );\n\t}", "public function handleChargeResp($ch){\n $this->chargeSuccess = $ch->outcome->network_status == 'approved_by_network';\n $this->msgToUser = $ch->outcome->seller_message;\n }", "public function getCharge(){\n return $this->Charge;\n }", "function multisite_over_quota_message()\n {\n }", "public function charges()\n\t{\n\t\t$data['title'] = 'Charges';\n\t\t$data['rentspaceroomtypeaircon'] = $this->getrentspaceroomtypeaircon();\n\t\t$data['rentspaceroomtypefemale'] = $this->getrentspaceroomtypefemale();\n\t\t$data['rentspaceroomtypemale'] = $this->getrentspaceroomtypemale();\n\t\t$data['natureofactivity'] = $this-> getnatureofactivity();\n\t\t$data['rentspaceventtype'] = $this->getrentspaceeventtype();\n\t\t$data['ratetype'] = $this->getratetype();\n\n\t\t$this->template\n\t\t\t->set_layout('student_template')\n\t\t\t->build('charges',$data);\n\n\t}", "public function send() {\n\n\t\t\t$campaign = Campaigns::findOrFail($this->request->_id);\n\n\t\t\t//<---- Verify Pledge send\n\t\t\tif(isset($this->request->_pledge) && $this->request->_pledge != 0 ){\n\t\t\t\t$findPledge = $campaign->rewards->where('id', $this->request->_pledge)\n\t\t\t\t\t\t->where('campaigns_id', $this->request->_id)\n\t\t\t\t\t\t->where('amount', $this->request->amount)->first();\n\n\t\t\t\t$pledgeClaimed = $campaign->donations()->where('rewards_id', $findPledge->id)->count();\n\t\t\t}\n\n\t\t\tif(isset($findPledge) && $pledgeClaimed < $findPledge->quantity) {\n\t\t\t\t$this->request->_pledge = $findPledge->id;\n\t\t\t} else {\n\t\t\t\t$this->request->_pledge = 0;\n\t\t\t}\n\n\t\t\t// Currency Position\n\t\t\tif($this->settings->currency_position == 'right') {\n\t\t\t\t$currencyPosition = 2;\n\t\t\t} else {\n\t\t\t\t$currencyPosition = null;\n\t\t\t}\n\n\t\t\tValidator::extend('check_payment_gateway', function($attribute, $value, $parameters)\n\t\t\t{\n\t\t\t\treturn PaymentGateways::find($value);\n\t\t\t});\n\n\t\t\t$data = $this->request->all();\n\n\t\t\t$data['_captcha'] = $this->settings->captcha_on_donations == 'off' ? $data['_captcha'] = 1 : $data['_captcha'] = 0;\n\n\t\t\t$messages = array (\n\t\t\t'amount.min' => trans('misc.amount_minimum'.$currencyPosition, ['symbol' => $this->settings->currency_symbol, 'code' => $this->settings->currency_code]),\n\t\t\t'amount.max' => trans('misc.amount_maximum'.$currencyPosition, ['symbol' => $this->settings->currency_symbol, 'code' => $this->settings->currency_code]),\n\t\t\t'payment_gateway.check_payment_gateway' => trans('admin.payments_error'),\n\n\t\t\t'bank_transfer.required_if' => trans('admin.bank_transfer_required'),\n\t\t\t'bank_transfer.min' => trans('admin.bank_transfer_limit'),\n\t\t\t'bank_transfer.max' => trans('admin.bank_transfer_limit'),\n\t\t\t'g-recaptcha-response.required_if' => trans('admin.captcha_error_required'),\n\t 'g-recaptcha-response.captcha' => trans('admin.captcha_error'),\n\t\t);\n\n\t\t//<---- Validation\n\t\t$validator = Validator::make($data, [\n\t\t\t\t'amount' => 'required|integer|min:'.$this->settings->min_donation_amount.'|max:'.$this->settings->max_donation_amount,\n 'full_name' => 'required|max:25',\n 'email' => 'required|email|max:100',\n 'country' => 'required',\n 'postal_code' => 'required|max:30',\n 'comment' => 'nullable|max:100',\n\t\t\t\t'payment_gateway' => 'required|check_payment_gateway',\n\t\t\t\t'bank_transfer' => 'required_if:payment_gateway,==,3|min:10|max:300',\n\t\t\t\t'g-recaptcha-response' => 'required_if:_captcha,==,0|captcha'\n\n\t \t],$messages);\n\n\t\t\tif ($validator->fails()) {\n\t\t\t return response()->json([\n\t\t\t\t\t 'success' => false,\n\t\t\t\t\t 'errors' => $validator->getMessageBag()->toArray(),\n\t\t\t\t\t ]);\n\t\t\t }\n\n\t\t\t\t\t// Get name of Payment Gateway\n\t\t\t\t\t$payment = PaymentGateways::find($this->request->payment_gateway);\n\n\t\t\t\t\tif(!$payment) {\n\t\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t\t\t'success' => false,\n\t\t\t\t\t\t\t\t'errors' => ['error' => trans('admin.payments_error')],\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = [\n\t\t\t\t\t\t'campaign_id' => $campaign->id,\n\t\t\t\t\t\t'campaign_title' => $campaign->title,\n\t\t\t\t\t];\n\n\t\t\t\t\t$data_all = $this->request->except(['_token']);\n\t\t\t\t\t$dataGlobal = array_merge($data, $data_all);\n\n\t\t\t\t\t// Send data to the payment processor\n\t\t\t\t\t\treturn redirect()->route(str_slug($payment->name), $dataGlobal);\n\t\t\t}", "public function charge(array $data);", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function _buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$quota=post_param_integer('quota');\n\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t// Stop if we can't afford this much quota\n\t\tif ((($quota*$price)>$pointsleft) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('CANT_AFFORD'));\n\t\t}\n\n\t\t// Mail off the order form\n\t\t$quota_url=get_option('quota_url');\n\t\t$_price=$quota*$price;\n\t\t$encoded_reason=do_lang('TITLE_QUOTA');\n\t\t$message_raw=do_template('POINTSTORE_QUOTA_MAIL',array('_GUID'=>'5a4e0bb5e53e6ccf8e57581c377557f4','ENCODED_REASON'=>$encoded_reason,'QUOTA'=>integer_format($quota),'EMAIL'=>$prefix.$suffix,'QUOTA_URL'=>$quota_url,'PRICE'=>integer_format($_price)));\n\t\trequire_code('notifications');\n\t\tdispatch_notification('pointstore_request_quota','quota_'.uniqid('',true),do_lang('MAIL_REQUEST_QUOTA',NULL,NULL,NULL,get_site_default_lang()),$message_raw->evaluate(get_site_default_lang(),false),NULL,NULL,3,true);\n\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_QUOTA_DONE'));\n\t}", "public function doChargeAction()\n\t\t{\n\t\t\t$config = Config::getInstance();\n\t\t\t// Save parameters in session.\n\t\t\t$session = new Zend_Session_Namespace( 'do-charge' );\n\t\t\tif ( $shopifyForm = $this->_getParam( 'shopify_form' ) ) {\n\t\t\t\t$session->shop = $this->_getParam( 'shop' );\n\t\t\t\t$session->plugin = $this->_getParam( 'plugin' );\n\t\t\t\t$session->plan = $this->_getParam( 'plan' );\n\t\t\t\t$session->charge->name = $this->_getParam( 'charge_name' );\n\t\t\t\t$session->charge->price = $this->_getParam( 'charge_price' );\n\t\t\t\t$session->charge->returnURL = $this->_getParam( 'charge_return_url' ); // TODO define it right here.\n\t\t\t\t$session->install = $this->_getParam( 'install' );\n\t\t\t\t$session->recreate = $this->_getParam( 'recreate' );\n\t\t\t\t// Standard payment set.\n\t\t\t\tif ( $shopifyForm == 'main' ) {\n\t\t\t\t\t$session->product_id = $this->_getParam( 'product_id' );\n\t\t\t\t\t$session->recurrent = (bool) $this->_getParam( 'recurrent' );\n\t\t\t\t\t$session->overdraft = 0;\n\t\t\t\t} else { // Overdraft set.\n\t\t\t\t\t$session->ids = explode( ',', $this->_getParam( 'ids' ) );\n\t\t\t\t\t$session->recurrent = 0;\n\t\t\t\t\t$session->overdraft = 1;\n\t\t\t\t}\n\t\t\t\t// Decode string parameters if a request is get.\n\t\t\t\tif ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {\n\t\t\t\t\t$session->shop = base64_decode( $session->shop );\n\t\t\t\t\t$session->plugin = base64_decode( $session->plugin );\n\t\t\t\t\t$session->plan = base64_decode( $session->plan );\n\t\t\t\t\t$session->charge->name = base64_decode( $session->charge->name );\n\t\t\t\t\t$session->charge->returnURL = base64_decode( $session->charge->returnURL );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Charge local data.\n\t\t\t$shop = Table::_( 'shops' )->get( $session->shop );\n\t\t\t$user = Table::_( 'users' )->getUserByShop( $shop->id );\n\t\t\t$plugin = Model::_( 'payment' )->getPlugin( 'shopify', $session->plugin );\n\t\t\t$instance = Table::_( 'plugins' )->getInstance( $shop->id, $plugin->id );\n\t\t\t$settings = $this->view->settings = $instance->getSettings();\n\t\t\t$token = Table::_( 'credentials' )->getForPlugin( $plugin->id, $user->id )->api_key;\n\t\t\t$session->token = $token;\n\t\t\t// Recurring or One-time charge.\n\t\t\t$chargeApiName = $session->recurrent ? 'recurring_application_charge' : 'application_charge';\n\t\t\t// Create a charge.\n\t\t\t$trialDays = 0;\n\t\t\tif ( $session->install ) {\n\t\t\t\t$trialDays = $session->trial_days = $settings->trial_period;\n\t\t\t} else if ( $shopifyForm == 'main' ) {\n\t\t\t\t$trialDays = $instance->getTrialRest( $settings->trial_period );\n\t\t\t}\n\t\t\t$response = $this->getHelper( 'ShopifyApi' )\n\t\t\t\t->initialize( $shop->name, $token )\n\t\t\t\t->post( $chargeApiName . 's', null, array (\n\t\t\t\t\t$chargeApiName => array (\n\t\t\t\t\t\t'name' => $session->charge->name,\n\t\t\t\t\t\t'price' => $session->charge->price,\n\t\t\t\t\t\t'return_url' => $session->charge->returnURL,\n\t\t\t\t\t\t'trial_days' => $trialDays,\n\t\t\t\t\t\t'test' => $config->payment->testmode\n\t\t\t\t\t)\n\t\t\t\t) );\n\t\t\t// Confirm charge.\n\t\t\tif ( isset ( $response->$chargeApiName ) ) {\n\t\t\t\treturn $this->getHelper( 'Redirector' )->gotoUrl(\n\t\t\t\t\t$response->$chargeApiName->confirmation_url\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function buyPostage()\n {\n\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<RecreditRequest>\n <RequesterID>'. $this->RequesterID.'</RequesterID>\n <RequestID>' . $this->PartnerTransactionID . '</RequestID>\n <CertifiedIntermediary>\n <AccountID>'.$this->AccountID.'</AccountID>\n <PassPhrase>'. $this->PassPhrase.'</PassPhrase>\n </CertifiedIntermediary>\n <RecreditAmount>500</RecreditAmount>\n </RecreditRequest>';\n\n\n $data = array(\"RecreditRequestXML\" => $xml);\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/BuyPostageXML', array(), $data);\n $this->send_request($request);\n\n\n }", "public function getServiceCharge()\n {\n return $this->service_charge;\n }", "public static function chargeFees($price=1)\n {\n\n }", "public function onCharge($order)\n {\n $this->statusCode = 'pending';\n $this->detail = 'pending response, token:' . $this->token;\n return parent::onCharge($order);\n }", "function sendwithdrawreqAction() {\n /**\n * check whether customer logged in or not\n */\n if (! $this->_getSession ()->isLoggedIn ()) {\n /**\n * add error message\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return;\n }\n /**\n * Get message\n *\n * @var string\n */\n $message = $this->getRequest ()->getParam ( 'req_message' );\n /**\n * Get Pending Amount\n *\n * @var Apptha_Marketplace_OrderController $pendingAmount\n */\n $pendingAmount = $this->getRequest ()->getParam ( 'pending-amount' );\n /**\n * Get Customer Data\n *\n * @var uobject\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n /**\n * Get customer Id\n *\n * @var unknown\n */\n $customerId = $customerData->getId ();\n /**\n * Sending email to admin to ask for pending amount\n */\n $adminEmailId = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get to mail id\n *\n * @var string\n */\n $toMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/email\" );\n /**\n * Get to name\n *\n * @var name\n */\n $toName = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/name\" );\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_seller_withdraw_request_to_admin' );\n\n /**\n * Load customer details.\n */\n $customer = Mage::getModel ( 'customer/customer' )->load ( $customerId );\n $selleremail = $customer->getEmail ();\n /**\n * Get Recipient details\n *\n * @var unknown\n */\n $recipient = $toMailId;\n $sellername = $customer->getName ();\n $emailTemplate->setSenderName ( $sellername );\n $emailTemplate->setSenderEmail ( $selleremail );\n $emailTemplateVariables = (array (\n 'ownername' => $toName,\n 'sellername' => $sellername,\n 'requestmessage' => $message,\n 'pendingamt' => $pendingAmount\n ));\n $emailTemplate->setDesignConfig ( array (\n 'area' => 'frontend'\n ) );\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n /**\n * Send email to admin.\n */\n $emailTemplate->send ( $recipient, $sellername, $emailTemplateVariables );\n /**\n * Success message after send email to admin.\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'Request Sent to Admin Successfully.' ) );\n $this->_redirect ( 'marketplace/order/viewtransaction/' );\n return;\n }", "function ciniki_sapos_web_stripeCustomerCharge(&$ciniki, $tnid, $args) {\n\n if( !isset($args['stripe-token']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.238', 'msg'=>'Internal Error'));\n }\n if( !isset($args['stripe-email']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.239', 'msg'=>'Internal Error'));\n }\n if( !isset($args['charge-amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.244', 'msg'=>'Internal Error'));\n }\n\n //\n // Load the tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'core', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_currency = $rc['settings']['intl-default-currency'];\n\n //\n // Load stripe settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', 'stripe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['settings']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.240', 'msg'=>'Stripe processing not configured'));\n }\n $stripe_settings = $rc['settings'];\n\n if( !isset($stripe_settings['stripe-sk']) || $stripe_settings['stripe-sk'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.241', 'msg'=>'Stripe processing not configured'));\n }\n\n //\n // Load stripe library\n //\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($stripe_settings['stripe-sk']);\n\n //\n // Create customer\n //\n try {\n $customer = \\Stripe\\Customer::create(array(\n 'email'=>$args['stripe-email'],\n 'source'=>$args['stripe-token'],\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to setup customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.242', 'msg'=>$e->getMessage()));\n }\n \n //\n // Process the charge\n //\n if( $args['charge-amount'] > 0 ) {\n try {\n $charge = \\Stripe\\Charge::create(array(\n 'customer' => $customer->id,\n 'amount' => number_format($args['charge-amount'] * 100, 0, '', ''),\n 'currency' => $intl_currency,\n ));\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to charge customer: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.245', 'msg'=>$e->getMessage()));\n }\n\n //\n // Check for a balance transaction\n //\n if( isset($charge['balance_transaction']) ) {\n try {\n $balance = \\Stripe\\BalanceTransaction::retrieve($charge['balance_transaction']);\n } catch( Exception $e) {\n error_log(\"STRIPE-ERR: Unable to get balance: \" . $e->getMessage());\n }\n }\n } else {\n //\n // If nothing to charge, store the customer details as part of the transaction.\n //\n $charge = $customer;\n }\n\n //\n // Add the transaction to the ciniki_sapos_transactions\n //\n if( isset($args['invoice_id']) ) {\n $dt = new DateTime('now', new DateTimeZone('UTC'));\n if( isset($balance['fee']) ) {\n $fees = bcdiv($balance['fee'], 100, 2);\n } else {\n $fees = 0;\n }\n if( isset($charge['outcome']['seller_message']) ) {\n $gateway_status = $charge['outcome']['seller_message'];\n } else {\n $gateway_status = 'Unknown';\n }\n $transaction_args = array(\n 'invoice_id'=>$args['invoice_id'],\n 'status'=>40,\n 'transaction_type'=>20,\n 'transaction_date'=>$dt->format('Y-m-d H:i:s'),\n 'source'=>30,\n 'customer_amount'=>$args['charge-amount'],\n 'transaction_fees'=>$fees,\n 'tenant_amount'=>bcsub($args['charge-amount'], $fees, 6),\n 'user_id'=>0,\n 'notes'=>'',\n 'gateway'=>30,\n 'gateway_token'=>$charge['id'],\n 'gateway_status'=>$gateway_status,\n 'gateway_response'=>serialize($charge),\n );\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.sapos.transaction', $transaction_args);\n if( $rc['stat'] != 'ok' ) {\n error_log(\"STRIPE-ERR: Unable to record transaction: \" . $e->getMessage());\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.243', 'msg'=>$e->getMessage()));\n }\n }\n\n return array('stat'=>'ok');\n}", "public function getCharge() {\n return Charge::retrieve($this->refund->__get('data')['object']['balance_transaction']);\n }", "public function create_charge( $token, $order ) {\n\t\t$description = sprintf(\n\t\t\t'Total %s charged for %d items, including shipping cost %s & tax %s',\n\t\t\t$order->get_total(),\n\t\t\t$order->get_item_count(),\n\t\t\t$order->get_shipping_total(),\n\t\t\t$order->get_total_tax()\n\t\t);\n\n\t\t$country_code = WC()->countries->get_country_calling_code( $order->get_billing_country() );\n\t\t$phone_number = preg_replace( '/[^0-9]/i', '', $order->get_billing_phone() );\n\t\tif ( $country_code === substr( $phone_number, 0, strlen( $country_code ) ) ) {\n\t\t\t$phone_number = substr( $phone_number, strlen( $country_code ) );\n\t\t}\n\n\t\t$data = array(\n\t\t\t'amount' => $order->get_total(),\n\t\t\t'currency' => $order->get_currency(),\n\t\t\t'threeDSecure' => true,\n\t\t\t'save_card' => false,\n\t\t\t'description' => $description,\n\t\t\t'statement_descriptor' => 'Sample',\n\t\t\t'reference' => array(\n\t\t\t\t'order' => $order->get_id()\n\t\t\t),\n\t\t\t'receipt' => array(\n\t\t\t\t'email' => false,\n\t\t\t\t'sms' => false\n\t\t\t),\n\t\t\t'customer' => array(\n\t\t\t\t'first_name' => $order->get_billing_first_name(),\n\t\t\t\t'last_name' => $order->get_billing_last_name(),\n\t\t\t\t'email' => $order->get_billing_email(),\n\t\t\t\t'phone' => array(\n\t\t\t\t\t'country_code' => $country_code,\n\t\t\t\t\t'number' => $phone_number\n\t\t\t\t)\n\t\t\t),\n\t\t\t'source' => array(\n\t\t\t\t'id' => $token\n\t\t\t),\n\t\t\t'post' => array(\n\t\t\t\t'url' => 'http://your_website.com/post_url'\n\t\t\t),\n\t\t\t'redirect' => array(\n\t\t\t\t'url' => $order->get_checkout_order_received_url()\n\t\t\t)\n\t\t);\n\n\t\treturn $this->request( 'charges', 'POST', $data );\n\t}", "public function lowBalanceAlert () {\n\t\t\t//check the sms balance before sending message out\n\t\t\t$balance = (int)$this->balance();\n\t\t\tif ($balance < 300) {\n\t\t\t\t// build the query\n\t\t\t\tif (!$this->lowBalanceAlertTo) return;\n\t\t\t\t\n\t\t\t\t$query_key_value = [\n\t\t\t\t\t'to' \t=> $this->lowBalanceAlertTo,\n\t\t\t\t\t'text' \t=> sprintf($this->lowBalanceMessage, $balance)\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t// get the response from the api server in json format\n\t\t\t\t$this->request($query_key_value);\n\t\t\t}\n\t\t}", "public function onCharge($order)\n {\n throw new GatewayException('Payment failed.');\n \treturn false;\n }", "public function recreateChargeAction()\n\t\t{\n\t\t\t$config = Config::getInstance();\n\t\t\t// Parameters.\n\t\t\t$this->_setParam( 'shopify_form', 'main' );\n\t\t\t// Cancel old charge.\n\t\t\tif ( !$this->_getParam( 'canceled' ) ) {\n\t\t\t\t$returnUrl = base64_encode( $this->view->url( array (\n\t\t\t\t\t'canceled' => '1'\n\t\t\t\t) ) );\n\t\t\t\t$this->_setParam( 'return_url', $returnUrl );\n\t\t\t\t$this->_forward( 'cancel-recurring-charge' );\n\t\t\t}\n\t\t\t// Create a new one.\n\t\t\telse {\n\t\t\t\t$chargeName = Zend_Registry::get( 'translate' )->_( 'pay for shopify app' );\n\t\t\t\t$returnUrl = $config->plugin->center->baseUrl . 'payment/shopify/finish-charge';\n\t\t\t\t$charge = Table::_( 'charges' )->get(\n\t\t\t\t\t$this->_getParam( 'charge_id' )\n\t\t\t\t);\n\t\t\t\t$shop = Table::_( 'shops' )->get( $charge->shop_id );\n\t\t\t\t$plugin = Table::_( 'plugins' )->get( $charge->plugin_id );\n\t\t\t\t$instance = Table::_( 'plugins' )->getInstance( $shop->id, $plugin->id );\n\t\t\t\t$instance->setSetting( 'trial changed', '0' );\n\t\t\t\t$currentPlan = Table::_( 'plans' )->getPlan(\n\t\t\t\t\t$plugin->id, $instance->getSetting( 'current plan' )->value\n\t\t\t\t);\n\t\t\t\t$products = $currentPlan->getProducts();\n\t\t\t\t// Parameters.\n\t\t\t\t$this->_setParam( 'shop', base64_encode( $shop->name ) );\n\t\t\t\t$this->_setParam( 'plugin', base64_encode( $plugin->name ) );\n\t\t\t\t$this->_setParam( 'plan', base64_encode( $currentPlan->getName() ) );\n\t\t\t\t$this->_setParam( 'product_id', $products->getRow( 0 )->id );\n\t\t\t\t$this->_setParam( 'recurrent', '1' );\n\t\t\t\t$this->_setParam( 'recreate', '1' );\n\t\t\t\t$this->_setParam( 'charge_name', base64_encode( $chargeName ) );\n\t\t\t\t$this->_setParam( 'charge_price', $products->getRow( 0 )->price );\n\t\t\t\t$this->_setParam( 'charge_return_url', base64_encode( $returnUrl ) );\n\t\t\t\t// Forward.\n\t\t\t\t$this->_forward( 'do-charge' );\n\t\t\t}\n\t\t}", "public function sendMoney() {\n // @TODO Do something\n echo 'VTB';\n parent::sendMoney();\n }", "public function notifyPayment()\n {\n }", "public function notify()\n {\n // @TODO: Needs to handle the various types of bounces: References, Recommendations, and general bounces that should be purged\n }", "function wceasypay_woocommerce_notice_mbway_2()\n{\n echo '<div class=\"error\"><p>' . __('WooCommerce Easypay Gateway depends on the last version of <a href=\"http://wordpress.org/extend/plugins/woocommerce/\">WooCommerce</a> to work!', 'wceasypay') . '</p></div>';\n}", "function wp_stripe_charge($amount, $card, $name, $description) {\n\n /*\n * Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically\n */\n\n $currency = 'usd';\n\n /*\n * Card - Token from stripe.js is provided (not individual card elements)\n */\n\n $charge = array(\n 'card' => $card,\n 'amount' => $amount,\n 'currency' => $currency,\n );\n\n if ( $description ) {\n $charge['description'] = $description;\n }\n\n $response = Stripe_Charge::create($charge);\n\n return $response;\n\n}", "public function get_amount_requested()\n {\n }", "public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }", "public function getCharge()\n {\n return $this->_fields['Charge']['FieldValue'];\n }", "function ec_woocommerce_custom_surcharge() {\nglobal $woocommerce;\n \n\tif ( is_admin() && ! defined( 'DOING_AJAX' ) )\n\treturn;\n\t \n\t$percentage = 0.01;\n\t$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;\n\t$woocommerce->cart->add_fee( 'Surcharge', $surcharge, true, 'standard' );\n \n}", "public function setCharge($Charge){\n $this->Charge = $Charge;\n }", "public function forceCheckoutOnContribute(){\n\t\tif(!$this->canContribute()){\n\t\t\t$_SESSION['flashMessage'] = \"Sorry, you will need complete this purchase before you can send another gift.\";\n\t\t\tview::Redirect('cart', 'index');\n\t\t}\n\t}", "function createCharge($payload) {\r\n $end_point = $this->tpi_server_domain.'/payment/xendit/credit-card/charges';\r\n\r\n $args = array(\r\n 'headers' => $this->defaultHeader(),\r\n 'timeout' => WC_Xendit_PG_API::DEFAULT_TIME_OUT,\r\n 'body' => json_encode($payload),\r\n 'user-agent' => 'WooCommerce ' . WC()->version\r\n );\r\n \r\n try {\r\n $response = wp_remote_post($end_point, $args);\r\n $this->handleNetworkError($response);\r\n $jsonResponse = json_decode($response['body'], true);\r\n\r\n return $jsonResponse;\r\n } catch (Exception $e) {\r\n throw new Exception($e->getMessage());\r\n }\r\n }", "public function finishChargeAction()\n\t\t{\n\t\t\t// Parameters.\n\t\t\t$chargeId = $this->_getParam( 'charge_id' );\n\t\t\t// Charge local data.\n\t\t\t$session = new Zend_Session_Namespace( 'do-charge' );\n\t\t\t$shop = Table::_( 'shops' )->get( $session->shop );\n\t\t\t$plugin = Model::_( 'payment' )->getPlugin( 'shopify', $session->plugin );\n\t\t\t$instance = Table::_( 'plugins' )->getInstance( $shop->id, $plugin->id );\n\t\t\t$basePlan = $this->getHelper( 'Shopify' )\n\t\t\t\t->getBasePlan( $session->plan );\n\t\t\t$plan = Model::_( 'payment' )->getPlan( $basePlan );\n\t\t\t// Recurring or One-time charge.\n\t\t\t$chargeApiName = $session->recurrent ? 'recurring_application_charge' : 'application_charge';\n\t\t\t// Get shopify charge data.\n\t\t\t$api = $this->getHelper( 'ShopifyApi' );\n\t\t\t$api->initialize( $shop->name, $session->token );\n\t\t\t$response = $api->get( $chargeApiName . 's', $chargeId );\n\t\t\t// Activate charge.\n\t\t\t$chargeAccepted = (\n\t\t\t\tisset ( $response->$chargeApiName ) &&\n\t\t\t\t( $response->$chargeApiName->status == 'accepted' )\n\t\t\t);\n\t\t\tif ( $chargeAccepted ) {\n\t\t\t\t$charge = $response->$chargeApiName;\n\t\t\t\t$response = $api->post( $chargeApiName . 's/activate', $chargeId, array (\n\t\t\t\t\t$chargeApiName => (array) $charge\n\t\t\t\t) );\n\t\t\t\t// Save charge.\n\t\t\t\tif ( $response === true ) {\n\t\t\t\t\t$details = '';\n\t\t\t\t\tforeach ( $charge as $key => $val ) {\n\t\t\t\t\t\t$details .= \"{$key}={$val}\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tTable::_( 'charges' )->insert( array (\n\t\t\t\t\t\t'charge_id' => $chargeId,\n\t\t\t\t\t\t'shop_id' => $shop->id,\n\t\t\t\t\t\t'plugin_id' => $plugin->id,\n\t\t\t\t\t\t'payment_plan_id' => $plan->id,\n\t\t\t\t\t\t'product_id' => $session->overdraft ? null : $session->product_id,\n\t\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t\t'recurring' => (integer) $session->recurrent,\n\t\t\t\t\t\t'overdraft' => (integer) $session->overdraft,\n\t\t\t\t\t\t'amount' => $charge->price,\n\t\t\t\t\t\t'date' => $charge->created_at,\n\t\t\t\t\t\t'details' => $details\n\t\t\t\t\t) );\n\t\t\t\t\t// Mark overdraft as paid.\n\t\t\t\t\tif ( $session->overdraft ) {\n\t\t\t\t\t\t$tableStatisticsOptions = new Default_Model_DbTable_OptionStatistics();\n\t\t\t\t\t\tforeach ( $session->ids as $id ) {\n\t\t\t\t\t\t\t$tableStatisticsOptions->overdraftStatus( $id, 'paid' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n/*\n\t\t\t\t\t// Change paid till date.\n\t\t\t\t\telse if () {\n\t\t\t\t\t\t$lastInsertId = Table::_( 'charges' )->getAdapter()->lastInsertId();\n\t\t\t\t\t\t$charge = Table::_( 'charges' )->get( $lastInsertId );\n\t\t\t\t\t\t$instance->paidTill(\n\t\t\t\t\t\t\t$charge->paidPeriod()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n*/\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Go to plugin.\n\t\t\t$action = $session->install ? 'install' : '';\n\t\t\t$this->getHelper( 'Shopify' )\n\t\t\t\t->gotoPlugin( $plugin->name, $action );\n\t\t}", "public function calculateCharge($biconcharges, $bireconcharges) {\n\t\n\t\t$accommodation = $this->accommodation;\n\t\t$day_arriving = $this->day_arriving;\n\t\t$day_leaving = $this->day_leaving;\n\t $nights = $day_leaving - $day_arriving;\n\n\t\tif ($this->paymentlevel && $this->bireconpaymentlevel) {\n\t\t # This person is attending both events.\n\t\t\t$biconband = $biconcharges->getBand($this);\n\t\t\t$bireconband = $bireconcharges->getBand($this);\n\t\t\t$charge = $bireconband->full_rate + \t$biconband->full_rate;\n\t\t\tif ($accommodation == 'on-site' && $nights > 0) {\n\t\t\t # Wednesday and Thursday are charged at BiReCon rates. All other days are charged at BiCon rates.\n\t\t\t\tif ($day_arriving <= 2) {\n\t\t\t\t\tif ($day_leaving > 3) {\n\t\t\t\t\t\t$birecon_nights = 3 - $day_arriving;\n\t\t\t\t\t\t$bicon_nights = $day_leaving - 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t $birecon_nights = $nights;\n\t\t\t\t\t\t$bicon_nights = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$charge += ($birecon_nights * $bireconband->room_rate) + ($bicon_nights * $biconband->room_rate);\n\t\t\t\t} else {\n\t\t\t\t\t$charge += ($nights * $biconband->room_rate);\n \t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t if ($this->paymentlevel) {\n\t\t\t\t$band = $biconcharges->getBand($this);\t\n\t\t } elseif ($this->bireconpaymentlevel) {\n\t\t\t\t$band = $bireconcharges->getBand($this);\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$charge = $band->full_rate;\n\t\t\tif ($accommodation == 'on-site' && $nights > 0) {\n\t\t\t\t$charge += ($nights * $band->room_rate);\n\t\t\t}\n\t\t}\n\t \n\t\treturn $charge;\n\t}", "public function setCharges($charges)\n {\n $this->charges = $charges;\n }", "function on_buy()\r\n\t{\r\n\t}", "public function payWayPurchase()\n\t{\n\t}", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public function getAdditionalCharge(){\n return $this->AdditionalCharge;\n }", "public function deliveryPriceOutDhaka()\n {\n }", "function __construct ()\n\t\t{\n\t\t\tparent::__construct ('Charges', 'Charge', 'Charge');\n\t\t}", "public function testWeaklingsCauseBounty()\n {\n if (!(defined('DEBUG') && DEBUG)) {\n $this->markTestSkipped(); // No merchant2 in non-debug scenarios for now.\n } else {\n $merchant = new Npc('merchant2');\n $this->assertGreaterThan(0, $merchant->bountyMod());\n $villager = new Npc('peasant2');\n $this->assertGreaterThan(0, $villager->bountyMod());\n }\n }", "public function getCapturableAmount();", "public function maybe_print_subscription_limit_notice()\n {\n\n global $product;\n\n // Product limits are applied\n if (!$this->maybe_make_product_not_purchasable(true, $product)) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have a subscription on this site.', 'subscriptio'), 'notice');\n }\n // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have it in one of your subscriptions.', 'subscriptio'), 'notice');\n }\n }\n }", "private function ProcessChargeFailed($event)\r\n\t\t{\r\n\t\t\t// TODO: Figure out how this is supposed to get set.\r\n\t\t\t//$customer_id = $event->data->object->customer;\r\n\t\t\t$customer_id = $this->GetUser();\r\n\t\t\t$customer = $this->Stripe->RetrieveCustomer($customer_id);\r\n\r\n\t\t\t$body = sprintf('\r\n\t\t\t\tHello %s,\\n\\n\r\n\t\t\t\tWe have failed to process your payment.\\n\\n\r\n\t\t\t\tPlease click here to <a href=\"%s?customer_id=%s\">update your payment information</a>.\\n\\n\r\n\t\t\t\tThank you!',\r\n\t\t\t\t$customer->description,\r\n\t\t\t\tself::UPDATE_CC_LINK,\r\n\t\t\t\t$customer_id\r\n\t\t\t);\r\n\r\n\t\t\t$mail = array(\r\n\t\t\t\t'headers' => array(\r\n\t\t\t\t\t'From: ' . html_entity_decode(get_bloginfo('name')) . ' <' . get_bloginfo('admin_email') . '>',\r\n\t\t\t\t\t'BCC: billing@freeupwebstudio.com'\r\n\t\t\t\t),\r\n\t\t\t\t'subject' => __('Failed Payment', self::STRIPE_WEBHOOK),\r\n\t\t\t\t'body' => $body\r\n\t\t\t);\r\n\r\n\t\t\t$this->Stripe->NotifyCustomerChargeFailed($customer, $mail);\r\n\t\t}", "public function rechargePerRound() {\r\n\t\tif ($this->isReactor()) {\r\n\t\t\treturn ($this->amount() * $this->recharge());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function shift_handle_donate() {\n\n\t// include Stripe\n\trequire_once( __dir__ . '/stripe-php/init.php' );\n\n\t\\Stripe\\Stripe::setApiKey($stripeKey);\n\n\t$token = $_POST['token'];\n\n\ttry {\n\t\t$charge = \\Stripe\\Charge::create(array(\n\t\t\t\"amount\" => $_POST['amount'] * 100,\n\t\t\t\"currency\" => \"cad\",\n\t\t\t\"description\" => \"Donation to Shift\",\n\t\t\t\"source\" => $token\n\t\t));\n\n\t\tdie(json_encode(array('message' => 'Thank you! Your donation of $' . $_POST[\"amount\"] . ' has been sent.')));\n\t} catch (Exception $e) {\n\t\tdie(json_encode(array('error' => $e->getMessage())));\n\t}\n\n}", "public function chargeFee($amount = false) {\n $this->checkFee($amount);\n\n if(!$amount) {\n $fee = config('games.under_over.entry_fee');\n } else {\n $fee = $amount;\n }\n \n // deduct from the gold of current user\n $this->gold = $this->gold - $fee;\n try {\n $this->saveOrFail();\n } catch(QueryException $ex) {\n throw new PersonalRuntimeException(__('common.errors.invalid_query'));\n }\n }", "public function testCapturePartialAmount()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_PARTIALLY_REFUSED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 16944\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(1, $messages = $this->captureReceiver->getSent());\n $this->assertEquals(8472, $messages[0]->getMessage()->getAmount());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public function getChargeReply()\n {\n return $this->get(self::_CHARGE_REPLY);\n }", "function reduce_woocommerce_min_strength_requirement( $strength ) {\n return 2;\n}", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "public function testCaptureFullAmount()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_ALL_VALIDATED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 16944\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(1, $messages = $this->captureReceiver->getSent());\n $this->assertEquals(16944, $messages[0]->getMessage()->getAmount());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public function getCharges();", "function wp_stripe_charge($amount, $card, $name, $description) {\n\n\t/*\n\t * Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically\n\t */\n\n\t$currency = 'usd';\n\n\t/*\n\t * Card - Token from stripe.js is provided (not individual card elements)\n\t */\n\n\t$charge = array(\n\t\t'card' => $card,\n\t\t'amount' => $amount,\n\t\t'currency' => $currency,\n\t);\n\n\tif ($description) {\n\t\t$charge['description'] = $description;\n\t}\n\n\t$response = Stripe_Charge::create($charge);\n\n\treturn $response;\n}", "public function getCurrentCharge()\n {\n return $this->current_charge;\n }", "public function getMinimumCharge()\r\n {\r\n return $this->basket->sCheckMinimumCharge();\r\n }", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "public function useBattery() {\n $time = $this->floor->getCleaningTime();\n if ($time <= $this->remainingBattery()) {\n $this->remainingBatteryTime = $this->remainingBattery() - $time;\n $this->floor->doneCleaning();\n echo sprintf(\"Battery Remaining for %s seconds\" . PHP_EOL, $this->remainingBattery());\n } else {\n $this->charge();\n }\n }", "function wpmu_checkAvailableSpace()\n {\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function Take_Gold($amount = 0) {\r\n\t\tglobal $character, $gameinstance;\r\n\t\tif(isset($amount) && is_numeric($amount) && $amount >= 0 && $amount <= $character['gold']) \r\n\t\t{\r\n\t\t\tdbn(__FILE__,__LINE__,\"update ${gameinstance}_characters set gold = gold - '$amount' where login_id = '$character[login_id]'\");\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tSystemMessage(CHAR_NOT_ENOUGH_GOLD);\r\n\t\t}\r\n\t}", "public function bookCreditBalance($relatedDocNo, $gsaUid, $amount) {\n trace('[METHOD] '.__METHOD__);\n \n $gsaAccTransAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $gsaShopTransAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $freeCreditArr = $gsaAccTransAccessorObj->selectFreeCredits($gsaUid);\n $amountResidual = $amount;\n foreach ($freeCreditArr as $key=>$creditDocNo) {\n \n \n $freeCredit = $gsaShopTransAccessorObj->selectTransactionDocumentData($creditDocNo);\n $freeCreditUpdate = array();\n $credit = bcsub($freeCredit['ENDPRB'],$freeCredit['GUTSCHRIFTZAHLUNG'],$this->precision);\n if (bcsub($credit,$amountResidual,$this->precision) > 0) {\n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($amountResidual,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n $amountResidual = 0; \n } else {\n $amountResidual = bcsub($amountResidual,$credit,$this->precision); \n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($credit,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n }\n $freeCreditUpdate['LETZTERUSER'] = 'Online-Shop selected by Customer'; // data type: varchar(30)\n $freeCreditUpdate['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n \n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $gsaShopTransAccessorObj->updateTransactionDocument($freeCredit['AUFNR'], $freeCreditUpdate);\n } \n if ($amountResidual <= 0) {\n break;\n }\n \n } \n\n if ($amountResidual > 0) {\n $this->bookPayment($relatedDocNo, bcsub($amount, $amountResidual,$this->precision), 0, false, date('Y-m-d'), $additionalNote='Online-Shop '.$gsaUid, $amount);\n //throw new tx_pttools_exception('There is not enough free credit for this customer', 3);\n } else {\n $this->bookPayment($relatedDocNo, $amount, 0, false, date('Y-m-d'), $additionalNote='Online-Shop Customer:'.$gsaUid, $amount);\n }\n // get related customer object, set booking data\n $customerObj = new tx_ptgsauserreg_customer($gsaUid);\n $bookingDate = date('Y-m-d');\n \n // update the related customer's transaction volume (\"Umsatz\"): ADRESSE.KUMSATZ, KUNDE.UMSATZ, KUNDE.SALDO, KUNDE.LETZTERUMSATZ\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $customerObj->registerTransactionVolume(0); // saldo and umsatz doesn't change\n }\n }", "function buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$topamount=intval(get_option('max_quota'));\n\n\t\tif ($price==0) $topamount=$pointsleft; else $topamount=intval(round($pointsleft/$price));\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// Screen\n\t\t$submit_name=do_lang_tempcode('TITLE_QUOTA');\n\t\t$post_url=build_url(array('page'=>'_SELF','type'=>'_buyquota','id'=>'pop3'),'_SELF');\n\t\t$text=do_template('POINTSTORE_QUOTA',array('_GUID'=>'1282fae968b4919bcd0ba1e3ca169fe8','POINTS_LEFT'=>integer_format($pointsleft),'PRICE'=>integer_format($price),'TOP_AMOUNT'=>integer_format($topamount),'EMAIL'=>$prefix.$suffix));\n\t\trequire_code('form_templates');\n\t\t$fields=form_input_integer(do_lang_tempcode('QUOTA'),do_lang_tempcode('QUOTA_DESCRIPTION'),'quota',100,true);\n\t\treturn do_template('FORM_SCREEN',array('_GUID'=>'1c82c713beaa03d1e3045e50295c722c','HIDDEN'=>'','URL'=>$post_url,'TITLE'=>$title,'FIELDS'=>$fields,'TEXT'=>$text,'SUBMIT_NAME'=>$submit_name));\n\t}", "function calculateCharge($base, $extraHours, $charge)\r\n {\r\n return ($base + ($extraHours * $charge));\r\n }", "abstract protected function handlePayment();", "public function doPayment($chapId, $buildId, $appId, $mobileNo, $appName, $price)\n {\n $currencyUserModel = new Api_Model_CurrencyUsers();\n $currencyDetails = $currencyUserModel->getCurrencyDetailsByChap($chapId);\n $currencyRate = $currencyDetails['rate'];\n $currencyCode = $currencyDetails['code'];\n\n\n $price = $this->getAirtelPricePoints(ceil($currencyRate * $price));\n\n\n $soapUrl = 'https://41.222.198.77:8443/ChargingWeb/services/ChargingExport1_ChargingHttpPort';\n\n $msg = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n xmlns:char=\"\n http://ChargingProcess/com/ibm/sdp/services/charging/abstraction/Charging\">\n <soapenv:Header/>\n <soapenv:Body>\n <char:charge>\n <inputMsg>\n <operation>debit</operation>\n <userId>'.$mobileNo.'</userId>\n <contentId>111</contentId>\n <itemName>SRKP</itemName>\n <contentDescription>Apps</contentDescription>\n <circleId/>\n <lineOfBusiness/>\n <customerSegment/>\n <contentMediaType>AppsPurchases'.$price.'0</contentMediaType>\n <serviceId>1</serviceId>\n <parentId/>\n <actualPrice>'.$price.'.0</actualPrice>\n <basePrice>'.$price.'.0</basePrice>\n <discountApplied>0</discountApplied>\n <paymentMethod/>\n <revenuePercent/>\n <netShare>0</netShare>\n <cpId>AIRTELAPPSSTORE</cpId>\n <customerClass/>\n <eventType>Content Purchase</eventType>\n <localTimeStamp/>\n <transactionId/>\n <subscriptionName>SRKPic</subscriptionName>\n <parentType/>\n <deliveryChannel>sms</deliveryChannel>\n <subscriptionTypeCode>abcd</subscriptionTypeCode>\n <subscriptionExternalId>2</subscriptionExternalId>\n <contentSize/>\n <currency>UNI</currency>\n <copyrightId>xxx</copyrightId>\n <cpTransactionId>rhKJJH</cpTransactionId>\n <copyrightDescription>copyright</copyrightDescription>\n <sMSkeyword>sms</sMSkeyword>\n <srcCode>abcd</srcCode>\n <contentUrl>www.ibm.com (http://www.ibm.com)</contentUrl> (\n \t\thttp://www.ibm.com%29%3C/contentUrl%3E)\n \t\t<subscriptiondays>1</subscriptiondays>\n \t\t</inputMsg>\n \t\t</char:charge>\n \t\t</soapenv:Body>\n \t\t</soapenv:Envelope>';\n\n $headers = array(\n \"Content-type: text/xml;charset=\\\"utf-8\\\"\",\n \"Accept: text/xml\",\n \"Cache-Control: no-cache\",\n \"Pragma: no-cache\",\n \"SOAPAction: https://AgUser:AgUser@41.222.198.77:8443/ChargingWeb/services/ChargingExport1_ChargingHttpPort\",\n \"Content-length: \".strlen($msg),\n ); //SOAPAction: your op URL\n\n $url = $soapUrl;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10000);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10000);\n curl_setopt($ch, CURLOPT_SSLVERSION, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n // curl_setopt($ch, CURLOPT_CAINFO, APPLICATION_PATH . '/configs/certrw.crt');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, 'AgUser:AgUser');\n curl_setopt($ch, CURLOPT_TIMEOUT, 100000);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $msg);\n\n $result = curl_exec($ch);\n \n\n $paymentTimeStamp = date('d-m-Y H:i:s');\n $buildUrl = null;\n\n $doc = new DOMDocument();\n $doc->loadXML($result);\n\n $paymentTimeStamp = date('d-m-Y');\n\n $buildUrl = null;\n\n //echo $doc->getElementsByTagName('status')->item(0)->nodeValue;die();\n\n if('Success' == $doc->getElementsByTagName('status')->item(0)->nodeValue)\n {\n \n //Get the S3 URL of the Relevant build\n $productDownloadCls = new Nexva_Api_ProductDownload();\n $buildUrl = $productDownloadCls->getBuildFileUrl($appId, $buildId);\n\n //$message = 'Y\\'ello, vous avez ete facture '. $amount.' '.$currencyCode. ' le '.$paymentTimeStamp. ' pour un telechargement depuis MTN app-store. Merci.';\n $message = 'Hello, your account was charged '. $price.'u at '.$paymentTimeStamp. ' for the successful transaction on the Airtel DRC App Store. Thank you.';\n $this->sendsms($mobileNo, $message, $chapId);\n\n $paymentResult = 'Success';\n $paymentTransId = strtotime($paymentTimeStamp);\n\n //parent::UpdateMobilePayment($paymentTimeStamp, $paymentTransId, $paymentResult, $buildUrl);\n if($this->_paymentId){\n parent::UpdateMobilePayment($paymentTimeStamp, $paymentTransId, $paymentResult, $buildUrl);\n }\n\n } else {\n $paymentResult = 'Fail';\n $paymentTransId = strtotime($paymentTimeStamp);\n //parent::UpdateMobilePayment($paymentTimeStamp, $paymentTransId, $paymentResult, $buildUrl);\n\n if($this->_paymentId){\n parent::UpdateMobilePayment($paymentTimeStamp, $paymentTransId, $paymentResult, $buildUrl);\n }\n }\n\n return $buildUrl;\n }", "public function chargeStop(){\n\t\treturn $this->_sendPacketToController(self::CHARGE_STOP);\n\t}", "function ProcessRefundAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Refund amount notifications inform you that a customer has been\n * refunded either the full amount or a partial amount of an order\n * total. A <refund-amount-notification> contains the order number\n * that Google assigned to the order, the value of the most recent\n * refund to the customer and the total amount that has been\n * refunded to the customer for the order. Google Checkout will send a\n * <refund-amount-notification> after refunding the customer.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <refund-amount-notification> to your internal systems that\n * process this order data.\n */\n SendNotificationAcknowledgment();\n}", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}", "function action_woocommerce_send_sms_order_hold($order_id) {\n # code...\n}", "function recharge_from_wallet_with_card(){\n\t\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t\t$card_no=$_REQUEST['card_number'];\n\t\t\t$cvv_no=$_REQUEST['cvv_no'];\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t//$recharge_transaction_id=$_POST['recharge_transaction_id'];\n\t\t\t$recharge_category_id = $_REQUEST['recharge_category_id']; //1- Mobile,2-DTH\n\t\t\t$operator_id = $_REQUEST['operator_id'];\n\t\t\t$rec_number=$_REQUEST['recharge_number'];\n\t\t\t$recharge_number = country_code.$_REQUEST['recharge_number'];\n\t\t\t$recharge_amount = $_REQUEST['recharge_amount'];\n\t\t\t$wallet_type = 2; // 1- Credit, 2-Debit\n\t\t\t$recharge_status = 1;\n\t\t\t$wt_category='2';// 1-Add money,2-Recharge\n\t\t\t$wallet_category='4'; // 4- Cashback\n\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\tif(!empty($recharge_user_id) && !empty($operator_id)&& !empty($recharge_number)&& !empty($recharge_amount))\n\t\t{\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t$wallet_used_amount = $records['0']['wallet_amount'];\n\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t$card_deduct_amount=$recharge_amount-$wallet_amount;\n\t\t\t\t\n\t\t\t\t$admin=$this->conn->get_all_records('admin');\n\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\n\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,user_wallet_rec_amount,user_card_card_rec_amount', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $recharge_amount . '\",\"' . $wt_category . '\",\"' .$transaction_id . '\",\"' . $wt_desc . '\",\"' .$wallet_amount . '\",\"' . $card_deduct_amount . '\"');\n\t\t\t\t\t\t\n\t\t\t\tif($recharge){\n\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('recharge','recharge_transaction_id,recharge_user_id, rechage_category,operator_id,rechage_type,recharge_number,recharge_amount,recharge_date,recharge_status','\"'.$transaction_id . '\",\"' . $recharge_user_id . '\",\"' . $recharge_category_id . '\",\"' . $operator_id . '\",\"' . $recharge_type_id . '\",\"' . $recharge_number . '\",\"' . $recharge_amount . '\",\"' . $current_date . '\",\"' . $recharge_status . '\"');\n\t\t\t\t\t\n\t\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\tif($reffer_status=='2'){\n\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t\t\t\t$wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t\t\t\t\t\t\t$refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t\t\t\t\t\t\t$wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t\t\t\t$wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\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\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t$data_frnd['wallet_amount']=$wallet+$refferal_amount;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data_frnd);\n\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// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t\t\t\t\t$data12['reffer_amount_status']=1;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data12);\n\t\t\t\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$cashback_record_id=$recharge_number;\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\tif(!empty($coupon_apply)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' .$transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\t\t\t\t\t\n\t\t\t\t\t// wallet amont set zero \n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t}\n\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t$admin_update_wallet=$admin_wallet+$recharge_amount;\n\t\t\t\t\t$data_admin['admin_wallet']=$admin_update_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('admin', 'admin_id',1, $data_admin);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Recharge Successfully\", \"recharge_id\" => $recharge,'recharge_number'=>$rec_number,'recharge_amount'=>$recharge_amount,'wallet_used_amount'=>$wallet_used_amount,'card_used_amount'=>$card_deduct_amount,'wallet_amount'=>$wallet_amount,'recharge_date'=>$current_date,'transaction_id'=>$transaction_id);\n\t\t\t\t}else{\n\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Recharge failed\");\n\t\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$recharge_user_id,'recharge_category_id'=>$recharge_category_id,'operator_id'=>$operator_id,'recharge_type_id'=>$recharge_type_id,'recharge_number'=>$recharge_number,'recharge_amount'=>$recharge_amount);\n\t\t}\n\t\techo $this -> json($post);\n\t\t\t\n\t\t\t\n\t\t\t\n}", "function action_woocommerce_send_sms_order_refunded($order_id) {\n # code...\n}", "public function sendBill($params) {\n $sp_code = $this->sp_code; // \\Yii::$app->params['GePG']['sp_code'];\n $sp_subcode = $this->sp_subcode; // \\Yii::$app->params['GePG']['sp_subcode'];\n $service_provider_id = $this->sp_id; // \\Yii::$app->params['GePG']['sp_id'];\n /////bill details\n $bill_no = $params[\"bill_number\"];\n $bill_amount = $params[\"amount\"];\n $bill_type = $params['bill_type']; // e.g 140313\n $bill_desc = $params['bill_description']; // Bill details \"Application Fees Payment\";\n $bill_gen_date = $params['bill_gen_date']; //date('Y-m-d' . '\\T' . 'H:i:s');\n $bill_gernerated_by = $params['bill_gernerated_by'];\n $bill_payer_id = $params['bill_payer_id'];\n $bill_payer_name = trim($params['payer_name']);\n $payer_phone_number = trim($params[\"payer_phone_number\"]);\n $bill_reference_table_id=$params['bill_reference_table_id'];\n $bill_reference_table=$params['bill_reference_table'];\n $bill_expiry_date=$params['bill_expiry_date'];\n $payer_email = \"\";\n $content = \"<gepgBillSubReq>\" .\n \"<BillHdr>\" .\n \"<SpCode>\" . $sp_code . \"</SpCode>\" .\n \"<RtrRespFlg>true</RtrRespFlg>\" .\n \"</BillHdr>\" .\n \"<BillTrxInf>\" .\n \"<BillId>\" . $bill_no . \"</BillId>\" .\n \"<SubSpCode>\" . $sp_subcode . \"</SubSpCode>\" .\n \"<SpSysId>\" . $service_provider_id . \"</SpSysId>\" .\n \"<BillAmt>\" . $bill_amount . \"</BillAmt>\" .\n \"<MiscAmt>0</MiscAmt>\" .\n \"<BillExprDt>\" . Date('Y-m-d' . '\\T' . 'h:i:s', strtotime(\"+$bill_expiry_date days\")) . \"</BillExprDt>\" .\n \"<PyrId>\" . $bill_payer_id . \"</PyrId>\" .\n \"<PyrName>\" . $bill_payer_name . \"</PyrName>\" .\n \"<BillDesc>\" . $bill_desc . \"</BillDesc>\" .\n \"<BillGenDt>\" . $bill_gen_date . \"</BillGenDt>\" .\n \"<BillGenBy>\" . $bill_gernerated_by . \"</BillGenBy>\" .\n \"<BillApprBy>\" . $bill_payer_name . \"</BillApprBy>\" .\n \"<PyrCellNum>\" . $payer_phone_number . \"</PyrCellNum>\" .\n \"<PyrEmail>\" . $payer_email . \"</PyrEmail>\" .\n \"<Ccy>TZS</Ccy>\" .\n \"<BillEqvAmt>\" . $bill_amount . \"</BillEqvAmt>\" .\n \"<RemFlag>false</RemFlag>\" .\n \"<BillPayOpt>3</BillPayOpt>\" .\n \"<BillItems>\" .\n \"<BillItem>\" .\n \"<BillItemRef>\" . $bill_no . \"</BillItemRef>\" .\n \"<UseItemRefOnPay>N</UseItemRefOnPay>\" .\n \"<BillItemAmt>\" . $bill_amount . \"</BillItemAmt>\" .\n \"<BillItemEqvAmt>\" . $bill_amount . \"</BillItemEqvAmt>\" .\n \"<BillItemMiscAmt>0</BillItemMiscAmt>\" .\n \"<GfsCode>\" . $bill_type . \"</GfsCode>\" .\n \"</BillItem>\" .\n \"</BillItems>\" .\n \"</BillTrxInf>\" .\n \"</gepgBillSubReq>\";\n $signature = $this->generateSignature($content);\n $data_string = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n return $this->postRequest($data_string);\n }", "public function actionCharge()\n {\n// See your keys here: https://dashboard.stripe.com/account/apikeys\n \\Stripe\\Stripe::setApiKey('sk_test_3SFREJy3Pla0AW4tWJXb4euo00B75ruITD');\n $post = filter_var_array($_POST, FILTER_SANITIZE_STRING);\n $first_name = $post['first_name'];\n $last_name = $post['last_name'];\n $email = $post['email'];\n $token = $post['stripeToken'];\n\n $customer = \\Stripe\\Customer::create(array(\n 'email' => $email,\n 'source' => $token\n ));\n\n $charge = \\Stripe\\Charge::create(array(\n 'amount' => 5000,\n 'currency' => 'usd',\n 'description' => 'Intro to React course',\n 'customer' => $customer->id\n ));\n\n echo \"<pre>\"; print_r($charge);\n\n\n }", "public function chargePaymentShouldCallCreateOnResourceServiceWithNewCharge(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($charge) use ($payment) {\n /** @var Charge $charge */\n $newPayment = $charge->getPayment();\n return $charge instanceof Charge &&\n $charge->getAmount() === 1.234 &&\n $charge->getCurrency() === 'myTestCurrency' &&\n $charge->getOrderId() === null &&\n $charge->getInvoiceId() === null &&\n $newPayment instanceof Payment &&\n $newPayment === $payment &&\n in_array($charge, $newPayment->getCharges(), true);\n }));\n\n $paymentSrv = $heidelpay->setResourceService($resourceSrvMock)->getPaymentService();\n $returnedCharge = $paymentSrv->chargePayment($payment, 1.234, 'myTestCurrency');\n $this->assertEquals([$returnedCharge], $payment->getCharges());\n }", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "public function setCharges($charges);", "public function setCharge($value)\n {\n $this->_fields['Charge']['FieldValue'] = $value;\n return $this;\n }", "public function chargePaymentShouldSetArgumentsInNewChargeObject(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($charge) use ($payment) {\n /** @var Charge $charge */\n $newPayment = $charge->getPayment();\n return $charge instanceof Charge &&\n $charge->getAmount() === 1.234 &&\n $charge->getCurrency() === 'myTestCurrency' &&\n $charge->getOrderId() === 'orderId' &&\n $charge->getInvoiceId() === 'invoiceId' &&\n $newPayment instanceof Payment &&\n $newPayment === $payment &&\n in_array($charge, $newPayment->getCharges(), true);\n }));\n\n $paymentSrv = $heidelpay->setResourceService($resourceSrvMock)->getPaymentService();\n $returnedCharge = $paymentSrv->chargePayment($payment, 1.234, 'myTestCurrency', 'orderId', 'invoiceId');\n $this->assertEquals([$returnedCharge], $payment->getCharges());\n }", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "function PricerrTheme_withdrawals()\n{\n $id_icon = 'icon-options-general-withdr';\n $ttl_of_stuff = 'PricerrTheme - ' . __('Withdrawal Requests', 'PricerrTheme');\n global $wpdb;\n\n //------------------------------------------------------\n\n echo '<div class=\"wrap\">';\n echo '<div class=\"icon32\" id=\"' . $id_icon . '\"><br/></div>';\n echo '<h2 class=\"my_title_class_sitemile\">' . $ttl_of_stuff . '</h2>';\n\n\n //----------------------------------------\n\n if (isset($_GET['den_id'])) {\n $tm = current_time('timestamp', 0);\n $ids = $_GET['den_id'];\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where id='$ids'\";\n $row = $wpdb->get_results($s);\n $row = $row[0];\n\n\n if ($row->done == 0) {\n echo '<div class=\"saved_thing\"><div class=\"padd10\">' . __('Payment rejected!', 'PricerrTheme') . '</div></div>';\n $ss = \"update \" . $wpdb->prefix . \"job_withdraw set done='-1', rejected_on='$tm', rejected='1', datedone='$tm' where id='$ids'\";\n $wpdb->query($ss);\n\n $ucr = PricerrTheme_get_credits($row->uid);\n PricerrTheme_send_email_when_withdraw_rejected($row->uid, $row->methods, PricerrTheme_get_show_price($row->amount));\n PricerrTheme_update_credits($row->uid, $ucr + $row->amount);\n\n }\n }\n\n// if (isset($_GET['tid'])) {\n// $tm = current_time('timestamp', 0);\n// $ids = $_GET['tid'];\n//\n// $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where id='$ids'\";\n// $row = $wpdb->get_results($s);\n// $row = $row[0];\n//\n// if ($row->done == 0) {\n//\n// $id = $row->id;\n// $user_address = $row->payeremail;\n// $uid = $row->uid;\n// $methods = $row->methods;\n// $amount = $row->amount;\n// $datemade = $row->datemade;\n//\n// $redirect_url = get_bloginfo('siteurl') . '/?withdrawal_action=paypal_withdrawal&id=' . $id .\n// '&user_address=' . $user_address . '&uid=' . $uid . '&methods=' . $methods . '&amount=' . $amount .\n// '&datemade=' . $datemade;\n//\n// $redirect = get_bloginfo('siteurl');\n//\n// wp_redirect($redirect);\n// exit;\n// //echo \"<div style='background-color:red; height: 50px; width: 50px;'>\" . $redirect_url . \"</div>\";\n//\n// //----------------------------------------\n// }\n// }\n\n if(isset($_GET[\"withdrawal_action\"])) {\n if ($_GET[\"withdrawal_action\"] == \"success\") {\n echo '<div class=\"saved_thing\"><div class=\"padd10\">' . __('Payment completed!', 'PricerrTheme') . '</div></div>';\n }\n }\n\n //---------------------------------------\n\n ?>\n\n <div id=\"usual2\" class=\"usual\">\n <ul>\n <li><a href=\"#tabs1\"><?php _e('Unresolved Requests', 'PricerrTheme'); ?></a></li>\n <li><a href=\"#tabs2\"><?php _e('Resolved Requests', 'PricerrTheme'); ?></a></li>\n <li><a href=\"#tabs_rejected\"><?php _e('Rejected Requests', 'PricerrTheme'); ?></a></li>\n <li><a href=\"#tabs3\"><?php _e('Search Unresolved', 'PricerrTheme'); ?></a></li>\n <li><a href=\"#tabs4\"><?php _e('Search Solved', 'PricerrTheme'); ?></a></li>\n <li><a href=\"#tabs_search_rejected\"><?php _e('Search Rejected', 'PricerrTheme'); ?></a></li>\n </ul>\n <div id=\"tabs1\">\n <?php\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where done='0' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0) {\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th width=\"12%\"><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Method', 'PricerrTheme'); ?></th>\n <th width=\"20%\"><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th width=\"25%\"><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n <tbody>\n <?php\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n $id = $row->id;\n $user_address = $row->payeremail;\n $uid = $row->uid;\n $methods = $row->methods;\n $amount = $row->amount;\n $datemade = $row->datemade;\n\n $redirect_url = get_bloginfo('siteurl') . '/?withdrawal_action=paypal_withdrawal&id=' . $id .\n '&user_address=' . $user_address . '&uid=' . $uid . '&methods=' . $methods . '&amount=' . $amount .\n '&datemade=' . $datemade;\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->methods . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . $redirect_url . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n //echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n </table>\n <?php } else { ?>\n\n <div class=\"padd101\">\n <?php _e('There are no unresolved withdrawal requests.', 'PricerrTheme'); ?>\n </div>\n\n <?php } ?>\n\n </div>\n\n <div id=\"tabs2\">\n\n\n <?php\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where done='1' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0):\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Released', 'PricerrTheme'); ?></th>\n <th><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n\n <tbody>\n <?php\n\n\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->datedone == 0 ? \"Not yet\" : date('d-M-Y H:i:s', $row->datedone)) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n\n </table>\n <?php else: ?>\n\n <div class=\"padd101\">\n <?php _e('There are no resolved withdrawal requests.', 'PricerrTheme'); ?>\n </div>\n\n <?php endif; ?>\n\n\n </div>\n\n <div id=\"tabs_rejected\">\n\n\n <?php\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where rejected='1' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0):\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Released', 'PricerrTheme'); ?></th>\n <th><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n\n <tbody>\n <?php\n\n\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->datedone == 0 ? \"Not yet\" : date('d-M-Y H:i:s', $row->datedone)) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n\n </table>\n <?php else: ?>\n\n <div class=\"padd101\">\n <?php _e('There are no rejected withdrawal requests.', 'PricerrTheme'); ?>\n </div>\n\n <?php endif; ?>\n\n\n </div>\n\n\n <div id=\"tabs3\">\n\n <form method=\"get\" action=\"<?php bloginfo('siteurl'); ?>/wp-admin/admin.php\">\n <input type=\"hidden\" value=\"withdraw-req\" name=\"page\"/>\n <input type=\"hidden\" value=\"tabs3\" name=\"active_tab\"/>\n <table width=\"100%\" class=\"sitemile-table\">\n <tr>\n <td><?php _e('Search User', 'PricerrTheme'); ?></td>\n <td><input type=\"text\" value=\"<?php echo $_GET['search_user']; ?>\" name=\"search_user\" size=\"20\"/>\n <input type=\"submit\" name=\"PricerrTheme_save3\" value=\"<?php _e('Search', 'PricerrTheme'); ?>\"/>\n </td>\n </tr>\n\n\n </table>\n </form>\n\n <?php\n\n if (isset($_GET['PricerrTheme_save3'])):\n\n $search_user = trim($_GET['search_user']);\n\n $user = get_userdatabylogin($search_user);\n $uid = $user->ID;\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where done='0' AND uid='$uid' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0):\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th width=\"12%\"><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Method', 'PricerrTheme'); ?></th>\n <th width=\"20%\"><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th width=\"25%\"><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n\n <tbody>\n <?php\n\n\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->methods . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n\n </table>\n <?php else: ?>\n\n <div class=\"padd101\">\n <?php _e('There are no results for your search.', 'PricerrTheme'); ?>\n </div>\n\n <?php endif;\n\n\n endif;\n\n ?>\n\n\n </div>\n\n <div id=\"tabs4\">\n\n <form method=\"get\" action=\"<?php bloginfo('siteurl'); ?>/wp-admin/admin.php\">\n <input type=\"hidden\" value=\"withdraw-req\" name=\"page\"/>\n <input type=\"hidden\" value=\"tabs4\" name=\"active_tab\"/>\n <table width=\"100%\" class=\"sitemile-table\">\n <tr>\n <td><?php _e('Search User', 'PricerrTheme'); ?></td>\n <td>\n <input type=\"text\" value=\"<?php echo $_GET['search_user4']; ?>\" name=\"search_user4\" size=\"20\"/>\n <input type=\"submit\" name=\"PricerrTheme_save4\" value=\"<?php _e('Search', 'PricerrTheme'); ?>\"/>\n </td>\n </tr>\n\n\n </table>\n </form>\n\n\n <?php\n\n if (isset($_GET['PricerrTheme_save4'])):\n\n $search_user = trim($_GET['search_user4']);\n\n $user = get_userdatabylogin($search_user);\n $uid = $user->ID;\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where done='1' AND uid='$uid' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0):\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th width=\"12%\"><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Method', 'PricerrTheme'); ?></th>\n <th width=\"20%\"><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th width=\"25%\"><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n\n <tbody>\n <?php\n\n\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->methods . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n\n </table>\n <?php else: ?>\n\n <div class=\"padd101\">\n <?php _e('There are no results for your search.', 'PricerrTheme'); ?>\n </div>\n\n <?php endif;\n\n\n endif;\n\n ?>\n\n </div>\n\n\n <div id=\"tabs_search_rejected\">\n\n <form method=\"get\" action=\"<?php bloginfo('siteurl'); ?>/wp-admin/admin.php\">\n <input type=\"hidden\" value=\"withdraw-req\" name=\"page\"/>\n <input type=\"hidden\" value=\"tabs_search_rejected\" name=\"active_tab\"/>\n <table width=\"100%\" class=\"sitemile-table\">\n <tr>\n <td><?php _e('Search User', 'PricerrTheme'); ?></td>\n <td>\n <input type=\"text\" value=\"<?php echo $_GET['search_user5']; ?>\" name=\"search_user5\" size=\"20\"/>\n <input type=\"submit\" name=\"PricerrTheme_save5\" value=\"<?php _e('Search', 'PricerrTheme'); ?>\"/>\n </td>\n </tr>\n\n\n </table>\n </form>\n\n\n <?php\n\n if (isset($_GET['PricerrTheme_save5'])):\n\n $search_user = trim($_GET['search_user5']);\n\n $user = get_userdatabylogin($search_user);\n $uid = $user->ID;\n\n $s = \"select * from \" . $wpdb->prefix . \"job_withdraw where rejected='1' AND uid='$uid' order by id desc\";\n $r = $wpdb->get_results($s);\n\n if (count($r) > 0):\n\n ?>\n\n <table class=\"widefat post fixed\" cellspacing=\"0\">\n <thead>\n <tr>\n <th width=\"12%\"><?php _e('Username', 'PricerrTheme'); ?></th>\n <th><?php _e('Method', 'PricerrTheme'); ?></th>\n <th width=\"20%\"><?php _e('Details', 'PricerrTheme'); ?></th>\n <th><?php _e('Date Requested', 'PricerrTheme'); ?></th>\n <th><?php _e('Amount', 'PricerrTheme'); ?></th>\n <th width=\"25%\"><?php _e('Options', 'PricerrTheme'); ?></th>\n </tr>\n </thead>\n\n\n <tbody>\n <?php\n\n\n\n foreach ($r as $row) {\n $user = get_userdata($row->uid);\n\n echo '<tr>';\n echo '<th>' . $user->user_login . '</th>';\n echo '<th>' . $row->methods . '</th>';\n echo '<th>' . $row->payeremail . '</th>';\n echo '<th>' . date('d-M-Y H:i:s', $row->datemade) . '</th>';\n echo '<th>' . PricerrTheme_get_show_price($row->amount) . '</th>';\n echo '<th>' . ($row->done == 0 ? '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&active_tab=tabs1&tid=' . $row->id . '\" class=\"awesome\">' . __('Make Complete', 'PricerrTheme') . '</a>' . ' | ' . '<a href=\"' . get_bloginfo('siteurl') . '/wp-admin/admin.php?page=withdraw-req&den_id=' . $row->id . '\" class=\"awesome\">' . __('Deny Request', 'PricerrTheme') . '</a>' : ($row->done == 1 ? __(\"Completed\", 'PricerrTheme') : __(\"Rejected\", 'PricerrTheme'))) . '</th>';\n echo '</tr>';\n }\n\n ?>\n </tbody>\n\n\n </table>\n <?php else: ?>\n\n <div class=\"padd101\">\n <?php _e('There are no results for your search.', 'PricerrTheme'); ?>\n </div>\n\n <?php endif;\n\n\n endif;\n\n ?>\n\n </div>\n\n <?php\n echo '</div>';\n\n}", "public function gatewayAction()\n {\n $user = $this->getUser();\n $amountdue = $this->getAmount();\n\n if ($user !== null && $amountdue > 0.15) {\n $limited_currencies = array('USD','ISK','HKD','TWD','CHF','EUR','DKK','CLP','CAD','CNY','THB','AUD','SGD','KRW','JPY','PLN','GBP','SEK','NZD','BRL','RUB');\n $currency_iso_code = $this->getCurrencyShortName();\n if (!in_array($currency_iso_code, $limited_currencies)) {\n $this->redirect(array('controller' => 'checkout'));\n } else {\n /** https://cex.io/api/last_price/BCH/EUR **/\n //$value_in_BCH = file_get_contents(\"https://blockchain.info/tobch?currency=\".$currency_iso_code.\"&value=\".$amountdue.\"\");\n $json = file_get_contents('https://cex.io/api/last_price/BCH/EUR');\n $json = json_decode($json, true);\n\n $value_in_BCH = 1/($json['lprice'] / $amountdue);\n\n if ($value_in_BCH > 0) {\n /** @var TYPE_NAME $zw_extended_public_key */\n $zw_extended_public_key = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_extended_public_key');\n $zw_blockchain_api_key = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_blockchain_api_key');\n $zw_callback_secret = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_callback_secret');\n\n $config_secret = trim($zw_callback_secret);\n $secret = strtoupper(md5($config_secret.'-'.$this->session->sUserId));\n\n $url = Shopware()->Router()->assemble(array('action' => 'notify', 'controller' => 'PaymentBitcoinCash', 'module' => 'frontend', 'secret' => $secret, 'forceSecure' => true));\n $callback_url = htmlspecialchars($url);\n\n $xpub = trim($zw_extended_public_key);\n $api_key = trim($zw_blockchain_api_key);\n $blockchain_url = 'https://api.blockchain.info/v2/receive?xpub='.$xpub.'&callback='.urlencode($callback_url).'&key='.$api_key.'';\n //$blockchain_url = 'https://api.blockchain.info/v2/receive?xpub='.$xpub.'&callback='.urlencode($callback_url).'&gap_limit=99&key='.$api_key.'';\n\n $address = false;\n $message = false;\n $description = false;\n $try = 0;\n\n $context = stream_context_create(array('http' => array('ignore_errors' => true)));\n\n while ($try < 2) {\n $response = file_get_contents($blockchain_url, false, $context);\n $object = json_decode($response);\n if (!empty($object->{'address'})) {\n $address = $object->{'address'};\n break;\n } else {\n if (!empty($object->{'message'})) {\n $message = $object->{'message'};\n $description = $object->{'description'};\n break;\n } else {\n $try++;\n sleep(10);\n }\n }\n }\n\n if ($address) {\n $orderNumber = $this->saveOrder($address, md5($address), 17, false);\n //$orderId = Shopware()->Db()->fetchOne('SELECT `id` FROM `s_order` WHERE `ordernumber` = ?', $orderNumber);\n $order = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order')->findOneBy(array('number' => $orderNumber));\n $orderId = $order->getId();\n $orderCurrency = $order->getCurrency();\n $invoiceAmount = $order->getInvoiceAmount();\n\n Shopware()->Db()->exec(\"INSERT INTO `zwilla_free_bitcoincash_address` \n (`id_order`,`value_in_BCH`,`address`,`status`,`crdate`) \n VALUES\n ('\".(int)$orderId.\"', '\".(double)$value_in_BCH.\"', '\".$address.\"', 'Pending', CURRENT_TIMESTAMP)\");\n\n $order->setComment('Please pay ' . $value_in_BCH . ' BCH to this address ' . $address . ' for order number ' . $orderNumber);\n\n Shopware()->Models()->flush($order);\n $this->View()->receivedAddress = 'YES';\n $this->View()->bitcoincashAddress = $address;\n $this->View()->valueInBCH = $value_in_BCH;\n $this->View()->orderNumber = $orderNumber;\n $this->View()->invoiceAmount = $invoiceAmount;\n $this->View()->orderCurrency = $orderCurrency;\n } else {\n // uncomment 3 lines below for debug\n //$logfile = fopen(dirname(__FILE__).'/error_log.txt', 'a+');\n //fwrite($logfile, $response);\n //fclose($logfile);\n Shopware()->Pluginlogger()->error('An unrecoverable error occurred: unable to obtain address, check your API key or xPub. ' . $message . ': ' . $description);\n $this->View()->receivedAddress = 'NO';\n $this->View()->message = $message;\n $this->View()->description = $description;\n }\n } else {\n $this->redirect(array('controller' => 'checkout'));\n }\n }\n } else {\n $this->redirect(array('controller' => 'checkout'));\n }\n }", "function filter_woocommerce_coupon_message( $msg, $msg_code, $instance ) {\n\t\tif ( $instance->code == \"15percent\" ) {\n\t\t\t$msg = \"15% discount applied successfully\";\n\t\t}\n\n\t\treturn $msg;\n\t}", "public function askForFeeConfirmation()\n {\n }", "function bill_pay_from_card() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$card_no = $_REQUEST['card_number'];\n\t\t$cvv_no = $_REQUEST['cvv_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$wallet_category = '4';\n\t\t// 4- Cashback\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_desc = 'PaY Bill';\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no', $bill_consumer_no);\n\t\t\t//print_r($bill_records);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\n\t\t\t\t\tif ($recharge) {\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" .$mobile;\n\n\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\n\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\t\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $recharge_amount;\n\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Bill Pay Successfully\", \"bill_recharge_id\" => $recharge, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount, 'wallet_amount' => $wallet_amount, 'bill_pay_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Pay Bill failed\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "function wc_add_notice_free_shipping() {\n\n $order_min_amount = get_free_shipping_minimum();\n\n $cart = WC()->cart->subtotal;\n $remaining = $order_min_amount - $cart;\n $f_str = \"\";\n if ( $cart < 1 ) {\n $f_str .= sprintf( __( '<strong>Free delivery</strong> from %s.', 'thegrapes' ), wc_price($order_min_amount));\n } else if ( $order_min_amount > $cart ){\n $f_str .= sprintf( __( 'Spend %s more to get <strong>free delivery</strong>.', 'thegrapes' ), wc_price($remaining));\n } else {\n $f_str .= '<strong>' . __( 'You have free delivery.', 'thegrapes' ) . '</strong>';\n }\n return $f_str;\n\n}", "private function sellTrasactionAddsMoney(){\n\n }", "private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}" ]
[ "0.61094177", "0.5994576", "0.5905651", "0.58630264", "0.57999116", "0.5703449", "0.5686063", "0.5599629", "0.5536707", "0.5528796", "0.5516534", "0.5481436", "0.5457499", "0.54460424", "0.5441387", "0.5353147", "0.5349842", "0.53464687", "0.5313933", "0.52805597", "0.52685446", "0.5254796", "0.52535665", "0.5245041", "0.52227825", "0.52217996", "0.5214842", "0.5155071", "0.51337075", "0.5117969", "0.511228", "0.51113665", "0.50870496", "0.50866836", "0.50834465", "0.5075586", "0.5071564", "0.5052599", "0.5050405", "0.50462884", "0.5044439", "0.5041816", "0.5039812", "0.5036499", "0.5021462", "0.50189537", "0.50145006", "0.50053215", "0.5004459", "0.49969703", "0.49962586", "0.4996037", "0.49935973", "0.49877167", "0.49858162", "0.4973535", "0.49728772", "0.49692047", "0.496773", "0.4967374", "0.49567476", "0.49559623", "0.4952567", "0.49497196", "0.49435705", "0.4939878", "0.4936808", "0.4931133", "0.49301913", "0.4929357", "0.49268782", "0.4922467", "0.4915644", "0.49118915", "0.4906644", "0.48948795", "0.48844072", "0.48782632", "0.48781043", "0.48776305", "0.48691657", "0.48588228", "0.48584998", "0.48528188", "0.48506576", "0.484747", "0.48436588", "0.48411816", "0.48403138", "0.4839523", "0.48349556", "0.48288184", "0.48253518", "0.48232427", "0.481669", "0.48088223", "0.48049423", "0.48005754", "0.4799894", "0.47773373", "0.47734058" ]
0.0
-1
Create a new policy instance.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createPolicy() {\n\t\tthrow new CmisNotImplementedException(\"createPolicy\");\n\t}", "public function testPolicyCanBeCreated()\n {\n $policy = factory(App\\Models\\Policy::class)->create([\n 'title' => 'Administrator',\n ]);\n\n $this->assertEquals($policy->title, 'Administrator');\n\n $this->seeInDatabase('policies', ['id' => '1', 'title' => 'Administrator']);\n }", "public function toPolicy()\n {\n return new Policy($this->calls);\n }", "public function addPolicy(Policy $policy)\n {\n $this->policies[] = $policy;\n return $this;\n }", "public function policy(Policy $policy = null)\n {\n if(null === $policy)\n {\n return $this->child('policy');\n }\n return $this->child('policy', $policy);\n }", "public function __construct($childPolicy) { }", "public function getPolicy()\n {\n return Controllers\\PolicyController::getInstance();\n }", "public function create()\n {\n return view('policy.create');\n }", "public function create()\n {\n return view('admin.policy.create');\n }", "public function create(Request $request)\n {\n $policy = new Policy();\n\n $now = Carbon::now();\n $next_year = Carbon::now()->addYear()->subDay();\n\n $policy->date_from = $now->format('d.m.Y');\n $policy->time_from = $now->addHour()->format('H').':00';\n $policy->date_to = $next_year->format('d.m.Y');\n $policy->time_to = '24:00';\n $policy->sign_date = $now->format('d.m.Y');\n $policy->same_client_owner = true;\n $policy->p_base = 4118;\n $policy->p_k1 = 1.8;\n $policy->p_k2 = 1.0;\n $policy->p_k3 = 1.0;\n $policy->p_k4 = 1.0;\n $policy->p_k5 = 1.0;\n $policy->p_k6 = 1.0;\n $policy->p_k7 = 1.0;\n $policy->p_k8 = 1.0;\n $policy->policy_serial = 'EEE';\n $policy->dk_date = $next_year->format('d.m.Y');\n $policy->t_amount = 500.0;\n $policy->f_amount = 2000.0;\n\n $max_policy_number = Policy::all()->max('policy_number');\n if(!$max_policy_number){\n $max_policy_number = '0724573036';\n }\n $max_receipt_number = Policy::all()->max('receipt_number');\n if(!$max_receipt_number){\n $max_receipt_number = '1711116';\n }\n $policy->policy_number = str_pad((int)$max_policy_number + 1, 10, '0', STR_PAD_LEFT);\n $policy->receipt_number = (int)$max_receipt_number + 1;\n\n $vehicles = [];\n $client = Client::find($request->get('client_id'));\n if($client){\n $policy->client = $client;\n $policy->drivers = $client->drivers;\n $vehicles = $client->vehicles;\n //if(!empty($vehicles)){\n // $policy->vehicle = $client->vehicles()->first();\n //}\n }\n $policy->company_name = trans('policy.Company Megaruss');\n $policy->owner_company = false;\n\n session()->put('url.intended', URL::previous());\n\n $companies = Policy::getCompanyOptionsForSelect();\n $makers = Vehicle::getMakeOptionsForSelect();\n\n return view('policies.create', compact('policy','vehicles','companies','makers'));\n }", "public function policy($force_new = false)\n\t{\n\t\tif ((! $force_new) && (! is_null($this->policy))) {\n\t\t\treturn $this->policy;\n\t\t}\n\n\t\treturn $this->policy = policy($this->policy_class);\n\t}", "public function create(PolicyCreateResponseModel $responseModel): ViewModel;", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.stsPolicy');\n }", "protected function getCreateNewObjectPolicy() {\n return PhabricatorPolicies::POLICY_NOONE;\n }", "public function run()\n\t{\n\t\t/** Access policy for admin\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Admin',\n\t\t\t'description' => 'Access policy for admin',\n\t\t]);\n\n\t\t/** Access policy for manager\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Manager',\n\t\t\t'description' => 'Access policy for manager',\n\t\t]);\n\n\t\t/** Access policy for simple member\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Member',\n\t\t\t'description' => 'Access policy for simple member',\n\t\t]);\n\t}", "public function store(Request $request)\n {\n\n $rules = [\n 'sub_broker_name',\n 'policy_holder_name',\n 'category',\n 'product_name',\n 'policy_amount',\n 'issuing_status',\n ];\n\n $this->validate($request, $rules);\n\n $policy = new Policy;\n\n $policy->sub_broker_id = $request->sub_broker_name;\n $policy->policy_holder_name = $request->policy_holder_name;\n $policy->category = $request->category;\n $policy->product_name = $request->product_name;\n $policy->policy_amount = $request->policy_amount;\n $policy->issuing_status = $request->issuing_status;\n\n $policy->save();\n\n// $data = $request->all();\n// $subbroker = Policy::create($data);\n\n return redirect()->route('policy.index');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createPolicy(\n $repositoryId,\n PropertiesInterface $properties,\n $folderId = null,\n array $policies = [],\n AclInterface $addAces = null,\n AclInterface $removeAces = null,\n ExtensionDataInterface $extension = null\n ) {\n // TODO: Implement createPolicy() method.\n }", "public function create() {}", "public function newInstance();", "public function newInstance();", "public function store(Request $request, PrivacyPolicy $PrivacyPolicy)\n {\n //dd(10);\n $inputArr['title'] = $request->get('title');\n $inputArr['description'] = $request->get('description');\n $PrivacyPolicy = $PrivacyPolicy->saveNewPolicy($inputArr);\n if(!$PrivacyPolicy){\n return redirect()->back()->with('error', 'Unable to add questionnaire. Please try again later.');\n }\n\n return redirect()->route('admin.privacypolicy.index')->with('success_message', 'New Privacy & Policy created successfully.');\n }", "public function createPolicy(User $user)\n {\n return $user->may(static::PERMISSION_CREATE);\n }", "public function createPolicy(User $user)\n {\n return $user->may(static::PERMISSION_CREATE);\n }", "public function Create()\n\t{\n\t\treturn new self;\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public function store(Request $request)\n {\n $this->validate($request, $this->rules);\n $mytime = Carbon\\Carbon::now();\n $policy = PrivacyPolicy::create($request->all() + [\n 'created_by' => Auth::user()->id,\n 'created_at' => $mytime->toDateTimeString()\n ]);\n \\Session::flash('flash_message','You have just created new Privacy Policy.');\n return redirect()->route('privacyPolicy.index');\n }", "public static function create() {\n return new self();\n }", "public static function create() {\n\t\treturn new self();\n\t}", "public function create()\n {\n $id = DB::table('policies')->max('id');\n\n $id += 1;\n\n return view('admin.policies.create', compact('id'));\n }", "public function create()\n {\n return new $this->class;\n }", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "private function createCollectionPolicy() {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $fedora_item = new fedora_item($this->contentModelPid);\n $datastreams = $fedora_item->get_datastreams_list_as_array();\n if (isset($datastreams['COLLECTION_POLICY_TMPL'])) {\n $collection_policy_template = $fedora_item->get_datastream_dissemination('COLLECTION_POLICY_TMPL');\n $collection_policy_template_dom = DOMDocument::loadXML($collection_policy_template);\n $collection_policy_template_root = $collection_policy_template_dom->getElementsByTagName('collection_policy');\n if ($collection_policy_template_root->length > 0) {\n $collection_policy_template_root = $collection_policy_template_root->item(0);\n $node = $this->importNode($collection_policy_template_root, TRUE);\n $datastream = $this->createDatastreamElement('COLLECTION_POLICY', 'A', 'X');\n $version = $this->createDatastreamVersionElement('COLLECTION_POLICY.0', 'Collection Policy', 'text/xml');\n $content = $this->createDatastreamContentElement();\n $this->root->appendChild($datastream)->appendChild($version)->appendChild($content)->appendChild($node);\n }\n }\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public function create(){}", "public function addToPolicyID($policyID)\n {\n $this->policyID[] = $policyID;\n return $this;\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public function store(StorePolicyRequest $request)\n {\n\n $client = Client::find($request->input('client.id'));\n\n if(!$client){\n $client = new Client();\n }\n $client->fill($request->input('client'));\n $client->save();\n\n if($request->has('vehicle.id')){\n $vehicle = Vehicle::find($request->input('vehicle.id'));\n }else{\n $vehicle = new Vehicle();\n }\n $vehicle->fill($request->input('vehicle'));\n $vehicle->client()->associate($client);\n $vehicle->save();\n\n $policy = new Policy($request->all());\n $policy->client()->associate($client);\n if($request->input('same_client_owner')){\n $policy->setOwnerData($client);\n }\n $policy->vehicle()->associate($vehicle);\n $policy->save();\n\n $drivers_sync = [];\n foreach($request->input('drivers') as $key => $driver){\n if(!empty($driver['name'])){\n $d = Driver::find($driver['id']);\n if(!$d){\n $d = new Driver();\n }\n $d->fill($driver);\n $d->client()->associate($client);\n $d->save();\n array_push($drivers_sync, $d->id);\n }\n }\n $policy->drivers()->sync($drivers_sync);\n\n flash()->success('Policy has been created successfully.');\n return Redirect::intended('/');\n }", "protected function policy()\n {\n return $this->gate()->getPolicyFor($this);\n }", "public function run()\n {\n PrivacyPolicy::create([\n\n 'main_text'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_one'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_two'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_three'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_four'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_five'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_six'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_seven'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_eight'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n ]);\n }", "public function create()\n {}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(ReturnPolicyRequest $Model): SetReturnPolicyResponse\n {\n return $this->client->request('createReturnPolicy', 'POST', 'return_policy',\n [\n 'json' => $Model->getArrayCopy(),\n ]\n );\n }", "public function create() {\n\t\t\t//\n\t\t}", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }" ]
[ "0.69238234", "0.63803977", "0.63180053", "0.6157489", "0.59963197", "0.5828844", "0.5753017", "0.5750766", "0.57240343", "0.5712267", "0.57120466", "0.5633073", "0.5629794", "0.5476492", "0.5414451", "0.536653", "0.5354097", "0.5354097", "0.5354097", "0.53313726", "0.5293763", "0.5292304", "0.5292304", "0.52784693", "0.52376395", "0.52376395", "0.52274543", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.52038455", "0.5195074", "0.5190787", "0.5188793", "0.51716197", "0.5159273", "0.5158003", "0.51553255", "0.5153394", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51383084", "0.51383084", "0.51305", "0.5099971", "0.5092445", "0.5087874", "0.50853986", "0.5082831", "0.5065765", "0.50374144", "0.503741", "0.50371057", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50251085", "0.5007391", "0.5007391", "0.5007391", "0.5007391" ]
0.0
-1
Determine if the media collection can be shown to the user.
public function index(Authenticatable $user) { return !!$user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }", "public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function hasPlayableResource($mm){\n return $mm->getFilteredTracksWithTags(['display']) || $mm->getProperty('opencast');\n }", "public function need_media()\n\t{\n\t\treturn $this->need_media;\n\t}", "public function shouldShow()\n {\n if (! $this->checkFilterPasses()) {\n return false;\n }\n if (! $this->getPath()) {\n return false;\n }\n\n return true;\n }", "private function canView(): bool\n {\n return true;\n }", "public function canDisplayAdminCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the check result\n return $this->config->getValue('saved_cards_enabled', 'checkoutcom_moto')\n && $this->config->getValue('active', 'checkoutcom_moto')\n && $this->vaultHandler->userHasCards($customerId);\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', app(Property::class));\n }", "public function canShowAnything()\n {\n if ($this->getCanShowDataFields() or $this->getCanShowAdditionalBooks()\n ) {\n $books = $this->getAdditionalBooksToShow();\n $fields = $this->getDataFieldsToShow();\n if (!empty($books) or !empty($fields)) {\n return true;\n }\n }\n\n return false;\n }", "public function canShowAnything()\n {\n if ($this->getCanShowDataFields() or $this->getCanShowAdditionalBooks()\n ) {\n $books = $this->getAdditionalBooksToShow();\n $fields = $this->getDataFieldsToShow();\n if (!empty($books) or !empty($fields)) {\n return true;\n }\n }\n\n return false;\n }", "abstract public function userCanVisualize();", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "public static function canDisplayDocumentTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_DOCUMENT_TYPE);\n\t}", "public function canView()\n {\n return true;\n }", "public function canBeViewed() {}", "protected function isVisible()\n {\n return parent::isVisible()\n && $this->getProduct()\n && $this->getAttachments();\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public static function canDisplayAttorneysMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY);\n\t}", "public function authorize()\n {\n $videoId = $this->route('videos');\n\n $exists = Video::where('id', $videoId)->where('user_id', \\Auth::id())->exists();\n if (\\Auth::user()->is_admin) {\n $exists = true;\n }\n\n return true;\n }", "private function shouldDisplayMessage()\n\t{\n\t\t// Only on admin app\n\t\tif (!$this->app->isClient('administrator'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only if authenticated\n\t\tif (JFactory::getUser()->guest)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on HTML documents\n\t\tif ($this->app->getDocument()->getType() !== 'html')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on full page requests\n\t\tif ($this->app->input->getCmd('tmpl', 'index') === 'component')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only to com_cpanel\n\t\tif ($this->app->input->get('option') !== 'com_cpanel')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "function have_social_media(){\n\t$social_media = get_social_media();\n\treturn !empty($social_media) && is_array($social_media);\n}", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "public function isDisplayable() {\n\t\treturn $this->displayable;\n\t}", "public function isDisplayable() {\n\t\treturn $this->displayable;\n\t}", "function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }", "public static function canDisplayMilestoneTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MILESTONE_TYPE);\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "public function hasShowDisplay()\n {\n return $this->show_display !== null;\n }", "function visible () {\n\t\treturn isadmin();\n\t}", "public function shouldShow()\n {\n return $this->_checkClass();\n }", "function checkVisual($contentId=0) {\r\n\t\tglobal $option;\r\n\r\n\t\t$func = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == 'com_eventlist'\r\n\t\t&& $func == 'details'\r\n\t\t);\r\n\t}", "public function staticPreviewIsEnabled()\n {\n return $this->staticPreview;\n }", "public function canArchive()\n {\n if ($this->container instanceof Space) {\n if ($this->canWrite())\n return true;\n return ($this->container->isAdmin());\n } elseif ($this->container instanceof User) {\n return false; // Not available on user profiels because there are no filters?\n }\n\n return false;\n }", "public function canHandle(\\Hubzero\\Filesystem\\Collection $collection)\n\t{\n\t\t// Do we have everything we need?\n\t\t$need = [\n\t\t\t'json' => '1',\n\t\t\t'videos' => function ($ext, $files) {\n\t\t\t\t// If we dont have all the necessary media formats\n\t\t\t\tif (array_key_exists('mp4', $ext))\n\t\t\t\t{\n\t\t\t\t\t// We have a video, and we also need an ogv and a webm\n\t\t\t\t\tif (!array_key_exists('ogv', $ext) || !array_key_exists('webm', $ext))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (array_key_exists('mp3', $ext))\n\t\t\t\t{\n\t\t\t\t\tif (!array_key_exists('ogg', $ext))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t'slideVideos' => function ($ext, $files) use ($collection) {\n\t\t\t\t// See if we even have a slides directory\n\t\t\t\tif ($slides = $collection->find('slides'))\n\t\t\t\t{\n\t\t\t\t\t$slides = $slides->listContents();\n\n\t\t\t\t\t// Array to hold slides with video clips\n\t\t\t\t\t$slideVideos = [];\n\n\t\t\t\t\t// Build array for checking slide video formats\n\t\t\t\t\tforeach ($slides as $s)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($s->isFile())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extension = $s->getExtension();\n\n\t\t\t\t\t\t\tif (in_array($extension, array('mp4', 'm4v', 'webm', 'ogv')))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$slideVideos[$s->getDisplayName()][$extension] = $s->getName();\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\t// Make sure for each of the slide videos we have all three formats and has a backup image for the slide\n\t\t\t\t\tforeach ($slideVideos as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count($v) < 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!$slides->has($k . '.png') && !$slides->has($k . '.jpg'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\tif (!$collection->hasExtensions($need))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static function canDisplayAttorneyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY_TYPE);\n\t}", "function fa_is_preview(){\n\tif( isset( $_GET['fa_slider_preview'] ) ){\n\t\tif( current_user_can('edit_fa_items') ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\t\n}", "public function canShowOnDemand () {\n return true;\n }", "public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\n }", "public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public static function canDisplayPropertyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PROPERTY_TYPE);\n\t}", "function checkVisual($contentId=0) {\r\n\t\t$option = JRequest::getVar('option');\r\n\t\t$view = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == $this->component\r\n\t\t&& $view == $this->singleView\r\n\t\t);\r\n\t}", "public function HasDisplays(): bool\n {\n return $this->DisplayLinks()->count() > 1;\n }", "public function isCollection()\n {\n if (Checkout::config()->click_and_collect) {\n $type = Session::get(\"Checkout.Delivery\");\n \n return ($type == \"collect\") ? true : false;\n } else {\n return false;\n }\n }", "public function isViewer()\n\t{\n\t\treturn ($this->role == self::ROLE_VIEWER);\n\t}", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function canShow()\r\n {\r\n return count($this->getTermAndConditions());\r\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "public function authorize()\n {\n $feedID = $this->route('feed');\n if (isset($feedID)) {\n return !empty(Feed::find($feedID));\n }\n\n return true;\n }", "public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\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(isset($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}", "private function canHideLists() {\n\t\treturn $this->getUser()->isAllowed( 'gather-hidelist' );\n\t}", "protected function _isNeedToShow()\n {\n if (!$this->_isModuleEnabled()) {\n return false;\n }\n\n if (!$this->_isParallaxBlockEnabled()) {\n return false;\n }\n\n return true;\n }", "public function canBeViewedBy($applicationName)\n {\n // if ($this->media->getHideToOthers()) {\n // if ($this->media->getApplicationName() === $applicationName) {\n // return true;\n // } else {\n // return false;\n // }\n // } else {\n // return true;\n // }\n return true;\n }", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "public function hasImage360Media()\n {\n static $result = null;\n if ($result === null) {\n $result = false;\n $block = $this->getProductMediaBlock();\n if ($block) {\n $images = $block->getGalleryImagesCollection();\n if ($images->count()) {\n $result = true;\n }\n }\n }\n return $result;\n }", "function is_preview_only() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_only_status();\n\t}\n\treturn false;\n}", "public function supportsVisibleFederation() {\n \treturn $this->manager->supportsVisibleFederation();\n\t}", "public function authorize()\n {\n $this->validate($this->rules());\n $user = auth()->user()->first();\n $type = ImageType::findOrFail($this->input('image_type_id'));\n $owner = $type->owner($this->owner_id)->first();\n\n return $user->can('view', $type) && $user->can('update', $owner);\n }", "public function isPreview()\n {\n return !$this->exists();\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function ajax_user_can() {\r\n\t\treturn current_user_can('upload_files');\r\n\t}", "public function canDisplay()\n {\n $amount = $this->getAmount();\n return $this->getDisplayZero() || ($amount != 0);\n }", "public function hasThumbnail(): bool\n {\n return $this->hasMedia($this->thumbnail_id);\n }", "public function canViewAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && ($this->auth->isSuperAdmin()\n || $this->auth->isAgent()\n || $this->isSelf());\n }", "public function is_preview()\n\t{\n\t\treturn (bool) $this->get('is_preview');\n\t}", "public function hasThumbnail(): bool\n\t{\n\t\treturn $this->hasMedia($this->thumbnail_id);\n\t}", "public function can_current_user_see_forum_association_fields() {\n\n\t\treturn current_user_can( 'manage_options' );\n\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Codilar_Image360::image360_settings_edit');\n }", "public function isViewable()\n\t{\n\t\treturn true;\n\t}", "public function canShowInfo() {}", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "public function canView(ConclusionInterface $conclusion);", "public function accessMediasFolder()\n {\n return true;\n }", "public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/curriculumdoc');\n }", "public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t);\n\t}", "public function isAdminPanelVisible() {}", "public function isUseInPreview() {\r\n\t\treturn $this->getUseInPreview();\r\n\t}", "public function hasVideo() {}", "public function checkVisual($contentId=0) {\r\n\t\t$option = JRequest::getVar('option');\r\n\r\n\t\t$task = JRequest::getVar( 'task' );\r\n\r\n\t\treturn ($option == 'com_hwdphotoshare' && ($task == 'viewgroup' ));\r\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public function canViewNewsFeedItem(array $item, $content, array $viewingUser)\n\t{\n\t\treturn $this->_mediaModel->canViewMedia();\n\t}", "public static function canDisplaySuburbsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_SUBURB);\n\t}", "public function supportsPreviewMode(): bool;", "public function authorize()\n {\n return $this->user()->can('list', Card::class);\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function canView($member=null) {\n\t\treturn $this->check(__FUNCTION__, $member);\n\t}" ]
[ "0.6860133", "0.6755482", "0.655311", "0.6434516", "0.6420023", "0.6393982", "0.6371265", "0.63376826", "0.6331493", "0.62387735", "0.62334794", "0.6206517", "0.6187671", "0.6161124", "0.61502075", "0.6129474", "0.61276996", "0.6026952", "0.6020767", "0.60100913", "0.5995116", "0.5993291", "0.59920514", "0.59865093", "0.5980709", "0.59732276", "0.5959793", "0.5959793", "0.5954309", "0.5952992", "0.5952867", "0.5937755", "0.593154", "0.5919922", "0.59183216", "0.58990276", "0.58723664", "0.58708835", "0.5866584", "0.58663344", "0.58655226", "0.58610874", "0.585732", "0.58571327", "0.5846385", "0.5842898", "0.5826772", "0.58185035", "0.5811739", "0.5804417", "0.58019054", "0.5800612", "0.5799585", "0.5783502", "0.57784796", "0.576109", "0.57575566", "0.57510257", "0.57473487", "0.5746786", "0.5735932", "0.5730818", "0.5730011", "0.5728904", "0.5715606", "0.5695775", "0.5693124", "0.5693108", "0.5688155", "0.56847", "0.5683931", "0.5677091", "0.5669976", "0.56680644", "0.56652814", "0.56648314", "0.5664534", "0.5663537", "0.5660662", "0.5653549", "0.5652139", "0.5647211", "0.5636531", "0.563231", "0.56294465", "0.5620713", "0.56203693", "0.56167114", "0.56134677", "0.5602339", "0.5593743", "0.5591707", "0.5591089", "0.55835986", "0.55810875", "0.55801046", "0.5576062", "0.55748296", "0.5574345", "0.5570407", "0.5568016" ]
0.0
-1
Determine if the given media can be updated by the user.
public function create(Authenticatable $user) { return !!$user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(User $user, Media $media)\n {\n // for gallery photos\n if ($media->model_type === User::class && $media->model_id === $user->id && $media->collection_name === User::MEDIA_COLLECTION_GALLERY) {\n return true;\n }\n\n return false;\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove')\t\t\t\n\t\t);\n\t}", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t);\n\t}", "function update($media)\n {\n if (!$media->valid) {\n $media->addErrors($media->errors);\n return false;\n }\n \n $path = mm_getConfigValue('filepaths.media');\n if (!$path) {\n throw new mm_IllegalArgumentException(\"No path defined for filepaths.media\");\n }\n $already_moved = false;\n $new_filename = $media->generateFilename();\n if ($media->filename != $new_filename) {\n $media->file_upload = $media->full_path;\n $media->filename = $new_filename;\n $res = $this->moveOrDelete($media);\n if (!$res) return false;\n $already_moved = true;\n }\n \n $dbh = mm_getDatabase();\n $sql = \"UPDATE mm_media \"\n . \" SET name=\" . dq($media->name)\n . \", description=\" . dq($media->description)\n . \", width=\" . intval($media->width)\n . \", height=\" . intval($media->height)\n . \", filename=\" . dq($media->filename)\n . \", mime_type=\" . dq($media->mime_type)\n . \", sortorder=\" . intval($media->sortorder)\n . \" WHERE id=\" . intval($media->id);\n $dbh->query($sql);\n \n if (!$already_moved) {\n $res = $this->moveOrDelete($media);\n if (!$res) return false;\n }\n \n //$this->addToCache($media);\n \n return true;\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function isUpdateResource();", "public function canUpdate($identifier = null);", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "function isRequested($user_id, $media_id)\n\t{\n\t\treturn $this->query->isRequested($user_id, $media_id);\n\t}", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function isUpdateSecurityRelevant() {}", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function test_can_update_media()\n { \n $data = $this->mediaDataHelper(); \n $media = $this->postJson('v1/media', $data);\n $media = Media::first();\n \n $response = $this->json('PATCH', 'v1/media/'.$media->id, $data); \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]); \n }", "public function getCanSendMediaMessages(): bool\n {\n return $this->getCanSendAudios() ||\n $this->getCanSendDocuments() ||\n $this->getCanSendPhotos() ||\n $this->getCanSendVideos() ||\n $this->getCanSendVideoNotes() ||\n $this->getCanSendVoiceNotes();\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function update($user, $model)\n {\n if( $user->hasPermissionTo('update ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function update(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:update')\n );\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function isUpdateSupported() {}", "public function isUpdateSupported() {}", "public function isUpdateSupported() {}", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "private function should_update() {\n\n\t\t// Get the translation.\n\t\t$translation = $this->get_item_from_api();\n\n\t\t// Only proceed with these checks if translation was found in the API.\n\t\tif ( $translation ) {\n\n\t\t\t// Build the translation path for our checks.\n\t\t\t$translation_path = WP_LANG_DIR;\n\t\t\t$translation_path .= ( 'theme' === $this->type ) ? '/themes/' : '/plugins/';\n\t\t\t$translation_path .= $this->slug . '-' . $this->lang . '.mo';\n\n\t\t\t// If translation file does not exist then we should download it.\n\t\t\tif ( ! file_exists( $translation_path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If the existing translation file is older than the one on the API, then we should update it.\n\t\t\tif ( filemtime( $translation_path ) < strtotime( $this->get_updated() ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to false.\n\t\treturn false;\n\t}", "public function mediadb_edit_media()\n {\n $form = $this->_getMediaForm();\n $worker = new \\Yana\\Forms\\Worker($this->_connectToDatabase('mediadb'), $form);\n return $worker->update();\n }", "public function isUpdateRequired();", "function isUpdateSupported() ;", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function update(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function update(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.update']);\n\n }", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "public function update(User $user, Image $image)\n {\n if ($user->isAdmin()) {\n return true;\n }\n\n // Allow update of own avatar\n if ($user->avatar && $user->avatar->id == $image->id) {\n return true;\n }\n\n // Allow updating of conference owner images for the\n // associated chair\n if ($user->isChair($image->owner)) {\n return true;\n }\n }", "public function updated(Media $media)\n {\n //\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function update(User $current, User $toUpdate = null)\n {\n if ($current->hasPermission('users.update')) return true;\n\n //no permissions and not trying to update his own model\n if ( ! $toUpdate || ($current->id !== $toUpdate->id)) return false;\n\n //user should not be able to change his own permissions or roles\n if ($this->request->get('permissions') || $this->request->get('roles')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function updateOwned(Request $request, $mediaId) {\n \n $isOwned = $request->has('consumed');\n \n $media = Media::findOrFail($mediaId);\n \n $this->authorize('updateOwned', $media);\n \n $media->update(['consumed' => $isOwned]);\n \n }", "abstract public function isUpdatableByUser(User $user);", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "public function need_media()\n\t{\n\t\treturn $this->need_media;\n\t}", "public function isModerated()\n {\n return $this->accepted !== null;\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "public function update(User $user, Volume $volume)\n {\n return $user->hasPermissionTo('Edit Volume');\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "private function checkIfFileLocationIsChanging($media)\n {\n if ($media->getName() !== null && 1 == 'todo') {\n // TODO\n }\n }", "public function getWasMediaBypassed()\n {\n if (array_key_exists(\"wasMediaBypassed\", $this->_propDict)) {\n return $this->_propDict[\"wasMediaBypassed\"];\n } else {\n return null;\n }\n }", "public function actionWouldSeeUpdate(){\n\t\t$data = Put::get();\n\t\t$token = F3::get('GET.token');\n\n\t\t$getToken = $this->model_users->getToken($token);\n\n\t\tif (!empty($getToken)):\n\n\t\t\tif (!empty($data['user']) && !empty($data['movie'])):\n\t\t\t\t$this->model_likes->updateWouldSee($data['user'], $data['movie'], $statut = 'delete');\n\t\t\t\tApi::response(200, 'Movie updated would see to no would see');;\n\t\t\telse:\n\t\t\t\tApi::response(204, 'No movie');\n\t\t\tendif;\n\n\t\telseif (empty($token)):\n\t\t\tApi::response(401, 'Hum... you need a token');\n\t\telse:\n\t\t\tApi::response(403, 'Invalid token');\n\t\tendif;\n\t}", "public function update(Request $request, Media $media)\n {\n //\n }", "public function update(Request $request, Media $media)\n {\n //\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function update()\n {\n $r = false;\n $vars = $this->container->getSiteInstance()->getVariables();\n if (!$vars->hasKey('facebook_number_of_likes')) {\n $r = true;\n }\n if ($vars->getValue('facebook_number_of_likes') != ($n = $this->getRemoteNumberOfLikes())) {\n $r = true;\n $vars->setValue('facebook_number_of_likes', $n);\n }\n if ($this->initializeIdList() && ($l = $this->getRemoteIdList()) != $this->id_list) {\n $r = true;\n $this->initializeIdList($l);\n }\n\n $status = $this->getStatus();\n while ($status != null) {\n if ($status->update()) {\n $r = true;\n }\n\n $status = $status->getNextStatus();\n }\n\n return $r;\n }", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "public function update(User $user, Property $property)\n {\n return in_array('properties-update', $user->role->permissions->pluck('title')->toArray())\n ? Response::allow()\n : Response::deny('You lack sufficient permissions to updated property');\n\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public static function media_update_returns() {\n return new \\external_value(PARAM_BOOL, 'Success');\n }", "private function canModify()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function isUpdateRequest()\n {\n return $this->isMethod('put') || $this->isMethod('patch');\n }", "public function is_allowed_to_update_feedback($feedback);", "public function hasUpdate();", "public function isUpdated() {}", "public function postUpdate(MediaInterface $media);", "public function mediadb_update_mediafolder()\n {\n $worker = $this->_getMediafolderFormWorker();\n return $worker->update();\n }", "public function canWrite() {\n\t\tif (empty($_SESSION['tokens']['fb'])) return false;\n\t\tif (empty($_SESSION['user']['fb']['permissions'])) return false;\n\t\treturn in_array('publish_actions', $_SESSION['user']['fb']['permissions']);\n\t}", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function canUpdate(IdentityInterface $user, Role $role)\n {\n return $user->role_id == 1; // 'super_admin'\n }", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function update(User $user, $entity)\n {\n return Auth::check() && (!empty($entity->campaign_id) ? $user->campaign->id == $entity->campaign_id : true)\n && $this->checkPermission('edit', $user, $entity);\n }", "public function update(User $user, Post $post): array|bool\n {\n return $user->ability(roles: 'admin', permissions: 'update_posts');\n }", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "public function ajax_user_can() {\r\n\t\treturn current_user_can('upload_files');\r\n\t}", "protected function validateOwner()\n {\n $value = $this->owner->getValue();\n if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {\n return true;\n }\n $mime = $this->getConfig();\n return is_array($mime)? in_array($value['type'], $mime):\n $value['type'] == $mime;\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "public function isUploadedFile($media)\n {\n if( ! $media instanceof MediaInterface )\n {\n return false;\n }\n \n return $media->getFile() instanceof UploadedFile;\n }", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "public function authorize()\n {\n $this->validate($this->rules());\n $user = auth()->user()->first();\n $type = ImageType::findOrFail($this->input('image_type_id'));\n $owner = $type->owner($this->owner_id)->first();\n\n return $user->can('view', $type) && $user->can('update', $owner);\n }", "public function update(User $user, DeviceParameter $deviceParameter)\n {\n return true; // TODO: Change as needed, but leave it true if no policy\n }" ]
[ "0.6618027", "0.654713", "0.65462726", "0.6478106", "0.6450698", "0.63816774", "0.6269372", "0.62406576", "0.6132627", "0.6106634", "0.60790825", "0.6065157", "0.60190374", "0.6006548", "0.5997102", "0.5921545", "0.5905303", "0.5885524", "0.5877367", "0.5858421", "0.5856951", "0.58274865", "0.5802068", "0.57925653", "0.57865286", "0.5763117", "0.5761414", "0.57564265", "0.57493496", "0.5733599", "0.5732592", "0.5703103", "0.57028013", "0.5683256", "0.5683256", "0.5683256", "0.56703454", "0.5668197", "0.5663089", "0.56556255", "0.5609625", "0.5592039", "0.5590086", "0.55643076", "0.5559965", "0.5557567", "0.55563515", "0.55340827", "0.550755", "0.550755", "0.549394", "0.54897213", "0.5472735", "0.54689014", "0.54672265", "0.54645413", "0.54620606", "0.5460727", "0.54593927", "0.54548496", "0.54540485", "0.5452643", "0.544474", "0.5439348", "0.5429681", "0.5428536", "0.54267484", "0.5425942", "0.54236305", "0.54236305", "0.54227555", "0.54204917", "0.5419995", "0.5419995", "0.54174274", "0.54066306", "0.53959095", "0.5390853", "0.5385347", "0.5382463", "0.5382379", "0.53798705", "0.5368556", "0.53589356", "0.53493375", "0.5328788", "0.53240776", "0.5311861", "0.5310395", "0.5310221", "0.5305926", "0.5298965", "0.529857", "0.52960145", "0.52878284", "0.52824616", "0.5280277", "0.52799666", "0.5278372", "0.52689725", "0.52542347" ]
0.0
-1
Determine if the given media can be shown to the user.
public function view(Authenticatable $user, Model $model) { return !!$user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasPlayableResource($mm){\n return $mm->getFilteredTracksWithTags(['display']) || $mm->getProperty('opencast');\n }", "public function need_media()\n\t{\n\t\treturn $this->need_media;\n\t}", "public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t);\n\t}", "public function support($block)\n {\n return BaseMediaStrategy::DISPLAY_MEDIA == $block;\n }", "public function show(Media $media)\n {\n //\n }", "public function show(Media $media)\n {\n //\n }", "function isRequested($user_id, $media_id)\n\t{\n\t\treturn $this->query->isRequested($user_id, $media_id);\n\t}", "public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove')\t\t\t\n\t\t);\n\t}", "public function view(User $user, Media $media)\n {\n return true;\n }", "private function _check_media_type()\n\t{\n\t\t// Parse the GET param if we haven't yet.\n\t\tif (! isset($this->media_filter)) {\n\t\t\t$this->media_filter = array();\n\t\t\tif (isset($_GET['m']))\n\t\t\t{\n\t\t\t\t$this->media_filter = $_GET['m'];\n\t\t\t\tif (! is_array($this->media_filter))\n\t\t\t\t{\n\t\t\t\t\t$this->media_filter = explode(',',$this->media_filter);\n\t\t\t\t}\n\t\t\t\t// Keep only the\n\t\t\t\t$this->media_filter = array_intersect(array_keys($this->media_values), $this->media_filter);\n\t\t\t}\n\t\t}\n\n\t\t// Return filters, if any\n\t\tif (count($this->media_filter) > 0)\n\t\t{\n\t\t\treturn $this->media_filter;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function canShow()\n {\n return $this->_authSession->isFirstPageAfterLogin() && $this->_getLatestItem();\n }", "public function canBeDisplayed($mm, $pubChannelCod){\n return $this->isPublished($mm, $pubChannelCod) && $this->hasPlayableResource($mm);\n }", "protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }", "function have_social_media(){\n\t$social_media = get_social_media();\n\treturn !empty($social_media) && is_array($social_media);\n}", "public function hasVideo() {}", "private function isFormatSupported($media)\n {\n return $media instanceof Media\n && ($media->getType() === Media::TYPE_IMAGE\n || ($media->getType() === Media::TYPE_VECTOR && $media->getExtension() === 'svg'));\n }", "public function shouldShow()\n {\n if (! $this->checkFilterPasses()) {\n return false;\n }\n if (! $this->getPath()) {\n return false;\n }\n\n return true;\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', app(Property::class));\n }", "private function _check_media_type()\n\t{\n\t\t// Parse the GET param if we haven't yet.\n\t\tif (! isset($this->media_filter)) {\n\t\t\t$this->media_filter = array();\n\t\t\tif (isset($_GET['k']))\n\t\t\t{\n\t\t\t\t$this->media_filter = $_GET['k'];\n\t\t\t\tif (! is_array($this->media_filter))\n\t\t\t\t{\n\t\t\t\t\t$this->media_filter = explode(',',$this->media_filter);\n\t\t\t\t}\n\t\t\t\t// Keep only the \n\t\t\t\t$this->media_filter = array_intersect(array_keys(self::$media_values), $this->media_filter);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Return filters, if any\n\t\tif (count($this->media_filter) > 0)\n\t\t{\n\t\t\treturn $this->media_filter;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "public function canDisplayAdminCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the check result\n return $this->config->getValue('saved_cards_enabled', 'checkoutcom_moto')\n && $this->config->getValue('active', 'checkoutcom_moto')\n && $this->vaultHandler->userHasCards($customerId);\n }", "public function getCanSendMediaMessages(): bool\n {\n return $this->getCanSendAudios() ||\n $this->getCanSendDocuments() ||\n $this->getCanSendPhotos() ||\n $this->getCanSendVideos() ||\n $this->getCanSendVideoNotes() ||\n $this->getCanSendVoiceNotes();\n }", "public function test_can_fetch_media()\n {\n $response = $this->get('v1/media');\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n }", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "private function isMediaAvailable(ModelProduct $product, string $attributeCode): bool\n {\n $isAvailable = false;\n\n $mediaGallery = $product->getMediaGalleryEntries();\n foreach ($mediaGallery as $mediaEntry) {\n if (in_array($attributeCode, $mediaEntry->getTypes(), true)) {\n $isAvailable = !$mediaEntry->isDisabled();\n break;\n }\n }\n\n return $isAvailable;\n }", "public function hasImage360Media()\n {\n static $result = null;\n if ($result === null) {\n $result = false;\n $block = $this->getProductMediaBlock();\n if ($block) {\n $images = $block->getGalleryImagesCollection();\n if ($images->count()) {\n $result = true;\n }\n }\n }\n return $result;\n }", "public function hasMediaType($category = 'site', $mediaType = null)\n {\n if ($mediaType == null) {\n $mediaType = $this->strPrefAcceptType;\n }\n if (isset($this->arrMediaTypes[$mediaType])) {\n switch ($category) {\n case 'media':\n case 'rest':\n case 'site':\n return $this->arrMediaTypes[$mediaType][$category];\n break;\n default:\n return false;\n }\n } else {\n return false;\n }\n }", "private function canView(): bool\n {\n return true;\n }", "function is_video() {\n return is_singular( array( 'video' ) );\n }", "private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "protected function isImage(Media $media)\n {\n return (new ImageGenerator())->canHandleMime($media->mime_type);\n }", "function fa_is_preview(){\n\tif( isset( $_GET['fa_slider_preview'] ) ){\n\t\tif( current_user_can('edit_fa_items') ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\t\n}", "public function canBeViewedBy($applicationName)\n {\n // if ($this->media->getHideToOthers()) {\n // if ($this->media->getApplicationName() === $applicationName) {\n // return true;\n // } else {\n // return false;\n // }\n // } else {\n // return true;\n // }\n return true;\n }", "public function show(Media $media)\n {\n if($media->videoType)\n {\n $mediaCategory = \\Model\\MediaCategory\\ModelName::where('videoType','=',$media->videoType)->first();\n }\n else\n {\n $mediaCategory = '';\n }\n\n if($media->program)\n {\n $project = \\Model\\Project\\ModelName::where('id','=',$media->program)->first();\n }\n else\n {\n $project = '';\n }\n\n return view('Admin::media.show', [\n 'media' => $media,\n 'mediaCategory' => $mediaCategory,\n 'project' => $project,\n ]);\n }", "public function supportsPreviewMode(): bool;", "function webp_is_displayable($result, $path) {\n if ($result === false) {\n $displayable_image_types = array( IMAGETYPE_WEBP );\n $info = @getimagesize( $path );\n\n if (empty($info)) {\n $result = false;\n } elseif (!in_array($info[2], $displayable_image_types)) {\n $result = false;\n } else {\n $result = true;\n }\n }\n\n return $result;\n}", "function webp_is_displayable($result, $path) {\n if ($result === false) {\n $displayable_image_types = array( IMAGETYPE_WEBP );\n $info = @getimagesize( $path );\n\n if (empty($info)) {\n $result = false;\n } elseif (!in_array($info[2], $displayable_image_types)) {\n $result = false;\n } else {\n $result = true;\n }\n }\n\n return $result;\n}", "function webp_is_displayable($result, $path) {\r\n if ($result === false) {\r\n $displayable_image_types = array( IMAGETYPE_WEBP );\r\n $info = @getimagesize( $path );\r\n\r\n if (empty($info)) {\r\n $result = false;\r\n } elseif (!in_array($info[2], $displayable_image_types)) {\r\n $result = false;\r\n } else {\r\n $result = true;\r\n }\r\n }\r\n\r\n return $result;\r\n}", "public function canShowAnything()\n {\n if ($this->getCanShowDataFields() or $this->getCanShowAdditionalBooks()\n ) {\n $books = $this->getAdditionalBooksToShow();\n $fields = $this->getDataFieldsToShow();\n if (!empty($books) or !empty($fields)) {\n return true;\n }\n }\n\n return false;\n }", "public function canShowAnything()\n {\n if ($this->getCanShowDataFields() or $this->getCanShowAdditionalBooks()\n ) {\n $books = $this->getAdditionalBooksToShow();\n $fields = $this->getDataFieldsToShow();\n if (!empty($books) or !empty($fields)) {\n return true;\n }\n }\n\n return false;\n }", "public function hasThumbnail(): bool\n {\n return $this->hasMedia($this->thumbnail_id);\n }", "private function shouldDisplayMessage()\n\t{\n\t\t// Only on admin app\n\t\tif (!$this->app->isClient('administrator'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only if authenticated\n\t\tif (JFactory::getUser()->guest)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on HTML documents\n\t\tif ($this->app->getDocument()->getType() !== 'html')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on full page requests\n\t\tif ($this->app->input->getCmd('tmpl', 'index') === 'component')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only to com_cpanel\n\t\tif ($this->app->input->get('option') !== 'com_cpanel')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasShowDisplay()\n {\n return $this->show_display !== null;\n }", "public function can_image_be_displayed( $id ) {\n\t\treturn ( ! isset( $this->image_display_status[ $id ] ) && in_array( $id, $this->slider_posts_with_post_thumbnails ) );\n\t}", "public function canShowInfo() {}", "public static function canDisplayMilestoneTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MILESTONE_TYPE);\n\t}", "public function canViewNewsFeedItem(array $item, $content, array $viewingUser)\n\t{\n\t\treturn $this->_mediaModel->canViewMedia();\n\t}", "protected function _isNeedToShow()\n {\n if (!$this->_isModuleEnabled()) {\n return false;\n }\n\n if (!$this->_isParallaxBlockEnabled()) {\n return false;\n }\n\n return true;\n }", "function checkVisual($contentId=0) {\r\n\t\t$option = JRequest::getVar('option');\r\n\t\t$view = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == $this->component\r\n\t\t&& $view == $this->singleView\r\n\t\t);\r\n\t}", "public function renderMediaAction()\n {\n $this->configuration = $this->objectManager->get(\\Sto\\Mediaoembed\\Content\\Configuration::class);\n\n try {\n $this->getEmbedDataFromProvider();\n $this->view->assign('configuration', $this->configuration);\n $this->view->assign('isSSLRequest', GeneralUtility::getIndpEnv('TYPO3_SSL'));\n $result = $this->view->render();\n } catch (\\Sto\\Mediaoembed\\Exception\\OEmbedException $exception) {\n $result = 'Error: ' . $exception->getMessage();\n }\n\n return $result;\n }", "private function _hasMediaClass($class)\n {\n foreach($this->module->mediaClasses as $mediaClass)\n {\n if(strpos($mediaClass, $class) !== false)\n {\n return true;\n }\n }\n \n return false;\n }", "public function hasThumbnail(): bool\n\t{\n\t\treturn $this->hasMedia($this->thumbnail_id);\n\t}", "abstract public function userCanVisualize();", "function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }", "public function checkVisual($contentId=0) {\r\n\t\t$option = JRequest::getVar('option');\r\n\r\n\t\t$task = JRequest::getVar( 'task' );\r\n\r\n\t\treturn ($option == 'com_hwdphotoshare' && ($task == 'viewgroup' ));\r\n }", "public function chkIsValidMediaId($media_id, $media_type, $err_tip='')\n\t\t{\n\n\t\t\tif($media_type && $media_id)\n\t\t\t{\n\t\t\t\tif($media_type == 'photo')\n\t\t\t\t{\n\t\t\t\t\t$sql = 'SELECT photo_id FROM '.$this->CFG['db']['tbl']['photo'].' WHERE photo_status=\\'Ok\\' AND photo_id=\\''.$media_id.'\\'';\n\t\t\t\t}\n\t\t\t\telseif($media_type == 'music')\n\t\t\t\t{\n\t\t\t\t\t$sql = 'SELECT music_id FROM '.$this->CFG['db']['tbl']['music'].' WHERE music_status=\\'Ok\\' AND music_id=\\''.$media_id.'\\'';\n\t\t\t\t}\n\t\t\t\telseif($media_type == 'video')\n\t\t\t\t{\n\t\t\t\t\t$sql = 'SELECT video_id FROM '.$this->CFG['db']['tbl']['video'].' WHERE video_status=\\'Ok\\' AND video_id=\\''.$media_id.'\\'';\n\t\t\t\t}\n\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\tif (!$rs)\n\t\t\t trigger_db_error($this->dbObj);\n\n\t\t\t\tif ($rs->FetchRow())\n\t\t\t\t\treturn true;\n\n\t\t\t\t$this->fields_err_tip_arr['media_id'] = $err_tip;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->fields_err_tip_arr['media_id'] = $err_tip;\n\t\t\treturn false;\n\t\t}", "protected function isDocument(Media $media)\n {\n return in_array(\n $media->mime_type,\n Config::get('laravel-media-uploader.documents_mime_types')\n );\n }", "function file_is_displayable_image($path)\n {\n }", "function checkVisual($contentId=0) {\r\n\t\tglobal $option;\r\n\r\n\t\t$func = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == 'com_eventlist'\r\n\t\t&& $func == 'details'\r\n\t\t);\r\n\t}", "public function isVideo(){\n if (strpos($this->attributes['mime'], 'video') !== false) {\n return true;\n }\n return false;\n }", "public function getWasMediaBypassed()\n {\n if (array_key_exists(\"wasMediaBypassed\", $this->_propDict)) {\n return $this->_propDict[\"wasMediaBypassed\"];\n } else {\n return null;\n }\n }", "protected function isVideo(Media $media)\n {\n return app('ffmpeg-driver')->open($media->getPath()) instanceof Video;\n }", "public function canBeViewed() {}", "public function canShowOnDemand () {\n return true;\n }", "function greenspace_can_show_post_thumbnail() {\n\treturn apply_filters(\n\t\t'greenspace_can_show_post_thumbnail',\n\t\t! post_password_required() && ! is_attachment() && has_post_thumbnail()\n\t);\n}", "protected function isVisible()\n {\n return parent::isVisible()\n && $this->getProduct()\n && $this->getAttachments();\n }", "public static function media($path){\n \n if(is_file(DEL_PATH.$path) && $path != '')\n return true;\n else \n return false;\n \n }", "public function canMemberLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n\t\tif ( empty( $like_profile_show ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }", "public function shouldShow()\n {\n return $this->_checkClass();\n }", "function config_get_allowed_media() {\n global $g_config;\n return array($g_config['cssmedia'],\"all\");\n}", "function ywig_can_show_post_thumbnail() {\n\treturn apply_filters(\n\t\t'ywig_can_show_post_thumbnail',\n\t\t! post_password_required() && ! is_attachment() && has_post_thumbnail()\n\t);\n}", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "public function displayMedia()\n {\n // section 127-0-1-1--35dee990:156e03a0457:-8000:00000000000008CC begin\n // section 127-0-1-1--35dee990:156e03a0457:-8000:00000000000008CC end\n }", "public function isExist($id_media)\n {\n \t// print_r($this->_db);\n\t\t$result = $this->_db->simpleSelect(\"media C\", \"C.id\", array(\"id\", \"=\", $id_media));\n\t\treturn $this->_db->haveRows($result);\n\t\t\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "public function isVideo()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return false;\r\n }", "protected static function is_previewing() {\n\t\tglobal $wp_query;\n\t\tif ( isset($_GET['preview']) && isset($_GET['preview_nonce']) && wp_verify_nonce($_GET['preview_nonce'], 'post_preview_'.$wp_query->queried_object_id) ) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function canMycontentLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function canLikesettings() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n $like_setting_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.setting.show' ) ;\n\t\tif ( empty( $like_profile_show ) || empty( $like_setting_show ) ) {\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "public function canDisplay()\n {\n $amount = $this->getAmount();\n return $this->getDisplayZero() || ($amount != 0);\n }", "public function shouldRespondTo($filename, $media_range = null)\n {\n // If no media range is passed, evalute http header \"Accept\"\n if ($media_range === null && isset($_SERVER['ACCEPT'])) {\n $media_range = reset(explode(';', $_SERVER['ACCEPT']));\n }\n\n // Test if either the filename has the appropriate extension or\n // if the client accepts the content type\n return ($this->extension() && fnmatch('*' . $this->extension(), $filename))\n || ($media_range && fnmatch($media_range, $this->contentType()));\n }", "function is_preview_only() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_only_status();\n\t}\n\treturn false;\n}", "public function is_preview()\n\t{\n\t\treturn (bool) $this->get('is_preview');\n\t}", "public function media();", "public function is_embed()\n {\n }", "function file_source_can_be_displayed($filename) {\n return in_array(get_file_extension($filename), get_displayable_file_types());\n }", "public function accessMediasFolder()\n {\n return true;\n }", "public function canView($member = null)\n {\n // if CMS user with sufficient rights:\n if ( Permission::check(\"VIEW_DRAFT_CONTENT\") ) {\n //if(Permission::checkMember($member, 'VIEW_EMBARGOEXPIRY')) {\n return true;\n }\n\n // if on front, controller should be a subclass of ContentController (ties it to CMS, = ok...)\n $ctr = Controller::curr();\n if ( is_subclass_of($ctr, \"ContentController\") ) {\n if ( $this->owner->getScheduledStatus() || $this->owner->getExpiredStatus() ) {\n\n // if $this->owner is the actual page being visited (Director::get_current_page());\n $curpage = Director::get_current_page();\n if ( $curpage->ID == $this->owner->ID ) {\n // we have to prevent visitors from actually visiting this page by redirecting to a 404\n // This is a bit of a hack (redirect), but else visitors will be presented with a\n // 'login' screen in order to acquire sufficient privileges to view the page)\n $errorPage = ErrorPage::get()->filter('ErrorCode', 404)->first();\n if ( $errorPage ) {\n $ctr->redirect($errorPage->Link(), 404);\n } else {\n // fallback (hack): redirect to anywhere, with a 404\n $ctr->redirect(rtrim($this->owner->Link(), '/') . \"-404\", 404);\n //$ctr->redirect(Page::get()->first()->Link(), 404);\n }\n }\n\n return false;\n } else {\n return true;\n }\n }\n\n // else, allow\n return true;\n }", "public function canShow()\r\n {\r\n return count($this->getTermAndConditions());\r\n }", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }", "public static function can($what)\n\t{\n\t\treturn (devMode() || isset(self::accesslist()[$what]));\n\t}", "public function isInstanceOfMediaType($object) : bool;", "public function canView()\n {\n return true;\n }", "public function canView($member=null) {\n\t\treturn $this->check(__FUNCTION__, $member);\n\t}", "function is_movies() {\n return ( is_post_type_archive( 'movie' ) || is_page( masvideos_get_page_id( 'movies' ) ) );\n }" ]
[ "0.6759568", "0.65001315", "0.6355498", "0.6340439", "0.6171499", "0.6171499", "0.6071349", "0.6050351", "0.60004675", "0.59768164", "0.5930673", "0.59224695", "0.59094495", "0.5891293", "0.58528936", "0.58453554", "0.58260006", "0.5825361", "0.58123755", "0.58025897", "0.57655436", "0.5761472", "0.57493067", "0.57350343", "0.57017803", "0.56676036", "0.5610399", "0.5550309", "0.55466795", "0.55360574", "0.5531073", "0.55251706", "0.5509694", "0.55043256", "0.5486209", "0.5464303", "0.5460093", "0.5442733", "0.5442733", "0.5436973", "0.54326314", "0.54273087", "0.54080707", "0.54070824", "0.5406953", "0.53751683", "0.53734696", "0.53690296", "0.53671294", "0.5365495", "0.53634477", "0.53608197", "0.53585064", "0.5355907", "0.53534013", "0.5334262", "0.5326085", "0.53233635", "0.53152883", "0.531199", "0.5310044", "0.5289743", "0.5281128", "0.52774036", "0.5268018", "0.5264295", "0.5255012", "0.52515334", "0.5237703", "0.5233786", "0.5233434", "0.52278", "0.52277154", "0.5217124", "0.52139145", "0.52132577", "0.52086025", "0.5207134", "0.5207134", "0.51980513", "0.5197303", "0.5187842", "0.5187821", "0.51796204", "0.5176021", "0.5171545", "0.5165547", "0.5152541", "0.5150382", "0.5146996", "0.51456904", "0.51358503", "0.5135355", "0.51295537", "0.51225775", "0.51182085", "0.5116303", "0.5116056", "0.5110597", "0.51090443", "0.510753" ]
0.0
-1
Determine if the given media can be updated by the user.
public function update(Authenticatable $user, Model $model) { return !!$user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(User $user, Media $media)\n {\n // for gallery photos\n if ($media->model_type === User::class && $media->model_id === $user->id && $media->collection_name === User::MEDIA_COLLECTION_GALLERY) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove')\t\t\t\n\t\t);\n\t}", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t);\n\t}", "function update($media)\n {\n if (!$media->valid) {\n $media->addErrors($media->errors);\n return false;\n }\n \n $path = mm_getConfigValue('filepaths.media');\n if (!$path) {\n throw new mm_IllegalArgumentException(\"No path defined for filepaths.media\");\n }\n $already_moved = false;\n $new_filename = $media->generateFilename();\n if ($media->filename != $new_filename) {\n $media->file_upload = $media->full_path;\n $media->filename = $new_filename;\n $res = $this->moveOrDelete($media);\n if (!$res) return false;\n $already_moved = true;\n }\n \n $dbh = mm_getDatabase();\n $sql = \"UPDATE mm_media \"\n . \" SET name=\" . dq($media->name)\n . \", description=\" . dq($media->description)\n . \", width=\" . intval($media->width)\n . \", height=\" . intval($media->height)\n . \", filename=\" . dq($media->filename)\n . \", mime_type=\" . dq($media->mime_type)\n . \", sortorder=\" . intval($media->sortorder)\n . \" WHERE id=\" . intval($media->id);\n $dbh->query($sql);\n \n if (!$already_moved) {\n $res = $this->moveOrDelete($media);\n if (!$res) return false;\n }\n \n //$this->addToCache($media);\n \n return true;\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function isUpdateResource();", "public function canUpdate($identifier = null);", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "function isRequested($user_id, $media_id)\n\t{\n\t\treturn $this->query->isRequested($user_id, $media_id);\n\t}", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function isUpdateSecurityRelevant() {}", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function test_can_update_media()\n { \n $data = $this->mediaDataHelper(); \n $media = $this->postJson('v1/media', $data);\n $media = Media::first();\n \n $response = $this->json('PATCH', 'v1/media/'.$media->id, $data); \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]); \n }", "public function getCanSendMediaMessages(): bool\n {\n return $this->getCanSendAudios() ||\n $this->getCanSendDocuments() ||\n $this->getCanSendPhotos() ||\n $this->getCanSendVideos() ||\n $this->getCanSendVideoNotes() ||\n $this->getCanSendVoiceNotes();\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function update($user, $model)\n {\n if( $user->hasPermissionTo('update ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function update(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:update')\n );\n }", "public function isUpdateSupported() {}", "public function isUpdateSupported() {}", "public function isUpdateSupported() {}", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "private function should_update() {\n\n\t\t// Get the translation.\n\t\t$translation = $this->get_item_from_api();\n\n\t\t// Only proceed with these checks if translation was found in the API.\n\t\tif ( $translation ) {\n\n\t\t\t// Build the translation path for our checks.\n\t\t\t$translation_path = WP_LANG_DIR;\n\t\t\t$translation_path .= ( 'theme' === $this->type ) ? '/themes/' : '/plugins/';\n\t\t\t$translation_path .= $this->slug . '-' . $this->lang . '.mo';\n\n\t\t\t// If translation file does not exist then we should download it.\n\t\t\tif ( ! file_exists( $translation_path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If the existing translation file is older than the one on the API, then we should update it.\n\t\t\tif ( filemtime( $translation_path ) < strtotime( $this->get_updated() ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to false.\n\t\treturn false;\n\t}", "public function mediadb_edit_media()\n {\n $form = $this->_getMediaForm();\n $worker = new \\Yana\\Forms\\Worker($this->_connectToDatabase('mediadb'), $form);\n return $worker->update();\n }", "public function isUpdateRequired();", "function isUpdateSupported() ;", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function update(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "public function update(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.update']);\n\n }", "public function update(User $user, Image $image)\n {\n if ($user->isAdmin()) {\n return true;\n }\n\n // Allow update of own avatar\n if ($user->avatar && $user->avatar->id == $image->id) {\n return true;\n }\n\n // Allow updating of conference owner images for the\n // associated chair\n if ($user->isChair($image->owner)) {\n return true;\n }\n }", "public function updated(Media $media)\n {\n //\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function update(User $current, User $toUpdate = null)\n {\n if ($current->hasPermission('users.update')) return true;\n\n //no permissions and not trying to update his own model\n if ( ! $toUpdate || ($current->id !== $toUpdate->id)) return false;\n\n //user should not be able to change his own permissions or roles\n if ($this->request->get('permissions') || $this->request->get('roles')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function updateOwned(Request $request, $mediaId) {\n \n $isOwned = $request->has('consumed');\n \n $media = Media::findOrFail($mediaId);\n \n $this->authorize('updateOwned', $media);\n \n $media->update(['consumed' => $isOwned]);\n \n }", "abstract public function isUpdatableByUser(User $user);", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "public function need_media()\n\t{\n\t\treturn $this->need_media;\n\t}", "public function isModerated()\n {\n return $this->accepted !== null;\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "public function update(User $user, Volume $volume)\n {\n return $user->hasPermissionTo('Edit Volume');\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "private function checkIfFileLocationIsChanging($media)\n {\n if ($media->getName() !== null && 1 == 'todo') {\n // TODO\n }\n }", "public function getWasMediaBypassed()\n {\n if (array_key_exists(\"wasMediaBypassed\", $this->_propDict)) {\n return $this->_propDict[\"wasMediaBypassed\"];\n } else {\n return null;\n }\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function actionWouldSeeUpdate(){\n\t\t$data = Put::get();\n\t\t$token = F3::get('GET.token');\n\n\t\t$getToken = $this->model_users->getToken($token);\n\n\t\tif (!empty($getToken)):\n\n\t\t\tif (!empty($data['user']) && !empty($data['movie'])):\n\t\t\t\t$this->model_likes->updateWouldSee($data['user'], $data['movie'], $statut = 'delete');\n\t\t\t\tApi::response(200, 'Movie updated would see to no would see');;\n\t\t\telse:\n\t\t\t\tApi::response(204, 'No movie');\n\t\t\tendif;\n\n\t\telseif (empty($token)):\n\t\t\tApi::response(401, 'Hum... you need a token');\n\t\telse:\n\t\t\tApi::response(403, 'Invalid token');\n\t\tendif;\n\t}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "public function update(Request $request, Media $media)\n {\n //\n }", "public function update(Request $request, Media $media)\n {\n //\n }", "public function update()\n {\n $r = false;\n $vars = $this->container->getSiteInstance()->getVariables();\n if (!$vars->hasKey('facebook_number_of_likes')) {\n $r = true;\n }\n if ($vars->getValue('facebook_number_of_likes') != ($n = $this->getRemoteNumberOfLikes())) {\n $r = true;\n $vars->setValue('facebook_number_of_likes', $n);\n }\n if ($this->initializeIdList() && ($l = $this->getRemoteIdList()) != $this->id_list) {\n $r = true;\n $this->initializeIdList($l);\n }\n\n $status = $this->getStatus();\n while ($status != null) {\n if ($status->update()) {\n $r = true;\n }\n\n $status = $status->getNextStatus();\n }\n\n return $r;\n }", "public function update(User $user, Property $property)\n {\n return in_array('properties-update', $user->role->permissions->pluck('title')->toArray())\n ? Response::allow()\n : Response::deny('You lack sufficient permissions to updated property');\n\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public static function media_update_returns() {\n return new \\external_value(PARAM_BOOL, 'Success');\n }", "private function canModify()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function isUpdateRequest()\n {\n return $this->isMethod('put') || $this->isMethod('patch');\n }", "public function is_allowed_to_update_feedback($feedback);", "public function hasUpdate();", "public function isUpdated() {}", "public function postUpdate(MediaInterface $media);", "public function mediadb_update_mediafolder()\n {\n $worker = $this->_getMediafolderFormWorker();\n return $worker->update();\n }", "public function canWrite() {\n\t\tif (empty($_SESSION['tokens']['fb'])) return false;\n\t\tif (empty($_SESSION['user']['fb']['permissions'])) return false;\n\t\treturn in_array('publish_actions', $_SESSION['user']['fb']['permissions']);\n\t}", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function canUpdate(IdentityInterface $user, Role $role)\n {\n return $user->role_id == 1; // 'super_admin'\n }", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function update(User $user, $entity)\n {\n return Auth::check() && (!empty($entity->campaign_id) ? $user->campaign->id == $entity->campaign_id : true)\n && $this->checkPermission('edit', $user, $entity);\n }", "public function update(User $user, Post $post): array|bool\n {\n return $user->ability(roles: 'admin', permissions: 'update_posts');\n }", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "public function ajax_user_can() {\r\n\t\treturn current_user_can('upload_files');\r\n\t}", "protected function validateOwner()\n {\n $value = $this->owner->getValue();\n if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {\n return true;\n }\n $mime = $this->getConfig();\n return is_array($mime)? in_array($value['type'], $mime):\n $value['type'] == $mime;\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "public function isUploadedFile($media)\n {\n if( ! $media instanceof MediaInterface )\n {\n return false;\n }\n \n return $media->getFile() instanceof UploadedFile;\n }", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "public function authorize()\n {\n $this->validate($this->rules());\n $user = auth()->user()->first();\n $type = ImageType::findOrFail($this->input('image_type_id'));\n $owner = $type->owner($this->owner_id)->first();\n\n return $user->can('view', $type) && $user->can('update', $owner);\n }", "public function update(User $user, DeviceParameter $deviceParameter)\n {\n return true; // TODO: Change as needed, but leave it true if no policy\n }" ]
[ "0.6616173", "0.65488183", "0.6546851", "0.64778507", "0.6451567", "0.6382797", "0.6270291", "0.62407094", "0.61325735", "0.61077344", "0.6075351", "0.60668266", "0.60175973", "0.60058755", "0.5995802", "0.5923021", "0.59074825", "0.5884998", "0.58774734", "0.58616924", "0.5859246", "0.5829344", "0.57986313", "0.57934064", "0.57890487", "0.57636446", "0.576273", "0.5758655", "0.5751899", "0.5735852", "0.5732106", "0.570311", "0.5702829", "0.5681862", "0.5681862", "0.5681862", "0.5671377", "0.5670549", "0.56626517", "0.5653391", "0.56087273", "0.55913687", "0.559086", "0.5564047", "0.5560752", "0.555912", "0.5555851", "0.55302835", "0.5508086", "0.5508086", "0.549281", "0.54921514", "0.547553", "0.5471396", "0.54665923", "0.5464833", "0.54624784", "0.5462172", "0.5461825", "0.54563457", "0.5454744", "0.54543495", "0.54479504", "0.54395455", "0.54322404", "0.5428055", "0.54277575", "0.54258174", "0.5425249", "0.542228", "0.542228", "0.54205805", "0.54205805", "0.5419551", "0.54161066", "0.54089934", "0.5394437", "0.53924525", "0.53841794", "0.53836495", "0.53818744", "0.53788966", "0.5365426", "0.53563917", "0.53504694", "0.5331072", "0.53238463", "0.53147", "0.531115", "0.53106034", "0.53034645", "0.5300036", "0.52998954", "0.5299136", "0.5290062", "0.5285315", "0.528253", "0.528009", "0.5277878", "0.5273199", "0.52540815" ]
0.0
-1
Determine if the given media can be deleted by the user.
public function delete(Authenticatable $user, Model $model) { return $user->id === $model->user_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(User $user, Media $media)\n {\n // for gallery photos\n if ($media->model_type === User::class && $media->model_id === $user->id && $media->collection_name === User::MEDIA_COLLECTION_GALLERY) {\n return true;\n }\n\n return false;\n }", "public function deleteMedia() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\t$rs = mq(\"update \" . DB_TBL_MEDIA . \" set md_active='0' where mdid='\" . $this->data['mdid'] . \"'\");\n\t\t\t$_SESSION['_mtype'] = \"W\";\n\t\t\t$_SESSION['_msg'] = \"deletedmedia\";\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "public function canDelete($userId = \"\")\n {\n $object = $this->getPolymorphicRelation();\n if ($object !== null && ($object instanceof ContentActiveRecord || $object instanceof ContentAddonActiveRecord)) {\n return $object->content->canWrite($userId);\n }\n\n // Embedded Media is not bound to an object\n if ($object == null) {\n return true;\n }\n\n return false;\n }", "public function delete(User $user, Media $medium): bool\n {\n return $user->isAdmin();\n }", "protected function canDelete($record) { return false; }", "public function isDeleteGranted($entity): bool;", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "function canDelete() {\n return true;\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "public function canDelete()\n {\n if ( null === $this->_canDelete )\n {\n $model = new Application_Model_AudioJobMapper();\n $results = $model->fetchAll( 'service_id = ' . $this->id );\n $this->_canDelete = !(bool) count( $results );\n }\n return $this->_canDelete;\n }", "protected function canDelete($record)\n {\n return true;\n }", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.reservationasset.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $record->id);\n\t\t}\n\t}", "public function canDelete()\n {\n return 1;\n }", "public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove')\t\t\t\n\t\t);\n\t}", "public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t);\n\t}", "public function canDelete($identifier = null);", "private function canDelete(Cinema $cinema, TokenInterface $token): bool\n {\n if (!$this->mayHallsBeDeleted($cinema, $token)) {\n return false;\n }\n\n return true;\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "function userCanDeleteFile($sessionID, $fileID ){\r\n\t\t$query = \"SELECT `ContactID` FROM `attachments` WHERE ID='$fileID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$result = mysql_fetch_array($result);\r\n\t\t$contactID = $result['ContactID'];\r\n\t\treturn $this->userCanDeleteContact( $sessionID, $contactID );\r\n\t}", "function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}", "public function canBeDeletedBy($editor)\n { return $this->canBeEditedBy($editor) && ( $this->id !== $editor->id );\n }", "protected function canDelete($record)\r\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->published != -2)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user = JFactory::getUser();\n\t\t\t// The record has been set. Check the record permissions.\n\t\t\treturn $user->authorise('meeting.delete', 'com_bigbluebutton.meeting.' . (int) $record->id);\n\t\t}\n\t\treturn false;\r\n\t}", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.tariff.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tableRoomType = $this->getTable('RoomType');\n\t\t\t$tableRoomType->load($record->room_type_id);\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $tableRoomType->reservation_asset_id);\n\t\t}\n\t}", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($item)\n {\n return false;\n }", "public function isPermDeleted($userid) {\n $recipient = $this->mailboxRecipient($userid);\n if ($this->sender_id == $userid) {\n $flag = $this->sender_del;\n } elseif ($recipient != null) {\n $flag = $recipient->recipient_del;\n }\n\n return is_null($flag) ? true : false;\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}", "function canDelete($member = NULL)\n\t{\n\t\treturn true;\n\t}", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "public function destroy(Media $photo)\n {\n if (!Auth::check()) {\n toast(\"error\", \"Authentication Error!\");\n return redirect()->back();\n }\n if (Auth::user()->hasMedia($photo->id)) {\n $photo->delete();\n // redirect\n Session::flash('success', 'Resource deleted!');\n return redirect()->route('media.index');\n } else {\n toast(\"error\", \"Unauthorized action!. You have no right over this resource\");\n return redirect()->back();\n }\n }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}", "public function isDeleteResource();", "public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}", "public function deleted(User $model)\n {\n // If the User is deleted, delete your image\n \\File::delete(base_path($model->img_url));\n return true;\n }", "public function deleted(Media $media)\n {\n if ( $media->local ) {\n $type = $media->mediatype->slug;\n switch ('image') {\n case 'value':\n Storage::delete( 'public/'.$media->source );\n $arr = explode( '/', $media->source );\n $thmb = array_pop( $arr );\n Storage::delete( MediaController::$thmbdir.$thmb );\n break;\n\n default:\n // code...\n break;\n }\n }\n }", "public function isDelete();", "public function delete($user, $model)\n {\n if( $user->hasPermissionTo('delete ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function removeMedia(Request $request)\n {\n if (env('APP_DEMO', false)) {\n Flash::warning('This is only demo app you can\\'t change this section ');\n } else {\n if (auth()->user()->can('medias.delete')) {\n $input = $request->all();\n $user = $this->userRepository->findWithoutFail($input['id']);\n try {\n if ($user->hasMedia($input['collection'])) {\n $user->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }\n }\n }", "public function canDelete(File $file)\n {\n return $this->checkFrontendUserPermissionsFile('userGroupAllowDeleteFiles', $file);\n }", "public function test_can_delete_a_media()\n { \n $data =$this->mediaDataHelper(); \n $response = $this->postJson('v1/media', $data);\n $media = Media::first();\n \n $response = $this->json('DELETE', 'v1/media/'.$media->id); \n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]); \n }", "public static function media($path){\n \n if(is_file(DEL_PATH.$path) && $path != '')\n return true;\n else \n return false;\n \n }", "public function delete(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function is_deletable()\r\n {\r\n return !$this->id || Validator_identifiers::instance()->where('id_dataset_active', $this->id)->count_all() || \r\n Upload_queue::instance()->where('id_dataset_active', $this->id)->count_all()\r\n ? FALSE : TRUE;\r\n }", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function canDelete($record = null)\n\t{\n\t\t$record = $record ?: $this->_record;\n\t\t$user = JFactory::getUser();\n\n\t\treturn $record->id < 7\n\t\t\t?\tfalse\n\t\t\t: $user->authorise('flexicontent.deletefield', 'com_flexicontent.field.' . $record->id);\n\t}", "public function candelete($cid, & $cid_noauth = null, & $cid_wassocs = null)\n\t{\n\t\t$authorizing_ignored = $cid_noauth ? array_flip($cid_noauth) : array();\n\t\t$assignments_ignored = $cid_wassocs ? array_flip($cid_wassocs) : array();\n\n\t\t$cid_noauth = array();\n\t\t$cid_wassocs = array();\n\n\t\tif (!count($cid))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$s_field_types = array('file', 'mediafile');\n\t\t$m_field_props = array('image' => array('originalname', 'existingname'));\n\t\t$m_value_props = array('image' => array('filename', 'filename'));\n\n\t\t$allowed_cid = $this->getDeletable($cid, $authorizing_ignored, $s_field_types, $m_field_props, $m_value_props);\n\n\t\t$r_allowed_cid = array_flip($allowed_cid);\n\n\t\tforeach($cid as $id)\n\t\t{\n\t\t\tif (!isset($r_allowed_cid[$id]))\n\t\t\t{\n\t\t\t\t$cid_noauth[] = $id;\n\t\t\t}\n\t\t}\n\n\t\treturn !count($cid_noauth) && !count($cid_wassocs);\n\t}", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "static public function canDeleteRawVideo($video, $context, $user)\r\n {\r\n if ( $user->getId() === null ) return false;\r\n\r\n self::_checkContext($context);\r\n self::_checkUser($user);\r\n self::_checkGallery($gallery);\r\n\r\n /**\r\n * if context - user profile\r\n */\r\n if ( $context instanceof Warecorp_User ) {\r\n if ($user->getId() == $video->getCreatorId())\r\n return true;\r\n else\r\n return false;\r\n }\r\n /**\r\n * if context - group\r\n */\r\n elseif ( $context instanceof Warecorp_Group_Base ) {\r\n if ($context->getMembers()->isHost($user->getId()) || $context->getMembers()->isCohost($user->getId()))\r\n return true;\r\n else\r\n return false;\r\n }\r\n return false;\r\n }", "function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1)\n {\n }", "public function canDelete($member = null) {\n if($member instanceof Member) {\n $memberID = $member->ID;\n } elseif(is_numeric($member)) {\n $memberID = $member;\n } else {\n $memberID = Member::currentUserID();\n }\n\n if ($memberID && Permission::checkMember($memberID, array(\"ADMIN\", \"MESSAGE_MANAGE\"))) {\n return true;\n }\n\n return false;\n }", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "function deleteAutore()\n{\n global $connection;\n $_SESSION['authorDeleteSuccess'] = false;\n $_SESSION['authorDeleteError'] = false;\n if (isset($_POST['delete'])) {\n $idAutore = $_POST['delete'];\n $photoAutore = $_POST['photoAutore'];\n\n $delete_Autore = \"DELETE FROM autore_video WHERE id_autore='$idAutore'\";\n $result_delete = mysqli_query($connection, $delete_Autore);\n if ($result_delete) {\n if (file_exists($photoAutore)) {\n unlink($photoAutore);\n }\n $_SESSION['authorDeleteSuccess'] = true;\n } else {\n $_SESSION['authorDeleteError'] = true;\n }\n }\n}", "public function canBeDeletedBy($user)\n {\n if ( ! ($user instanceof User)) {\n return false;\n }\n \n if ($this->isOwnedBy($user)) {\n \n // Allow a User to delete their own Key regardless of status.\n return true;\n \n } elseif ($user->isAdmin()) {\n \n /* Only allow someone else to delete a User's Key if they have the\n * appropriate authority and the Key has already been \"terminated\"\n * (for lack of a better word). */\n switch ($this->status) {\n case self::STATUS_DENIED:\n case self::STATUS_REVOKED:\n return true;\n\n default:\n return false;\n }\n }\n \n return false;\n }", "public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "public function delete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:delete')\n );\n }", "public function suppression_media($user_id, $media_id, $type_media) {\n $this->load->model('photos');\n $this->load->helper('form');\n $this->load->library('form_validation');\n $datas = array();\n print $type_media;\n if ($user_id != $this->session->userdata('uid')) {\n show_404();\n }\n if ($this->input->post(\"delete\")) {\n if ($type_media == 1) {\n\n $this->photos->delete_photo($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n\n if ($type_media == 2) {\n\n $this->photos->delete_album($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n\n if ($type_media == 3) {\n\n $this->photos->delete_video($media_id);\n // add success page photo\n $this->load->view('success-concert');\n }\n }\n echo $this->input->post(\"no_delete\"); {\n //CLOSE POP UP\n }\n\n $this->load->view('photos/delete_photos', $datas);\n }", "private function canDelete(Customer $customer, User $user)\n {\n return $user === $customer->getUser();\n }", "public function delete()\n\t{\n\t\tif ( $this->isSocialPost() ) return $this->removeImage();\n\t\treturn true;\n\t}", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "public function delete(): bool\n {\n return $this->actionHandler->delete();\n }", "public function destroy($media) {\n $response = response();\n $jsonResponse = array('success' => 0);\n \n if(checkModel($media)){\n // TODO Additionnal checks to ensure user is allowed to delete media\n $deleted = $media->delete();\n if($deleted){\n $jsonResponse['success'] = 1;\n }\n }\n \n $responsePrepared = $response->json($jsonResponse);\n return $responsePrepared;\n }", "public function isDelete(): bool {}", "function delete_media($FormID) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from MEDIALIBRARY\r\n where media='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "public function delete(User $user, Image $image)\n {\n if ($user->isAdmin()) {\n return true;\n }\n\n // Allow deletion of own avatar\n if ($user->avatar && $user->avatar->id == $image->id) {\n return true;\n }\n\n // Allow if the user is chair for the image owners conference\n if ($user->isChair($image->owner)) {\n return true;\n }\n }", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "function moveOrDelete($media)\n {\n // Move uploaded file to permanent location\n if ($media->file_upload) {\n if (is_string($media->file_upload)) {\n mm_log(\"Copying: \\$media->file_upload: $media->file_upload, \\$media->full_path: $media->full_path\");\n \n $dest_dir = dirname($media->full_path);\n if (!file_exists($dest_dir)) {\n mm_log(\"Creating directory $dest_dir\");\n if (!mkdirp($dest_dir)) {\n $media->addError(\"Failed to create directory\");\n return false;\n }\n }\n \n if (!copy($media->file_upload, $media->full_path)) {\n $media->addErrors(\"Failed to copy media file from $media->file_upload to $media->full_path\");\n return false;\n }\n unlink($media->file_upload);\n }\n else {\n if (!$media->file_upload->moveTo($media->full_path)) {\n $media->addErrors($media->file_upload->errors);\n return false;\n }\n }\n }\n return true;\n }", "public function forceDelete(User $user, Media $media)\n {\n //\n }", "public function canDelete( $link_id, $original_flag, $post_id ) {\n\t\treturn $original_flag;\n\t}", "function userCanDeleteContact( $sessionID, $contactID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function authorize()\n {\n return $this->can('delete');\n }", "public function isDeleted();", "public function isDeleted();", "function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function delete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.delete']);\n\n }", "public function isDeleted()\n {\n $filter = static::idToFilter($this);\n $query = static::filterToQuery($filter, ['from-trash']);\n\n if (empty($query['_id'])) {\n return false;\n }\n\n return static::getCollection()->count($query) > 0;\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "protected function canDeleteRating($rating){\n // Check if there's even a logged in user to save some cycles doing all the calculations below\n // also ensure we have a valid rating object\n if(!$this->canUserModify() ||\n !$rating ||\n !method_exists($rating, 'getMetadata') ||\n !$rating::getMetadata()->COM_type === 'SocialQuestionCommentContentRating') {\n return false;\n }\n\n return $this->isActive() &&\n $this->isQuestionActive() &&\n !$this->isAuthor() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENTCONTENTRATING_DELETE, $rating);\n }", "public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }" ]
[ "0.70095396", "0.68181753", "0.6670246", "0.6603252", "0.65986216", "0.6586424", "0.6536907", "0.6516732", "0.6482817", "0.64418393", "0.6440919", "0.6407811", "0.6360327", "0.6344802", "0.6342461", "0.63335973", "0.6303251", "0.6298284", "0.6282184", "0.62811434", "0.62320375", "0.62231463", "0.62194896", "0.6166148", "0.6152569", "0.6119829", "0.61184126", "0.6112226", "0.61017394", "0.6086306", "0.6073791", "0.6054682", "0.6012509", "0.6008617", "0.59984905", "0.59984905", "0.5992487", "0.5985247", "0.59497005", "0.58954453", "0.586729", "0.5856057", "0.58505124", "0.5844333", "0.5835998", "0.58327353", "0.58280843", "0.5811034", "0.57936674", "0.5792171", "0.5786561", "0.5782258", "0.5770002", "0.5757765", "0.57555026", "0.5753454", "0.57477033", "0.5744192", "0.5744032", "0.57417536", "0.5740932", "0.5732665", "0.57306945", "0.5723234", "0.57149136", "0.571339", "0.57102543", "0.57076246", "0.57061327", "0.5705883", "0.5699767", "0.5691438", "0.56871927", "0.56870836", "0.5677339", "0.56610733", "0.5647928", "0.5645584", "0.5644936", "0.5638246", "0.5629097", "0.5627869", "0.5626267", "0.5608922", "0.56069463", "0.5605427", "0.56044215", "0.56032103", "0.5598866", "0.5597478", "0.55825377", "0.55760515", "0.55760515", "0.55754143", "0.5568464", "0.55632883", "0.55618274", "0.5555538", "0.5551506", "0.55446005", "0.5541843" ]
0.0
-1
TODO Move me to Extras or specific to CPTs script
function remove_title_box() { remove_post_type_support('board_minutes', 'title'); remove_post_type_support('floor_minutes', 'title'); remove_post_type_support('board_agenda', 'title'); remove_post_type_support('general_agenda', 'title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_content_builder_cpts() {\n // FROM PLUGIN AND THEME\n echo efflab_cb_get_module_cpts();\n \n}", "function customs()\n\t{\n\t\t$custom = $this->ipsclass->load_class( ROOT_PATH.'mod_install/'.$this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'].'.php', $this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'] );\n\t\t$custom->xml_array =& $this->xml_array;\n\t\t\n\t\tif ( $this->ipsclass->input['un'] )\n\t\t{\n\t\t\t$custom->uninstall();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom->install();\n\t\t}\n\t}", "public function payment_scripts() {\n\n \t}", "public function payment_scripts() {\n \n\t \t}", "public function scripts()\n\t\t{\n\t\t}", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "public function generatePage_whichScript() {}", "function script()\n {\n }", "public function preExecute(){\n\n\t\n\t}", "protected function getTceMain() {}", "protected function metodo_protegido() {\n }", "function wp_get_pomo_file_data($po_file)\n {\n }", "public function extra();", "public function catalogos() \n\t{\n\t}", "abstract public function getTypoScriptSetup() ;", "abstract protected function getTypoScriptSetup();", "protected function preProcess() {}", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "public function getTceMain() {}", "function cl_procprocessodoc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"procprocessodoc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public static function execute() {\n if ( defined( 'DPC_EXECUTED' ) ) {\n return false;\n } else {\n define( 'DPC_EXECUTED', true );\n }\n load_textdomain( 'dustpress-components', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' );\n add_action( 'init', __NAMESPACE__ . '\\Components::add_options_page', 1, 1 );\n add_action( 'init', __NAMESPACE__ . '\\Components::hook', 20, 1 );\n add_action( 'dustpress/partials', __NAMESPACE__ . '\\Components::add_partial_path', 1, 1 );\n add_action( 'activated_plugin', __NAMESPACE__ . '\\Components::load_first', 1, 1 );\n add_filter( 'acf/format_value/type=group', __NAMESPACE__ . '\\Components::add_layout_static', 150, 3 );\n add_filter( 'acf/format_value/type=group', __NAMESPACE__ . '\\Data::component_handle', 200, 3 );\n add_filter( 'acf/format_value/type=flexible_content', __NAMESPACE__ . '\\Data::component_handle', 200, 3 );\n }", "public function extra_voor_verp()\n\t{\n\t}", "function admin_print_scripts() {\n\n \t\tdo_action('acf_print_scripts-input');\n\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function preProcess();", "public function preProcess();", "function addtoTranscript()\r\n {\r\n \r\n }", "protected function outputSpecificStep() {}", "public function custom()\n\t{\n\t}", "function main() {\n\t\t$this->out(__('I18n Shell', true));\n\t\t$this->hr();\n\t\t$this->out(__('[E]xtract POT file from sources', true));\n\t\t$this->out(__('[I]nitialize i18n database table', true));\n\t\t$this->out(__('[H]elp', true));\n\t\t$this->out(__('[Q]uit', true));\n\n\t\t$choice = strtolower($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));\n\t\tswitch ($choice) {\n\t\t\tcase 'e':\n\t\t\t\t$this->Extract->execute();\n\t\t\tbreak;\n\t\t\tcase 'i':\n\t\t\t\t$this->initdb();\n\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\t$this->help();\n\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\texit(0);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.', true));\n\t\t}\n\t\t$this->hr();\n\t\t$this->main();\n\t}", "public function setup()\n {\t\t\n }", "public function setup()\n {\t\t\n }", "function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }", "function setup() {}", "private function public_hooks()\n\t{\n\t}", "function main()\t{\n\t\tglobal $SOBE,$LANG;\n\t\t$out = array();\n\t\t\n\t\t$GLOBALS['TYPO3_DB']->debugOutput = TRUE;\n\t\t\n\t\tif(t3lib_div::_GP('import')){\n\t\t\t$this->doImport();\n\t\t}\n\t\t\n\t\t\n\t\t$TDparams = ' class=\"bgColor4\" valign=\"top\"';\n\t\t$out = t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'whatistheipsv', $this->pObj->doc->backPath,'|'.$LANG->getLL('whatistheipsv', 1)).'\n\t\t<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\">\n\t\t\t<tr>\n\t\t \t\t<td'.$TDparams.'>Path to csv-file: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'pathtocsvfile', $this->pObj->doc->backPath).'</td>\n\t\t \t\t<td'.$TDparams.'><input type=\"text\" name=\"SET[tx_categoriesimportipsv_filepath]\" size=\"60\" value=\"'.$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_filepath'].'\" /></td>\n\t\t \t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>Prefix original id: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'prefixoriginalid', $this->pObj->doc->backPath).'</td>\n\t\t\t\t<td'.$TDparams.'><input type=\"text\" name=\"SET[tx_categoriesimportipsv_origidprefix]\" size=\"20\" value=\"'.$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_origidprefix'].'\" /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>Action: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'action', $this->pObj->doc->backPath).'</td>\n\t\t\t\t<td'.$TDparams.'>'.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[tx_categoriesimportipsv_action]',$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_action'],$this->pObj->MOD_MENU['tx_categoriesimportipsv_action']).'</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>&nbsp;</td>\n\t\t\t\t<td'.$TDparams.'><input type=\"submit\" name=\"import\" value=\"Import\" onclick=\"alert('.$LANG->JScharCode('Notice! This script will run for a very long time and in some situations it may even halt or cause the browser to freeze. If you experience any problems try running it from a shell (see manual)').');return confirm('.$LANG->JScharCode('Are you sure? You are about to create many categories').');\" /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t';\n\t\t//(@ini_get(\"safe_mode\") == 'On' || @init_get(\"safe_mode\") === 1) ? TRUE : FALSE;\n\t\treturn $this->pObj->doc->section($LANG->getLL('subtitle'),$out,0,1);\n\t}", "private function setup()\r\n\t{ }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "abstract protected function setup_info();", "public function getPR() {}", "function extract()\n {\n }", "public function passo1() {\n $this->Traducao->import('default.pot');\n }", "abstract public function pluginDetails();", "function spreadshop_article_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadarticledetail.php');\n}", "function sevenconcepts_pre_insertion($flux){\n if ($flux['args']['table']=='spip_auteurs'){\n include_spip('cextras_pipelines');\n $champs_extras=champs_extras_objet(table_objet_sql('auteur'));\n foreach($champs_extras as $value){\n $flux['data'][$value['options']['nom']]=_request($value['options']['nom']); \n }\n $flux['data']['name']=_request('nom_inscription'); \n }\nreturn $flux;\n}", "function on_add_extra()\r\n\t{\r\n\t}", "function TS_VCSC_Extensions_Create_Variables() {\r\n // Create Data Holder Object (window.krautcomposium)\r\n $TS_VCSC_VariablesOutput = array();\r\n $TS_VCSC_VariablesOutput['Releases'] = array();\r\n $TS_VCSC_VariablesOutput['Lightbox'] = array();\r\n $TS_VCSC_VariablesOutput['Other'] = array();\r\n\t\t\techo '<script type=\"text/javascript\">'; \r\n\t\t\t\t// Current Plugin Version\r\n\t\t\t\techo 'var $TS_VCSC_CurrentPluginRelease = \"' . COMPOSIUM_VERSION . '\";';\r\n $TS_VCSC_VariablesOutput['Releases']['Composium'] = COMPOSIUM_VERSION;\r\n\t\t\t\t// Current WP Bakery Page Builder Extensions Addon Version\r\n\t\t\t\techo 'var $TS_VCSC_CurrentComposerRelease = \"' . $this->TS_VCSC_VisualComposer_Version . '\";';\r\n $TS_VCSC_VariablesOutput['Releases']['WPBakeryBuilder'] = $this->TS_VCSC_VisualComposer_Version;\r\n\t\t\t\t// Current Page/Post Title\r\n\t\t\t\tif ((TS_VCSC_IsEditPagePost()) && ($this->TS_VCSC_EditorLivePreview == \"true\") && ($this->TS_VCSC_Visual_Composer_Elements['TS Title Advanced']['active'] == 'true')) {\r\n\t\t\t\t\tglobal $post;\r\n\t\t\t\t\tif ($post) {\r\n\t\t\t\t\t\techo 'var $TS_VCSC_CurrentPageTitle = \"' . get_the_title($post->ID) . '\";';\r\n $TS_VCSC_VariablesOutput['CurrentPageTitle'] = get_the_title($post->ID);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo 'var $TS_VCSC_CurrentPageTitle = ' . __( \"Title could not (yet) be retrieved!\", \"ts_visual_composer_extend\" ) . ';';\r\n $TS_VCSC_VariablesOutput['CurrentPageTitle'] = __( \"Title could not (yet) be retrieved!\", \"ts_visual_composer_extend\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Lightbox Settings\r\n\t\t\t\tif ($this->TS_VCSC_UseInternalLightbox == \"true\") { \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Activated = true;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Activated'] = true;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Thumbs = \"' . \t\t\t\t\t((array_key_exists('thumbs', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbs'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbs']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Thumbnails'] = ((array_key_exists('thumbs', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbs'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbs']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Thumbsize = ' . \t\t\t\t((array_key_exists('thumbsize', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbsize'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbsize']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Thumbsize'] = (int)((array_key_exists('thumbsize', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbsize'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbsize']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Animation = \"' . \t\t\t\t((array_key_exists('animation', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['animation'] : $this->TS_VCSC_Lightbox_Setting_Defaults['animation']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Animation'] = ((array_key_exists('animation', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['animation'] : $this->TS_VCSC_Lightbox_Setting_Defaults['animation']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Captions = \"' . \t\t\t\t((array_key_exists('captions', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['captions'] : $this->TS_VCSC_Lightbox_Setting_Defaults['captions']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Captions'] = ((array_key_exists('captions', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['captions'] : $this->TS_VCSC_Lightbox_Setting_Defaults['captions']);\r\n echo 'var $TS_VCSC_Lightbox_Closer = ' . \t\t\t\t\t(((array_key_exists('closer', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['closer'] : $this->TS_VCSC_Lightbox_Setting_Defaults['closer']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Closer'] = (((array_key_exists('closer', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['closer'] : $this->TS_VCSC_Lightbox_Setting_Defaults['closer']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Durations = ' . \t\t\t\t((array_key_exists('duration', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['duration'] : $this->TS_VCSC_Lightbox_Setting_Defaults['duration']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Duration'] = (int)((array_key_exists('duration', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['duration'] : $this->TS_VCSC_Lightbox_Setting_Defaults['duration']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Share = ' . \t\t\t\t\t(((array_key_exists('share', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['share'] : $this->TS_VCSC_Lightbox_Setting_Defaults['share']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Share'] = (((array_key_exists('share', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['share'] : $this->TS_VCSC_Lightbox_Setting_Defaults['share']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Save = ' . \t\t\t\t\t\t(((array_key_exists('save', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['save'] : $this->TS_VCSC_Lightbox_Setting_Defaults['save']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Save'] = (((array_key_exists('save', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['save'] : $this->TS_VCSC_Lightbox_Setting_Defaults['save']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_LoadAPIs = ' . \t\t\t\t\t(((array_key_exists('loadapis', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['loadapis'] : $this->TS_VCSC_Lightbox_Setting_Defaults['loadapis']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['LoadAPIs'] = (((array_key_exists('loadapis', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['loadapis'] : $this->TS_VCSC_Lightbox_Setting_Defaults['loadapis']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Social = \"' . \t\t\t\t\t((array_key_exists('social', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['social'] : $this->TS_VCSC_Lightbox_Setting_Defaults['social']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Social'] = ((array_key_exists('social', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['social'] : $this->TS_VCSC_Lightbox_Setting_Defaults['social']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_NoTouch = ' . \t\t\t\t\t(((array_key_exists('notouch', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['notouch'] : $this->TS_VCSC_Lightbox_Setting_Defaults['notouch']) == 1 ? 'false' : 'true') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['NoTouch'] = (((array_key_exists('notouch', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['notouch'] : $this->TS_VCSC_Lightbox_Setting_Defaults['notouch']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_BGClose = ' . \t\t\t\t\t(((array_key_exists('bgclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['bgclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['bgclose']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['BGClose'] = (((array_key_exists('bgclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['bgclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['bgclose']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_NoHashes = ' . \t\t\t\t\t(((array_key_exists('nohashes', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['nohashes'] : $this->TS_VCSC_Lightbox_Setting_Defaults['nohashes']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['NoHashes'] = (((array_key_exists('nohashes', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['nohashes'] : $this->TS_VCSC_Lightbox_Setting_Defaults['nohashes']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Keyboard = ' . \t\t\t\t\t(((array_key_exists('keyboard', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['keyboard'] : $this->TS_VCSC_Lightbox_Setting_Defaults['keyboard']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Keyboard'] = (((array_key_exists('keyboard', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['keyboard'] : $this->TS_VCSC_Lightbox_Setting_Defaults['keyboard']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_FullScreen = ' . \t\t\t\t(((array_key_exists('fullscreen', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fullscreen'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fullscreen']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['FullScreen'] = (((array_key_exists('fullscreen', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fullscreen'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fullscreen']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Zoom = ' . \t\t\t\t\t\t(((array_key_exists('zoom', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['zoom'] : $this->TS_VCSC_Lightbox_Setting_Defaults['zoom']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Zoom'] = (((array_key_exists('zoom', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['zoom'] : $this->TS_VCSC_Lightbox_Setting_Defaults['zoom']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_FXSpeed = ' . \t\t\t\t\t((array_key_exists('fxspeed', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fxspeed'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fxspeed']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['FXSpeed'] = (int)((array_key_exists('fxspeed', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fxspeed'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fxspeed']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Scheme = \"' . \t\t\t\t\t((array_key_exists('scheme', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scheme'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scheme']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Scheme'] = ((array_key_exists('scheme', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scheme'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scheme']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Controls = \"' . ((array_key_exists('controls', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['controls'] : $this->TS_VCSC_Lightbox_Setting_Defaults['controls']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Buttons'] = ((array_key_exists('controls', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['controls'] : $this->TS_VCSC_Lightbox_Setting_Defaults['controls']);\r\n echo 'var $TS_VCSC_Lightbox_URLColor = ' . \t\t\t\t\t(((array_key_exists('urlcolorscan', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['urlcolorscan'] : $this->TS_VCSC_Lightbox_Setting_Defaults['urlcolorscan']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['URLColor'] = (((array_key_exists('urlcolorscan', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['urlcolorscan'] : $this->TS_VCSC_Lightbox_Setting_Defaults['urlcolorscan']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Backlight = \"' . \t\t\t\t((array_key_exists('backlight', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['backlight'] : $this->TS_VCSC_Lightbox_Setting_Defaults['backlight']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Backlight'] = ((array_key_exists('backlight', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['backlight'] : $this->TS_VCSC_Lightbox_Setting_Defaults['backlight']);\r\n echo 'var $TS_VCSC_Lightbox_UseColor = ' . \t\t\t\t\t(((array_key_exists('usecolor', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['usecolor'] : $this->TS_VCSC_Lightbox_Setting_Defaults['usecolor']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['UseColor'] = (((array_key_exists('usecolor', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['usecolor'] : $this->TS_VCSC_Lightbox_Setting_Defaults['usecolor']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Overlay = \"' . \t\t\t\t\t((array_key_exists('overlay', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['overlay'] : $this->TS_VCSC_Lightbox_Setting_Defaults['overlay']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Overlay'] = ((array_key_exists('overlay', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['overlay'] : $this->TS_VCSC_Lightbox_Setting_Defaults['overlay']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Background = \"' . \t\t\t\t((array_key_exists('background', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['background'] : $this->TS_VCSC_Lightbox_Setting_Defaults['background']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Background'] = ((array_key_exists('background', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['background'] : $this->TS_VCSC_Lightbox_Setting_Defaults['background']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Repeat = \"' . \t\t\t\t\t((array_key_exists('repeat', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['repeat'] : $this->TS_VCSC_Lightbox_Setting_Defaults['repeat']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Repeat'] = ((array_key_exists('repeat', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['repeat'] : $this->TS_VCSC_Lightbox_Setting_Defaults['repeat']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Noise = \"' . \t\t\t\t\t((array_key_exists('noise', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['noise'] : $this->TS_VCSC_Lightbox_Setting_Defaults['noise']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Noise'] = ((array_key_exists('noise', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['noise'] : $this->TS_VCSC_Lightbox_Setting_Defaults['noise']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_CORS = ' . \t\t\t\t\t\t(((array_key_exists('cors', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['cors'] : $this->TS_VCSC_Lightbox_Setting_Defaults['cors']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['CORS'] = (((array_key_exists('cors', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['cors'] : $this->TS_VCSC_Lightbox_Setting_Defaults['cors']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Tapping = ' . \t\t\t\t\t(((array_key_exists('tapping', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['tapping'] : $this->TS_VCSC_Lightbox_Setting_Defaults['tapping']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Tapping'] = (((array_key_exists('tapping', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['tapping'] : $this->TS_VCSC_Lightbox_Setting_Defaults['tapping']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_ScrollBlock = \"' . \t\t\t\t((array_key_exists('scrollblock', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scrollblock'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scrollblock']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['ScrollBlock'] = ((array_key_exists('scrollblock', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scrollblock'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scrollblock']);\r\n echo 'var $TS_VCSC_Lightbox_Protection = \"' . \t\t\t\t((array_key_exists('protection', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['protection'] : $this->TS_VCSC_Lightbox_Setting_Defaults['protection']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Protection'] = ((array_key_exists('protection', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['protection'] : $this->TS_VCSC_Lightbox_Setting_Defaults['protection']);\r\n echo 'var $TS_VCSC_Lightbox_HistoryClose = ' .\t\t\t\t(((array_key_exists('historyclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['historyclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['historyclose']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['HistoryClose'] = (((array_key_exists('historyclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['historyclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['historyclose']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_CustomScroll = ' .\t\t\t\t(((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['CustomScroll'] = (((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_HomeURL = \"' . \t\t\t\t\tget_home_url() . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['HomeURL'] = get_home_url();\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_LastScroll = 0;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['LastScroll'] = 0;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Showing = false;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Showing'] = false;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_PrettyPhoto = ' . \t\t\t\t$this->TS_VCSC_UseLightboxPrettyPhoto . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['PrettyPhoto'] = ((($this->TS_VCSC_UseLightboxPrettyPhoto == \"true\") || ($this->TS_VCSC_UseLightboxPrettyPhoto == true)) ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_AttachAllOther = ' .\t\t\t$this->TS_VCSC_UseLightboxAttachAllOther . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['AttachAllOther'] = ((($this->TS_VCSC_UseLightboxAttachAllOther == \"true\") || ($this->TS_VCSC_UseLightboxAttachAllOther == true)) ? true : false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Activated = false;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Activated'] = false;\r\n\t\t\t\t} \r\n\t\t\t\t// Hammer Version Setting\r\n\t\t\t\techo 'var $TS_VCSC_Hammer_ReleaseNew = ' . $this->TS_VCSC_LoadFrontEndHammerNew . ';';\r\n $TS_VCSC_VariablesOutput['Other']['HammerReleaseNew'] = ((($this->TS_VCSC_LoadFrontEndHammerNew == \"true\") || ($this->TS_VCSC_LoadFrontEndHammerNew == true)) ? true : false);\r\n\t\t\t\t// Extended Row Effects (Breakpoint)\r\n\t\t\t\tif (get_option('ts_vcsc_extend_settings_additionsRows', 0) == 1) {\r\n\t\t\t\t\techo 'var $TS_VCSC_RowEffects_Breakpoint = ' . \t\t\t\tget_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600') . ';';\r\n $TS_VCSC_VariablesOutput['Other']['RowsBreakPoint'] = (int)get_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600');\r\n\t\t\t\t}\r\n // AJAX Callback URL\r\n $TS_VCSC_VariablesOutput['Other']['AjaxURL'] = admin_url('admin-ajax.php'); \r\n // Output Data Holder Object (window.krautcomposium) \r\n //echo 'window.krautcomposium = ' . json_encode($TS_VCSC_VariablesOutput) . ';';\r\n\t\t\techo '</script>';\r\n\t\t}", "function init_args()\r\n{\r\n $_REQUEST = strings_stripSlashes($_REQUEST);\r\n\r\n // if any piece of context is missing => we will display nothing instead of crashing WORK TO BE DONE\r\n $args = new stdClass();\r\n $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID'];\r\n $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID'];\r\n $args->tcase_id = isset($_REQUEST['tcase_id']) ? $_REQUEST['tcase_id'] : 0;\r\n $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? $_REQUEST['tcversion_id'] : 0;\r\n return $args; \r\n}", "public function getExtra();", "public function helper()\n\t{\n\t\n\t}", "public function page_script(){\r\n\r\n echo ISSET($this->pageSettings->page_script)?$this->pageSettings->page_script:'';\r\n\r\n }", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "function desinstaller_champs_extras($champs, $nom_meta_base_version) {\r\n\tvider_champs_extras($champs);\r\n\teffacer_meta($nom_meta_base_version);\t\r\n}", "function factures_autoriser(){}", "public function transactionFormGetScriptParameters ();", "abstract protected function _preProcess();", "public function init() {\n\n\t\t// Run an action so we can hook in beforehand\n\t\t$this->before( 'ubc_press_before_create_all_cpts' );\n\n\t\t// Determine which CPTs to create\n\t\t$this->determine();\n\n\t\t// Create the CPTs\n\t\t$this->create();\n\n\t\t// Run an action so we can hook in afterwards\n\t\t$this->after( 'ubc_press_after_create_all_cpts' );\n\n\t}", "function getOrDefineStuff(){\n // $co->setPackageObject(Package::getByHandle($this->pkgHandle));\n // $co->getOrDefine('SCOTTC_COMMERCE_CART_ABANDONED_PER_PAGE', 20);\n // $co->getOrDefine('SCOTTC_AFFILIATE_IGNORE_SUPER_USER', 0);\n // $co->getOrDefine('SCOTTC_AFFILIATES_TIMESTAMP_FORMAT', 'm/d/Y H:i:sa');\n // $co->getOrDefine('SCOTTC_AFFILIATES_GET_VAR_PREFIX', 'qAf');\n // $co->getOrDefine('SCOTTC_AFFILIATE_COOKIE_DAYS',14);\n // $co->getOrDefine('SCOTTC_AFFILIATE_USE_COOKIES',1);\n // $co->getOrDefine('SCOTTC_AFFILIATE_LOG_EARNINGS',1);\n // define('SCOTTECOMAFFILATESPACKAGEHANDLE',$this->getPackageHandle());\n }", "function run() {\n CRM_Utils_System::setTitle(ts('Party'));\n\n if (array_key_exists (\"country\",$_GET)) {\n $this->assign(\"country\", $_GET[\"country\"]);\n\n }\n CRM_Core_Resources::singleton()\n\t ->addScriptFile('civicrm.root','js/jquery/jquery.crmEditable.js', 0, 'html-header', FALSE)\n\t ->addScriptFile('civicrm.root','packages/jquery/plugins/jquery.jeditable.min.js', 0, 'html-header', FALSE)\n //->addScriptFile('org.ep2019.editor', 'js/datatable/media/js/jquery.dataTables.js', -9998, 'html-header', FALSE);\n //->addScriptFile('org.ep2019.editor', 'dist/js/script.js', -9998, 'html-header', FALSE);\n;\n// ->addScriptFile('org.ep2019.editor', 'js/datatable/media/js/jquery.dataTables.js', 0, 'html-header', FALSE);\n\n parent::run();\n }", "function spreadshop_assortment()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortment.php');\nadd_filter('wp_head', 'sources');\n}", "public function getTypoScriptSetup() {}", "public function getTypoScriptSetup() {}", "function main($PA,$pObj)\t{\n\n\t\t\t// Load Lorem Ipsum sources from text file:\n\t\t$this->loadLoremIpsumArray();\n\n\t\tswitch($PA['params']['type'])\t{\n\t\t\tcase 'title':\n\t\t\tcase 'header':\n\t\t\tcase 'description':\n\t\t\tcase 'word':\n\t\t\tcase 'paragraph':\n\t\t\tcase 'loremipsum':\n\t\t\t\t\t// Add the element name as first parameter\n\t\t\t\t$onclick = $this->getHeaderTitleJS(\n\t\t\t\t\t\t\t\t\"document.\".$PA['formName'].\"['\".$PA['itemName'].\"']\",\n\t\t\t\t\t\t\t\t\"document.\".$PA['formName'].\"['\".$PA['itemName'].\"'].value\",\n\t\t\t\t\t\t\t\t$PA['params']['type'],\n\t\t\t\t\t\t\t\t$PA['params']['endSequence'],\n\t\t\t\t\t\t\t\t$PA['params']['add'],\n\t\t\t\t\t\t\t\tt3lib_div::intInRange($PA['params']['count'],2,100,10)\n\t\t\t\t\t\t\t) . ';' .\n\t\t\t\t\t\t\timplode('',$PA['fieldChangeFunc']).\t\t// Necessary to tell TCEforms that the value is updated.\n\t\t\t\t\t\t\t'return false;';\n\n\t\t\t\t$output.= '<a href=\"#\" onclick=\"'.htmlspecialchars($onclick).'\">'.\n\t\t\t\t\t\t\t$this->getIcon($PA['params']['type']).\n\t\t\t\t\t\t\t'</a>';\n\t\t\tbreak;\n\t\t\tcase 'images':\n\t\t\t\treturn parent::main($PA,$pObj);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $output;\n\t}", "function settings_callback_section() {\n\t ?>\n\t <p class=\"description\"><?php _e( 'Define the Utilities to use.', 'thaim-utilities' );?></p>\n\t <?php\n\t}", "function preflight($type, $parent) {\n // $parent is the class calling this method\n // $type is the type of change (install, update or discover_install)\n //echo '<p>' . JText::_('COM_HELLOWORLD_PREFLIGHT_' . $type . '_TEXT') . '</p>';\n }", "function hl_create_batch( ) { \r\n \r\n include( plugin_dir_path( __FILE__ ) . 'metabox-template.php');\r\n}", "function installer_champs_extras($champs, $nom_meta_base_version, $version_cible) {\r\n\t$current_version = 0.0;\r\n\tif ((!isset($GLOBALS['meta'][$nom_meta_base_version]))\r\n\t|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){\r\n\t\t// cas d'une installation\r\n\t\tif ($current_version==0.0){\r\n\t\t\tcreer_champs_extras($champs);\r\n\t\t\tecrire_meta($nom_meta_base_version,$current_version=$version_cible,'non');\r\n\t\t}\r\n\t}\t\r\n}", "public function get_app_script()\n {\n }", "public function customizer() {\n\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'googlefont-array.php';\n //require_once DF_CUSTOMIZER_CONTROL_DIR . 'interface.php';\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'sanitization.php';\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'setup.php';\n /* Backup Import / Export */\n require_once DF_CUSTOMIZER_CONTROL_DIR . 'backup.php';\n\n }", "function preflight($type, $parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\t// $type is the type of change (install, update or discover_install)\n\t\t//echo '<p>' . JText::_('COM_HELLOWORLD_PREFLIGHT_' . $type . '_TEXT') . '</p>';\n\t}", "public function acp();", "public function preExecute() {\n }", "private static function hypertext()\n {\n $files = ['Res', 'Html'];\n $folder = static::$root.'Hypertext'.'/';\n\n self::call($files, $folder);\n }", "public function preExec()\n {\n }", "public function extObjContent() {}", "public function extObjContent() {}", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "function beManaged()\n {\n }", "function postflight($type, $parent) {\n // $parent is the class calling this method\n // $type is the type of change (install, update or discover_install)\n //echo '<p>' . JText::_('COM_HELLOWORLD_POSTFLIGHT_' . $type . '_TEXT') . '</p>';\n }", "function start()\n {\n\t\t$GLOBALS['appshore_data']['api']['op'] = $_SESSION['customization']['applications']['tab_id']?$this->selectOp($_SESSION['customization']['applications']['tab_id']):'administration.customization_fields.edit'; \n\t\treturn execMethod($GLOBALS['appshore_data']['api']['op']);\t\t\n }", "public function step_3()\n {\n }", "function main() {\n global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n $config = $BE_USER->getTSConfig('x4econgress');\n\t\t$this->id = $config['properties']['pidList'];\n\t\t$this->showFields = $config['properties']['showFields'];\n\t\t\n\t\tif(empty($this->showFields)){\n\t\t\t$this->showFields = 'name,firstname,type,address,zip,city,country,email,remarks';\n\t\t}\n\t\t\n // Access check!\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n $access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\n if (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id)) {\n\t\t\n // Draw the header.\n $this->doc = t3lib_div::makeInstance(\"bigDoc\");\n $this->doc->backPath = $BACK_PATH;\n //$this->doc->form='<form action=\"\" method=\"POST\">';\n $backUrl = 'http://'.$_SERVER['HTTP_HOST'].'/';\n\t\t\t$backUrl .= 'typo3/mod.php?M=txx4econgressM1_txx4econgressM1';\n\t\t\tif (isset($_POST['x4econgress_congresses'])) {\n\t\t\t\t$backUrl .= '&x4econgress_congresses='.$_POST['x4econgress_congresses'];\n\t\t\t}\n // JavaScript\n $this->doc->JScode = '\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 0;\n function jumpToUrl(URL) {\n document.location = URL;\n }\n\t\t\t\t\tfunction jump(url,modName,mainModName)\t{\n\t\t\t\t\t// Clear information about which entry in nav. tree that might have been highlighted.\n\t\t\t\t\ttop.fsMod.navFrameHighlightedID = new Array();\n\t\t\t\t\t\n\t\t\t\t\tif (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)\t{\n\t\t\t\t\t\ttop.content.nav_frame.refresh_nav();\n\t\t\t\t\t}\n\n\t\t\t\t\ttop.nextLoadModuleUrl = url;\n\t\t\t\t\ttop.goToModule(modName);\n\t\t\t\t\t}\n\t\t\t\t\tvar T3_THIS_LOCATION = top.getModuleUrl(top.TS.PATH_typo3+\"../typo3conf/ext/x4econgress/mod1/index.php?\");\n\t\t\t\t\tT3_THIS_LOCATION = \"'.urlencode($backUrl).'\";\n </script>\n ';\n $this->doc->postCode='\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 1;\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = '.intval($this->id).';\n </script>\n ';\n\n $headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->divider(5);\n\n // Render content:\n $this->moduleContent();\n\n\n // ShortCut\n if ($BE_USER->mayMakeShortcut()) {\n $this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n }\n\n $this->content.=$this->doc->spacer(10);\n } else {\n // If no access or if ID == zero\n\n $this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n $this->doc->backPath = $BACK_PATH;\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->spacer(5);\n $this->content.=$this->doc->spacer(10);\n }\n }", "protected function beforeProcess() {\n }", "public function extraInfo();", "public function getScript($post)\r\n {\r\n $r = Recipe::load($post['recipe']);\r\n $s = $r->getStepById($post['step']); \r\n $sm = array();\r\n foreach ($post as $key => $value)\r\n {\r\n switch ($key)\r\n {\r\n case 'cid': \r\n $sm[] = array('cid' => $value); \r\n $sm[] = array('condition' => $s->getConditionById($value));\r\n break; \r\n case 'condition':\r\n $sm[] = array('condition' => $value);\r\n break;\r\n case 'recipe': \r\n $sm[] = array('recipe' => $r);\r\n $sm[] = array('step' => $s); \r\n break;\r\n case 'aid': \r\n $sm[] = array('aid' => $value); \r\n break; \r\n case 'action':\r\n $sm[] = array('action' => $value);\r\n break;\r\n case 'row':\r\n $sm[] = array('row' => $value);\r\n break;\r\n case 'type':\r\n $sm[] = array('type' => $value);\r\n break;\r\n }\r\n }\r\n foreach ($sm as $tplVar)\r\n {\r\n $this->context->smarty->assign($tplVar);\r\n }\r\n if (array_key_exists('action', $post)) {\r\n if (method_exists($post['action'],$post['operation']))\r\n $t = call_user_func(array($post['action'],$post['operation']),$post);\r\n }\r\n \r\n $this->context->smarty->assign(\r\n array(\r\n 'recipe' => $r,\r\n 'step' => $s, \r\n 'row' => $post['row']\r\n )\r\n ); \r\n if (file_exists(_PS_MODULE_DIR_ . 'massivo/views/templates/admin/helpers/js/actions/' . $post['script'] . '.js.tpl'))\r\n $tpl =$this->context->smarty->fetch(_PS_MODULE_DIR_ . 'massivo/views/templates/admin/helpers/js/actions/' . $post['script'] . '.js.tpl'); \r\n else\r\n $tpl = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'massivo/views/templates/admin/helpers/js/' . $post['script'] . '.js.tpl'); \r\n return $tpl;\r\n }", "function wp_idolondemand_concept_extraction($args) {\n\textract($args);\n\techo $before_widget;\n\techo $before_title;?>Concept Extraction<?php echo $after_title;\n\tdisplay_wp_idolondemand_concept_extraction();\n\techo $after_widget;\n}", "function preflight($type, $parent)\n\t{\n\t\techo '<p>' . JText::_('COM_SPORTSARTICLE_PREFLIGHT_' . $type . '_TEXT') . '</p>';\n\t}", "function ihs_add_script_header() {\n\n\t\t$output = '';\n\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_header_meta', true ) );\n\t\t}\n\t\techo $output;\n\t}", "function addPOSEntry()\n{\n\n}", "function postflight($type, $parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\t// $type is the type of change (install, update or discover_install)\n\t\t//echo '<p>' . JText::_('COM_HELLOWORLD_POSTFLIGHT_' . $type . '_TEXT') . '</p>';\n\t}", "function dl_cadi_settings(){\r\n\r\n}", "function opcion__info()\n\t{\n\t\t$p = $this->get_proyecto();\n\t\t$param = $this->get_parametros();\n\t\t$this->consola->titulo( \"Informacion sobre el PROYECTO '\" . $p->get_id() . \"' en la INSTANCIA '\" . $p->get_instancia()->get_id() . \"'\");\n\t\t$this->consola->mensaje(\"Version de la aplicación: \".$p->get_version_proyecto().\"\\n\");\n\t\tif ( isset( $param['-c'] ) ) {\n\t\t\t// COMPONENTES\n\t\t\t$this->consola->subtitulo('Listado de COMPONENTES');\n\t\t\t$this->consola->tabla( $p->get_resumen_componentes_utilizados() , array( 'Tipo', 'Cantidad') );\n\t\t} elseif ( isset( $param['-g'] ) ) {\n\t\t\t// GRUPOS de ACCESO\n\t\t\t$this->consola->subtitulo('Listado de GRUPOS de ACCESO');\n\t\t\t$this->consola->tabla( $p->get_lista_grupos_acceso() , array( 'ID', 'Nombre') );\n\t\t} else {\n\t\t\t$this->consola->subtitulo('Reportes');\n\t\t\t$subopciones = array( \t'-c' => 'Listado de COMPONENTES',\n\t\t\t\t\t\t\t\t\t'-g' => 'Listado de GRUPOS de ACCESO' ) ;\n\t\t\t$this->consola->coleccion( $subopciones );\n\t\t}\n\t}", "function preflight($type, $parent) \n {\n echo '<div class=\"alert alert-success\">';\n echo ' <p>' . JText::_('COM_ACTIVATEGRID_INSTALL_TEXT' ) . '</p>';\n echo '</div>';\n \n echo '<p><a href=\"index.php?option=com_config&view=component&component=com_activategrid\"><button class=\"btn btn-large btn-block btn-success\" type=\"button\">'.JText::_('COM_ACTIVATEGRID_GET_START' ).'</button></a></p>';\n }", "abstract protected function setup();", "protected function _preExec()\n {\n }", "function auto_run()\n\t{\n\t\t$this->html = $this->ipsclass->acp_load_template('cp_skin_tools');\n\n\t\tswitch($this->ipsclass->input['code'])\n\t\t{\n\t\t\tcase 'master_xml_export':\n\t\t\t\t$this->master_xml_export();\n\t\t\t\tbreak;\n\n\t\t\tcase 'manage':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_add':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_form('add');\n\t\t\t\tbreak;\n\t\t\tcase 'component_add_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_save('add');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_edit':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_form('edit');\n\t\t\t\tbreak;\n\t\t\tcase 'component_edit_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_save('edit');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_delete':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_delete();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_export':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':export' );\n\t\t\t\t$this->components_export('single');\n\t\t\t\tbreak;\n\t\t\tcase 'component_import':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':import' );\n\t\t\t\t$this->components_import();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_uninstall':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_uninstall();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_move':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_move();\n\t\t\t\tbreak;\n\t\t\tcase 'component_toggle_enabled':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_toggle_enabled();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\t\t}\n\t}" ]
[ "0.5742019", "0.56496096", "0.561742", "0.5566256", "0.5489256", "0.5487434", "0.54467773", "0.54448384", "0.5416801", "0.5390784", "0.53869003", "0.5382678", "0.5364046", "0.53452706", "0.5330584", "0.5321502", "0.5312764", "0.5255562", "0.52531093", "0.5232234", "0.52214026", "0.52094036", "0.52053654", "0.5202057", "0.51809335", "0.51809335", "0.51763016", "0.5163052", "0.51477057", "0.5146723", "0.51364046", "0.51364046", "0.5133185", "0.5106612", "0.51046294", "0.5104543", "0.50807506", "0.5076264", "0.507137", "0.50696385", "0.5068566", "0.5067022", "0.5056367", "0.50481296", "0.50245774", "0.5017859", "0.50118697", "0.5009191", "0.50084543", "0.5007659", "0.5006465", "0.49910972", "0.49769607", "0.49769607", "0.49769607", "0.49769607", "0.49712375", "0.49681193", "0.49650952", "0.4961586", "0.49550837", "0.49448773", "0.4942005", "0.4940166", "0.493926", "0.493926", "0.49378973", "0.492122", "0.49139377", "0.49120957", "0.49115008", "0.4911368", "0.49113628", "0.49102095", "0.4909094", "0.49066553", "0.4901393", "0.48920706", "0.48907423", "0.48902217", "0.48886678", "0.48886678", "0.48880363", "0.4884951", "0.4881363", "0.48811144", "0.48771456", "0.4872328", "0.4871191", "0.48710558", "0.48699963", "0.4868948", "0.48660526", "0.48549852", "0.48542693", "0.48532155", "0.48483267", "0.48454878", "0.48417026", "0.48327", "0.48299184" ]
0.0
-1
Allows WordPress to recognize the semesterly URL structure of the combined Floor and Board Minutes post types' archive page. All URL rewrites are documented inside this function's contents. When changing these rewrite rules, the .htaccess file will need to be updated. This can be done by clicking the "Save" button on the Permalinks settings page in WordPress, or by calling flush_rewrite_rules(), which should only be called once. Do NOT make a call to flush_rewrite_rules() on every page load! It's unnecessary and impacts performance.
function add_minutes_url_rewrite_rules( $wp_rewrite ) { $wp_rewrite->rules = array( /** * Meeting minutes archive URL structure. * Shows minutes for the latest semester. */ 'minutes/?$' => $wp_rewrite->index . '?post_type=board_minutes', /** * Meeting minutes archive URL structure. * minutes/{string}/{year}/ * Example: minutes/spring/2013/ */ 'minutes/?([^/]*)/([0-9]{4})/?$' => $wp_rewrite->index . '?post_type=board_minutes&semester=' . $wp_rewrite->preg_index(1) . '&year=' . $wp_rewrite->preg_index(2), ) + $wp_rewrite->rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_archive_rewrite_rules() {\n\t\t$post_types = get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true,'show_ui' => true) );\n\n\t\tforeach ( $post_types as $post_type ):\n\t\t\tif( !$post_type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$permalink = get_option( $post_type.'_structure' );\n\t\t\t$post_type_obj = get_post_type_object($post_type);\n\t\t\t$slug = $post_type_obj->rewrite['slug'];\n\t\t\tif( !$slug )\n\t\t\t\t$slug = $post_type;\n\n\t\t\tif( $post_type_obj->has_archive ){\n\t\t\t\tif( is_string( $post_type_obj->has_archive ) ){\n\t\t\t\t\t$slug = $post_type_obj->has_archive;\n\t\t\t\t};\n\n\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&paged=$matches[2]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type='.$post_type, 'top' );\n\t\t\t}\n\n\n\t\tendforeach;\n\t}", "function custom_rewrite_rule(){\n $page_id = $this->page_id;\n $slugs = $this->slugs;\n foreach ($slugs as $key => $value){\n if($value['slug']){\n add_rewrite_rule($key.'/([a-z0-9-]+)[/]?$','index.php?page_id='.$page_id.'&'.$key.'=$matches[1]','top');\n }else{\n add_rewrite_rule($key.'[/]?$','index.php?page_id='.$page_id.'&'.$key.'=$matches[1]','top');\n }\n }\n /// end rewrite\n flush_rewrite_rules();\n }", "function portal_custom_page_rewrite_rules() {\n\n global $wp_rewrite;\n\n\t$slug = portal_get_slug();\n\n if( isset( $wp_rewrite->front ) ) $slug = substr( $wp_rewrite->front, 1 ) . $slug;\n\n /**\n * Custom task pages\n */\n add_rewrite_rule( '^' . $slug . '/tasks/?$', 'index.php?post_type=portal_projects&portal_tasks_page=home', 'top' );\n\tadd_rewrite_rule( '^' . $slug . '/tasks/([^/]*)/?', 'index.php?post_type=portal_projects&portal_tasks_page=$matches[1]', 'top' );\n\n /**\n * Custom Status\n */\n add_rewrite_rule( '^' . $slug . '/status/([^/]+)/?$', 'index.php?post_type=portal_projects&portal_status_page=$matches[1]', 'top' );\n add_rewrite_rule( '^' . $slug . '/status/([^/]+)/page/([0-9]+)?/?$', 'index.php?post_type=portal_projects&portal_status_page=$matches[1]&paged=$matches[2]', 'top' );\n\n}", "static public function init_rewrite_rules() {\n\n\t\t$fronts = self::get_rewrite_fronts();\n\t\t$paged_regex = self::$paged_regex_base;\n\n\t\t$flpaged_rules = array(\n\n\t\t\t// Category archive\n\t\t\t$fronts['category'] . '/(.+?)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Tag archive\n\t\t\t$fronts['tag'] . '/([^/]+)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Year archive\n\t\t\t$fronts['date'] . '([0-9]{4})/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Year/month archive\n\t\t\t$fronts['date'] . '([0-9]{4})/([0-9]{1,2})/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&flpaged=$matches[3]',\n\n\t\t\t// Day archive\n\t\t\t$fronts['date'] . '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&flpaged=$matches[4]',\n\n\t\t\t// Author archive\n\t\t\t$fronts['author'] . '([^/]+)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Post single - Numeric permastruct (/archives/%post_id%)\n\t\t\t$fronts['default'] . '([0-9]+)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?p=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Page\n\t\t\t'(.?.+?)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&flpaged=$matches[2]',\n\n\t\t\t// Post single\n\t\t\t'(.+?)/' . $paged_regex . '/?([0-9]{1,})/?$' => 'index.php?name=$matches[1]&flpaged=$matches[2]',\n\t\t);\n\n\t\t// Frontpage static\n\t\tif ( get_option( 'page_on_front' ) ) {\n\t\t\t$flpaged_rules[ $paged_regex . '/([0-9]*)/?' ] = 'index.php?page_id=' . get_option( 'page_on_front' ) . '&flpaged=$matches[1]';\n\t\t}\n\t\t// Generic Rule for Homepage / Search\n\t\t$flpaged_rules[ $paged_regex . '/?([0-9]{1,})/?$' ] = 'index.php?&flpaged=$matches[1]';\n\n\t\tforeach ( $flpaged_rules as $regex => $redirect ) {\n\t\t\tadd_rewrite_rule( $regex, $redirect, 'top' );\n\t\t}\n\n\t\tadd_rewrite_tag( '%flpaged%', '([^&]+)' );\n\t}", "public function wp_rewrite_rules()\n {\n }", "public function page_rewrite_rules()\n {\n }", "function chapel_hour_flush_rewrite_rules() {\n chapel_hour_post_type();\n flush_rewrite_rules();\n}", "public function using_mod_rewrite_permalinks()\n {\n }", "function add_custom_rewrite_rule() {\n // the default permalink structure is being used.\n if( ($current_rules = get_option('rewrite_rules')) ) {\n\n // Next, iterate through each custom rule adding a new rule\n // that replaces 'movies' with 'films' and give it a higher\n // priority than the existing rule.\n foreach($current_rules as $key => $val) {\n if(strpos($key, 'archive') !== false) {\n add_rewrite_rule(str_ireplace('archive', 'projects', $key), $val, 'top'); \n } // end if\n } // end foreach\n\n } // end if/else\n\n // ...and we flush the rules\n flush_rewrite_rules();\n\n}", "function iis7_save_url_rewrite_rules()\n {\n }", "static public function post_type_rewrite_rules( $post_type, $args ) {\n\t\tglobal $wp_rewrite;\n\n\t\tif ( $args->_builtin or ! $args->publicly_queryable ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( false === $args->rewrite ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get our custom pagination if sets.\n\t\t$custom_paged = self::get_custom_paged();\n\n\t\tif ( ! $custom_paged || empty( $custom_paged ) || ! isset( $custom_paged['current_page'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$is_single = false;\n\n\t\t// Check if it's a CPT archive or CPT single.\n\t\tif ( $custom_paged['current_page'] != $post_type ) {\n\n\t\t\t// Is a child post of the current post type?\n\t\t\t$post_object = get_page_by_path( $custom_paged['current_page'], OBJECT, $post_type );\n\n\t\t\tif ( $post_object ) {\n\t\t\t\t$is_single = true;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$slug = $args->rewrite['slug'];\n\n\t\tif ( is_string( $args->has_archive ) ) {\n\t\t\t$slug = $args->has_archive;\n\t\t}\n\n\t\tif ( $args->rewrite['with_front'] ) {\n\t\t\t$slug = substr( $wp_rewrite->front, 1 ) . $slug;\n\t\t}\n\n\t\t// Append $custom_paged[ 'current_page' ] to slug if it's single.\n\t\tif ( $is_single ) {\n\t\t\t$regex = $slug . '/' . $custom_paged['current_page'] . '/' . self::$paged_regex_base . '/?([0-9]{1,})/?$';\n\t\t\t$redirect = 'index.php?post_type=' . $post_type . '&name=' . $custom_paged['current_page'] . '&flpaged=$matches[1]';\n\t\t} else {\n\t\t\t$regex = $slug . '/' . self::$paged_regex_base . '/?([0-9]{1,})/?$';\n\t\t\t$redirect = 'index.php?post_type=' . $post_type . '&flpaged=$matches[1]';\n\t\t}\n\n\t\tadd_rewrite_rule( $regex, $redirect, 'top' );\n\n\t\t// Set true for flushing.\n\t\tself::$_rewrote_post_type = true;\n\t}", "function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}", "function workshop_rewrite_flush() {\n workshop_cpt_init();\n flush_rewrite_rules();\n}", "function mrl_mod_rewrite( $rules ) {\r\n $options = get_option('MyReadingLibraryOptions');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([0-9]+)/?$', 'index.php?my_reading_library_id=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . 'page/([^/]+)/?$', 'index.php?my_reading_library_page=$matches[1]', 'top'); \r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . 'reader/([^/]+)/?$', 'index.php?my_reading_library_reader=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([^/]+)/([^/]+)/?$', 'index.php?my_reading_library_author=$matches[1]&my_reading_library_title=$matches[2]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([^/]+)/?$', 'index.php?my_reading_library_author=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '?$', 'index.php?my_reading_library_library=1', 'top');\r\n}", "public function add_rewrite_rules() {\n\t\t$priority = 'top';\n\t\t$root_rule = '/([^/]+)/?$';\n\n\t\t$page_slug = wct_paged_slug();\n\t\t$paged_rule = '/([^/]+)/' . $page_slug . '/?([0-9]{1,})/?$';\n\t\t$embed_rule = '/([^/]+)/embed/?$';\n\n\t\t// User Comments\n\t\t$user_comments_rule = '/([^/]+)/' . $this->user_comments_slug . '/?$';\n\t\t$user_comments_paged_rule = '/([^/]+)/' . $this->user_comments_slug . '/' . $this->cpage_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User Rates\n\t\t$user_rates_rule = '/([^/]+)/' . $this->user_rates_slug . '/?$';\n\t\t$user_rates_paged_rule = '/([^/]+)/' . $this->user_rates_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User to rate\n\t\t$user_to_rate_rule = '/([^/]+)/' . $this->user_to_rate_slug . '/?$';\n\t\t$user_to_rate_paged_rule = '/([^/]+)/' . $this->user_to_rate_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User talks\n\t\t$user_talks_rule = '/([^/]+)/' . $this->user_talks_slug . '/?$';\n\t\t$user_talks_paged_rule = '/([^/]+)/' . $this->user_talks_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User rules\n\t\tadd_rewrite_rule( $this->user_slug . $user_comments_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_comments_rid . '=1&' . $this->cpage_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_comments_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_comments_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_rates_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_rates_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_rates_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_rates_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_to_rate_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_to_rate_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_to_rate_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_to_rate_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_talks_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_talks_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_talks_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_talks_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $embed_rule, 'index.php?' . $this->user_rid . '=$matches[1]&embed=true', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $root_rule, 'index.php?' . $this->user_rid . '=$matches[1]', $priority );\n\n\t\t// Action rules (only add a new talk right now)\n\t\tadd_rewrite_rule( $this->action_slug . $root_rule, 'index.php?' . $this->action_rid . '=$matches[1]', $priority );\n\t}", "function rewrite_rules($wp_rewrite) {\n $new_rules = array(\n 'hcard_url/(.+)' => 'index.php?hcard_url=' . $wp_rewrite->preg_index(1)\n );\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n }", "function custom_rewrite_rule() {\n\n}", "function save_mod_rewrite_rules()\n {\n }", "function modify_rewrites() {\n\tadd_rewrite_rule( '^search/?$', 'index.php?s=', 'top' );\n\tadd_rewrite_rule( '^search/page/?([0-9]{1,})/?$', 'index.php?s=&paged=$matches[1]', 'top' );\n}", "private function flush_rewrite_rules() {\n\n\t\tglobal $updraftplus_addons_migrator;\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) switch_to_blog($updraftplus_addons_migrator->new_blogid);\n\n\t\t$filter_these = array('permalink_structure', 'rewrite_rules', 'page_on_front');\n\t\t\n\t\tforeach ($filter_these as $opt) {\n\t\t\tadd_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->init();\n\t\t// Don't do this: it will cause rules created by plugins that weren't active at the start of the restore run to be lost\n\t\t// flush_rewrite_rules(true);\n\n\t\tif (function_exists('save_mod_rewrite_rules')) save_mod_rewrite_rules();\n\t\tif (function_exists('iis7_save_url_rewrite_rules')) iis7_save_url_rewrite_rules();\n\n\t\tforeach ($filter_these as $opt) {\n\t\t\tremove_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) restore_current_blog();\n\n\t}", "public function get_rewrite_rules() {\n\t\treturn array(\n\t\t\t'archives/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/category/(.+?)/?$' => 'index.php?category_name=$matches[1]',\n\t\t\t'archives/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/?$' => 'index.php?tag=$matches[1]',\n\t\t\t'archives/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?post_format=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/type/([^/]+)/?$' => 'index.php?post_format=$matches[1]',\n\t\t\t'archives/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/author/([^/]+)/?$' => 'index.php?author_name=$matches[1]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/?$' => 'index.php?year=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)/trackback/?$' => 'index.php?p=$matches[1]&tb=1',\n\t\t\t'archives/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/page/?([0-9]{1,})/?$' => 'index.php?p=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/([0-9]+)/comment-page-([0-9]{1,})/?$' => 'index.php?p=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)(/[0-9]+)?/?$' => 'index.php?p=$matches[1]&page=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]'\n\t\t);\n\t}", "public function rewrite_flush() {\n\n // Register the post type.\n $this->create_post_type();\n\n // ATTENTION: This is *only* done during plugin activation hook in this example!\n // You should *NEVER EVER* do this on every page load!!\n flush_rewrite_rules();\n }", "public function add_rewrite_rules()\n {\n }", "public function add_rewrite_rules()\n {\n }", "public function load_rewrites(WP_Rewrite $wp_rewrite)\n {\n // Don't add rewrite rules if archive page of MEC is disabled\n if(!$this->main->get_archive_status()) return;\n \n if(!$wp_rewrite instanceof WP_Rewrite)\n {\n global $wp_rewrite;\n }\n \n // MEC main slug\n $slug = $this->main->get_main_slug();\n \n // MEC main post type name\n $PT = $this->main->get_main_post_type();\n \n $rules = array(\n '(?:'.$slug.')/(\\d{4}-\\d{2})/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month&MecDate=$matches[1]',\n '(?:'.$slug.')/(?:monthly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month',\n '(?:'.$slug.')/(?:weekly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=week',\n '(?:'.$slug.')/(?:daily)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=day',\n '(?:'.$slug.')/(?:map)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=map',\n '(?:'.$slug.')/(?:list)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=list',\n '(?:'.$slug.')/(?:grid)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=grid',\n '(?:'.$slug.')/?$'=>'index.php?post_type='.$PT.'&MecDisplay=default',\n '(?:'.$slug.')/(feed|rdf|rss|rss2|atom)/?$'=>'index.php?post_type='.$PT.'&feed=$matches[1]',\n );\n\n $wp_rewrite->rules = $rules + $wp_rewrite->rules;\n }", "public function mod_rewrite_rules()\n {\n }", "function custom_page_permalink() {\r\n global $wp_rewrite;\r\n\r\n if ( get_option('permalink_structure') != '' && !strpos($wp_rewrite->get_page_permastruct(), '.' . $this->options->extension) ) {\r\n $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.' . $this->options->extension;\r\n }\r\n }", "function nk_helper_rewrite_rules_portfolio () {\n flush_rewrite_rules();\n}", "static public function add_rewrite_rules(){\n\t global $wp,$wp_rewrite; \n\t $wp->add_query_var( 'profile' );\n\n\t foreach( AT_Route::fronted() as $key=>$params ){\n\t\t\t$wp_rewrite->add_rule('^' .$key, 'index.php?profile=true', 'top');\n\t\t\tforeach ( $params['regular_expressions'] as $key => $expression ) {\n\t\t\t\t$wp_rewrite->add_rule('^' .$key . $expression, 'index.php?profile=true', 'top');\n\t\t\t}\n\n\t }\n\n\t $wp_rewrite->flush_rules();\n\t}", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "function mod_rewrite_fix_wordpress_dir($rules) {\n $rules = preg_replace('/^(RewriteRule\\s)(\\^index.*-)(.*)$/m', '$1^$ /index.php$3', $rules);\n // make all rewriterules go to the right index in the wordpress directory\n $rules = preg_replace('/^(RewriteRule .+)(index\\.php.*)$/m', '$1wordpress/$2', $rules);\n return $rules;\n}", "function wpbp_add_rewrites($content) {\n global $wp_rewrite;\n $llama_new_non_wp_rules = array(\n \t// icons for home screen and bookmarks\n\t 'assets/icons/(.*)' => THEME_PATH . '/assets/icons/$1',\n \t'favicon.ico' => 'assets/icons/favicon.ico',\n \t'apple-touch(.*).png' => 'assets/icons/apple-touch$1.png',\n\n \t// other rules\n\t 'assets/wpbp-assets/(.*)' => THEME_PATH . '/assets/wpbp-assets/$1',\n '(.*)\\.[\\d]+\\.(css|js)$'\t=> '$1.$2 [L]',\n '(.*)\\.[\\d]+\\.(js)$' => '/$1.$2 [QSA,L]',\n '(.*)\\.[\\d]+\\.(css)$' => '$1.$2 [L]'\n );\n $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $llama_new_non_wp_rules);\n return $content;\n}", "public function rewriteURL(): void\n {\n global $wp_rewrite;\n $customEndpoint = $this->customEndpoint();\n $newRules = [\n $customEndpoint . '/?$' => 'index.php?' . self::CUSTOMPAGEVAR . '=' . $customEndpoint,\n ];\n $wp_rewrite->rules = $newRules + (array) $wp_rewrite->rules;\n }", "function humcore_add_rewrite_rule() {\n\n\tadd_rewrite_rule(\n\t\t'(deposits/item)/([^/]+)(/(review))?/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_command=$matches[4]',\n\t\t'top'\n\t);\n\n\tadd_rewrite_rule(\n\t\t'(deposits/download)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n\t// Rewrite for deposits/objects handled as ngix proxy pass.\n\n\tadd_rewrite_rule(\n\t\t'(deposits/view)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n add_rewrite_rule(\n '(deposits/list)/?$',\n 'index.php?pagename=$matches[1]',\n 'top'\n );\n\n}", "function theme_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "function wst_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "function rae_add_custom_rewrite_rules() {\n\tadd_rewrite_rule( '^event/[0-9]{4}/([^/]+)/?$', 'index.php?name=$matches[1]&post_type=event', 'top' );\n}", "function reset_permalinks() {\n global $wp_rewrite;\n $wp_rewrite->set_permalink_structure( '/%postname%/' );\n}", "public static function add_rewrite_rule()\n {\n }", "public function addRewriteRules( $wp_rewrite ) {\r\n $new_rules = array( \r\n get_option('vh_custom_post_type_url_slug') . '/' . get_option('vh_game_provider_url_slug'). '/(.+)' => 'index.php?'.get_option('vh_custom_post_type_url_slug') . '-' . get_option('vh_game_provider_url_slug').'=' .\r\n $wp_rewrite->preg_index(1) );\r\n\r\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\r\n }", "function tennis_rewrite_tag_rule() {\n\tadd_rewrite_tag( '%manage%', '([^&]+)' );\n\tadd_rewrite_rule( '^manage/([^/]*)/?', 'single_tenniseventcpt.php?manage=$matches[1]','top' );\n\t\n\t// remove comments and customize for custom post types\n\t// add_rewrite_rule( '^event/city/([^/]*)/?', 'index.php?post_type=event&city=$matches[1]','top' );\n}", "public function generate_rewrite_rules($permalink_structure, $ep_mask = \\EP_NONE, $paged = \\true, $feed = \\true, $forcomments = \\false, $walk_dirs = \\true, $endpoints = \\true)\n {\n }", "function got_url_rewrite()\n {\n }", "function ind_page_rewrite_rules($rules) {\n\tglobal $wp_rewrite;\t \n\n\t// add rewrite tokens\n\t$keytag = '%chapter%';\n\t$wp_rewrite->add_rewrite_tag($keytag, '([0-9]+)', 'chapter=');\n\n\t// rules for 'pages'\n\t$page_structure = $wp_rewrite->page_structure . \"/chapter/$keytag\";\n\t$page_structure = str_replace('//', '/', $page_structure);\n\t$wp_rewrite->page_structure = $page_structure;\n\t$page_rewrite = $wp_rewrite->page_rewrite_rules();\n\n\t$answer = array();\n\t$answer['(.?.+?)/chapter/([0-9]+)/?$'] = 'index.php?pagename=$matches[1]&chapter=$matches[2]';\n\t$answer = $answer + $rules + $page_rewrite; \n\t\n\treturn $answer; \n\t\n}", "function my_rewrite_flush() {\n // Note: \"add\" is written with quotes, as CPTs don't get added to the DB,\n // They are only referenced in the post_type column with a post entry, \n // when you add a post of this CPT.\n yee_post_type_testimonial_init();\n // ATTENTION: This is *only* done during plugin activation hook in this example!\n // You should *NEVER EVER* do this on every page load!!\n flush_rewrite_rules();\n}", "protected function register_rewrite_rules() {\n\t\tif ( ! empty( $this->rules ) ) {\n\t\t\tforeach ( $this->rules as $value ) {\n\t\t\t\tadd_rewrite_rule( $value['regex'], $value['replace'], $value['type'] );\n\t\t\t}\n\t\t}\n\t}", "function ex_theme_terlet() {\n \tflush_rewrite_rules();\n }", "function roots_flush_rewrites() {\n\nif(of_get_option('flush_htaccess', false) == 1 || get_transient(\"was_flushed\") === false) {\n\t\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->flush_rules();\n\t\n\t\tset_transient(\"was_flushed\", true, 60 * 60 * 24 * 7 );\n\t}\n}", "function dvs_add_rewrite_rules( $wp_rewrite )\n{\n $new_rules = array(\n 'my-prefix/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),\n );\n\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n}", "function rad_rewrite_flush(){\n\trad_setup_products(); //the function above that set up the CPT\n\tflush_rewrite_rules(); //re-builds the .htaccess rules\n}", "function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}", "public function fixRewrite()\n {\n if (!defined('REWRITED')) {\n preg_match(\"#^([^\\.]*)\\.#\", $_SERVER['HTTP_HOST'], $match);\n if ($_SERVER['HTTP_HOST'] != $GLOBALS['domain_info']['host']\n && $_GET['page'] && $_GET['page'] != $match[1]\n ) {\n $_GET['rlVareables'] = $_GET['page'] . ($_GET['rlVareables'] ? '/' . $_GET['rlVareables'] : '');\n\n $_GET['page'] = $match[1];\n $_GET['wildcard'] = '';\n } elseif ($_SERVER['HTTP_HOST'] != $GLOBALS['domain_info']['host']\n && (!isset($_GET['page']) || $_GET['listing_id'])\n ) {\n $_GET['page'] = $match[1];\n $_GET['wildcard'] = '';\n }\n\n define('REWRITED', true);\n }\n }", "function insert_rewrite_rules( $rules ) {\r\n $newrules = array();\r\n\r\n //portal page\r\n $newrules[wpc_client_get_slug( 'portal_page_id', false, false ) . '/(.+?)/?$'] = 'index.php?wpc_page=portal_page&wpc_page_value=$matches[1]';\r\n\r\n //preview for HUB\r\n $newrules[wpc_client_get_slug( 'hub_page_id', false, false ) . '/(\\d*)/?$'] = 'index.php?wpc_page=hub_preview&wpc_page_value=$matches[1]';\r\n\r\n return $newrules + $rules;\r\n }", "function add_rewrite_rules() {\n\n\tadd_rewrite_tag( '%image%', '([^/]*)');\n\n\tadd_rewrite_rule('^gallery/([^/]*)/([^/]*)/?$', 'index.php?gallery=$matches[1]&image=$matches[2]', 'top');\n}", "function rest_theme_routes() {\n $routes = array();\n\n $query = new WP_Query( array(\n 'post_type' => 'any',\n 'post_status' => 'publish',\n 'posts_per_page' => -1,\n ) );\n\n if ( $query->have_posts() ) {\n while ( $query->have_posts() ) {\n $query->the_post();\n $routes[] = array(\n 'id' => get_the_ID(),\n 'type' => get_post_type(),\n 'slug' => basename( get_permalink() ),\n 'link' => str_replace( site_url(), '', get_permalink() ),\n 'template' => get_page_template_slug()\n );\n }\n }\n\n wp_reset_postdata();\n\n return $routes;\n}", "function myplugin_flush_rewrites() {\r\r\n\tmyplugin_custom_post_types_registration();\r\r\n\tflush_rewrite_rules();\r\r\n}", "function rewrite_thumbnail_url( $rewrite ) {\n\n // Step 1\n $new_rules = \"\\n# WP Extend ThumbnailApi support step 1\\n\";\n $new_rules .= \"<IfModule mod_rewrite.c>\\n\";\n\n $new_rules .= \"RewriteEngine On\\n\";\n $new_rules .= \"RewriteBase /\\n\";\n\n $new_rules .= \"# URL contains width and height query string\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_URI} ^/\" . $this->path_base_thumbnail_api . \"/\\n\";\n $new_rules .= \"RewriteCond %{QUERY_STRING} ^w=([0-9]*)&h=([0-9]*)$\\n\";\n $new_rules .= \"RewriteRule ^\" . $this->path_base_thumbnail_api . \"/(.*)$ /\" . $this->path_generated_images . \"/w%1-h%2-$1? [QSA,L]\\n\";\n\n $new_rules .= \"# URL contains width only query string\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_URI} ^/\" . $this->path_base_thumbnail_api . \"/\\n\";\n $new_rules .= \"RewriteCond %{QUERY_STRING} ^w=([0-9]*)$\\n\";\n $new_rules .= \"RewriteRule ^\" . $this->path_base_thumbnail_api . \"/(.*)$ /\" . $this->path_generated_images . \"/w%1-h0-$1? [QSA,L]\\n\";\n\n $new_rules .= \"# URL contains height only query string\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_URI} ^/\" . $this->path_base_thumbnail_api . \"/\\n\";\n $new_rules .= \"RewriteCond %{QUERY_STRING} ^h=([0-9]*)$\\n\";\n $new_rules .= \"RewriteRule ^\" . $this->path_base_thumbnail_api . \"/(.*)$ /\" . $this->path_generated_images . \"/w0-h%1-$1? [QSA,L]\\n\";\n\n $new_rules .= \"# URL does not contains any query string\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_URI} ^/\" . $this->path_base_thumbnail_api . \"/\\n\";\n $new_rules .= \"RewriteRule ^\" . $this->path_base_thumbnail_api . \"/(.*)$ /\" . $this->path_generated_images . \"/w0-h0-$1? [QSA,L]\\n\";\n\n $new_rules .= \"</IfModule>\\n\\n\";\n\n // Step 2\n $new_rules .= \"# WP Extend ThumbnailApi support step 2\\n\";\n $new_rules .= \"<IfModule mod_rewrite.c>\\n\";\n\n $new_rules .= \"RewriteEngine On\\n\";\n $new_rules .= \"RewriteBase /\" . $this->path_generated_images . \"/\\n\";\n \n $new_rules .= \"# redirect all requests to non-existing resources to special handler\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_FILENAME} !-f\\n\";\n $new_rules .= \"RewriteCond %{REQUEST_FILENAME} !-d\\n\";\n $new_rules .= \"RewriteRule ^\" . $this->path_generated_images . \"/(.+)$ /\" . str_replace(home_url() . '/', '', admin_url()) . \"admin-post.php?action=\" . WPEXTEND_MAIN_SLUG_ADMIN_PAGE . \"_thumbnail_api&name_image=$1 [QSA,L]\\n\";\n\n $new_rules .= \"</IfModule>\\n\\n\";\n\n return $new_rules . $rewrite;\n }", "function c5_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "public function add_rewrite_rules() {\n add_rewrite_tag('%salesforce-login%', '([^&]+)');\n add_rewrite_rule('salesforce-login/?$', 'index.php?salesforce-login=salesforce-login', 'top');\n\n add_rewrite_tag('%salesforce-callback%', '([^&]+)');\n add_rewrite_rule('salesforce-callback/?$', 'index.php?salesforce-callback=salesforce-callback', 'top');\n }", "function refresh_rewrite_rules() {\n\tflush_rewrite_rules();\n\tdo_action( 'rri_flush_rules' );\n}", "function ind_post_rewrite_rules($rules) {\n\tglobal $wp_rewrite;\n \n\t// add rewrite tokens\n\t$keytag = '%chapter%';\n\t$wp_rewrite->add_rewrite_tag($keytag, '([0-9]+)', 'chapter=');\n\n\t// rules for 'posts'\n\t$post_structure = $wp_rewrite->permalink_structure . \"/chapter/$keytag\";\n\t$post_structure = str_replace('//', '/', $post_structure);\n\t$post_rewrite = $wp_rewrite->generate_rewrite_rules($post_structure, EP_PERMALINK);\n\n\t$rules = array_merge($post_rewrite,$rules);\n\t \n\treturn $rules;\n}", "public function generate_rewrite_rule($permalink_structure, $walk_dirs = \\false)\n {\n }", "function rest_api_register_rewrites()\n {\n }", "function cc_bare_category_rewrite_rules($rules) {\n\n\t$cc_rules = array();\n\n\t# We unset this existing rule so that we can later re-append it to the\n\t# list of rewrite rules, else it will match before the more specific\n\t# ones do.\n\tunset($rules['(.+?)/?$']);\n\n\t# Handles pagination for URLs like /catname/year/month/page/#\n\t$cc_rules['(.+?)/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]';\n\n\t# Handles pagination for URLs like /catname/year/page/#\n\t$cc_rules['(.+?)/([0-9]{4})/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&year=$matches[2]&paged=$matches[3]';\n\n\t# Handles pagination for URLs like /catname/page/#\n\t$cc_rules['(.+?)/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';\n\n\t# Handles the basic bare category for URLs like /catname\n\t$cc_rules['(.+?)/?$'] = 'index.php?category_name=$matches[1]';\n\n\t# Now append our rules to the ones WP generated\n\treturn $rules + $cc_rules;\n\n}", "public function rewriteRules()\n {\n add_rewrite_rule('janrain/(.*?)/?$', 'index.php?janrain=$matches[1]', 'top');\n add_rewrite_tag('%janrain%', '([^&]+)');\n }", "function custom_rewrite_rule() {\n add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?page_id=12&food=$matches[1]&variety=$matches[2]','top');\n}", "function wpcf_filter_type( $data, $post_type ) {\n if ( !empty( $data['rewrite']['enabled'] ) ) {\n $data['rewrite']['with_front'] = !empty( $data['rewrite']['with_front'] );\n $data['rewrite']['feeds'] = !empty( $data['rewrite']['feeds'] );\n $data['rewrite']['pages'] = !empty( $data['rewrite']['pages'] );\n\n // If slug is not submitted use default slug\n if ( empty( $data['rewrite']['slug'] ) ) {\n $data['rewrite']['slug'] = $data['slug'];\n }\n\n // Also force default slug if rewrite mode is 'normal'\n if ( !empty( $data['rewrite']['custom'] ) && $data['rewrite']['custom'] != 'normal' ) {\n $data['rewrite']['slug'] = $data['rewrite']['slug'];\n }\n\n // Register with _x()\n $data['rewrite']['slug'] = _x( $data['rewrite']['slug'], 'URL slug',\n 'wpcf' );\n //\n // CHANGED leave it for reference if we need\n // to return handling slugs back to WP.\n // \n // We unset slug settings and leave WP to handle it himself.\n // Let WP decide what slugs should be!\n// if (!empty($data['rewrite']['custom']) && $data['rewrite']['custom'] != 'normal') {\n// unset($data['rewrite']['slug']);\n// }\n // Just discard non-WP property\n unset( $data['rewrite']['custom'] );\n } else {\n $data['rewrite'] = false;\n }\n\n return $data;\n}", "function nesia_flush_rewriterules () {\r\r\n\tflush_rewrite_rules();\r\r\n}", "function kalabera_flush_rewrite_rules() {\n flush_rewrite_rules();\n}", "function eman_add_rewrites( $content )\n\t{\n\t\tglobal $wp_rewrite;\n\t\t$new_non_wp_rules = array(\n\t\t\t'assets/(.*)' => THEME_PATH . '/assets/$1',\n\t\t\t'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'\n\t\t);\n\t\t$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);\n\t\treturn $content;\n\t}", "function hm_create_custom_rewrite_rules( $rules ) {\n\n \t// Define the custom permalink structure\n \tglobal $hm_rewrite_rules;\n\n \t$new_rules = array();\n\n \tforeach( (array) $hm_rewrite_rules as $rule )\n \t\t$new_rules[ $rule[0] ] = $rule[1];\n\n \t$rules = array_merge( (array) $new_rules, $rules );\n\n\treturn $rules;\n}", "public function rewrite_flush()\n {\n $this->register_post_type();\n $this->build_database_table();\n flush_rewrite_rules();\n }", "function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "function ffd_get_permalink_structure() {\r\n\t$saved_permalinks = (array) get_option( 'ffd_permalinks', array() );\r\n\t$permalinks = wp_parse_args(\r\n\t\tarray_filter( $saved_permalinks ), array(\r\n\t\t\t'listing_base' => _x( 'listing', 'slug', 'ffd-integration' ),\r\n\t\t\t'category_base' => _x( 'listing-category', 'slug', 'ffd-integration' ),\r\n\t\t\t'tag_base' => _x( 'listing-tag', 'slug', 'ffd-integration' ),\r\n\t\t\t'attribute_base' => '',\r\n\t\t\t'use_verbose_page_rules' => false,\r\n\t\t)\r\n\t);\r\n\r\n\tif ( $saved_permalinks !== $permalinks ) {\r\n\t\tupdate_option( 'ffd_permalinks', $permalinks );\r\n\t}\r\n\r\n\t$permalinks['listing_rewrite_slug'] = untrailingslashit( $permalinks['listing_base'] );\r\n\t$permalinks['category_rewrite_slug'] = untrailingslashit( $permalinks['category_base'] );\r\n\t$permalinks['tag_rewrite_slug'] = untrailingslashit( $permalinks['tag_base'] );\r\n\t$permalinks['attribute_rewrite_slug'] = untrailingslashit( $permalinks['attribute_base'] );\r\n\r\n\treturn $permalinks;\r\n}", "public function rewrite_rules($wp_rewrite) {\r\n $rules = array();\r\n if (SQ_Classes_Tools::getOption('sq_use') == 1) {\r\n\r\n //For Favicon\r\n if (SQ_Classes_Tools::getOption('sq_auto_favicon') == 1) {\r\n $rules['favicon\\.ico$'] = 'index.php?sq_get=favicon';\r\n $rules['favicon\\.icon$'] = 'index.php?sq_get=favicon';\r\n $rules['touch-icon\\.png$'] = 'index.php?sq_get=touchicon';\r\n foreach ($this->model->appleSizes as $size) {\r\n $size = (int)$size;\r\n $rules['touch-icon' . $size . '\\.png$'] = 'index.php?sq_get=touchicon&sq_size=' . $size;\r\n }\r\n }\r\n\r\n if (SQ_Classes_Tools::getOption('sq_auto_feed') == 1) {\r\n $rules['sqfeedcss$'] = 'index.php?sq_get=feedcss';\r\n }\r\n }\r\n return array_merge($rules, $wp_rewrite);\r\n }", "function rewrite_rules_xmlsitemap_d4seo() {\n\t\tadd_rewrite_rule('sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$', 'index.php?xmlsitemap=1&xmlurl=$matches[2]', 'top');\n\t\tadd_rewrite_tag('%xmlurl%', '([^&]+)');\n\t}", "function my_insert_rewrite_rules( $rules ) {\n\t$newrules = array();\n\t$newrules['events/(viewevent)/(\\d*)$'] = 'index.php?pagename=$matches[1]&rid=$matches[2]';\n\treturn $newrules + $rules;\n}", "static public function flush_rewrite_rules() {\n\t\tglobal $wp_rewrite;\n\n\t\tif ( self::$_rewrote_post_type || self::$_rewrote_taxonomy ) {\n\t\t\t// Need to flush (soft) so our custom rules will work.\n\t\t\t$wp_rewrite->flush_rules( false );\n\t\t}\n\n\t\tself::$_rewrote_post_type = false;\n\t\tself::$_rewrote_taxonomy = false;\n\t}", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t\t\n\t\t// If we want to turn the rewrite engine on, add the statement\n\t\tif($this->includeTurnOnEngine){\n\t\t\t$this->appendTurnOnEngine();\n\t\t}\n\t\t\n\t\t// Are there actually URLs to rewrite?\n\t\tif(!empty($this->urls)){\n\t\t\t\n\t\t\t// Loop through the URLs\n\t\t\tforeach($this->urls as $source => $destination){\n\t\t\t\t\n\t\t\t\t// Check for query strings, as RewriteRule will ignore them\n\t\t\t\t$queryStringPos = strpos($source, '?');\n\t\t\t\t\n\t\t\t\t// URL has a query string\n\t\t\t\tif($queryStringPos !== FALSE){\n\t\t\t\t\t\n\t\t\t\t\t// Grab the query string\n\t\t\t\t\t$queryString = substr($source, $queryStringPos + 1);\n\t\t\t\t\t\n\t\t\t\t\t// If there wasn't just a lone ? in the URL\n\t\t\t\t\tif($queryString != ''){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add a RewriteCond for this query string\n\t\t\t\t\t\t$this->buildRewriteCondition('QUERY_STRING', $queryString);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// RewriteRule matches on the request URI without query strings, so remove the query string\n\t\t\t\t\t$source = substr($source, 0, $queryStringPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add a RewriteRule for this source / destination\n\t\t\t\t$this->buildRewriteRule($source, $destination);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we are adding the check for mod_rewrite.c add the closing tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckEnd();\n\t\t}\n\t\t\n\t\t// Return our rewrites\n\t\treturn $this->rewrites;\n\t}", "function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}", "function parseRouterFromHtaccess($route)\n{\n\t///////////////////////////////////////////////\n\t//START customize URL\n\t$parts = explode('/', $route);\n\t\n\t//not check URL Rewrite if specified controller group\n\tif($parts[0] == 'admin' || $parts[0] == 'site')\n\t\treturn $route;\n\t\n\t$controllergroup = '';\n\t$controller = '';\n\t$action = '';\n\t$routerArgString = '';\n\t\n\tfor($i = 0; $i < count($parts); $i++)\n\t{\n\t\t$partValue = $parts[$i]; \n\t\t\n\t\tif(preg_match('/([a-z]+)\\.php$/', $partValue, $match)) //normal controller, such as(login,logout,register,tos,...)\n\t\t{\n\t\t\tif($controller != '')\n\t\t\t{\n\t\t\t\t$action = $partValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controllergroup = 'site';\n\t\t\t\t$controller = $match[1];\n\t\t\t}\n\t\t}\n\t\telseif(preg_match('/page-(\\d+)/', $partValue, $match)) //this is a page group: page-1, page-2...\n\t\t{\n\t\t\t$_GET['page'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-(\\d+)$/', $partValue, $match))\t//photo detail url\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'detail';\n\t\t\t$_GET['photoid'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-c(\\d+)$/', $partValue, $match)) //category photos\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'index';\n\t\t\t$_GET['category'] = $match[1];\n\t\t}\n\t\telse if(strlen($partValue) > 0)\t// appending remain of route string parts\n\t\t{\n\t\t\t$routerArgString .= $partValue . '/';\n\t\t}\n\t}\n\t\n\t//assign default value for group,controller,action\n\tif($controllergroup == '') $controllergroup = 'site';\n\tif($controller == '') $controller = 'index';\n\tif($action == '') $action = 'index';\n\t\n\t//packing the route again after processing\n\t$route = '';\n\tif($controllergroup != '')\n\t\t$route .= $controllergroup . '/';\n\tif($controller != '')\n\t\t$route .= $controller . '/' ;\n\tif($action != '')\n\t\t$route .= $action . '/';\n\tif($routerArgString != '')\n\t\t$route .= $routerArgString;\n\t\t\n\t//die($route);\n\t\n\t//END customize URL\n\t/////////////////////////////////////////////////\n\t\n\treturn $route;\n}", "public function flush_rewrite_rules(){\n\t\t\tif ( get_option( '_wolf_discography_flush_rewrite_rules_flag' ) ) {\n\t\t\t\tflush_rewrite_rules();\n\t\t\t\tdelete_option( '_wolf_discography_flush_rewrite_rules_flag' );\n\t\t\t}\n\t\t}", "private function crawl_site() {\n\t\t/*\n\t\t * If 'Your homepage displays' is set to 'Your latest posts', validate the homepage.\n\t\t * It will not be part of the page validation below.\n\t\t */\n\t\tif ( 'posts' === get_option( 'show_on_front' ) && $this->is_template_supported( 'is_home' ) ) {\n\t\t\t$this->validate_and_store_url( home_url( '/' ), 'home' );\n\t\t}\n\n\t\t$amp_enabled_taxonomies = array_filter(\n\t\t\tget_taxonomies( [ 'public' => true ] ),\n\t\t\t[ $this, 'does_taxonomy_support_amp' ]\n\t\t);\n\t\t$public_post_types = get_post_types( [ 'public' => true ], 'names' );\n\n\t\t// Validate one URL of each template/content type, then another URL of each type on the next iteration.\n\t\tfor ( $i = 0; $i < $this->limit_type_validate_count; $i++ ) {\n\t\t\t// Validate all public, published posts.\n\t\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t\t$post_ids = $this->get_posts_that_support_amp( $this->get_posts_by_type( $post_type, $i, 1 ) );\n\t\t\t\tif ( ! empty( $post_ids[0] ) ) {\n\t\t\t\t\t$this->validate_and_store_url( get_permalink( $post_ids[0] ), $post_type );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ( $amp_enabled_taxonomies as $taxonomy ) {\n\t\t\t\t$taxonomy_links = $this->get_taxonomy_links( $taxonomy, $i, 1 );\n\t\t\t\t$link = reset( $taxonomy_links );\n\t\t\t\tif ( ! empty( $link ) ) {\n\t\t\t\t\t$this->validate_and_store_url( $link, $taxonomy );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$author_page_urls = $this->get_author_page_urls( $i, 1 );\n\t\t\tif ( ! empty( $author_page_urls[0] ) ) {\n\t\t\t\t$this->validate_and_store_url( $author_page_urls[0], 'author' );\n\t\t\t}\n\t\t}\n\n\t\t// Only validate 1 date and 1 search page.\n\t\t$url = $this->get_date_page();\n\t\tif ( $url ) {\n\t\t\t$this->validate_and_store_url( $url, 'date' );\n\t\t}\n\t\t$url = $this->get_search_page();\n\t\tif ( $url ) {\n\t\t\t$this->validate_and_store_url( $url, 'search' );\n\t\t}\n\t}", "function cmshowcase_flush_rules(){\n flush_rewrite_rules();\n }", "public function action_init_register_rewrites() {\n add_rewrite_endpoint( 'ics', EP_PERMALINK );\n }", "public function loadRewriteRules() : void {\n // get user rewrite rules, use regular and escaped versions of them\n $this->rewrite_rules =\n RewriteRules::generate(\n $this->site_url,\n $this->destination_url\n );\n\n if ( ! $this->rewrite_rules ) {\n $err = 'No URL rewrite rules defined';\n WsLog::l( $err );\n throw new WP2StaticException( $err );\n }\n }", "function jfb_add_rewrites($wp_rewrite)\r\r\n{\r\r\n $autologin = explode(get_bloginfo('url'), plugins_url(dirname(plugin_basename(__FILE__))));\r\r\n $autologin = trim($autologin[1] . \"/_autologin.php\", \"/\") . '?p=$1';\r\r\n $wp_rewrite->non_wp_rules = $wp_rewrite->non_wp_rules + array('autologin[/]?([0-9]*)$' => $autologin);\r\r\n}", "function json_feed_rewrite_rules( $rules ) {\n\tglobal $default_rewrite_rules, $wp_rewrite;\n\t\n\tif( empty( $rules ) ) {\n\t\tif( empty( $default_rewrite_rules ) ) {\n\t\t\tif ( true === defined( 'WPCOM_IS_VIP_ENV' ) && true === WPCOM_IS_VIP_ENV ) {\n\t\t\t\t$default_rewrite_rules = array();\n\t\t\t} else {\n\t\t\t\t$default_rewrite_rules = $wp_rewrite->rewrite_rules();\n\t\t\t}\n\t\t}\n\t\t$rules = $default_rewrite_rules;\n\t}\n\t\n\t$add_rules = array ( \n\t\t'feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?&feed=$matches[1]&jsonp=$matches[3]&date_format=$matches[5]&remove_uncategorized=$matches[7]',\n\t\t\t\n\t\t'(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?&feed=$matches[1]&jsonp=$matches[3]&date_format=$matches[5]&remove_uncategorized=$matches[7]',\n\t\t\n\t\t'comments/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?&feed=$matches[1]&withcomments=1&jsonp=$matches[3]&date_format=$matches[5]&remove_uncategorized=$matches[7]',\n\t\t\t\n\t\t'comments/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?&feed=$matches[1]&withcomments=1&jsonp=$matches[3]&date_format=$matches[5]&remove_uncategorized=$matches[7]',\n\t\t\n\t\t'search/(.+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?s=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'search/(.+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?s=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'category/(.+?)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?category_name=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'category/(.+?)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?category_name=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'tag/(.+?)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?tag=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'tag/(.+?)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?tag=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'author/([^/]+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?author_name=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'author/([^/]+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?author_name=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&jsonp=$matches[6]&date_format=$matches[8]&remove_uncategorized=$matches[10]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&jsonp=$matches[6]&date_format=$matches[8]&remove_uncategorized=$matches[10]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&jsonp=$matches[5]&date_format=$matches[7]&remove_uncategorized=$matches[9]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&jsonp=$matches[5]&date_format=$matches[7]&remove_uncategorized=$matches[9]',\n\t\t\n\t\t'([0-9]{4})/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'([0-9]{4})/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$'\n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[3]&date_format=$matches[5]&remove_uncategorized=$matches[7]',\n\t\t\n\t\t'[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]&jsonp=$matches[7]&date_format=$matches[9]&remove_uncategorized=$matches[11]',\n\t\t\n\t\t'([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]&jsonp=$matches[7]&date_format=$matches[9]&remove_uncategorized=$matches[11]',\n\t\t\n\t\t'[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'.+?/attachment/([^/]+)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'.+?/attachment/([^/]+)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?attachment=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'(.+?)/feed/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?pagename=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t\t\n\t\t'(.+?)/(json)(/jsonp/([^/]+))?(/date_format/([^/]+))?(/remove_uncategorized/([^/]+))?/?$' \n\t\t\t=> 'index.php?pagename=$matches[1]&feed=$matches[2]&jsonp=$matches[4]&date_format=$matches[6]&remove_uncategorized=$matches[8]',\n\t);\n\treturn array_merge( $add_rules, (array) $rules );\n}", "function jn_htmlInUrl_page_permalink() {\r\n\t\tglobal $wp_rewrite;\r\n\t\tif ( in_array( 'page', $this->selected_post_type ) ) {\r\n\t\t\tif ( ! strpos( $wp_rewrite->get_page_permastruct(), '.html' ) ) {\r\n\t\t\t\t$wp_rewrite->page_structure = $wp_rewrite->page_structure . '.html';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$wp_rewrite->flush_rules();\r\n\t}", "function purge_rewrite_rules_on_acf_save($post_id){\n\t$screen = get_current_screen();\n\n\t// only run this expensive operation when our custom options page is saved\n\tif (strpos($screen->id, \"ucf-people-directory-general-settings\") == true) {\n\n\n\n\t\t// need to re-register the class definition, so that the rewrite flush function knows what the new slug is.\n\t\t// otherwise, it would use the already-defined class with the old slug, since changing the setting doesn't\n\t\t// change the CPT definition until another page is loaded. IE it would require pressing save a second time.\n\t\tif ( class_exists( 'UCF_People_PostType' ) ) {\n\t\t\t\\UCF_People_PostType::register();\n\t\t}\n\t\t// Now that the in-memory version has the new arguments, we can flush the rules\n\t\tflush_rewrite_rules(false);\n\t}\n}", "function al3_flush_rewrite_rules_events() {\n\tflush_rewrite_rules();\n}", "function om13_rewrite_siteurls($url) {\n\tif (!(WP_DEBUG && function_exists('http_build_url'))) {\n\t\treturn $url;\n\t}\n\treturn http_build_url($url, array(\n\t\t'host' => $_SERVER['HTTP_HOST']\n\t));\n}", "function custom_parse_request_tricksy( $query ) {\n if ( ! $query->is_main_query() )return;\n\n // Only mod our very specific rewrite rule match\n if ( 2 != count( $query->query ) || ! isset( $query->query['page'] ) ) { return; }\n\n // 'name' will be set if post permalinks are just post_name, otherwise the page rule will match\n if ( ! empty( $query->query['name'] ) ) {\n $query->set( 'post_type', array( 'post', 'systemplate', 'page' ) );\n }\n}", "function got_mod_rewrite()\n {\n }", "public function add_tax_rewrite_rules() {\n\t\tif(get_option('no_taxonomy_structure')) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tglobal $wp_rewrite;\n\t\t$taxonomies = get_taxonomies(array( '_builtin' => false));\n\t\t$taxonomies['category'] = 'category';\n\n\t\tif(empty($taxonomies)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($taxonomies as $taxonomy) :\n\t\t\t$taxonomyObject = get_taxonomy($taxonomy);\n\t\t\t$post_types = $taxonomyObject->object_type;\n\n\t\t\tforeach ($post_types as $post_type):\n\t\t\t\t$post_type_obj = get_post_type_object($post_type);\n\t\t\t\t$slug = $post_type_obj->rewrite['slug'];\n\t\t\t\tif(!$slug) {\n\t\t\t\t\t$slug = $post_type;\n\t\t\t\t}\n\n\t\t\t\tif(is_string($post_type_obj->has_archive)) {\n\t\t\t\t\t$slug = $post_type_obj->has_archive;\n\t\t\t\t};\n\n\t\t\t\tif ( $taxonomy == 'category' ){\n\t\t\t\t\t$taxonomypat = ($cb = get_option('category_base')) ? $cb : $taxonomy;\n\t\t\t\t\t$tax = 'category_name';\n\t\t\t\t} else {\n\t\t\t\t\t// Edit by [Xiphe]\n\t\t\t\t\tif (isset($taxonomyObject->rewrite['slug'])) {\n\t\t\t\t\t\t$taxonomypat = $taxonomyObject->rewrite['slug'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$taxonomypat = $taxonomy;\n\t\t\t\t\t}\n\t\t\t\t\t// [Xiphe] stop\n\n\t\t\t\t\t$tax = $taxonomy;\n\t\t\t\t}\n\n\n\t\t\t\t//add taxonomy slug\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&paged=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/?$', 'index.php?'.$tax.'=$matches[1]', 'top' ); // modified by [steve] [*** bug fixing]\n\n\t\t\t\t// below rules were added by [steve]\n\t\t\t\tadd_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );\n\n\t\t\tendforeach;\n\t\tendforeach;\n\t}", "function my_pagination_rewrite() { \n add_rewrite_rule('vacancies/page/?([0-9]{1,})/?$', 'index.php?post_type=vacancy&paged=$matches[1]', 'top'); \n}", "function rewrite_post_parmalink($original) {\n $parts = parse_url($original);\n $oparts = explode('/', preg_replace('/\\/$/', '', $parts['path']));\n $slug = end($oparts);\n\n $prefix = preg_replace('/\\/$/', '', $_SERVER[\"REQUEST_URI\"]);\n return \"//{$parts['host']}{$prefix}/{$slug}\";\n}", "public function test_rest_url_generation() {\n\t\t// In pretty permalinks case, we expect a path of wp-json/ with no query.\n\t\t$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/wp-json/', get_rest_url() );\n\n\t\t// In index permalinks case, we expect a path of index.php/wp-json/ with no query.\n\t\t$this->set_permalink_structure( '/index.php/%year%/%monthnum%/%day%/%postname%/' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php/wp-json/', get_rest_url() );\n\n\t\t// In non-pretty case, we get a query string to invoke the rest router.\n\t\t$this->set_permalink_structure( '' );\n\t\t$this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php?rest_route=/', get_rest_url() );\n\t}" ]
[ "0.6929106", "0.66224253", "0.641614", "0.6340045", "0.630275", "0.6301879", "0.6229302", "0.6188833", "0.6147688", "0.60948646", "0.604962", "0.60313743", "0.5979689", "0.5961714", "0.59573483", "0.5937727", "0.5916227", "0.5892422", "0.5856888", "0.5836028", "0.57976526", "0.5795786", "0.5792986", "0.57924503", "0.57802993", "0.5743961", "0.5734509", "0.5698807", "0.5650251", "0.56259876", "0.56189555", "0.5607859", "0.5588916", "0.5584394", "0.5564863", "0.554505", "0.5542855", "0.5531523", "0.552641", "0.5514772", "0.55074656", "0.54754096", "0.5472008", "0.54699063", "0.54435205", "0.5442249", "0.5437689", "0.5426262", "0.54222906", "0.5419639", "0.5413232", "0.54126656", "0.54092044", "0.54088044", "0.53719705", "0.5371781", "0.53674585", "0.53630817", "0.53610015", "0.53531605", "0.53396606", "0.53303325", "0.53257984", "0.53063464", "0.53044224", "0.5297721", "0.5296658", "0.5290307", "0.5274566", "0.52678746", "0.5266053", "0.5248741", "0.52457225", "0.5241657", "0.5241657", "0.52226526", "0.5217223", "0.520885", "0.5188221", "0.5187368", "0.51780677", "0.5171621", "0.51557785", "0.5155646", "0.5143265", "0.5140972", "0.5140044", "0.51364547", "0.5131416", "0.51288676", "0.5123829", "0.51196265", "0.511638", "0.511618", "0.5104565", "0.50976264", "0.5081381", "0.50738764", "0.5071958", "0.5066959" ]
0.6268083
6
Applies the currentmenuitem class to any menu item with the title "Meeting Minutes" in a WordPress menu if the current page is a meeting minutes archive.
function add_minutes_current_menu_item_class( $classes = array(), $menu_item = false ) { if ( 'board_minutes' == Extras\get_post_type_outside_loop() && 'Meeting Minutes' == $menu_item->title && ! in_array( 'current-menu-item', $classes ) ) $classes[] = 'current-menu-item'; return $classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_nav_menu_classes($classes, $item){\n if( is_post_type_archive('program') && ($item->title == \"Programs\") ){\n $classes[] = 'current-menu-item';\n }\n\n return $classes;\n }", "function set_current_menu_class($classes) {\n\tglobal $post;\n\t\n\t/*\n\tif( _s_is_page_template_name( 'find-an-agent' ) || is_post_type_archive( 'agent' ) || is_singular( 'agent' ) ) {\n\t\t\n\t\t$classes = array_filter($classes, \"remove_parent_classes\");\n\t\t\n\t\tif ( in_array('menu-item-206', $classes ) )\n\t\t\t$classes[] = 'current-menu-item';\n\t}\n\t*/\n\t\t\t\n\treturn $classes;\n}", "function be_menu_item_classes( $classes, $item, $args ) {\n global $post;\nif( in_array('photo-item',$classes) && is_page() && $post->post_parent ) {\n $classes[] = 'current-menu-item';\n }\n\n return $classes;\n\n}", "function add_current_nav_class($classes, $item) {\n\tglobal $post;\n\t// Getting the post type of the current post\n\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t$current_post_type_slug = $current_post_type->rewrite['slug'];\n\t// Getting the URL of the menu item\n\t$menu_slug = strtolower(trim($item->url));\n\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t$classes[] = 'current-menu-item';\n\t}\n\t// Return the corrected set of classes to be added to the menu item\n\treturn $classes;\n}", "function add_nav_class( $classes, $item ) {\n if ( is_page('past-events') AND $item->post_title === 'Events') {\n // Notice you can change the conditional from is_single() and $item->title\n $classes[] = \"current-menu-item\";\n }\n return $classes;\n}", "function add_current_nav_class($classes, $item) {\n\t\tglobal $post;\n\t\t\n\t\t// Getting the post type of the current post\n\t\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t\t$current_post_type_slug = $current_post_type->rewrite['slug'];\n\t\t\t\n\t\t// Getting the URL of the menu item\n\t\t$menu_slug = strtolower(trim($item->url));\n\t\t\n\t\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\t\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t\n\t\t $classes[] = 'current-menu-item';\n\t\t\n\t\t}\n\t\t\n\t\t// Return the corrected set of classes to be added to the menu item\n\t\treturn $classes;\n\t\n\t}", "function add_current_nav_class($classes, $item) {\n\t\tglobal $post;\n\t\t\n\t\t// Getting the post type of the current post\n\t\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t\t$current_post_type_slug = $current_post_type->rewrite[slug];\n\t\t\t\n\t\t// Getting the URL of the menu item\n\t\t$menu_slug = strtolower(trim($item->url));\n\t\t\n\t\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\t\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t\n\t\t $classes[] = 'current-menu-item';\n\t\t\n\t\t}\n\t\t\n\t\t// Return the corrected set of classes to be added to the menu item\n\t\treturn $classes;\n\t\n\t}", "function mro_menu_top_item_classes( $classes, $item, $args ) {\n\n\tif( 'primary' !== $args->theme_location )\n\t\treturn $classes;\n\n\tif( is_front_page() && ( 'Clases de Yoga' == $item->title || 'Clases de yoga' == $item->title || 'Clases' == $item->title ) )\n\t\t$classes[] = 'active';\n\n\tif( is_singular( 'mro-team' ) && ( 'Clases de Yoga' == $item->title || 'Clases de yoga' == $item->title || 'Clases' == $item->title ) )\n\t\t$classes[] = 'current-menu-item active';\n\n\tif( is_singular( 'mro-event' ) && 'Actividades' == $item->title )\n\t\t$classes[] = 'current-menu-item active';\n\n\tif( is_page_template( 'page-templates/template-thai.php' ) && 'Masaje tai' == $item->title )\n\t\t$classes[] = 'current-menu-item active';\n\n\t// if( ( is_singular( 'code' ) || is_tax( 'code-tag' ) ) && 'Talleres' == $item->title )\n\t\t// $classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Entrenamiento' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Masaje Tai' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Yoga' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Nosotros' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\tif( mandir_is_tree(18) && 'Tienda' == $item->title )\n\t\t$classes[] = 'current-menu-item';\n\n\t// if( is_singular( 'projects' ) && 'Contáctenos' == $item->title )\n\t// \t$classes[] = 'current-menu-item';\n\n\treturn array_unique( $classes );\n}", "function cmdeals_nav_menu_item_classes( $menu_items, $args ) {\n\t\n\tif (!is_cmdeals()) return $menu_items;\n\t\n\t$store_page \t\t= (int) get_option('cmdeals_store_page_id');\n\t$page_for_posts = (int) get_option( 'page_for_posts' );\n\n\tforeach ( (array) $menu_items as $key => $menu_item ) :\n\n\t\t$classes = (array) $menu_item->classes;\n\n\t\t// Unset active class for blog page\n\t\tif ( $page_for_posts == $menu_item->object_id ) :\n\t\t\t$menu_items[$key]->current = false;\n\t\t\tunset( $classes[ array_search('current_page_parent', $classes) ] );\n\t\t\tunset( $classes[ array_search('current-menu-item', $classes) ] );\n\n\t\t// Set active state if this is the store page link\n\t\telseif ( is_store() && $store_page == $menu_item->object_id ) :\n\t\t\t$menu_items[$key]->current = true;\n\t\t\t$classes[] = 'current-menu-item';\n\t\t\t$classes[] = 'current_page_item';\n\t\t\n\t\tendif;\n\n\t\t$menu_items[$key]->classes = array_unique( $classes );\n\t\n\tendforeach;\n\n\treturn $menu_items;\n}", "function foundation_active_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "function special_nav_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "function trucking_filter_active_class_menu( $classes){\n if(in_array('current-menu-item', $classes)) {\n $classes[] = 'active';\n }\n return $classes;\n}", "function greenfields_add_active_class($classes, $item)\n{\n if (in_array('current-menu-item', $classes)) {\n $classes[] = \"active\";\n }\n\n return $classes;\n}", "function audiotheme_nav_menu_classes( $items, $args ) {\n\tglobal $wp;\n\n\t$classes = array();\n\t$first_top = -1;\n\n\t$current_url = trailingslashit( home_url( add_query_arg( array(), $wp->request ) ) );\n\t$blog_page_id = get_option( 'page_for_posts' );\n\t$is_blog_post = is_singular( 'post' );\n\n\t$is_audiotheme_post_type = is_singular( array( 'audiotheme_gig', 'audiotheme_record', 'audiotheme_track', 'audiotheme_video' ) );\n\t$post_type_archive_id = get_audiotheme_post_type_archive( get_post_type() );\n\t$post_type_archive_link = get_post_type_archive_link( get_post_type() );\n\n\tforeach ( $items as $key => $item ) {\n\t\tif ( 0 == $item->menu_item_parent ) {\n\t\t\t$first_top = ( -1 == $first_top ) ? $key : $first_top;\n\t\t\t$last_top = $key;\n\t\t} else {\n\t\t\tif ( ! isset( $classes['first-child-items'][ $item->menu_item_parent ] ) ) {\n\t\t\t\t$classes['first-child-items'][ $item->menu_item_parent ] = $key;\n\t\t\t\t$items[ $key ]->classes[] = 'first-child-item';\n\t\t\t}\n\t\t\t$classes['last-child-items'][ $item->menu_item_parent ] = $key;\n\t\t}\n\n\t\tif ( ! is_404() && ! is_search() ) {\n\t\t\tif (\n\t\t\t\t'audiotheme_archive' == $item->object &&\n\t\t\t\t$post_type_archive_id == $item->object_id &&\n\t\t\t\ttrailingslashit( $item->url ) == $current_url\n\t\t\t) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-item';\n\t\t\t}\n\n\t\t\tif ( $is_blog_post && $blog_page_id == $item->object_id ) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-parent';\n\t\t\t}\n\n\t\t\t// Add 'current-menu-parent' class to CPT archive links when viewing a singular template.\n\t\t\tif ( $is_audiotheme_post_type && $post_type_archive_link == $item->url ) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-parent';\n\t\t\t}\n\t\t}\n\t}\n\n\t$items[ $first_top ]->classes[] = 'first-item';\n\t$items[ $last_top ]->classes[] = 'last-item';\n\n\tif ( isset( $classes['last-child-items'] ) ) {\n\t\tforeach ( $classes['last-child-items'] as $item_id ) {\n\t\t\t$items[ $item_id ]->classes[] = 'last-child-item';\n\t\t}\n\t}\n\n\treturn $items;\n}", "function atg_menu_classes($classes, $item, $args) {\n if($args->theme_location == 'header') {\n $classes[] = 'nav-item';\n }\n return $classes;\n}", "function rwbs_add_active_class_to_nav_menu($classes) {\n if (in_array('current-menu-item', $classes, true) || in_array('current_page_item', $classes, true)) {\n $classes = array_diff($classes, array('current-menu-item', 'current_page_item', 'active'));\n $classes[] = 'active';\n }\n return $classes;\n}", "public static function menu_current_class( $classes, $item ) {\n\n\t\t\t$url = trailingslashit( $item->url );\n\t\t\t$base = basename( $url );\n\n\t\t\t// Default.\n\t\t\t$classes[] = 'cz';\n\n\t\t\t// Fix anchor links\n\t\t\tif ( self::contains( $url, '/#' ) ) {\n\t\t\t\treturn $classes;\n\t\t\t}\n\n\t\t\t// Find parent menu\n\t\t\t$in_array = in_array( 'current_page_parent', $classes );\n\n\t\t\t// Current menu\n\t\t\tif ( in_array( 'current-menu-ancestor', $classes ) || in_array( 'current-menu-item', $classes ) || ( $in_array && get_post_type() === 'post' ) ) {\n\t\t\t\t$classes[] = 'current_menu';\n\t\t\t}\n\n\t\t\t// Current menu parent.\n\t\t\tif ( have_posts() ) { \n\n\t\t\t\t$c = get_post_type_object( get_post_type( self::$post->ID ) );\n\n\t\t\t\tif ( ! empty( $c ) ) {\n\n\t\t\t\t\t// Check custom link of post or page in menu.\n\t\t\t\t\t$con1 = ( is_singular() && $url === trailingslashit( get_the_permalink( self::$post->ID ) ) );\n\n\t\t\t\t\t// Check post type slug changes.\n\t\t\t\t\t$con2 = ( isset( $c->rewrite['slug'] ) && self::contains( $base, $c->rewrite['slug'] ) && $in_array );\n\n\t\t\t\t\t// Check with post type name.\n\t\t\t\t\t$con3 = ( $base === strtolower( urlencode( html_entity_decode( $c->name ) ) ) );\n\n\t\t\t\t\t// Fix multisite same name as post type name conflict.\n\t\t\t\t\tif ( $con3 && trailingslashit( get_site_url() ) === $url ) {\n\t\t\t\t\t\t$con3 = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check with post type label.\n\t\t\t\t\t$con4 = ( $base === strtolower( urlencode( html_entity_decode( $c->label ) ) ) );\n\t\t\t\t\t\n\t\t\t\t\t// Check if CPT name is different in menu URL and fix also for non-english lang.\n\t\t\t\t\t$con5 = ( $base === strtolower( urlencode( html_entity_decode( $c->has_archive ) ) ) );\n\n\t\t\t\t\tif ( $con1 || $con2 || $con3 || $con4 || $con5 ) {\n\t\t\t\t\t\t$classes[] = 'current_menu';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Fix: single post with category in menu.\n\t\t\tif ( in_array( 'menu-item-object-category', $classes ) && is_single() ) {\n\n\t\t\t\t$key = array_search( 'current-menu-parent', $classes );\n\n\t\t\t\tif ( isset( $classes[ $key ] ) ) {\n\t\t\t\t\tunset( $classes[ $key ] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/*\n\t\t\t// Fix: Non-english languages.\n\t\t\tif ( is_post_type_archive( 'product' ) || is_singular( 'product' ) ) {\n\n\t\t\t\t$classes_json = json_encode( $classes );\n\n\t\t\t\tif ( ! self::contains( $classes_json, 'current-' ) && ! self::contains( $classes_json, 'current_menu_' ) ) {\n\n\t\t\t\t\t$key = array_search( 'current_menu', $classes );\n\n\t\t\t\t\tif ( isset( $classes[ $key ] ) ) {\n\t\t\t\t\t\tunset( $classes[ $key ] );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t*/\n\n\t\t\treturn $classes;\n\t\t}", "function launchpad_modify_nav_class($classes, $item) {\n\t$slug = sanitize_title($item->title);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\t\n\t$classes[] = 'menu-' . $slug;\n\t\n\t$link_url = preg_replace('|^https?://' . $_SERVER['HTTP_HOST'] . '/|', '/', $item->url);\n\t$current_url = $_SERVER['REQUEST_URI'];\n\t\n\tif($link_url != '/' && $current_url !== $link_url && stristr($current_url, $link_url) !== false) {\n\t\t$classes[] = 'current-hierarchy-ancestor';\n\t} else if($current_url === $link_url) {\n\t\t$classes[] = 'current-hierarchy-page';\t\t\n\t}\n\t\n\t$classes = array_unique($classes);\n\t\n\t// Apply filters to allow the developer to change it.\n\t$classes = apply_filters('launchpad_nav_class', $classes);\n\t\n\treturn array_filter(\n\t\t$classes, \n\t\tfunction($el) {\n\t\t\t$el = trim($el);\n\t\t\treturn empty($el) ? false : true;\n\t\t}\n\t);\n}", "function uk_active_nav_class( $class, $item ) {\n if (in_array( 'current-menu-item', $class )) {\n $class[] = 'uk-active';\n }\n return $class;\n}", "function je_portfolio_menu_item_classes( $classes, $item )\n{\n switch ( get_query_var('post_type') ) {\n // Only run on portfolio post type\n case 'portfolio_item':\n // Remove current_page_parent from Blog menu item\n if( $item->title == 'Blog' ) {\n $classes = array_diff( $classes, array( 'current_page_parent' ) );\n }\n // Add current_page_parent class to the portfolio menu item\n if ( $item->title == 'Books' ) {\n $classes[] = 'current_page_parent';\n }\n break;\n }\n \n return $classes;\n}", "function ntp_blogpost_nav_class($classes, $item) {\n if ( is_single() && get_post_type() !== 'ntp_project' && $item->title == \"Blog\" ) {\n $classes[] = 'current_page_item';\n }\n return $classes;\n}", "function ua_webtide_filter_jobs_nav_menu( $item_output, $item, $depth, $args ) {\n\tif ( ! ( isset( $args ) && isset( $args->theme_location ) && 'main-menu' == $args->theme_location ) ) {\n\t\treturn $item_output;\n\t}\n\t\t\n\t// Only if it has the \"add-jobs-count\" class\n\tif ( ! ( isset( $item ) && isset( $item->classes ) && in_array( 'add-jobs-count', $item->classes ) ) ) {\n\t\treturn $item_output;\n\t}\n\t\t\n\t// Get/add the jobs count\n\tif ( $published_jobs_count = function_exists( 'get_ua_webtide_jobs_count' ) ? get_ua_webtide_jobs_count() : 0 ) {\n\t\t\n\t\t// Add the count before the link\n\t\t$item_output = '<span class=\"has-jobs-notification\"><span class=\"job-notification\">' . $published_jobs_count . '</span>' . $item_output . '</span>';\n\t\t\n\t}\n\n\treturn $item_output;\n\t\n}", "function active_nav_class($classes, $item){\n\tif (in_array('current-menu-item', $classes)) {\n\t\t$classes[] = 'active';\n\t}\n\treturn $classes;\n}", "public function custom_wp_nav_menu( $css_class, $item ) {\n\n\t\t//Init vars\n\t\tglobal $post;\n\n\t\t//Remove 'current_page_parent' from blog menu item when not a blog page\n\t\tif( get_post_type() !== 'post' ) {\n\n\t\t\tif( $item->object_id == get_option('page_for_posts') ) {\n\t\t\t\tforeach ($css_class as $k=>$v) {\n\t\t\t\t\tif ($v=='current_page_parent') unset($css_class[$k]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t//Add custom post type slug as css class to all menu items for custom posts\n\t\tif( (get_post_type($item->object_id) !== 'post') && (get_post_type($item->object_id) !== 'page') ) {\n\n\t\t\t$css_class[] = str_replace('_', '-', get_post_type($item->object_id));\n\n\t\t}\n\n\t\t//Add object id class\n\t\t$css_class[] = 'active-for-post-' . $item->object_id;\n\n\t\t//Is active page?\n\t\tif( isset($post->ID, $item->object_id) && ($post->ID == $item->object_id) ) {\n\t\t\t$css_class[] = 'active';\n\t\t}\n\n\t\treturn $css_class;\n\t}", "function add_menu_classes($menu)\n {\n }", "function _wp_menu_item_classes_by_context(&$menu_items)\n {\n }", "function nav_menu_css_class($classes, $item) {\n\t$slug = sanitize_title($item->title);\n\t$post_type = get_query_var('post_type');\n\t$blog_id = get_option('page_for_posts');\n\t$is_404 = is_404();\n\n\t$classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'is-active', $classes);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\t$classes[] = 'nav__item';\n\t$classes[] = 'nav__item--' . $slug;\n\t$classes = array_unique($classes);\n\n\t// Add active class if item has \"cases-cpt\" class\n\tif ( $post_type === 'cases') {\n\t\tif ( in_array('cases-cpt', $classes) ) {\n\t\t\t$classes[] = 'is-active';\n\t\t}\n\t}\n\n\t// Add active class if item has \"job-cpt\" class\n\tif ( $post_type === 'job') {\n\t\tif ( in_array('job-cpt', $classes) ) {\n\t\t\t$classes[] = 'is-active';\n\t\t}\n\t}\n\n\t// If \"blog\" has active class, and current page is either tax or cpt, remove active class\n\tif ( $item->object_id === $blog_id && in_array('is-active', $classes)) {\n\t\tif ( $post_type === 'cases' || $post_type === 'job' || $is_404 ) {\n\t\t\t$key = array_search('is-active', $classes); \n\t\t\tif ($key !== false) unset($classes[$key]);\n\t\t}\n\t}\n\n\treturn array_filter($classes, 'is_element_empty');\n}", "function custom_nav_menu_css_class( $classes, $item, $args ) {\n\tif ( $args->theme_location == 'main_menu' ) {\n\n//add common class to main menu item\n\t\tif ( $item->menu_item_parent == 0 ) {\n\t\t\tarray_push( $classes, 'header__item' );\n\t\t} else {\n\n//add common class to sub menu item\n\t\t\tarray_push( $classes,'header__submenu-item' );\n\t\t}\n\n\n//add class to item if has sub menu\n\t\tif (in_array('menu-item-has-children', $classes)){\n\t\t\tarray_push( $classes, 'header__submenu-list' );\n\t\t} \n\t}\n\treturn $classes;\n}", "public static function nav_menu_css_class( $classes, $item, $args = array() ) {\n\t\tif(strpos($item->url, '#') !== false && ($key = array_search('current-menu-item', $classes)) !== false) {\n\t\t\tunset($classes[$key]);\n\t\t\t$classes[] = 'maybe-current-menu-item';\n\t\t}\n\n\t\treturn $classes;\n\t}", "function add_parent_url_menu_class( $classes = array(), $item = false ) {\n // Get current URL\n $current_url = current_url();\n\n // Get homepage URL\n $homepage_url = trailingslashit( get_bloginfo( 'url' ) );\n\n // Exclude 404 and homepage\n if( is_404() or $item->url == $homepage_url )\n return $classes;\n\n if ( get_post_type() == \"projets\" )\n {\n unset($classes[array_search('current_page_parent',$classes)]);\n if ( isset($item->url) )\n if ( strstr( $current_url, $item->url) )\n $classes[] = 'current-menu-item';\n }\n\n return $classes;\n}", "function simple_bootstrap_add_active_class($classes, $item) {\n if( in_array('current-menu-item', $classes) ) {\n $classes[] = \"active\";\n }\n \n return $classes;\n}", "function add_specific_menu_location_atts( $atts, $item, $args ) {\n // check if the item is in the primary menu\n if( $args->theme_location == 'top_navigation' ) {\n // add the desired attributes:\n $atts['class'] = 'btn btn-primary';\n }\n return $atts;\n}", "function active_menu()\n{\n $CI =& get_instance();\n\n $class = '';\n if($CI->router->fetch_class() == 'blog') {\n $class = 'class=\"navbar-item-active\"';\n }\n return $class;\n}", "function menu_item_classes( $classes, $item, $args, $depth ) {\n $classes[] = 'nav-item';\n return $classes;\n}", "function revo_nav_menu_css_class( $classes, $item ) {\n\t$slug = sanitize_title($item->title);\n\t$classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\n\t$classes[] = 'menu-' . $slug;\n\n\t$classes = array_unique($classes);\n\n\treturn array_filter($classes, 'revo_element_empty');\n}", "function roots_cpt_active_menu($menu) {\n if ('base_service' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-services', 'menu-services active', $menu);\n }\n if ('base_portfolio' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-portfolio', 'menu-portfolio active', $menu);\n }\n return $menu;\n}", "public function activateMenuClassFix()\n {\n add_filter('nav_menu_css_class', array($this, 'fixMenuClasses'), 10, 2);\n }", "function nav_menu_css_class( $classes, $item ) {\n\n\t$_classes = [ 'menu__item' ];\n\n\tforeach ( [ 'item', 'parent', 'ancestor' ] as $type ) {\n\n\t\tif ( in_array( \"current-menu-{$type}\", $classes ) || in_array( \"current_page_{$type}\", $classes ) ) {\n\n\t\t\t$_classes[] = 'item' === $type ? 'menu__item--current' : \"menu__item--{$type}\";\n\t\t}\n\t}\n\n\t// If the menu item is a post type archive and we're viewing a single\n\t// post of that post type, the menu item should be an ancestor.\n\tif ( 'post_type_archive' === $item->type && is_singular( $item->object ) && ! in_array( 'menu__item--ancestor', $_classes ) ) {\n\t\t$_classes[] = 'menu__item--ancestor';\n\t}\n\n\t// Add a class if the menu item has children.\n\tif ( in_array( 'menu-item-has-children', $classes ) ) {\n\t\t$_classes[] = 'has-children';\n\t}\n\n\t// Add custom user-added classes if we have any.\n\t$custom = get_post_meta( $item->ID, '_menu_item_classes', true );\n\n\tif ( $custom ) {\n\t\t$_classes = array_merge( $_classes, (array) $custom );\n\t}\n\n\treturn $_classes;\n}", "function nav_menu_add_classes($items, $args) {\n //Add first item class\n $items[1]->classes[] = 'first';\n\n //Add last item class\n $i = count($items);\n while($items[$i]->menu_item_parent != 0 && $i > 0) {\n $i--;\n }\n $items[$i]->classes[] = 'last';\n\n return $items;\n}", "function nav_accordion_item_class( $classes, $item, $args ) {\n\tif ( 'nav-primary' === $args->theme_location ) {\n\t\t$classes[] = 'NavAccordion_Item';\n\t\tif ( array_intersect( $classes, [ 'current-menu-item' ] ) ) {\n\t\t\t$classes[] = 'NavAccordion_Item-Active';\n\t\t}\n\t}\n\treturn $classes;\n}", "function remove_menu_class_filter($var) {\n\treturn is_array($var) ? array_intersect($var, array('current-menu-item','current-post-ancestor','current-menu-ancestor','current-menu-parent')) : '';\n}", "function wpbp_bookmark_add_menu($items, $args)\n{\n if (!is_user_logged_in()) return $items;\n\n if( $args->theme_location == 'primary' ) {\n return $items . '\n <li id=\"wpbp_bookmark_item\" class=\"menu-item menu-item-type-custom menu-item-object-custom wpbp_bookmark_menu\">\n <a href=\"/page-bookmarks/\"><i>★</i>Bookmarks</a>\n </li>\n ';\n }\n return $items;\n}", "function menu_class_to_body($classes)\n{\n $id_menu = 49;\n if (ICL_LANGUAGE_CODE == \"fr\") {\n $id_menu = 142;\n } elseif (ICL_LANGUAGE_CODE == \"en\") {\n $id_menu = 144;\n } elseif (ICL_LANGUAGE_CODE == \"zh-hans\") {\n $id_menu = 69;\n }\n $items = wp_get_nav_menu_items($id_menu); //change to suit your menu id\n\n foreach ($items as $item):\n $menuClasses = $item->classes;\n $objectId = $item->object_id . ' ';\n\n //if ( is_page($item->object_id) ):\n if (is_page($item->object_id) || is_archive($item->object_id) || is_category($item->object_id)):\n $current[] = $menuClasses;\n endif;\n\n endforeach;\n\n $classes[] = $current[0][0];\n\n return $classes;\n}", "function getMainMenu() {\r\n $links = array();\r\n\r\n //Get nav menu id by name\r\n $menu_name = 'primary';\r\n $locations = get_nav_menu_locations();\r\n $menu_id = (isset($locations[$menu_name])) ? $locations[$menu_name] : 0;\r\n\r\n //Get nav menu items\r\n $items = wp_get_nav_menu_items( $menu_id, array(\r\n 'order' => 'ASC',\r\n 'orderby' => 'menu_order',\r\n 'post_type' => 'nav_menu_item',\r\n 'post_status' => 'publish',\r\n 'output' => ARRAY_A,\r\n 'output_key' => 'menu_order',\r\n 'nopaging' => true,\r\n 'update_post_term_cache' => false )\r\n );\r\n\r\n if(!empty($items)) {\r\n foreach($items as $item) {\r\n //active class for pages, categories\r\n $active = false;\r\n\r\n if( ($item->object == 'page') && (is_page($item->object_id)) ) {\r\n $active = 'active';\r\n } \r\n \r\n $links[$item->ID] = array(\r\n 'title' => $item->title,\r\n 'href' => $item->url,\r\n 'class' => $active\r\n );\r\n }\r\n }\r\n\r\n return $links;\r\n}", "function add_menuclass($ulclass) {\nreturn preg_replace('/<ul>/', '<ul class=\"nav main\">', $ulclass, 1);\n}", "function wpdocs_special_nav_class( $classes, $item ) {\n if ( 'Movilizarte en Yarumal' == $item->title ) {\n // Notice you can change the conditional from is_single() and $item->title\n $classes[] = \"special-class\";\n }\n return $classes;\n}", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "function add_menuclass($ulclass) {\r\nreturn preg_replace('/<ul>/', '<ul class=\"menu\">', $ulclass, 1);\r\n}", "public function current_to_active( $nav_menu, $args ){\n\t\t$replace = array(\n\t\t\t//List of menu item classes that should be changed to \"active\"\n\t\t\t'current_page_item' \t=> 'active',\n\t\t\t'current_page_parent' \t=> 'active',\n\t\t\t'current_page_ancestor' => 'active',\n\t\t\t'current-menu-item' \t=> 'active',\n\t\t\t'current-menu-parent' \t=> 'active',\n\t\t\t'current-menu-ancestor' => 'active',\n\t\t);\n\t\t$nav_menu = str_replace(array_keys($replace), $replace, $nav_menu);\n\n\t\treturn $nav_menu;\n\t}", "function fielding_filter_nav_menu( $sorted_menu_items, $args ) {\n\tglobal $fielding_page_host, $fielding_page_path;\n\n\t$current_theme = wp_get_theme();\n\t$front_page = get_option( 'page_on_front' );\n\t$posts_page = get_option( 'page_for_posts' );\n\t$locations = get_nav_menu_locations();\n\t$menu_id = $locations[ $args->theme_location ];\n\n\tif ( 'main_nav' == $args->theme_location ) {\n\t\t// Subnav\n\t\t$current_count = 0;\n\t\t$current_id = 0;\n\t\t$parent_id = 0;\n\t\t$grandparent_id = 0;\n\t\t$has_children = false;\n\t\t$current_object_id = 0;\n\n\t\t// Count current instances\n\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\tif ( $item->current ) {\n\t\t\t\t$current_count++;\n\t\t\t\t$current_object_id = $item->object_id;\n\t\t\t\t$current_id = $item->ID;\n\t\t\t\t$parent_id = $item->menu_item_parent;\n\t\t\t\t$has_children = in_array( 'menu-item-has-children', $item->classes );\n\t\t\t}\n\t\t}\n\n\t\t$ancestor_ids = get_post_ancestors( $current_object_id );\n\t\t$parent_object_id = isset( $ancestor_ids[0] ) ? $ancestor_ids[0] : 0;\n\n\t\t// Set current\n\t\tif ( $current_count > 1 ) {\n\t\t\t// Get tree parent\n\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\tif ( $item->object_id == $parent_object_id ) {\n\t\t\t\t\t$parent_id = $item->ID;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get tree current\n\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\tif ( $item->current && $item->menu_item_parent == $parent_id ) {\n\t\t\t\t\t$current_id = $item->ID;\n\t\t\t\t\t$has_children = in_array( 'menu-item-has-children', $item->classes );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// single\n\t\t}\n\n\t\t// Set parent\n\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\tif ( $item->ID == $parent_id ) {\n\t\t\t\t$grandparent_id = $item->menu_item_parent;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Catch single posts\n\t\tif ( is_single() || is_category() ) {\n\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\tif ( $item->object_id === $posts_page) {\n\t\t\t\t\t$current_count++;\n\t\t\t\t\t$current_object_id = $item->object_id;\n\t\t\t\t\t$current_id = $item->ID;\n\t\t\t\t\t$parent_id = $item->menu_item_parent;\n\t\t\t\t\t$has_children = in_array( 'menu-item-has-children', $item->classes );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Catch outliers\n\t\tif ( 0 == $current_id ) {\n\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\tif ( $item->menu_item_parent == 0 ) {\n\t\t\t\t\t$parent_id = $item->ID;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $args->display ) ) {\n\t\t\tif ( 'subnavigation' == $args->display ) {\n\n\t\t\t\t// Filter sidebar\n\t\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\t\tif ( $item->menu_item_parent == 0 ) {\n\t\t\t\t\t\tunset( $sorted_menu_items[ $key ] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $item->current && $item->ID == $current_id ) {\n\t\t\t\t\t\t\t// show\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ( $has_children && $item->menu_item_parent == $current_id ) {\n\t\t\t\t\t\t\t\t// show current pages children\n\t\t\t\t\t\t\t// } else if ( ( $has_children && $item->ID == $parent_id) || ( ! $has_children && $item->ID == $grandparent_id) ) {\n\t\t\t\t\t\t\t\t// show\n\t\t\t\t\t\t\t} else if ( $item->menu_item_parent == $parent_id || ( ! $has_children && $item->menu_item_parent == $grandparent_id ) ) {\n\t\t\t\t\t\t\t\t// show\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// remove\n\t\t\t\t\t\t\t\tunset( $sorted_menu_items[ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( 'breadcrumb' == $args->display ) {\n\t\t\t\t// Filter breadcrumb\n\t\t\t\t$nav_ancestor_ids = fielding_get_nav_ancestors( $sorted_menu_items, $current_id );\n\t\t\t\tforeach ( $sorted_menu_items as $key => $item ) {\n\t\t\t\t\t// Should be tree current, or a tree ancestor\n\t\t\t\t\tif ( ( $item->current && $item->ID == $current_id) || ( $item->current_item_ancestor && in_array( $item->ID , $nav_ancestor_ids ) ) ) {\n\t\t\t\t\t\t// show\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// remove\n\t\t\t\t\t\tunset( $sorted_menu_items[ $key ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add items\n\n\t\t\t\t// Check for top level\n\t\t\t\t$has_front = false;\n\t\t\t\t$front_id = 0;\n\n\t\t\t\tforeach ( $sorted_menu_items as $item ) {\n\t\t\t\t\tif ( $item->object == 'page' && $item->object_id == $front_page ) {\n\t\t\t\t\t\t$has_front = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// News / Calendar hacks...\n\t\t\t\tglobal $fielding_news_active;\n\t\t\t\tglobal $fielding_news_page;\n\t\t\t\tglobal $fielding_calendar_active;\n\t\t\t\tglobal $fielding_calendar_page;\n\n\t\t\t\tif ( $fielding_calendar_active ) {\n\t\t\t\t\t$sorted_menu_items = array();\n\n\t\t\t\t\tif ( $fielding_calendar_page ) {\n\t\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t\t'title' => $fielding_calendar_page,\n\t\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t\t) );\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'Event Archives',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => fielding_page_link( 'calendar_archives', false ),\n\t\t\t\t\t) );\n\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'Calendar',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => fielding_page_link( 'calendar', false ),\n\t\t\t\t\t) );\n\n\t\t\t\t} else if ( $fielding_news_active ) {\n\t\t\t\t\t$sorted_menu_items = array();\n\n\t\t\t\t\tif ( $fielding_news_page ) {\n\t\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t\t'title' => $fielding_news_page,\n\t\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t\t) );\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'News Archives',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => fielding_page_link( 'news_archives', false ),\n\t\t\t\t\t) );\n\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'News & Media',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => fielding_page_link( 'news_media', false ),\n\t\t\t\t\t) );\n\n\t\t\t\t} else if ( is_404() ) {\n\t\t\t\t\t// 404\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => '404',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t) );\n\t\t\t\t} else if ( is_search() ) {\n\t\t\t\t\t// Search\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'Search',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t) );\n\t\t\t\t} else if ( is_single() ) {\n\t\t\t\t\t// Add current post\n\t\t\t\t\tarray_push( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => get_the_title(),\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => get_the_permalink(),\n\t\t\t\t\t) );\n\t\t\t\t} else if ( isset( $_GET['s'] ) ) {\n\t\t\t\t\t// Add search\n\t\t\t\t\tarray_push( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => 'Search Results',\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t) );\n\t\t\t\t} else if ( is_category() ) {\n\t\t\t\t\t$categories = get_the_category();\n\t\t\t\t\t$category = $categories[0];\n\t\t\t\t\t// Add current category\n\t\t\t\t\tarray_push( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => $category->name,\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => '#',\n\t\t\t\t\t) );\n\t\t\t\t} else if ( ! fielding_page_in_menu( $menu_id, $current_object_id ) ) {\n\t\t\t\t\t// Add current post\n\t\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t\t'title' => get_the_title(),\n\t\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t\t'ID' => '',\n\t\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t\t'url' => get_the_permalink(),\n\t\t\t\t\t) );\n\t\t\t\t}\n\n\t\t\t\t// Add home\n\t\t\t\tarray_unshift( $sorted_menu_items , (object) array(\n\t\t\t\t\t'title' => 'Home',\n\t\t\t\t\t'menu_item_parent' => '',\n\t\t\t\t\t'ID' => 'home',\n\t\t\t\t\t'db_id' => '',\n\t\t\t\t\t'url' => fielding_page_link( 'home', false ),\n\t\t\t\t) );\n\n\t\t\t\t// Trim titles\n\t\t\t\t$count = count( $sorted_menu_items );\n\t\t\t\t$limit_current = 30;\n\t\t\t\t$limit_all = ( $count > 5 ) ? 10 : $limit_current;\n\t\t\t\t$i = 0;\n\n\t\t\t\tforeach ( $sorted_menu_items as &$item ) {\n\t\t\t\t\t$i++;\n\n\t\t\t\t\tif ( $i < $count && strlen( $item->title ) > $limit_all ) {\n\t\t\t\t\t\t$item->title = trim( substr( $item->title, 0, $limit_all ) ) . '...';\n\t\t\t\t\t} else if ( $i == $count && strlen( $item->title ) > $limit_current ) {\n\t\t\t\t\t\t$item->title = trim( substr( $item->title, 0, $limit_current ) ) . '...';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $sorted_menu_items;\n}", "function remove_parent_classes($class){\n return in_array( $class, array( 'current_page_item', 'current_page_parent', 'current_page_ancestor', 'current-menu-item' ) ) ? FALSE : TRUE;\n}", "function current_to_active($text)\n{\n $replace = array(\n //List of menu item classes that should be changed to \"active\"\n 'current-menu-item' => 'active',\n 'current_page_parent' => 'active',\n 'current_page_ancestor' => 'active',\n 'current_page_item' => 'active',\n );\n $text = str_replace(array_keys($replace), $replace, $text);\n return $text;\n}", "function custom_nav_item( $menu, stdClass $args ){\n if ( 'primary' != $args->theme_location )\n\n return $menu; \n\t\t// $menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"dashicons dashicons-search\"></i>\n\t\t$menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"fa fa-search\"></i>\n\t\t\t\t<a href=\"#search-container\" class=\"screen-reader-text\"></a>\n\t\t\t\t</div>'; \n return $menu; \n}", "function add_specific_menu_location_atts( $atts, $item, $args ) {\n if( $args->theme_location == 'header' ) {\n // add the desired attributes:\n $atts['class'] = 'navbar-item';\n }\n return $atts;\n}", "public static function menu_item() {\r\n\t\t$app_settings = new Inf_Member_App_Settings();\r\n\r\n\t\t$hook_suffix = add_utility_page(\r\n\t\t\t__( 'Inf Member Plugin Settings', 'inf-member' ), // page <title>\r\n\t\t\t'Inf Member', // menu title\r\n\t\t\t'manage_options', // capability needed\r\n\t\t\tself::PAGE_SLUG, // what should I call you?\r\n\t\t\tarray( &$app_settings, 'settings_page' ), // pageload callback\r\n\t\t\t'' // to be replaced by dashicon\r\n\t\t);\r\n\r\n\t\t// conditional load CSS, scripts\r\n\t\tif ( $hook_suffix ) {\r\n\t\t\t$app_settings->hook_suffix = $hook_suffix;\r\n\t\t\tregister_setting( $hook_suffix, self::OPTION_NAME, array( 'Inf_Member_App_Settings', 'sanitize_options' ) );\r\n\t\t\tadd_action( 'load-' . $hook_suffix, array( &$app_settings, 'onload' ) );\r\n\t\t}\r\n\r\n\t\treturn $hook_suffix;\r\n\t}", "function custom_nav_class($classes, $item)\n{\n if(array_search(\"menu-item-has-children\", $classes) && !$item->menu_item_parent)\n {\n $classes[] = \"dropdown\";\n }\n\n return $classes;\n}", "function newsroom_elated_get_main_menu($additional_class = 'eltd-default-nav') {\n newsroom_elated_get_module_template_part('templates/parts/navigation', 'header', '', array('additional_class' => $additional_class));\n }", "function bethel_add_submenu_to_post() {\n\tglobal $post;\n\t$menu_items = get_menu_items_for_current_page();\n\tif ($menu_items && sizeof($menu_items) > 1) {\n\t\techo '<ul class=\"bethel-subpages-nav\">';\n\t\tforeach ($menu_items as $menu_item) {\n\t\t\techo '<li'.($menu_item->object_id == $post->ID ? ' class=\"current-item\"' : '').\">\";\n\t\t\techo \"<a href=\\\"{$menu_item->url}\\\">{$menu_item->title}</a>\";\n\t\t\techo '</li>';\n\t\t}\n\t\techo '</ul>';\n\t} elseif (is_page() && $post->post_parent) {\n $menu_items = get_pages (array('parent' => $post->post_parent, 'sort_order' => 'menu_order', 'hierarchical' => false));\n if ($menu_items && sizeof($menu_items) > 1) {\n echo '<ul class=\"bethel-subpages-nav\">';\n foreach ($menu_items as $menu_item) {\n echo '<li'.($menu_item->ID == $post->ID ? ' class=\"current-item\"' : '').\">\";\n echo '<a href=\"'.get_permalink($menu_item->ID).\"\\\">{$menu_item->post_title}</a>\";\n echo '</li>';\n }\n echo '</ul>';\n }\n }\n}", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item';\n return $classes;\n}", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "function is_sidebar_menu_active($current)\n{\n $CI =& get_instance();\n if ($CI->uri->segment(1) == $current) {\n return 'active';\n }\n return '';\n}", "public function MenuCurrentItem() {\n return $this->MainMenu()->find('Code', 'KapostAdmin');\n }", "function sic_page_menu_args( $args ) {\n\t$args['menu_class'] = 'nav';\n\t$args['container'] = FALSE;\n\n\n\treturn $args;\n}", "function is_current($id, $classname = \"current_page_item\", $echo = true){\n\tglobal $post;\n\tif($post->ID == $id){\n\t\tif($echo)\tprintf('class=\"%s\"', $classname);\n\t\telse \t\treturn true;\n\t}\n\t\n\treturn false;\n\t\t\n}", "function my_custom_menu_item( $items, $args ) {\n\tif ( $args->theme_location == 'main-menu' ) {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$items .= '<li><a href=\"/cuenta\">Cuenta</li>'; // Iniciar Sesión - Cuenta\n\t\t\t$items .= '<li><a href=\"/vip\"><i class=\"fa fa-star\"></i></a></li>'; // Iniciar Sesión VIP - VIP\n\t\t\t$items .= '<li><a href=\"/dashboard\"><i class=\"fa fa-shopping-cart\"></i></a></li>'; // # - Dashboard\n\t\t\t$items .= '<li><a href=\"/cerrar-sesion\"><i class=\"fa fa-sign-out\"></i></li>'; // Administrador - Cerrar Sesión\n\t\t} else {\n\t\t\t$items .= '<li><a href=\"/iniciar-sesion\" class=\"fancybox-login\" data-fancybox-type=\"iframe\">Iniciar sesión</li>'; // Iniciar Sesión - Cuenta\n\t\t\t$items .= '<li><a href=\"/registrarse\" class=\"fancybox-login registrarse\" data-fancybox-type=\"iframe\">Registrarse <i class=\"fa fa-arrow-circle-right\"></i></a></li>'; // Registrarse\n\t\t\t$items .= '<li><a href=\"/iniciar-sesion-vip\" class=\"fancybox-login\" data-fancybox-type=\"iframe\"><i class=\"fa fa-star\"></i></a></li>'; // Iniciar Sesión VIP - VIP\n\t\t\t$items .= '<li><a href=\"#\"><i class=\"fa fa-shopping-cart\"></i></a></li>'; // # - Dashboard\n\t\t\t$items .= '<li><a href=\"/wp-admin\" target=\"_blank\"><i class=\"fa fa-user\"></i></a></li>'; // Administrador - Cerrar Sesión\n\t\t}\n\t\t$items .= '<li><a href=\"https://www.facebook.com/Comsubcol-SAS-1116634048391880\" target=\"_blank\"><i class=\"fa fa-facebook\"></i></a></li>'; // Facebook\n\t\t$items .= '<li><a href=\"https://www.twitter.com/ComsubcolSAS\" target=\"_blank\"><i class=\"fa fa-twitter\"></i></a></li>'; // Twitter\n\t\t$items .= '<li><a href=\"https://www.instagram.com/ComsubcolSAS\" target=\"_blank\"><i class=\"fa fa-instagram\"></i></a></li>'; // Instagram\n\t\tif ( isset( $_POST[ 'item_subasta' ] ) ) {\n\t\t\t$item_subasta = $_POST[ 'item_subasta' ];\n\t\t} else {\n\t\t\t$item_subasta = 'Buscar...';\n\t\t}\n\t\t$items .= '\n\t\t\t<li>\n\t\t\t\t<p><a href=\"#\" id=\"example-show\" class=\"showLink\"><i class=\"fa fa-search\"></i></a></p>\n\t\t\t\t<div id=\"example\" class=\"more\">\n\t\t\t\t\t<form action=\"' . esc_url( get_permalink( 2640 ) ) . '\" method=\"post\" id=\"blog-search\" class=\"blog-search\">\n\t\t\t\t\t\t<input type=\"text\" id=\"item_subasta\" name=\"item_subasta\" value=\"\" class=\"blog-search-field\" placeholder=\"' . $item_subasta . '\">\n\t\t\t\t\t</form>\n\t\t\t\t\t<p class=\"hidden-xs hidden-sm\"><a href=\"#\" id=\"example-hide\" class=\"hideLink\"><i class=\"fa fa-close\"></i></a></p>\n\t\t\t\t</div>\n\t\t\t</li>';\n\t}\n\treturn $items;\n}", "function minicard_page_menu() {\n\tglobal $wp_query;\n\techo '<ul>';\n\t$exclude = str_replace(' ', '', trim(get_option('exclude_ids')));\n\tif ($exclude) $exclude = '&exclude='.$exclude.'';\n\t\n\t/* Show home unless un-needed */\n\t\t$show_home = true;\n\t\t$post_obj = $wp_query->get_queried_object();\n\t\t$post_ID = $post_obj->ID;\n\n\t\t$show_on_front = get_option( 'show_on_front'); // does the front page display the latest posts or a static page\n\t\t$page_on_front = get_option( 'page_on_front' ); // if it shows a page, what page\n\t\t$page_for_posts = get_option( 'page_for_posts' );\n\t\t\n\t\tif ($show_on_front == 'page' && $page_on_front > 0) $show_home = false;\n\t\t\n\t\tif ($show_home) {\n\t\t\n\t\t\techo '<li class=\"page_item ';\n\t\t\t\n\t\t\tif (is_home() && $post_ID!=$page_for_posts) echo 'current_page_item';\n\t\t\t\n\t\t\techo '\"><a href=\"'.get_bloginfo('url').'\" title=\"'.__('Home','minicard').'\">'.__('Home','minicard').'</a></li>';\n\t\t\t\n\t\t\tif ( ( is_home() || is_search() ) && $post_ID!=$page_for_posts) {\n\t\t\t\techo str_replace('current_page_parent','', wp_list_pages('sort_column=menu_order&title_li=&echo=0&link_before=&link_after=&depth=1'.$exclude));\n\t\t\t} else {\n\t\t\t\techo wp_list_pages('sort_column=menu_order&title_li=&echo=0&link_before=&link_after=&depth=1'.$exclude);\n\t\t\t}\n\t\t\n\t\t} else {\t\t\t\t\n\t\t\techo wp_list_pages('sort_column=menu_order&title_li=&echo=0&link_before=&link_after=&depth=1'.$exclude);\t\t\t\t\t\n\t\t}\n\t/* end */\n\techo minicard_menu_search_box();\n\techo '</ul>';\n}", "function primary_add_menu_atts( $atts, $item, $args ) {\r\n\tif( $args->theme_location == 'primary-menu' ) {\r\n\t$atts['class=\"nav-link js-scroll-trigger\"'] = 'return true';\r\n}\r\n return $atts;\r\n}", "function bethel_filter_menu_items() {\n\tadd_filter ('walker_nav_menu_start_el', 'bethel_add_menu_subtitles');\n}", "function most_recent_posts_create_menu()\r\n{\r\n\tadd_menu_page('MRP Overview', 'Most Recent Posts', \t\t'administrator', 'MostRecentPostsSettings', 'MRPOverview', 'http://buildautomate.com/favicon.ico');\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Shortcode', \t\t'Shortcode', \t\t'administrator', 'MRPShortcodes',\t\t'MRPShortcodes');\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Registration', \t\t'Registration', \t\t'administrator', 'MRPRegistration',\t\t'MRPRegistration');\t\t\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Tech Support', \t\t'Tech Support', \t\t'administrator', 'MRPTechSupport', \t\t'MRPTechSupport');\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Help', \t\t'Help', \t\t'administrator', 'MRPHelp',\t\t'MRPHelp');\t\t\t\t\r\n\t\t\t\r\n\t//call register settings function\r\n\tadd_action( 'admin_init', 'MRPregister_mysettings' );\r\n}", "function uwmadison_page_menu_args( $args ) {\n\t\t$args['show_home'] = true;\n\t\t$args['menu_class'] = $args['container_class'];\n\t\treturn $args;\n\t}", "function wp_edit_nav_menu_walker($class, $menu_id = 0)\n {\n }", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n $args['menu_class'] = 'nav-list';\n return $args;\n}", "function filter_menu_items( $args ) {\r\n $args['show_home'] = false;\r\n return $args;\r\n}", "function _s_contact_menu_atts( $atts, $item, $args ) {\n $classes = $item->classes;\n \n \t if ( in_array( 'get-started', $classes ) ) {\n\t\t$atts['data-open'] = 'contact';\n\t }\n\t return $atts;\n}", "function cera_grimlock_navbar_nav_menu( $args ) {\n\t\tif ( has_nav_menu( 'primary' ) ) :\n\t\t\twp_nav_menu( wp_parse_args( $args, array(\n\t\t\t\t'theme_location' => 'primary',\n\t\t\t) ) );\n\t\tendif;\n\t}", "function check_current_menu($page_name, $current_page) {\n\tif ($page_name === $current_page) return \"current\";\n\telse return \"\";\n}", "public function menu_main_menu()\n {\n return menu_main_menu();\n }", "public function highlight_menu_item( $parent_file ) {\n\t\t\t// Get the current screen.\n\t\t\t$current_screen = get_current_screen();\n\n\t\t\t// Check whether is the custom dashboard page\n\t\t\t// and change the `parent_file` to woocart-dashboard.\n\t\t\tif ( 'dashboard_page_woocart-dashboard' == $current_screen->base ) {\n\t\t\t\t$parent_file = $this->get_menu_slug();\n\t\t\t}\n\n\t\t\t// Return the `parent_file`.\n\t\t\treturn $parent_file;\n\t\t}", "function sld_manage_menu_items() {\n\tif( !current_user_can( 'administrator' ) ) {\n\t}\n\tremove_menu_page('link-manager.php'); // Links\n\t// remove_menu_page('edit.php'); // Posts\n\tremove_menu_page('upload.php'); // Media\n\t// remove_menu_page('edit-comments.php'); // Comments\n\t// remove_menu_page('edit.php?post_type=page'); // Pages\n\t// remove_menu_page('plugins.php'); // Plugins\n\t// remove_menu_page('themes.php'); // Appearance\n\t// remove_menu_page('users.php'); // Users\n\t// remove_menu_page('tools.php'); // Tools\n\t// remove_menu_page('options-general.php'); // Settings\n}", "function myplugin_custom_walker( $args ) {\n if($args['theme_location']==\"\")\n {\n return array_merge( $args, array(\n 'container_class'=>\"menu_list\",\n 'menu_class'=>'',\n ) );\n } else {\n return array_merge( $args, array(\n 'theme_location' => 'primary',\n 'menu_class' => 'nav navbar-nav',\n ) );\n }\n}", "function custom_menu_item_id_class( $menu_items, $args ) {\n\t$counter = array();\n\n\tforeach ( $menu_items as $k => $item ) {\n\t\tif ( !isset( $counter[$item->menu_item_parent] ) ) {\n\t\t\t$counter[$item->menu_item_parent] = 0;\n\t\t}\n\t\t$counter[$item->menu_item_parent] += 1;\n\n\t\t$item->menu_index = $counter[$item->menu_item_parent];\n\t\t$item->classes[] = 'nth-' . $item->menu_index;\n\t}\n\n\tforeach ( $menu_items as $k => $item ) {\n\t\tif ( $item->menu_index == 1 ) {\n\t\t\t$item->classes[] = 'menu-first';\n\t\t}\n\t\tif ( $item->menu_index == $counter[$item->menu_item_parent] ) {\n\t\t\t$item->classes[] = 'menu-last';\n\t\t}\n\t}\n\n\treturn $menu_items;\n}", "function wpstartup_menu_html( $menu ){\n if( $menu != '' || is_array( $menu ) ){\n if( is_array( $menu ) ){\n // multi menu\n foreach( $menu as $nm ){\n\n if( has_nav_menu( $nm ) ){\n echo '<div id=\"'.$nm.'menubox\"><div id=\"'.$nm.'menu\" class=\"\"><nav><div class=\"innerpadding\">';\n //if( $nm == 'top' ){\n echo '<div class=\"menutoggle\"><span>menu</span></div>';\n //}\n wp_nav_menu( array( 'theme_location' => $nm ) );\n echo '<div class=\"clr\"></div></div></nav></div></div>';\n }\n }\n }else if( has_nav_menu( $menu ) ){\n // single menu\n echo '<div id=\"'.$menu.'menubox\"><div id=\"'.$menu.'menu\" class=\"\"><nav><div class=\"innerpadding\">';\n //if( $menu == 'top' ){\n echo '<div class=\"menutoggle\"><span>menu</span></div>';\n //}\n wp_nav_menu( array( 'theme_location' => $menu , 'menu_class' => 'nav-menu' ) );\n echo '<div class=\"clr\"></div></div></nav></div></div>';\n }\n }\n}", "function is_nav_menu_item($menu_item_id = 0)\n {\n }", "function wordpress_time_capsule_admin_menu($menus = array()) {\r\n\r\n\tif( is_wptc_filter_registered('is_whitelabling_active_wptc') \r\n\t\t&& apply_filters('is_whitelabling_active_wptc', false) \r\n\t\t&& !apply_filters('is_whitelabling_override_wptc', false) ){\r\n\r\n\t\treturn do_action('add_pages_wl_wptc', time());\r\n\t}\r\n\r\n\twptc_log(array(),'-----------athorized 4----------------');\r\n\r\n\tif (empty($menus)) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\tif ($menus['main']) {\r\n\t\t$text = __('WP Time Capsule', 'wptc');\r\n\t\tadd_menu_page($text, $text, 'activate_plugins', 'wp-time-capsule-monitor', 'wordpress_time_capsule_monitor', 'dashicons-wptc', '80.0564');\r\n\t}\r\n\r\n\tif ($menus['backups']) {\r\n\t\t$text = __('Backups', 'wptc');\r\n\t\tadd_submenu_page('wp-time-capsule-monitor', $text, $text, 'activate_plugins', 'wp-time-capsule-monitor', 'wordpress_time_capsule_monitor');\r\n\t}\r\n\r\n\tif ($menus['sub_menus']) {\r\n\t\tdo_action('add_additional_sub_menus_wptc_h', '');\r\n\t}\r\n\r\n\tif ($menus['activity_log']) {\r\n\t\t$text = __('Activity Log', 'wptc');\r\n\t\tadd_submenu_page('wp-time-capsule-monitor', $text, $text, 'activate_plugins', 'wp-time-capsule-activity', 'wordpress_time_capsule_activity');\r\n\t}\r\n\r\n\tif ($menus['settings']) {\r\n\t\t$text = __('Settings', 'wptc');\r\n\t\tadd_submenu_page('wp-time-capsule-monitor', $text, $text, 'activate_plugins', 'wp-time-capsule-settings', 'wptimecapsule_settings_hook');\r\n\t}\r\n\r\n\tif ($menus['initial_setup']) {\r\n\t\t$text = __('Initial Setup', 'wptc');\r\n\t\tadd_submenu_page(null, $text, $text, 'activate_plugins', 'wp-time-capsule', 'wordpress_time_capsule_admin_menu_contents');\r\n\t}\r\n\r\n\r\n\tif ($menus['dev_option']) {\r\n\t\tif (WPTC_ENV != 'production' || WPTC_DEBUG) {\r\n\t\t\t$text = __('Dev Options', 'wptc');\r\n\t\t\tadd_submenu_page('wp-time-capsule-monitor', $text, $text, 'activate_plugins', 'wp-time-capsule-dev-options', 'wordpress_time_capsule_dev_options');\r\n\t\t}\r\n\t}\r\n\r\n\tdownload_recent_decrypted_file_wptc();\r\n}", "function widget_meteo_menu_items()\n{\n // Create a top-level menu item.\n $hookname = add_menu_page(\n 'Bonjour,', // Page title - Titre de la page\n 'Widget Météo', // Menu title - Titre du menu\n 'manage_options', // Capabilities - Capacités\n 'widget_meteo', // Slug\n 'widget_meteo_markup', // Display callback\n 'dashicons-cloud', // Icon\n // 'dashicons-tickets', // Icon\n 66 // Priority/position. Just after 'Plugins'\n );\n}", "function koelsch_resources_footer_menu(){\n global $community_context;\n $lt = $community_context->getCurrentLivingTypes();\n $menuID = isset($lt['resources_menu_id']) ? $lt['resources_menu_id'] : false;\n if ($menuID){?>\n <div class=\"col col-12 col-nav\">\n <h4>Resources</h4>\n <?php\n wp_nav_menu(array(\n 'menu'=> $menuID,\n 'menu_id'=>'',\n 'menu_class'=>'second-menu main-item',\n 'container'=>false,\n 'depth'=>1,\n // 'walker'=> new Koelsch_Walker_Nav_Menu,\n 'fallback_cb'=>'__return_false'\n ));\n ?></div><?php\n }\n}", "function emc_nav_menu_args( $args ) {\r\n\r\n\t$args[ 'theme_location' ] = 'primary';\r\n\t$args[ 'container_class' ] = 'container';\r\n\t/**\r\n\t * Set our new walker only if a menu is assigned,\r\n\t * and a child theme hasn't modified it to one level\r\n\t * (naughty child theme...)\r\n\t */\r\n\tif ( 1 !== $args[ 'depth' ] && has_nav_menu( 'primary' ) ) {\r\n\t\t$args[ 'walker' ] = new EMC_Page_Navigation_Walker;\r\n\t}\r\n\treturn $args;\r\n}", "function add_additional_class_on_li($classes, $item, $args)\n{\n if (isset($args->add_li_class_to_footer)) {\n $classes[] = $args->add_li_class_to_footer;\n }\n return $classes;\n}", "function new_spa_menu_items($items, $args) {\n\n if( get_option('is_single_page') && $args->theme_location == 'header-menu' ){\n\n $myItems = wp_get_nav_menu_items($args->menu);\n foreach ($myItems as $item) {\n if ($item->post_parent){\n $auxUrl = str_replace(get_site_url().'/','#post-', $item->url);\n $auxUrl = str_replace('#post-home/','#post-', $auxUrl);\n $auxUrl = str_replace('#post-inicio/','#post-', $auxUrl);\n $auxUrl = str_replace('/','', $auxUrl);\n $auxUrl = str_replace('#post-',get_site_url().'#post-', $auxUrl);\n\n $items = str_replace($item->url, $auxUrl, $items);\n }\n }\n\n return $items;\n }\n else{\n return $items;\n }\n}", "function add_slug_class_to_menu_item($output){\n\t$ps = get_option('permalink_structure');if(!empty($ps)){\n\t\t$idstr = preg_match_all('/<li id=\"menu-item-(\\d+)/', $output, $matches);\n\t\tforeach($matches[1] as $mid){\n\t\t\t$id = get_post_meta($mid, '_menu_item_object_id', true);\n\t\t\t$slug = basename(get_permalink($id));\n\t\t\t$output = preg_replace('/menu-item-'.$mid.'\">/', 'menu-item-'.$mid.' menu-item-'.$slug.'\">', $output, 1);\n\t\t}\n\t}\n\treturn $output;\n}", "function my_walker_nav_menu_start_el($item_output, $item, $depth, $args) {\n $classes = implode(' ', $item->classes);\n $item_output = preg_replace('/<a /', '<a class=\"'.$classes.'\"', $item_output, 1);\n return $item_output;\n }", "function jet_menu_oceanwp_fix_menu_args( $args ) {\n\n\tif ( ! isset( $args['menu_class'] ) || 'jet-menu' !== $args['menu_class'] ) {\n\t\treturn $args;\n\t}\n\n\t$args['link_before'] = '';\n\t$args['link_after'] = '';\n\n\treturn $args;\n}", "function fixr_menu($location = \"main_menu\", $css_class_prefix = 'main-menu', $css_class_modifiers = null, $user_classes = null){ \n \n // Check to see if any css modifiers were supplied\n if($css_class_modifiers){\n\n if(is_array($css_class_modifiers)){\n $modifiers = implode(\" \", $css_class_modifiers);\n } elseif (is_string($css_class_modifiers)) {\n $modifiers = $css_class_modifiers;\n }\n\n } else {\n $modifiers = '';\n }\n\n $args = array(\n 'theme_location' => $location,\n 'container' => false,\n 'items_wrap' => '<ul class=\"' . $css_class_prefix . ' ' . $modifiers . '\">%3$s</ul>',\n 'walker' => new fixr_mega_menu($css_class_prefix, true)\n );\n \n if (has_nav_menu($location)){\n return wp_nav_menu($args);\n }else{\n echo \"<p>You need to first define a menu in WP-admin<p>\";\n }\n}", "function ieatwp_default_menu(){ ?>\n\t\t<ul class=\"navbar navbar-right\">\n <li><a href=\"#section_intro\" class=\"easing\">Home</a></li>\n <li><a href=\"#section_about\" class=\"easing\">About</a></li>\n <li><a href=\"#section_work\" class=\"easing\">Strategy</a></li>\n <li><a href=\"#section_resume\" class=\"easing\">Resume</a></li>\n <li><a href=\"#section_portfolio\" class=\"easing\">Portfolio</a></li>\n <li><a href=\"#section_services\" class=\"easing\">Services</a></li>\n <li><a href=\"#section_contact\" class=\"easing\">Contact</a></li>\n </ul>\n<?php }", "function biagiotti_mikado_get_main_menu( $additional_class = 'mkdf-default-nav' ) {\n\t\tbiagiotti_mikado_get_module_template_part( 'parts/navigation', 'header', '', array( 'additional_class' => $additional_class ) );\n\t}", "function wpmu_menu()\n {\n }", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }" ]
[ "0.717478", "0.6953265", "0.67572683", "0.66246814", "0.66095525", "0.65450203", "0.6529088", "0.6447683", "0.63619995", "0.63496006", "0.629071", "0.62456274", "0.6174017", "0.610552", "0.6069494", "0.6052789", "0.602766", "0.5988481", "0.59804165", "0.5962665", "0.59413415", "0.590372", "0.58798456", "0.5782502", "0.5782145", "0.57776964", "0.5749443", "0.56978047", "0.5664962", "0.56583214", "0.5645588", "0.56436414", "0.55849004", "0.5538395", "0.5514969", "0.5471819", "0.5468919", "0.54626256", "0.54604733", "0.546043", "0.5392324", "0.53772223", "0.5355281", "0.53321433", "0.5290322", "0.5274304", "0.5251068", "0.5237827", "0.5224735", "0.52176434", "0.521486", "0.5213244", "0.5205814", "0.52036273", "0.5202771", "0.5201359", "0.51996064", "0.5195809", "0.5185407", "0.5172275", "0.5171989", "0.5169874", "0.5155261", "0.5151852", "0.5140669", "0.5135823", "0.51315975", "0.5112371", "0.510523", "0.51030517", "0.50992346", "0.50893384", "0.50740284", "0.5063172", "0.50615835", "0.5060418", "0.5057703", "0.5057079", "0.5055161", "0.50453454", "0.50453", "0.50451744", "0.5038251", "0.50346595", "0.50296545", "0.50284624", "0.50257283", "0.50220114", "0.50157493", "0.5006135", "0.5003251", "0.4995898", "0.4992993", "0.49901664", "0.49825296", "0.49719352", "0.49680665", "0.4965778", "0.49610183", "0.49610183" ]
0.7954639
0
Tear down function for all tests
public function teardown() { m::close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function teardown()\n {\n //\n }", "public function teardown()\n {\n }", "public function tearDown(): void\n {\n Session::getInstance()->destroy();\n Session::kill();\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "protected function doTearDown(): void\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function teardown()\n {\n parent::teardown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "public static function tearDown()\n {\n self::$instance = null;\n }", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "protected function tearDown()\n {\n $test_user = Auth::instance()->get_user();\n $test_user->logins = 1;\n $test_user->save();\n\n // Stop the search daemon\n exec('killall searchd');\n }", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "public static function tearDownAfterClass() {\n\t\t\n\t}", "protected function tearDown()\n {\n if ($this->app) {\n foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {\n call_user_func($callback);\n }\n }\n\n $this->setUpHasRun = false;\n\n if (property_exists($this, 'serverVariables')) {\n $this->serverVariables = [];\n }\n\n if (class_exists('Mockery')) {\n Mockery::close();\n }\n\n $this->afterApplicationCreatedCallbacks = [];\n $this->beforeApplicationDestroyedCallbacks = [];\n }", "protected function tearDown(): void\n {\n app(Session::class)->invalidate();\n Routes::reset();\n Kernel::reset();\n }", "public function tearDown()\n {\n $this->stop();\n }", "protected function tearDown() {\n\t\tConfig::getInstance()->clear();\n\t\tApplication::getInstance()->getDiContainer()->getEventHandlerRegistry()->clearAll();\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown() {\n spl_autoload_unregister('autoloadForTesting');\n unset($this->object);\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public static function tearDownAfterClass() {\n\n }", "public function tearDown()\n {\n TestvfsStreamWrapper::unregister();\n }", "protected function tearDown()\r\n {\r\n $this->session->logout();\r\n }", "public function tearDown()\n\t{\n\t\t\\Session::$instance = null;\n\t}", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\r\n\t\tparent::tearDown();\r\n\t\tunset ( $this->mockedCacheCleanerBuilder );\r\n\t\tunset ( $this->mockedEventDispatcher );\r\n\t\tunset ( $this->mockedEventQueue );\r\n\t\tunset ( $this->mockedEventRepository );\r\n\t\tunset ( $this->mockedTypo3DbBackend );\r\n\t\tunset ( $this->cacheEventHandler );\r\n\t}", "public function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n\t{\n\t\tSession::$instance = null;\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "public static function tearDownAfterClass(): void\n {\n VCR::eject();\n VCR::turnOff();\n }", "public static function tearDownAfterClass(): void\n {\n VCR::eject();\n VCR::turnOff();\n }", "public static function tearDownAfterClass() {\n\t}", "protected function tearDown()\n {\n $this->tgLog = null;\n }", "public function tearDown()\n {\n if ($this->app) {\n foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {\n call_user_func($callback);\n }\n $this->app->flush();\n $this->app = null;\n }\n\n if (class_exists('Mockery')) {\n Mockery::close();\n }\n }", "protected function tearDown() {\n\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "protected function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\n $this->stack = null;\n }", "public function tearDown(): void\n {\n $this->api = null;\n parent::tearDown();\n }", "public function tear_down() {\n\t\t$this->registry = null;\n\n\t\tparent::tear_down();\n\t}", "public static function tearDownAfterClass(): void\n {\n vfsStreamWrapper::unregister();\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "public function tearDown()\n {\n// StaticEventManager::resetInstance();\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\n\t\t$this->Application = null;\n\t\tparent::tearDown ();\n\t}", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "protected function tearDown() {\n Monkey\\tearDown();\n parent::tearDown();\n }", "public static function tearDownAfterClass(): void\n {\n\n\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown() {\n $this->command = null;\n }", "public function tearDown() {\n $this->listener = null;\n $this->event = null;\n $this->request = null;\n }", "public static function tearDownAfterClass()\r\n {\r\n }", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }", "public static function tearDownAfterClass()\n {\n\n }" ]
[ "0.7754866", "0.7733016", "0.75688344", "0.75596863", "0.74822825", "0.74563587", "0.74380374", "0.73697543", "0.7367903", "0.7367903", "0.7367903", "0.7367903", "0.7367903", "0.73617", "0.73617", "0.73617", "0.73588115", "0.7356027", "0.7345407", "0.73223525", "0.7318087", "0.73172545", "0.7312366", "0.7303132", "0.72983027", "0.7260114", "0.7256139", "0.7249078", "0.7245421", "0.7245182", "0.7244873", "0.7237545", "0.723722", "0.7232", "0.7231511", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7218141", "0.7216896", "0.72140783", "0.7203176", "0.72029895", "0.720142", "0.72009534", "0.7198387", "0.719648", "0.7193916", "0.71769226", "0.71769226", "0.7174837", "0.71745116", "0.71686417", "0.7168043", "0.7159322", "0.71576345", "0.71576345", "0.7157373", "0.71521854", "0.7147221", "0.71469146", "0.7145817", "0.7144528", "0.71419215", "0.71256226", "0.7125339", "0.7123461", "0.7116757", "0.71095234", "0.7108315", "0.7105597", "0.7104727", "0.7098665", "0.70971864", "0.7093174", "0.70903826", "0.7088818", "0.7085591", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422", "0.7079422" ]
0.7190629
58
Constructor for the Whispercast object.
public function __construct($interface, $prefix = '') { parent::__construct($interface, $prefix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($casting)\n {\n $this->casting = $casting;\n }", "public function __construct()\n\t{\n\t\t//get data from Webhook call\n\t\t$this->raw_data = file_get_contents(\"php://input\");\n\t\t//decode data\n\t\t$this->decoded_data = json_decode($this->raw_data, true);\n\t\t//Set attributes and Default actions\n\t\t$this->method = \"sendMessage\";\n\t\t$this->action = \"typing\";\n\t\t//Get data\n\t\tif (isset($this->decoded_data[\"message\"][\"text\"]))\n\t\t{\t//Get data and type (photo , text or other)\n\t\t\t$this->text = $this->decoded_data[\"message\"][\"text\"];\n\t\t\t$this->type = \"text\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"photo\"]))\n\t\t{\n\t\t\t$this->type = \"photo\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"location\"]))\n\t\t{\n\t\t\t$this->type = \"location\";\t\n\t\t}else if(isset($this->decoded_data[\"message\"][\"video\"]))\n\t\t{\n\t\t\t$this->type = \"video\";\n\t\t}else{\n\t\t\t$this->type = \"unknown\";\n\t\t}\n\t\t//Inline query or regular query ?\n\t\tif (isset($this->decoded_data[\"inline_query\"])) \n\t\t{\t//inline_query is present instead of message field in case of an inline request\n\t\t\t$this->isInlineQuery = isset($this->decoded_data[\"inline_query\"]) ? true : false;\n\t\t\t$this->inlineQuery = $this->decoded_data[\"inline_query\"];\t//Contains id,from,query and offset\n\t\t}\n\t}", "public function __construct($broadCastInstance)\n {\n Log::info('construct broadcast');\n $this->broadCastInstance = $broadCastInstance;\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->text = func_get_arg(0);\n $this->channel = func_get_arg(1);\n }\n }", "public function __construct(WatsonTextToSpeech $watsonTextToSpeech)\n {\n parent::__construct();\n $this->watsonTextToSpeech = $watsonTextToSpeech;\n }", "function __construct() {\n parent::__construct();\n\n $this->_converter = new \\System\\Data\\Converter();\n }", "public function __construct()\n\t{\n\t\tSwiftriver_Event::add('swiftriver.channel.validate', array($this, 'validate'));\n\t\t\n\t\t// Create a string representation of the channel\n\t\tSwiftriver_Event::add('swiftriver.channel.format', array($this, 'format'));\n\t\t\n\t\t// Hook into welcome page new river creation\n\t\tSwiftriver_Event::add('swiftriver.welcome.create_river', array($this, 'add_chanel_options'));\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->createSocket(self::SOCKET_OUTPUT);\n $this->createSocket(self::SOCKET_ARRAY);\n $this->createSocket(self::SOCKET_INDEX);\n $this->createSocket(self::SOCKET_DATA);\n }", "protected function _construct(){\n\t\tparent::_construct();\n\t\t$this->_init('qgnerd_gameficationcampaign/campaign');\n\t}", "public function __construct()\n {\n // Metres, Centimetres, Millimetres, Yards, Foot, Inches\n $conversions = array(\n 'Weight' => array(\n 'base' => 'kg',\n 'conv' => array(\n 'g' => 1000,\n 'mg' => 1000000,\n 't' => 0.001,\n 'oz' => 35.274,\n 'lb' => 2.2046,\n )\n ),\n 'Distance' => array(\n 'base' => 'km',\n 'conv' => array(\n 'm' => 1000,\n 'cm' => 100000,\n 'mm' => 1000000,\n 'in' => 39370,\n 'ft' => 3280.8,\n 'yd' => 1093.6\n )\n )\n );\n\n foreach ($conversions as $val) {\n $this->addConversion($val['base'], $val['conv']);\n }\n }", "public function __construct() {\n\n\t\t$this->supportedFeedTypes = array('RSS1', 'RSS2', 'ATOM');\n\t\t$this->type = 'RSS2';\n\t\t\n\t\t$this->db = new DBCex();\n\t\t$this->parser = new Parser();\n\t\t\n\t\t$this->type = $type;\n\t\t$this->feedElements = array();\n\n\t\t//default values for channel\n\t\t$this->addChannelTag('title', $this->type . 'Feed');\n//\t\t$this->addChannelTag('link', 'http://www.buero-hahn.de');\n\n\t\t//Tag elements that we need to CDATA encode\n\t\t$this->feedElements['CDATAEncoded'] = array('description', 'content:encoded', 'summary');\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->webhook = new Webhook;\n }", "public function __construct()\n {\n parent::__construct();\n\n // Set data types\n $this->data_types = array(\n 'title' => 'string',\n 'url' => 'url',\n 'url_key' => 'md5',\n 'embed' => 'string',\n 'created_on' => 'datetime'\n );\n\n }", "final private function __construct() {\n\t\t\t}", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "private function construct() {\n\n\t\t$this->is_json_valid = [\n\t\t\t'amp' => true,\n\t\t\t'nonamp' => true,\n\t\t];\n\n\t\t$this->init();\n\t}", "public function __construct() {\n\t\t$this->QuackBehaviour = new Quack();\n\t\t$this->FlyBehaviour = new FlyWithWings();\n\t}", "public function construct()\n\t\t{\n\t\t}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->events = func_get_arg(0);\n $this->attributes = func_get_arg(1);\n }\n }", "function __construct() {\n\n $this->setAttack();\n $this->setHP();\n $this->setName();\n $this->setStrategyIndex();\n $this->setIsFidai();\n\n }", "function create()\n\t{\n\t\tglobal $ilDB;\n\n\t\tparent::create();\n\t\t\n\t\t$query = \"INSERT INTO il_media_cast_data (\".\n\t\t\t\" id\".\n\t\t\t\", is_online\".\n\t\t\t\", public_files\".\n\t\t\t\", downloadable\".\n\t\t \", def_access\".\n\t\t\t\", sortmode\".\n\t\t\t\", viewmode\".\n\t\t\t\" ) VALUES (\".\n\t\t\t$ilDB->quote($this->getId(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getOnline(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getPublicFiles(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getDownloadable(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getDefaultAccess(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getOrder(), \"integer\")\n\t\t\t.\",\".$ilDB->quote((int) $this->getViewMode(), \"text\")\t\t\t\n\t\t\t.\")\";\n\t\t$ilDB->manipulate($query);\n\n\t}", "private function __constuct()\n\t{\n\t\t$this->channels = new Channels();\n\t}", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.offerShiftRequest');\n }", "public function __construct()\n {\n $decryptor = Mage::helper('core');\n\n $this->AccountSid = Mage::helper('twilio')->getAccountSID();\n $this->AuthToken = Mage::helper('twilio')->getAuthToken();\n $this->twilioNumber = Mage::helper('twilio')->getTwilioNumber();\n $this->smsNotificationNumber = Mage::helper('twilio')->getSMSNotificationNumber();\n\n parent::__construct($this->AccountSid, $this->AuthToken);\n }", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t\t$this->Twitter = Twitter::getInstance();\n\t}", "private function __construct() {\n\t\t}", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->ingress = func_get_arg(0);\n }\n }", "public function __construct()\n {\n $this->data['messagetype'] = get_class($this);\n }", "protected abstract function __construct();", "final private function __construct()\n {\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->stream = fopen('php://output', 'w');\n\t}", "function __construct()\n\t{\n\t\t$this->obj = \"Send\";\n\t}", "public function __construct(AttachWebsocketStream $websocket)\n {\n $this->attachedWebsocket = $websocket;\n }", "public function __construct() {\n\t\tparent::__construct(PodcastModel::NAME);\n\n\t\t$this->url = $this->getBaseUrl();\n\n\t\t$node = $this->getNodesForWidget('joppa', 'podcast', 1);\n\t\tif ($node) {\n\t\t\t$node = array_pop($node);\n $this->url .= '/' . $node->getRoute();\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->textEncoding = 0x00;\n $this->description = '';\n }", "public function __construct()\n {\n if (11 == func_num_args()) {\n $this->id = func_get_arg(0);\n $this->owner = func_get_arg(1);\n $this->applicationId = func_get_arg(2);\n $this->time = func_get_arg(3);\n $this->segmentCount = func_get_arg(4);\n $this->direction = func_get_arg(5);\n $this->to = func_get_arg(6);\n $this->from = func_get_arg(7);\n $this->media = func_get_arg(8);\n $this->text = func_get_arg(9);\n $this->tag = func_get_arg(10);\n }\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->helpers_dir= ADDONPATH.'modules/streams_import/helpers/profiles';\n\n\t\t// load everything\n\t\t$this->load->library('streams_import');\n\t\t$this->load->library('unzip');\n\t\t$this->load->library('format');\n\t\t$this->load->config('streams_import_c');\n\t\t$this->load->helper(array('folder',\n 'file',\n 'directory',\n 'streams_import'\n ));\n\t\t\n\t\t$this->stream_slug = $this->streams_import->stream_slug;\n\t\t$this->namespace = $this->streams_import->namespace;\n\n\t}", "public function construct() {\n\n }", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "public function __construct()\n {\n $this->types = array(self::TYPE_EMISSION, self::TYPE_TRANSFER);\n }", "public function __construct()\n {\n if (15 == func_num_args()) {\n $this->mode = func_get_arg(0);\n $this->detectionTimeout = func_get_arg(1);\n $this->silenceTimeout = func_get_arg(2);\n $this->speechThreshold = func_get_arg(3);\n $this->speechEndThreshold = func_get_arg(4);\n $this->delayResult = func_get_arg(5);\n $this->callbackUrl = func_get_arg(6);\n $this->callbackMethod = func_get_arg(7);\n $this->fallbackUrl = func_get_arg(8);\n $this->fallbackMethod = func_get_arg(9);\n $this->username = func_get_arg(10);\n $this->password = func_get_arg(11);\n $this->fallbackUsername = func_get_arg(12);\n $this->fallbackPassword = func_get_arg(13);\n $this->machineSpeechEndThreshold = func_get_arg(14);\n }\n }", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "public function __construct() {\n\n\t\t}", "final private function __construct()\n\t{\n\t}", "function __construct() {\n\t\tparent::__construct(\n\t\t\t'zappy_feed_burner', // Base ID\n\t\t\t__('Zappy Feed Burner Widget','fashion'), // Widget Name\n\t\t\tarray( 'description' => __( 'Subscribe to our email newsletter.', 'zappy_feed_burner' ), ) // Widget Description\n\t\t);\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t//$this->exposeMethod('send');\n\t}", "public function __construct()\n {\n if (6 == func_num_args()) {\n $this->listId = func_get_arg(0);\n $this->sender = func_get_arg(1);\n $this->subject = func_get_arg(2);\n $this->body = func_get_arg(3);\n $this->resourceUrls = func_get_arg(4);\n $this->sendDate = func_get_arg(5);\n }\n }", "public function __construct($config){\n parent::__construct(\"http://minicasts.podomatic.com/play\",\"\");\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "public function __construct()\n {\n $this->messageBirdClient = new Client(config('carro_messenger.message_bird.access_key'));\n $this->whatsAppchannelId = config('carro_messenger.message_bird.whatsapp_channel_id');\n }", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n\t{\n\t\t$this->zws = mb_chr(8203, 'UTF-8');\n\t\n\t\t$this->checkDimensions();\n\t}", "public function __construct() { \n\t\t\n\n\t\t}", "protected function _construct()\n {\n $this->_init('magenest_ultimatefollowupemail_sms_log', 'id');\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->causes = func_get_arg(0);\n $this->message = func_get_arg(1);\n }\n }", "public function __construct() {\n\n parent::__construct();\n $this->allowedTypes = array(\n CultureFeed_Activity::CONTENT_TYPE_EVENT,\n CultureFeed_Activity::CONTENT_TYPE_PRODUCTION,\n CultureFeed_Activity::CONTENT_TYPE_ACTOR,\n CultureFeed_Activity::CONTENT_TYPE_ACTIVITY,\n CultureFeed_Activity::CONTENT_TYPE_BOOK,\n CultureFeed_Activity::CONTENT_TYPE_NODE,\n CultureFeed_Activity::CONTENT_TYPE_CULTUREFEED_PAGE,\n );\n\n $this->subject = t('More info requested by');\n $this->viewPrefix = t('has requested more info on');\n $this->viewSuffix = t('');\n $this->label = t('More info requested');\n\n }", "public function __construct(array $waiver)\n {\n // Check for required keys\n parent::__construct($waiver, self::REQUIRED_KEYS, self::class);\n\n // Load the wavier sumamry into public variables\n $this->waiverId = $waiver['waiverId'];\n $this->templateId = $waiver['templateId'];\n $this->title = $waiver['title'];\n $this->createdOn = $waiver['createdOn'];\n $this->expirationDate = $waiver['expirationDate'];\n $this->expired = $waiver['expired'];\n $this->verified = $waiver['verified'];\n $this->kiosk = $waiver['kiosk'];\n $this->firstName = $waiver['firstName'];\n $this->middleName = $waiver['middleName'];\n $this->lastName = $waiver['lastName'];\n $this->dob = $waiver['dob'];\n $this->isMinor = $waiver['isMinor'];\n $this->clientIP = $waiver['clientIP'];\n $this->tags = $waiver['tags'];\n\n // Check that flags field is an array\n $this->flags = array();\n if(!is_array($waiver['flags']))\n throw new \\InvalidArgumentException('Flags field must be an array');\n foreach($waiver['flags'] as $flag) {\n array_push($this->flags, new SmartwaiverFlag($flag));\n }\n\n // Check that participants is an array and create participant objects\n $this->participants = [];\n if(!is_array($waiver['participants']))\n throw new \\InvalidArgumentException('Participants field must be an array');\n if(count($waiver['participants']) < 1)\n throw new \\InvalidArgumentException('There must be at least one participant');\n foreach($waiver['participants'] as $waiverParticipant) {\n array_push($this->participants, new SmartwaiverParticipant($waiverParticipant));\n }\n\n // Load the waiver data\n $this->email = $waiver['email'];\n $this->marketingAllowed = $waiver['marketingAllowed'];\n $this->addressLineOne = $waiver['addressLineOne'];\n $this->addressLineTwo = $waiver['addressLineTwo'];\n $this->addressCity = $waiver['addressCity'];\n $this->addressState = $waiver['addressState'];\n $this->addressZip = $waiver['addressZip'];\n $this->addressCountry = $waiver['addressCountry'];\n $this->emergencyContactName = $waiver['emergencyContactName'];\n $this->emergencyContactPhone = $waiver['emergencyContactPhone'];\n $this->insuranceCarrier = $waiver['insuranceCarrier'];\n $this->insurancePolicyNumber = $waiver['insurancePolicyNumber'];\n $this->driversLicenseNumber = $waiver['driversLicenseNumber'];\n $this->driversLicenseState = $waiver['driversLicenseState'];\n $this->photos = $waiver['photos'];\n\n // Check that custom waiver fields is an array\n $this->customWaiverFields = array();\n $this->customWaiverFieldsByGuid = array();\n if(!is_array($waiver['customWaiverFields']))\n throw new \\InvalidArgumentException('Custom waiver fields must be an array');\n foreach($waiver['customWaiverFields'] as $guid => $customWaiverField) {\n $customWaiverFieldObject = new SmartwaiverCustomField($customWaiverField);\n array_push($this->customWaiverFields, $customWaiverFieldObject);\n $this->customWaiverFieldsByGuid[$guid] = $customWaiverFieldObject;\n }\n\n // Check that guardian field is not null\n $this->guardian = null;\n if(!is_null($waiver['guardian'])) {\n $this->guardian = new SmartwaiverGuardian($waiver['guardian']);\n }\n\n $this->pdf = $waiver['pdf'];\n }", "protected function __construct()\r\n\t\t{\r\n\t\t}", "public function __construct()\r\n {\r\n if(3 == func_num_args())\r\n {\r\n $this->destination = func_get_arg(0);\r\n $this->hsCode = func_get_arg(1);\r\n $this->source = func_get_arg(2);\r\n }\r\n }", "protected final function __construct() {}", "public function __construct() {\n\n\t\t/* Do a Require Once On the needed Libraries */\n\t\trequire_once Config::get('prefix') . '/modules/httpq/httpqplayer.class.php';\n\n\t}", "public function _construct()\n\t{\n\n\t}", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => env('CHAT_STREAM_URL', 'http://192.168.0.6:5000/')\n ]);\n }", "private function __construct()\n\t{\n\n\t}", "public function __construct(TwitterStream $twitterStream)\n {\n $this->twitterStream = $twitterStream;\n parent::__construct();\n }", "function __construct() {\n\t\tadd_shortcode( 'audio', array( $this, 'audio_shortcode' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'check_infinite' ) );\n\t\tadd_action( 'infinite_scroll_render', array( $this, 'audio_shortcode_infinite' ), 11 );\n\t}", "final private function __construct() {}", "final private function __construct() {}", "public function __construct() { \n\t\n\t\t/* Do a Require Once On the needed Libraries */\n\t\trequire_once Config::get('prefix') . '/modules/mpd/mpd.class.php';\n\n\t}", "public function __construct()\n\t{\n\t\t$this->type('subscriber');\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "private function __construct()\t{}", "protected function _construct()\n {\n $this->_init(BusinessModelMessage::class, ResourceModelMessage::class);\n }", "private function __construct()\r\n\t{\r\n\t}", "function __construct() {\n\n\t\t// Example URL: http://cinesport.boston.com/boston-globe-sports/manning-reflects-win-over-brady-pats/\n\t\twp_embed_register_handler( 'cinesport', BDC_CINESPORT_EMBED_REGEX, array( $this, 'cinesport_embed_handler' ) );\n\n\t\tadd_shortcode( 'cinesport', array( $this, 'cinesport_shortcode_handler' ) );\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t}", "private function __construct() {\r\n\t}", "public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}" ]
[ "0.68583405", "0.64783174", "0.6454682", "0.60456425", "0.5901037", "0.5806428", "0.573582", "0.57098246", "0.5662975", "0.5640815", "0.5607303", "0.56040144", "0.55732405", "0.5561969", "0.5529732", "0.55070305", "0.54856753", "0.5483345", "0.54628026", "0.5459474", "0.54541", "0.5444916", "0.54426783", "0.5433638", "0.5431966", "0.5422561", "0.5421967", "0.542113", "0.5397938", "0.5394219", "0.5393361", "0.5385137", "0.53845555", "0.5378898", "0.5364075", "0.5363362", "0.5357768", "0.53427505", "0.53353906", "0.53292054", "0.5321008", "0.532064", "0.53135175", "0.5312668", "0.53036153", "0.5296624", "0.5293282", "0.5291835", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5291297", "0.5285803", "0.5279914", "0.52727026", "0.52716005", "0.5266963", "0.52640575", "0.5263425", "0.5262648", "0.5261652", "0.52536166", "0.5250537", "0.5249698", "0.5246983", "0.5239946", "0.5238005", "0.5235334", "0.5234798", "0.5234498", "0.5228536", "0.5227251", "0.5227251", "0.5225866", "0.5224171", "0.5221349", "0.52199817", "0.5217819", "0.5214728", "0.5209205", "0.5206725", "0.5205556", "0.5205556", "0.52046645", "0.52012616", "0.52012616", "0.52012616", "0.52012616" ]
0.0
-1
Destroys the server having the given id.
public function destroy($id) { $iid = $this->_interface->getElementPrefix(); $media_element_service = $this->_interface->MediaElementService(); $sources = new Whispercast_Sources($this->_interface); try { $media_element_service->StopExportElement('http', $this->_interface->export.'/files'); } catch(Exception $e) { } try { $media_element_service->StopExportElement('rtmp', $this->_interface->export.'/files'); } catch(Exception $e) { } try { $media_element_service->StopExportElement('http', $this->_interface->export.'/download/files'); } catch(Exception $e) { } try { $media_element_service->StopExportElement('rtmp', $this->_interface->export.'/preview/files'); } catch(Exception $e) { } try { $media_element_service->StopExportElement('http', $this->_interface->export.'/thumbnails'); } catch(Exception $e) { } try { $sources->destroy($id, 'http'); } catch(Exception $e) { } try { $sources->destroy($id, 'rtmp'); } catch(Exception $e) { } try { $media_element_service->DeleteElementSpec($iid.'_ts'); } catch(Exception $e) { } try { $media_element_service->DeleteElementSpec($iid.'_live'); } catch(Exception $e) { } for ($b = 0; $b < 32; $b++) { try { $media_element_service->DeleteElementSpec($iid.'_live_'.$b); } catch(Exception $e) { } } try { $media_element_service->DeleteElementSpec($iid.'_thumbnails'); } catch(Exception $e) { } for ($b = 0; $b < 32; $b++) { try { $media_element_service->DeleteElementSpec($iid.'_thumbnails_'.$b); } catch(Exception $e) { } } try { $media_element_service->DeleteElementSpec($iid.'_public_files'); } catch(Exception $e) { } for ($b = 0; $b < 32; $b++) { try { $media_element_service->DeleteElementSpec($iid.'_public_files_'.$b); } catch(Exception $e) { } } try { $media_element_service->DeleteElementSpec($iid.'_files'); } catch(Exception $e) { } for ($b = 0; $b < 32; $b++) { try { $media_element_service->DeleteElementSpec($iid.'_files_'.$b); } catch(Exception $e) { } } try { $media_element_service->DeleteElementSpec($iid.'_files_renamer'); } catch(Exception $e) { } try { $media_element_service->DeleteAuthorizerSpec($iid.'_authorizer_publish'); } catch(Exception $e) { } try { $media_element_service->DeleteAuthorizerSpec($iid.'_authorizer_preview'); } catch(Exception $e) { } try { $media_element_service->DeleteElementSpec($iid.'_osde'); } catch(Exception $e) { } try { $media_element_service->DeleteElementSpec($iid.'_osda'); } catch(Exception $e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy($id)\n {\n event(new OpLog($id));\n\n $ret = [\n 'error_code' => 0,\n 'error_message' => ''\n ];\n $server = Servers::find($id);\n if (!$server){\n $ret['error_code'] = -1;\n $ret['error_message'] = '服务器不存在';\n } else {\n\n if (Gate::denies('enter', $server)) {\n abort(403);\n }\n\n if ($server->status != -1 ){\n $server->status = -1;\n if (!$server->save()) {\n $ret['error_code'] = 1;\n $ret['error_message'] = '保存失败';\n }\n }\n }\n\n echo json_encode($ret);\n }", "public function destroy($id)\n {\n return $this->work->srvDestroy($id);\n }", "public function deleteServer ($id) {\n $server = Server::find($id);\n\n if ($server) {\n $server->delete();\n }\n return redirect('servers');\n }", "public function destroy($id)\n {\n $client = Client::find($id);\n $client->delete();\n }", "public function destroy($id)\n {\n return $this->header->srvDestroy($id);\n }", "public function destroy(string $id)\n {\n //\n }", "public\n function destroy($id)\n {\n if (empty($id)) {\n return JsonResponse::create(['error' => '无效参数'], 422);\n }\n $result = GameServerList::whereId((int)$id)->first();\n if (empty($result)) {\n return JsonResponse::create(['error' => '无效ID标识'], 422);\n }\n if ($result->delete()) {\n return JsonResponse::create(['success' => '删除成功']);\n }\n else {\n return JsonResponse::create(['error' => '删除失败'], 422);\n }\n }", "public function destroy($id);", "public function destroy($id);", "public function destroy($id);", "public function destroy($id);", "public function destroy($id);", "public function destroy($id)\n {\n $service = Service::findOrFail($id);\n $server = $service->server;\n $easypanel = new \\Easypanel($server->ip, $server->port, $server->authcode);\n $res = $easypanel->delVh($service->user);\n if($res){\n $service->forceDelete();\n return redirect()->back()->with('success', '删除成功');\n }else{\n return redirect()->back()->withErrors('删除失败');\n }\n }", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy($id) {\n\t\t//\n\t}", "public function destroy( $id ) {\n\t\t//\n\t}", "public function removeServer($id) {\n\t\t$server = $this->dbHandler->getServerById($id);\n\t\t$this->dbHandler->removeServer($id);\n\t\t$event = new GenericEvent($server['url_hash']);\n\t\t$this->dispatcher->dispatch('OCP\\Federation\\TrustedServerEvent::remove', $event);\n\t}", "public function destroy($id)\n {\n // todo\n }", "public function destroy($id)\n {\n //TODO\n }", "public function destroy($id){}", "function delete_server($id) {\n\ttry {\n\t\t$dbh = get_dbh();\n\t\t$stmt = $dbh->prepare('DELETE FROM servers WHERE id = ?');\n\t\t$stmt->execute(array($id));\n\t} catch (PDOException $e) {\n\t\terror(0, 'DB error in save_server: ' . $e->getMessage());\n\t}\n\n\treturn TRUE;\n}", "public function destroy( $id )\n {\n //\n }", "public function destroy( $id )\n {\n //\n }", "public function destroy( $id )\n {\n //\n }", "public static function destroy($id){\n//\t\techo 'destroy'.$id.\"\\n<br>\";\n\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t$query='DELETE FROM php_session WHERE id='.$db->escape($id);\n\t\treturn $db->query($query);\n\t}", "public function deleteFrom($serverName, $id){\n if($server = $this->_serverExist($serverName)){\n $client = new Client();\n try{\n $response = $client->delete($server['url'].$server['crud_prefix'].'/'.$id, [\n 'headers' => [\n 'Authorization' => ($this->token) ? 'Bearer '.$this->token : '',\n ]\n ]);\n }catch(\\Exception $exception){\n return $this->_parseGuzzleException($exception, $server);\n }\n\n $responseJson = json_decode($response->getBody(), true);\n return $responseJson;\n }\n return $this->serverError('Server '.$serverName.' is not listed as available');\n }", "public function destroy($id)\n {\n \n \n }", "public function destroy($id)\n {\n return $this->roomHostService->delete($id);\n }", "public function destroy($id) {\n //\n }", "public function destroy( $id ) {\n\n\t}", "public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function destroy($id)\n {\n //\n dump($id);\n }", "public function destroy($id)\n {\n if ($id == null) return response()->json(['error' => 'ID na url é obrigatória'], 400);\n $ordem_servico = ordem_servico::find($id);\n if ($ordem_servico->delete()) return response()->json(['OK'], 200);\n }", "public function destroy($id)\n {\n Computer::destroy($id);\n return redirect('computers');\n }", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n\t{\n\t\t//\n\t}" ]
[ "0.74786717", "0.72420794", "0.72357404", "0.71735144", "0.69346577", "0.6879666", "0.68487424", "0.6819196", "0.6819196", "0.6819196", "0.6819196", "0.6819196", "0.6817164", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6781569", "0.6777866", "0.6758622", "0.6756901", "0.6744883", "0.672612", "0.67232555", "0.6715271", "0.6715271", "0.671118", "0.6703634", "0.67014426", "0.6693287", "0.6682111", "0.6676775", "0.6674912", "0.6668668", "0.6668668", "0.6668668", "0.6668668", "0.6667013", "0.6664369", "0.6662977", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318", "0.6659318" ]
0.0
-1
insert registers to table
function insertRegs($db,$table,$data):bool { if (is_array($data)){ $columns='';$bindv='';$values=null; foreach ($data as $column => $value) { $columns.='`'.$column.'`,'; $bindv.='?,'; $values[]=$value; } $columns=substr($columns,0,-1); $bindv=substr($bindv,0,-1); $sql="INSERT INTO {$table}({$columns}) VALUES ({$bindv})"; try{ $stmt=$db->prepare($sql); $stmt->execute($values); }catch(PDOException $e){ echo $e->getMessage(); return false; } return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n DB::table('registers')->insert(array(\n\t \t\tarray('name'=>'Sardars Advance'),\n\t \t\tarray('name'=>'Employees Advance'),\n\t \t\tarray('name'=>'Sales Register'), \n\t \t\tarray('name'=>'Employees Salary'), \n\t \t\tarray('name'=>'Sardars Salary'), \n\t \t\tarray('name'=>'Workers Salary'), \n\t \t\t)\n \t);\n }", "public function register(){\n $this->registration->execute([], $this);\n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function register()\n {\n $this->registration->execute([],$this);\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function insert($table);", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function action_register() {\n\t\t\t$this->data[] = 0; // record_id - default for increment\n\t\t\t$this->prepareMainData();\n\t\t\t$model = Model::factory($this->modelName)->registerRecord($this->data);\n\t\t\tif ($model) $this->request->redirect($this->redirectURL);\n\t\t\n\t}", "abstract public function insert();", "public function insert($loyPrg);", "public abstract function insert();", "public function register()\n\t{\n\t\t$post = $this->input->post();\n\t\tdate_default_timezone_set('Asia/Jakarta');\n\t\t$now = date('Y-m-d H:i:s');\n\n\t\t$ins['nip'] = $post['nip'];\n\t\t$ins['nama'] = $post['nama'];\n\t\t$ins['email'] = $post['email'];\n\t\t$ins['nohp'] = $post['nohp'];\n\t\t$ins['password'] = md5($post['password']);\n\t\t$this->db->set('createtime', $now);\n\t\t$this->db->insert('mst_user', $ins);\n\t}", "public function inserir()\n {\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "public function InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores)\r\n {\r\n \r\n \r\n\t//$sql=\"INSERT INTO `$this->database`.`$tabla` ( `Fecha`, `Movimiento`, `Detalle`, `idDocumento`, `Cantidad`, `ValorUnitario` , `ValorTotal`, `$idProductoTabla`)\r\n\t//VALUES ( '$fecha','$Movimiento','$Detalle','$idDocumento','$Cantidad','$ValorUnitario','$ValorTotal','$idProducto')\";\r\n\t\r\n\t\r\n\t$sql=\"INSERT INTO `$this->database`.`$tabla` (\";\r\n\t$fin=$NumRegistros-1;\r\n\tfor($i=0;$i<$NumRegistros;$i++){\r\n\t\t$col=$Columnas[$i];\r\n\t\t$reg=$Valores[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"`$col`,\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"`$col`)\";\r\n\t}\r\n\t$sql=$sql.\"VALUES (\";\r\n\t\r\n\tfor($i=0;$i<$NumRegistros;$i++){\r\n\t\t\r\n\t\t$reg=$Valores[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"'$reg',\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"'$reg')\";\r\n\t}\r\n\t\r\n\t//print_r($sql);\r\n\tmysql_query($sql, $this->con) or die(\"no se pudo ingresar el registro en la tabla $tabla: \" . mysql_error());\t\r\n\t//return(1);\r\n\t\r\n}", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function insert(...$field_values);", "public function insertRow($row);", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insert()\n {\n $this->id = insert($this);\n }", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "public function insert() {\n \n }", "public function insert($table, array $data);", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "public abstract function Insert();", "public static function insert()\n {\n }", "public function insert(registroEquipo $reEquipo);", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}", "public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\n }", "public function insertNextRegisterId($Reg_id){\n\t\t$data['value'] = ($Reg_id + 1);\n\t\t$this->db->where('next_id', 'register_id');\n\t\t$this->db->update('nextid', $data);\n\t}", "function registerToDatabase() {\n\t\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t\t$this->conn = connectToDb(\"db_avalanche_store\");\n\n\t\t\t$add_query = \"INSERT INTO tbl_dev_info \n\t\t\t(user_id, \n\t\t\t dev_name,\t\n\t\t\t dev_desc) \n\t\t\tVALUES \n\t\t\t('$this->dev_id', \n\t\t\t '$this->dev_name',\t\n\t\t\t '$this->dev_description');\";\n\n\t\t\t$result = $this->conn->query($add_query);\n\n\t\t\t$this->conn->close();\n\n\t\t\tif (!$result) return false;\n\n\t\t\treturn true;\n\t\t}", "public function insert($table, array $fields);", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "public function bulkInsert()\n {\n DB::table($this->dbTable)\n ->insert($this->insertUpdateArray);\n }", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "public function insert($cbtRekapNilai);", "function insert() {\n\t \n\t \t$sql = \"INSERT INTO evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function insert($tarConvenio);", "public function insert($perifericos);", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_person_detail (psd_ps_id, psd_dp_id, psd_tax_no, psd_id_card_no, psd_passport_no, psd_picture, psd_blood_id, psd_reli_id, psd_nation_id, psd_race_id, psd_psst_id, psd_birthdate, psd_birth_pv_id, psd_gd_id, psd_account_no, psd_ba_id, psd_facebook, psd_twitter, psd_website, psd_email, psd_cellphone, psd_phone, psd_ex_phone, psd_work_phone, psd_lodge_id, psd_lodge_no, psd_lodge_phone, psd_addcur_no, psd_addcur_pv_id, psd_addcur_amph_id, psd_addcur_dist_id, psd_addcur_zipcode, psd_addhome_no, psd_addhome_pv_id, psd_addhome_amph_id, psd_addhome_dist_id, psd_addhome_zipcode)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id, $this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "protected function saveInsert()\n {\n }", "private function register()\n {\n $s = 'INSERT INTO `users` (`project`, `authService`, `authServiceID`, `vcs_login`, `email`, `anonymousIdent`, `conf`, `last_connect`) VALUES (\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\", now())';\n $params = array($this->project, $this->authService, $this->authServiceID, $this->vcsLogin, $this->email, $this->anonymousIdent, json_encode($this->defaultConf));\n\n $this->conn->query($s, $params);\n return $this->conn->insert_id();\n }", "public function insert($data);", "protected function _insert()\n\t{\n\t}", "public function insertUser(RegisterData $registerData): int;", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "function insertTableRow($tableName)\n{\n\n if ($tableName == \"userdata\") {\n global $errorRegister, $errorFirstName, $errorLastName, $errorEmail, $errorPassword, $errorPassword, $errorPasswordRepeat, $errorRegister, $errorAGBCheckbox;\n\n $errorRegister = $errorFirstName = $errorLastName = $errorEmail = $errorPassword = $errorPasswordRepeat = $errorAGBCheckbox = $firstnameInput = $lastnameInput = $emailInput = $passwordInput = $passwordRepeatInput = $checkboxInput = \"\";\n if (!isset($_POST['agbCheckboxRegisterAdmin'])) {\n $_POST['agbCheckboxRegisterAdmin'] = \"\";\n }\n\n $tokenClass = new token();\n $xsrfType = \"AdminNewUserForm\";\n\n $firstnameInput = sanitize_input(ucfirst($_POST['firstnameRegisterAdmin']));\n $lastnameInput = sanitize_input(ucfirst($_POST['lastnameRegisterAdmin']));\n $emailInput = sanitize_input($_POST['emailRegisterAdmin']);\n $passwordInput = sanitize_input($_POST['passwordRegisterAdmin']);\n $passwordRepeatInput = sanitize_input($_POST['passwordRepeatRegisterAdmin']);\n $checkboxInput = $_POST['agbCheckboxRegisterAdmin'];\n\n $validation = new validation();\n $registrationValidation = $validation->validRegister($firstnameInput, $lastnameInput, $emailInput, $passwordInput, $passwordRepeatInput, $checkboxInput);\n\n if ($registrationValidation == true) {\n $data = database::getConnections()->view(\"userdata\", \"email=:email\", [':email' => $emailInput]);\n if ($data == false) {\n if (($tokenData = $tokenClass->checkXSRFToken($_POST[\"xsrfToken\"])) == true) {\n $password_hash = password_hash($passwordInput, PASSWORD_DEFAULT);\n $ipAddress = get_client_ip();\n\n if (database::getConnections()->insertRegisterUserData(\"userdata\", $firstnameInput, $lastnameInput, $emailInput, $password_hash) == true) {\n $data = database::getConnections()->view(\"userdata\", \"email=:email\", [':email' => $emailInput]);\n if (database::getConnections()->insertRegisterUserInfo(\"userinfo\", $data[\"id\"], $ipAddress) == true) {\n echo '<p class=\"success\">Sie wurden erfolgreich registriert!</p>';\n }\n } else {\n echo $errorSearch = '<p class=\"error\">Beim Anlegen Ihres Accounts ist ein fehler aufgetreten! Versuchen Sie es erneut!</p>';\n }\n\n $tokenClass->deleteXSRFToken($tokenData[\"id\"], $xsrfType);\n\n // Es wird ein Token erstellt zum Aktivieren des Accounts, dieser wird auch hochgeladen in die \"token\" Tabelle\n $xsrfTypeRegisterActivate = \"RegisterAccountActivate\";\n $xsrfExpiresRegisterActivate = date(\"Y-m-d H:i:s\", strtotime(date(\"Y-m-d H:i:s\") . \" +1440 minutes\")); // 24 Stunden (1 Tage)\n $xsrfTokenRegisterActivate = $tokenClass->generateXSRFToken();\n database::getConnections()->tokenInsert($xsrfTokenRegisterActivate, $xsrfTypeRegisterActivate, $xsrfExpiresRegisterActivate, $data[\"id\"]);\n\n // Schreibe dem User eine E-Mail mit allen Registrierungsdaten und dem Aktivierungslink\n $newMail = new mail();\n $newMail->registerAccountDataMail($emailInput, $firstnameInput, $lastnameInput, $ipAddress, $xsrfTokenRegisterActivate, $data[\"id\"]);\n\n // ACHTUNG! //// ACHTUNG! //// ACHTUNG! //// ACHTUNG! //// ACHTUNG! //// ACHTUNG! //// ACHTUNG! //\n // Diese zwei Links hier unten drunter sind nur dafür da, für die Entwicklung, also wenn man keine E-Mail enthalten kann\n global $errorSearch;\n $errorSearch = '<a href=\"http://localhost:8888/Boost-Your-Life/resources/login.php?token=' . $xsrfTokenRegisterActivate . '&id=' . $data[\"id\"] . '\">Klicken Sie hier um Ihren Account zu aktivieren! (Dieser Link besteht nur, weil man über MAMP keine E-Mails verschicken kann!)</a>';\n\n // Free Googie Host Server\n // $errorSearch = '<a href=\"http://boost-your-life.thats.im/resources/login.php?token=' . $xsrfTokenRegisterActivate . '&id=' . $data[\"id\"] . '\">Klicken Sie hier um Ihren Account zu aktivieren! (Dieser Link besteht nur, weil man bei dem Kostenlosen Server sehr oft keine E-Mails bekommt und es auch ein E-Mail Limit gibt!)</a>';\n } else {\n global $errorSearch;\n echo $errorSearch = '<p class=\"error\">Bitte versuchen Sie es nach einem Refresh erneut! Wenn nach dem Refresh das Problem immer noch besteht, so wenden Sie sich bitte an den Support ===> support@boost-your-life.de</p>';\n }\n } else {\n global $errorSearch;\n echo $errorSearch = '<p class=\"error\">Diese E-Mail Adresse ist schon vergeben, bitte eine andere eingeben!</p>';\n }\n } elseif ($registrationValidation == false || $data == true || $tokenData == false) {\n global $errorEmail, $errorRegister;\n echo $form = '<div class=\"formAdminRegister\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"tableName\" value=\"user\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $_POST[\"xsrfToken\"] . '\">\n <div>\n <div>' . $errorRegister . '</div>\n <h1>Registrieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"firstnameRegisterAdmin\">Vorname:</label>\n <input type=\"text\" name=\"firstnameRegisterAdmin\" id=\"firstnameRegisterAdmin\" placeholder=\"Vorname\" title=\"Beispiel = Manfred Müller\" autofocus maxlength=\"75\" value=\"' . $firstnameInput . '\">\n <div>' . $errorFirstName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"lastnameRegisterAdmin\">Nachname:</label>\n <input type=\"text\" name=\"lastnameRegisterAdmin\" id=\"lastnameRegisterAdmin\" placeholder=\"Nachname\" title=\"Beispiel = Trautmann-Neuhagen\" maxlength=\"75\" value=\"' . $lastnameInput . '\">\n <div>' . $errorLastName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"emailRegisterAdmin\">Email Adresse:</label>\n <input type=\"email\" name=\"emailRegisterAdmin\" id=\"emailRegisterAdmin\" placeholder=\"E-Mail Adresse\" title=\"Beispiel = max-Mustermann123@gmail.com\" maxlength=\"255\" value=\"' . $emailInput . '\">\n <div>' . $errorEmail . '</div>\n </div>\n <div class=\"field\">\n <label for=\"passwordRegisterAdmin\">Passwort:</label>\n <input type=\"password\" name=\"passwordRegisterAdmin\" id=\"passwordRegisterAdmin\" placeholder=\"Passwort\" title=\"Das Passwort muss einen klein und groß Buchstaben, eine Zahl und ein Sonderzeichen enthalten\" autocomplete=\"off\" maxlength=\"100\">\n <div>' . $errorPassword . '</div>\n </div>\n <div class=\"field\">\n <label for=\"passwordRepeatRegisterAdmin\">Passwort wiederholen:</label>\n <input type=\"password\" name=\"passwordRepeatRegisterAdmin\" id=\"passwordRepeatRegisterAdmin\" placeholder=\"Passwort wiederholen!\" title=\"Das Passwort muss wiederholt werden!\" autocomplete=\"off\" maxlength=\"100\">\n <div>' . $errorPasswordRepeat . '</div>\n </div>\n <div class=\"field\">\n <label for=\"agbCheckboxRegisterAdmin\">\n <input type=\"checkbox\" name=\"agbCheckboxRegisterAdmin\" id=\"agbCheckboxRegisterAdmin\"><a class=\"agbDatenschutzLink\" href=\"agb.php\">AGB</a> & <a class=\"agbDatenschutzLink\" href=\"datenschutz.php\">DATENSCHUTZBESTIMMUNGEN</a> Akzeptieren\n </label>\n <div>' . $errorAGBCheckbox . '</div>\n </div>\n <br>\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Registrieren\">\n </form></div><br>';\n }\n } else {\n\n $errorSections = $errorRegister = $errorTitle = $errorDescription = $errorTextMessage = $errorSoundcloudLink = $errorYouTubeLink = $errorAGBCheckbox = \"\";\n global $newUser, $userid, $errorTextMessage, $errorRegister, $errorTitle, $errorDescription, $errorSoundcloudLink, $errorYouTubeLink, $errorAGBCheckbox, $errorSections;\n\n $tokenClass = new token();\n $xsrfType = \"AdminNewNLPForm\";\n\n $author = $newUser->userFirstName . \" \" . $newUser->userLastName;\n $titleInput = sanitize_input(ucfirst($_POST['title']));\n $descriptionInput = sanitize_input(ucfirst($_POST['description']));\n $textInput = sanitize_input($_POST['text']);\n $soundcloudInput = sanitize_input($_POST['soundcloudLink']);\n $youtubeInput = sanitize_input($_POST['youtubeLink']);\n $checkboxInput = $_POST['agbCheckbox'];\n $genreInput = $_POST['genre'];\n\n $validation = new validation();\n $registrationValidation = $validation->validRegisterNLP($titleInput, $descriptionInput, $textInput, $genreInput, $soundcloudInput, $youtubeInput, $checkboxInput);\n\n if ($registrationValidation == true) {\n $data = database::getConnections()->view(\"nlp\", \"userid\");\n if ($data == true) {\n if (($tokenData = $tokenClass->checkXSRFToken($_POST[\"xsrfToken\"])) == true) {\n\n require_once '../functions/imageUpload.php';\n\n // Es wird geschaut ob ein Bild hochgeladen wurde\n if (!$_FILES['appImage']['size'] == 0) {\n $unlink = \"\";\n $bildFunktion = imageUploads(\"insert\", \"Nlp\", $userid, $id, $unlink);\n\n // Wenn das Bild erfolgreich hochgeladen wurde, dann lade die NLP Übung mit den Inhalten hoch\n if ($bildFunktion == false) {\n if (database::getConnections()->insertDataNLP(\"nlp\", $userid, $author, $genreInput, $titleInput, $descriptionInput, $textInput, $soundcloudInput, $youtubeInput) == true) {\n global $errorSearch;\n $errorSearch = '<p class=\"success\">Die NLP Übung wurde erfolgreich angelegt!</p>';\n\n $nlpData = database::getConnections()->view(\"nlp\", \"userid=:userid ORDER BY uploaded DESC LIMIT 1\", [':userid' => $userid]);\n $imageData = database::getConnections()->view(\"images\", \"userid=:userid ORDER BY uploaded DESC LIMIT 1\", [':userid' => $userid]);\n\n database::getConnections()->updateNlpImageID($nlpData[\"id\"], $imageData[\"id\"]);\n\n // $nlpData = database::getConnections()->view(\"nlp\", \"userid=:userid ORDER BY uploaded DESC LIMIT 1\", [':userid' => $userid]);\n\n // database::getConnections()->updateNlpImageID($nlpData[\"id\"], $userid);\n } else {\n global $errorSearch;\n $errorSearch = '<p class=\"error\">Beim Anlegen der NLP Übung ist ein fehler aufgetreten!</p>';\n }\n $tokenClass->deleteXSRFToken($tokenData[\"id\"], $xsrfType);\n }\n\n } else {\n global $errorImage;\n $errorImage = '<p class=\"errorMessages\">Bitte wählen Sie ein Bild aus!</p>';\n }\n\n } else {\n global $errorRegister;\n $errorRegister = '<p class=\"errorMessages\">Bitte versuchen Sie es nach einem Refresh erneut! Wenn nach dem Refresh das Problem immer noch besteht, so wenden Sie sich bitte an den Support = support@web.de</p>';\n }\n }\n } elseif ($registrationValidation == false || $data == false || $tokenData == false || $bildFunktion == true || $_FILES['appImage']['size'] == 0) {\n global $errorRegister, $errorImage;\n echo '<div class=\"formAdminRegister\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"tableName\" value=\"nlp\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $_POST[\"xsrfToken\"] . '\">\n <div>\n <div>' . $errorRegister . '</div>\n <h1>Importieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"nlpImage\">Übungsbild:</label>\n <input type=\"file\" required accept=\"image/*\" name=\"appImage\" id=\"nlpImage\">\n <div>' . $errorImage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"title\">Titel:</label>\n <input type=\"text\" name=\"title\" id=\"title\" placeholder=\"Titel\" autofocus maxlength=\"45\" value=\"' . $titleInput . '\">\n <div>' . $errorTitle . '</div>\n </div>\n <div class=\"field\">\n <label for=\"description\">Beschreibung:</label>\n <input type=\"text\" name=\"description\" id=\"description\" placeholder=\"Beschreibung\" maxlength=\"200\" value=\"' . $descriptionInput . '\">\n <div>' . $errorDescription . '</div>\n </div>\n <div class=\"field\">\n <label for=\"text\">Text:</label>\n <textarea name=\"text\" id=\"text\" placeholder=\"Text\" rows=\"4\" cols=\"60\">' . $textInput . '</textarea>\n <div>' . $errorTextMessage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Genre:</label>\n <select class=\"\" name=\"genre\" id=\"genre\">\n\t\t\t\t <optgroug name=\"genre\" id=\"genre\">\n <option value=\"' . $genreInput . '\" disabled selected>Wähle aus!</option>\n <option value=\"A\">A</option>\n <option value=\"B\">B</option>\n <option value=\"C\">C</option>\n <option value=\"D\">D</option>\n <option value=\"E\">E</option>\n <option value=\"F\">F</option>\n <option value=\"G\">G</option>\n\t\t\t\t </optgroup>\n </select>\n <div>' . $errorSections . '</div>\n </div>\n <div class=\"field\">\n <label for=\"soundcloudLink\">Soundcloud Link/SRC:</label>\n <input type=\"url\" name=\"soundcloudLink\" id=\"soundcloudLink\" placeholder=\"Soundcloud Link\" maxlength=\"255\" value=\"' . $soundcloudInput . '\">\n <div>' . $errorSoundcloudLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"youtubeLink\">YouTube Link/SRC:</label>\n <input type=\"url\" name=\"youtubeLink\" id=\"youtubeLink\" placeholder=\"YouTube Link\" maxlength=\"255\" value=\"' . $youtubeInput . '\">\n <div>' . $errorYouTubeLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"agbCheckbox\">\n <input type=\"checkbox\" name=\"agbCheckbox\" id=\"agbCheckbox\"><a class=\"agbDatenschutzLink\" href=\"agb.php\">AGB</a> & <a class=\"agbDatenschutzLink\" href=\"datenschutz.php\">DATENSCHUTZBESTIMMUNGEN</a> Akzeptieren\n </label>\n <div>' . $errorAGBCheckbox . '</div>\n </div>\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Importieren\">\n </form></div><br>';\n }\n\n }\n\n}", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "function fillTable(): void\n{\n $sql = '\n SET autocommit=0; \n SET unique_checks=0;\n SET foreign_key_checks=0;\n INSERT INTO `products` (name, price, color) VALUES ' . generateTableData(1000001) . ';\n SET unique_checks=1;\n SET foreign_key_checks=1;\n COMMIT;\n ';\n\n DB::getInstance()->query($sql);\n}", "public function insert(Table $table, $row);", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "protected function fillTable()\n {\n $names = [\n 'Anna', 'Betty', 'Clara', 'Donna', 'Fiona',\n 'Gertrude', 'Hanna', 'Ione', 'Julia', 'Kara',\n ];\n\n $stm = \"INSERT INTO {$this->table} (name) VALUES (:name)\";\n foreach ($names as $name) {\n $this->connection->perform($stm, ['name' => $name]);\n }\n }", "public function insert($gunBbl);", "function insertRow($table, $names, $values) {\n return mysql_query(sprintf('INSERT INTO %s (`%s`) VALUES (\"%s\")', $table, $names, $values));\n }", "public function insert()\n {\n \n }", "public function register($data)\n {\n $this->db->insert('user', $data);\n // $this->db->affected_rows();\n //else send back to register page\n }", "function registrar(){\r\n\r\n include('config.php');\r\n\r\n date_default_timezone_set('America/Cuiaba');\r\n $pdo = new PDO('mysql:host='.HOST.';dbname='.DATABASE, USUARIO, SENHA);\r\n\r\n $cursos = array('Engenharia da Computação', 'Engenharia de Controle e Automação', 'Engenharia de Minas', 'Engenharia de Trasportes', 'Engenharia Quimica');\r\n \r\n $nome = $_POST['nome'];\r\n $email = $_POST['email'];\r\n $rga = $_POST['rga'];\r\n $semestre = $_POST['semestre']; \r\n $data = date('Y-m-d H:i:s');\r\n $senha = $_POST['senha'];\r\n $confirmaSenha = $_POST['confirmaSenha'];\r\n $curso = '';\r\n \r\n for($i = 1; $i <= 5; $i++){ //verificando qual o curso pelo rga\r\n\r\n if($rga['9'] == $i)\r\n $curso = $cursos[$i];\r\n \r\n \r\n }\r\n \r\n\r\n $sql = $pdo->prepare(\"INSERT INTO `tabela_estudantes` VALUES (null,?,?,?,?,?,?,?)\"); //inserirndo na tabela vendas\r\n\r\n $sql->execute(array($nome, $senha, $data, $email, $curso, $semestre, $rga));\r\n\r\n echo '<h6 style=\"color: rgb(255, 255, 255);\">Usuario registrado com sucesso!</h6>';\r\n\r\n }", "function insert ($tablename, $newRow) \n\t{\n\t\t$lockfp = $this->getLock($tablename);\t\t\t\n\t\t$this->tables[$tablename][] = $newRow;\n\t\t$this->writeTable($tablename);\n\t\t$this->releaseLock($lockfp);\n\t}", "function insertarPuertos($puerto,$bandera,$refdestinos) {\r\n$sql = \"insert into tbpuertos(idpuerto,puerto,bandera,refdestinos)\r\nvalues ('','\".($puerto).\"','\".($bandera).\"',\".$refdestinos.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "function insert($table,$data){\n\t\t$j=0;\n\t\t$c=count($data);\n\t\tforeach($data as $key=>$value){\n\t\t\t$j++;\n\t\t\tif($c==$j){\n\t\t\t\t$line_1.='`'.$key.'`';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"'\";\n\t\t\t} else {\n\t\t\t\t$line_1.='`'.$key.'`, ';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tINSERT INTO `$table`\n\t\t\t(\".$line_1.\") VALUES\n\t\t\t(\".$line_2.\")\n\t\t\");\n\t\treturn $r;\n\t}", "function register($firstname, $lastname, $birthday, $address, $town, $postal_code, $telephone, $email, $credit_card, $username, $password){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn -> prepare('INSERT INTO `clients` (`id`, `username`, `password`, `firstname`, `lastname`, `email`, `birthday`, `address`, `town`, `postal_code`, `telephone`, `credit_card`, `is_admin`) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)');\n\t\t$sth \t-> execute(array($username, $password, $firstname, $lastname, $email, $birthday, $address, $town, $postal_code, $telephone, $credit_card));\n\t}", "public function insert($table_name, $fields_values = array())\r\n {\r\n }", "function userRegister($account_id,$cellphone,$password,$nickname)\n {\n $query=$this->db->query(\"insert into xl_account(id,cellphone,password,register_user,nickname) values('{$account_id}','{$cellphone}','{$password}',1,'{$nickname}')\");\n if ($this->db->affected_rows() > 0) {\n # if register success, return true\n return TRUE;\n }\n\n return FALSE;\n }", "function add($table,$values){\n $conn=connectDB();\n $query=\"INSERT INTO $table VALUES ($values)\";\n //print($query);\n $conn->query($query);\n }", "public function insert(array $params);", "public function run()\n {\n \n\n \\DB::table('registers')->delete();\n \n \\DB::table('registers')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'cuenta' => 107503000017,\n 'destinatario' => 'AYRE TEGUCIGALPA SA',\n 'direccion' => 'BARRIO CONCEPCION',\n 'municipio' => 'COMAYAGUELA',\n 'departamento' => 'FRANCISCO MORAZAN',\n 'ruta' => 'C1',\n 'status' => 'ENTREGADO',\n 'recibe' => 'MIGUEL ANGEL MONCADA',\n 'banco' => 83985,\n 'created_at' => '2017-11-27 17:25:26',\n 'updated_at' => '2017-11-27 17:25:29',\n ),\n ));\n \n \n }", "public function insert(array $data);", "public function insert(array $data);", "function insert($table, $columns);", "public function insert($tableName, $data);", "function createRegistrationUsers($regID, $userid)\n {\n $data['registrationID'] = $regID;\n\n //get the user ids of whoever just registered.\n $data['userID'] = $userid; //user ids\n\n // to test for sql query\n //$sql = $this->db->set($data)->get_compiled_insert('pt_registration_users');\n $this->db->insert('pt_registration_users', $data);\n \n //echo $sql;\n \n }", "function insert_unregister_user($id,$cellphone)\n {\n $query=$this->db->query(\"INSERT INTO xl_account(id,cellphone,register_user) VALUES ('{$id}','{$cellphone}',0)\");\n \n if ($this->db->affected_rows()>0) \n {\n return TRUE;\n }\n \n return FALSE;\n\n }", "public function registerUser($data,$table)\n {\n return $this->db->insert($table,$data);\n }", "public function register()\n\t{\n\t\t//validate that all fields are filled and proper\n\t\t$errors = $this->validate();\n\t\tif ($errors != NULL)\n\t\t\treturn $errors;\n\t\t\n\t\t//insert task into database\n\t\t$dbhandle = db_connect();\n\t\t$stmt = $dbhandle->stmt_init();\n\t\t\n\t\t$stmt->prepare(\"INSERT INTO Tasks\n\t\t(\n\t\t\tTitle,\n\t\t\tDescription, \n\t\t\tLocation,\n\t\t\tCategory,\n\t\t\tTags,\n\t\t\tEndDateTime,\n\t\t\tLister,\n\t\t\tNumImages,\n\t\t\tInformation,\n\t\t\tInitialBid,\n\t\t\tActive\n\t\t) \n\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)\");\n\t\t$stmt->bind_param(\"sssisiiisi\", $this->title, $this->description, $this->location, $this->category, $this->tags, $this->enddatetime, $this->userid, $this->numimg, $this->content, $this->price);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t\n\t\t$this->taskid = $dbhandle->insert_id;\n\t\t\n\t\t//close connection and return 0\n\t\t$stmt->close();\n\t\t$dbhandle->close();\n\t\treturn NULL;\n\t}", "public static function Insert(){\r\n }", "function register_user($new) {\n \n $this->db->insert('users', $new);\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function registra_sesion()\r\n {\r\n $datos_usuario = array(\r\n 'nom_usuario' => $this->session->userdata('nom_usuario'),\r\n 'id_perfil' => $this->session->userdata('id_perfil')\r\n );\r\n // $insert_id = $this->db->insert_id();\r\n // $IdSesion = $this->db->insert_id();\r\n $this->db->insert('sesiones',$datos_usuario);\r\n // $this->db->insert(userdata($IdSesion));\r\n }", "function register_user($register_data){\n\tarray_walk($register_data,'array_sanitize');\n\t$register_data['password']=md5($register_data['password']);\n\t//print_r($register_data);\n\t\n\t$fields='`'.implode('`,`',array_keys($register_data)).'`';\n\t//echo $fields;\n\t$data='\\''.implode('\\',\\'',$register_data).'\\'';\n\t//echo $data;\n\t\n\t//echo \"INSERT INTO `cwusers` ($fields) VALUES ($data)\";\n\t//die();\n\tmysql_query(\"INSERT INTO `cwusers` ($fields) VALUES ($data)\");\n}", "public function insert_data_reservasi($data)\n\t {\n\t\t$this->db->insert('tbb_reservasi', $data); \n\t }", "public function run()\n {\n DB::table('enregistrement_sieges')->insert([\n 'num_enregistrement'=>2,\n 'num_siege'=>1,\n // 'id_siege' =>1,\n \n ]); \n\n\n\n \n }", "public function insert($connection, $table, $rows);", "function registerUser($data){\n\t\t\tprint($this->db->insert('users', $data));\n\t\t}", "public function registrar(array $data)\n {\n \n $password = password_hash($data['password'], PASSWORD_DEFAULT);\n \n foreach($data as $pos => $valor)\n {\n if(!property_exists($this->class, $pos))\n unset($data[$pos]);\n }\n \n $data['password'] = $password;\n $data['created_at'] = date('Y-m-d H:i:s');\n \n $query = \"INSERT INTO \" . $this->table . \" (\";\n\n foreach($data as $prop => $value){\n\n $query .= \" $prop,\";\n }\n\n $query = substr($query, 0, -1);\n\n $query .= \" ) VALUES (\";\n\n foreach($data as $prop => $value){\n\n $query .= \" :$prop,\";\n }\n\n $query = substr($query, 0, -1);\n\n $query .= \" );\";\n\n $db = DBConnection::getConnection();\n \n $stmt = $db->prepare($query);\n $exito = $stmt->execute($data);\n\n if(!$exito) {\n throw new Exception('No se pudo crear el Registro');\n }\n }", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "public function insert($table, $data) {\n\t\t$fields = $values = array();\n\n\t\tforeach ($data as $key => $val) {\n\t\t\t$fields[] = $this->escape_identifiers($key);\n\t\t\t$values[] = $this->escape($val);\n\t\t}\n\n\t\treturn $this->_insert($this->protect_identifiers($table, NULL, FALSE), $fields, $values);\n\t}", "public function insert($registro){\r\n foreach ($registro as $i => $v) {\r\n \r\n if($i != 'telefone_resp'){\r\n \r\n if($i == 'usuario_resp'){\r\n $v == 'sim' ? $v=1 : $v=0;\r\n }\r\n \r\n $lar_temp[$i] = $v;\r\n }\r\n else{\r\n break;\r\n }\r\n\r\n }\r\n \r\n\r\n //$this->db->trans_strict(TRUE);\r\n\r\n var_dump($lar_temp);\r\n\r\n //montando as query's de inserção do banco de dados e suas transações\r\n $this->db->trans_start(); \r\n\r\n $this->db->insert('lar_temp',$lar_temp);\r\n $id_lar_temp = $this->db->select_max('id')\r\n ->get('lar_temp')\r\n -> result_array();\r\n \r\n if(!$lar_temp['usuario_resp']){\r\n\r\n for($i = 0; $i < sizeof($registro['nome_resp']); $i++) {\r\n $this->db->query(\"INSERT INTO responsavel (`nome`) VALUES ('\".$registro['nome_resp'][$i].\"')\");\r\n $id_resp = $this->db->select_max('id')\r\n ->get('responsavel')\r\n -> result_array();\r\n $this->db->query(\"INSERT INTO telefone_responsavel (`n_telefone`,`cod_responsavel`) VALUES ('\".$registro['telefone_resp'][$i].\"',\".$id_resp[0]['id'].\")\");\r\n\r\n\r\n $this->db->query(\"INSERT INTO lar_temp_resp (`cod_responsavel`, `cod_lar_temp`) VALUES (\".$id_resp[0]['id'].\",\".$id_lar_temp[0]['id'].\")\");\r\n }\r\n\r\n }\r\n\r\n $this->db->trans_complete();\r\n\r\n if($this->db->trans_status() == FALSE){ \r\n log_message('ERROR',\"Ocorreu algum problema na execução das Transações entre as tabelas!\");\r\n return FALSE;\r\n }\r\n else{\r\n return TRUE;\r\n }\r\n\t\t\r\n }", "public function register_array($register_array){\n\n\n\t$fields = '`'.implode('`,`', array_keys($register_array)).'`';\n\n\t$data = '\\''.implode('\\', \\'', $register_array) . '\\'';\n\n\t\t $this->query(\"INSERT INTO `users`($fields) VALUES ($data)\");\n\n\t\t return true;\n\t}" ]
[ "0.66050667", "0.62555635", "0.62439764", "0.6176819", "0.615584", "0.6134541", "0.6065163", "0.604952", "0.60074854", "0.60045725", "0.6003256", "0.59707016", "0.5969477", "0.59405", "0.59388316", "0.59245545", "0.5918401", "0.5907464", "0.590541", "0.588585", "0.58848625", "0.5875386", "0.5874961", "0.5874835", "0.5863979", "0.5853723", "0.5849219", "0.5841223", "0.58384925", "0.58361286", "0.58352846", "0.5816132", "0.58101344", "0.5802529", "0.5797774", "0.57960576", "0.57946783", "0.57925224", "0.5785944", "0.5760359", "0.5733826", "0.5731504", "0.5729783", "0.5724556", "0.5718113", "0.5717738", "0.571432", "0.57051504", "0.5697373", "0.569413", "0.5689481", "0.5685157", "0.5684054", "0.567948", "0.5679148", "0.5679148", "0.567115", "0.5669944", "0.56687933", "0.56672895", "0.5667148", "0.5661843", "0.5661843", "0.5661757", "0.5657065", "0.56459165", "0.5640888", "0.5628624", "0.56261003", "0.562203", "0.5620576", "0.56205183", "0.5619674", "0.56155825", "0.5612524", "0.5603855", "0.5603422", "0.5602845", "0.5594321", "0.5594321", "0.55912477", "0.5588068", "0.5586711", "0.5577268", "0.55747247", "0.5574533", "0.5571946", "0.5564701", "0.55557704", "0.5548769", "0.55385554", "0.5536573", "0.553268", "0.55265105", "0.55206025", "0.5504338", "0.5500289", "0.5497395", "0.5491078", "0.5490374" ]
0.5830272
31
Checks if incoming message array is in src format
private function isSpinel($hexArray) { if(!isset($hexArray[1])) throw new Exceptions\IncompleteMessageException("Message with only four bits."); return $hexArray[0] == $this->prefix[0] && $hexArray[1] == $this->prefix[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSourceFormat()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function isSource();", "public function canConvertFrom($source, $targetType) {\n\t\treturn (isset($source['type']) && $source['type'] === 'plupload');\n\t}", "public function validateSource() {\n\t\treturn true;\n\t}", "public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function hasSrc()\n {\n return $this->get(self::SRC) !== null;\n }", "function isAttach1Valid(Array &$input) {\n return false;\n }", "function isAttach2Valid(Array &$input) {\n return false;\n }", "protected function isUnisaFile($src)\n {\n return str_contains($src, 'unisaonline.net');\n }", "protected final function CheckFormat(&$data)\n {\n if ($data[1] != \"Receiver\" && $data[2] != \"Transmitter\") \n ExHandler::Error500(\"Vue files must contain 'Receiver' and 'Transmitter' in cells B:1 and C:1 respectively.\");\n }", "public function hasSource() : bool;", "function cemhub_is_an_allowed_external_campaign_source_id($campaing_source_id, $webform_node_id) {\n $webform_settings = cemhub_get_integrated_webform_settings_by_node_id($webform_node_id);\n $allowed_external_campaign_sources = list_extract_allowed_values($webform_settings->external_campaign_source, 'list_text', FALSE);\n\n return in_array($campaing_source_id, $allowed_external_campaign_sources);\n}", "function check_image_type_array($source_pic)\n{\n switch ($source_pic) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "protected function isBase64($src)\n {\n return preg_match(\"/data\\:/\", $src);\n }", "public function isValidSource($source) {\nif ($source['name']=='livewhale') {\n\treturn true;\n};\nif (!empty($source['host']) && !empty($source['username']) && !empty($source['password']) && !empty($source['database'])) {\n\treturn true;\n}\nelse {\n\t$this->error='Source must specify a minimum of: host, username, password, database';\n\treturn false;\n};\n}", "private function checkSourceFormat(array $params, array &$errorsBag):void\n {\n if (empty($params['sourceFormat'])) {\n $this->addActionValidationError($errorsBag, 'missing_field_sourceFormat');\n }\n\n if (isset($params['sourceFormat']) && !in_array($params['sourceFormat'], self::FEATURES_SOURCE_FORMATS)) {\n $this->addActionValidationError($errorsBag, 'invalid_sourceFormat');\n }\n }", "public function hasSource(){\n return $this->_has(37);\n }", "public function hasSourceUri(){\n return $this->_has(7);\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "public function hasSourceUri(){\n return $this->_has(5);\n }", "private function checkSourceDataValues(array $params, array &$errorsBag)\n {\n if (!empty($params['sourceFormat'])) {\n if ($params['sourceFormat'] === 'inline') {\n $this->checkSourceDataInlineNegativeNumbers($params['sourceData'], $errorsBag);\n }\n if ($params['sourceFormat'] === 'blob') {\n $this->checkSourceDataBlobFile($params['sourceData'], $errorsBag);\n }\n }\n }", "private function checkSourceMimeType()\n {\n $fileMimeType = $this->getMimeTypeOfSource();\n if (is_null($fileMimeType)) {\n throw new InvalidImageTypeException('Image type could not be detected');\n } elseif ($fileMimeType === false) {\n throw new InvalidImageTypeException('File seems not to be an image.');\n } elseif (!in_array($fileMimeType, self::$allowedMimeTypes)) {\n throw new InvalidImageTypeException('Unsupported mime type: ' . $fileMimeType);\n }\n }", "public static function validate($source, $config = array()) {\n if (is_array($config)) {\n if (isset($config['mime']) && is_array($config['mime']) && sizeof($config['mime']) > 0) {\n $mime = binarypool_mime::getMimeType($source);\n if (! in_array($mime, $config['mime'])) {\n throw new binarypool_exception(119, 400, \"Invalid MIME type for image. Allowed types: \" .\n implode(', ', $config['mime']));\n return false;\n }\n }\n }\n \n return true;\n }", "public function isInputsFromDifferentCodecs(): bool\n {\n $this->consistencyCheck();\n\n $input_list = ProjectInputs::query()->where('project', $this->id)->get();\n if (count($input_list) > 1) {\n return $input_list->where('status', InputStatuses::WRONG_CODEC)->isNotEmpty();\n } else {\n return false;\n }\n }", "public function doesSupportRichMessage()\n {\n return in_array($this->requestSource, $this->supportedRichMessagePlatforms);\n }", "private function validate_mms_data($_mms_data)\n {\n // Some code goes here to validate the mms_data array passed as an argument\n }", "public function parse($src) { \n\t\t$this->lines = ''; \n\t\t$m = explode(\"\\n\",$src); \n\t\t\n\t\tforeach($m as $line) { \n\t\t\t$line = trim($line); \n\t\t\tif ($line!='') { \n\t\t\t\tif ($line[0]!='#') $this->lines[] = $line; \n\t\t\t} \n\t\t} \n\t\t\n\t\t$this->cursor = 0; \n\t\t$this->out = array(); \n\t\t$this->error_found = false; \n\t\twhile (!$this->eof()) { \n\t\t\t$rc = $this->parse_statement($this->out); \n\t\t\tif ($rc=='}') return 'Обнаружен неожиданный символ \"{\"'; \n\t\t\tif ($this->error_found) return $this->error_message; \n\t\t} \n\t\t\n\t\treturn $this->out; \n\t}", "function test_streams($instream, &$format)\n{\n\tif ($instream === false)\n\t{\n\t\treturn false;\n\t}\n\n\tif ($format === false)\n\t{\n\t\t$format = \"\";\n\t}\n\treturn true;\n}", "protected function isRemoteFile($src)\n {\n return str_contains($src, 'http://') || str_contains($src, 'https://');\n }", "public function AlreadyUsed(string $src): bool\n {\n return $this->inArray($this->others(), $src, 'src');\n }", "public function getSourceMsg($iterator);", "protected function checkType(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Type) && $this->_Type !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Type} is not a valid value for Type\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && $this->_Type != '' && !in_array($this->_Type, array(self::TYPE_SOURCE, self::TYPE_THUMBNAIL, self::TYPE_FILE, self::TYPE_CCA)) ) {\n\t\t\t$inMessage .= \"Type must be one of TYPE_SOURCE, TYPE_THUMBNAIL, TYPE_FILE\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\treturn $isValid;\n\t}", "public function getSource():array;", "function isValid($array){\n return $array['format_valid'];\n }", "private function Decode ($src){\n for ($i = 1; $i < count($src)/2 + 1; $i++) {\n $a = $this->fromHexChar($src[$i*2-1]);\n if ($a == -1) {\n throw new \\Exception(\"Error: Invalid Byte Error 1\");\n }\n $b = $this->fromHexChar($src[$i*2]);\n if ($b == -1) {\n throw new \\Exception(\"Error: Invalid Byte Error 2\");\n }\n $src[$i] = ($a << 4) | $b;\n }\n if (count($src)%2 == 1) {\n // Check for invalid char before reporting bad length,\n // since the invalid char (if present) is an earlier problem.\n throw new \\Exception(\"Error: Error Lenght\");\n }\n return array_slice($src,0,$i-1);\n }", "public function validatePayload($payload) {\n $decodePayload = json_decode($payload['payload']);\n \n if (is_object($decodePayload)) {\n if (!property_exists($decodePayload,'repository' ) ||\n !property_exists($decodePayload, 'commits') ||\n !property_exists($decodePayload,'canon_url')) {\n return false;\n }\n\n if ($decodePayload->canon_url != 'https://bitbucket.org' ) {\n return false;\n }\n\n return $decodePayload;\n }else{\n return false;\n }\n }", "function isValidFormat($messageBody){\n \t$pattern = '/^\\d{3}-?\\d{3}-?\\d{4}/';\n \tif(\tpreg_match($pattern, $messageBody, $matches) ){\n \t\t$recipientPhoneNumber = $matches[0];\n \t\t$strippedMessage = preg_replace('/'.$matches[0].'/', '', $messageBody);\n \t\tif(!empty($strippedMessage) && !ctype_space($strippedMessage) )\n \t\t{\n\n \t\t\treturn array('phoneNumber' => $recipientPhoneNumber, 'messageBody'=>$strippedMessage);\n \t\t}\n\t\t}\n\t\treturn false;\n }", "function isSupportedType($type, $src_file) {\n if ($type !== \"jpg\" && $type !== \"jpeg\" && $type !== \"png\") {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Source file is not an image or image type is not supported.');\n }\n return true;\n }", "private function checkSourceData(array $params, array &$errorsBag):void\n {\n if (!isset($params['sourceData'])) {\n $this->addActionValidationError($errorsBag, 'missing_field_sourceData');\n }\n if (isset($params['sourceData'])) {\n $sourceData = '';\n $sourceData = \\array_filter($params['sourceData']);\n if (empty($sourceData)) {\n $this->addActionValidationError($errorsBag, 'invalid_sourceData');\n }\n if (!empty($sourceData)) {\n $platformsCodesRaw = array_keys($params['sourceData']);\n $platformsCodes = \\preg_grep('/all/', $platformsCodesRaw, PREG_GREP_INVERT);\n if (!empty($platformsCodes)) {\n if (isset($params['sourceData']['all'])) {\n $this->addActionValidationError($errorsBag, 'invalid_sourceData_allAndCodes');\n }\n $errorsBag = array_merge($this->checkPlatformCodes($this->platformRepo, $platformsCodes), $errorsBag);\n }\n\n $this->checkSourceDataValues($params, $errorsBag);\n }\n }\n }", "function compatible(ReceivedAudio $other)\n {\n if ($this->waveFormat != $other->waveFormat)\n {\n if ($this->dbg) echo (\"waveFormat does not match<br/>\");\n return 0;\n }\n if ($this->numChannels != $other->numChannels)\n {\n if ($this->dbg) echo (\"numChannels does not match<br/>\");\n return 0;\n }\n if ($this->sampleRate != $other->sampleRate)\n {\n if ($this->dbg) echo (\"sampleRate does not match<br/>\");\n return 0;\n }\n if ($this->byteRate != $other->byteRate)\n {\n if ($this->dbg) echo (\"byteRate does not match<br/>\");\n return 0;\n }\n if ($this->blockAlign != $other->blockAlign)\n {\n if ($this->dbg) echo (\"blockAlign does not match<br/>\");\n return 0;\n }\n if ($this->bitsPerSample != $other->bitsPerSample)\n { \n if ($this->dbg) echo (\"bitsPerSample does not match<br/>\");\n return 0;\n }\n if ($this->extraFmt != $other->extraFmt)\n {\n if ($this->dbg) echo (\"extraFmt does not match<br/>\");\n return 0;\n }\n if ($this->dbg) echo (\"Files are compatible<br/>\");\n return 1;\n }", "public function originIsValid(): bool;", "protected function sourceExists()\n\t{\n\t\tglobal $ilUser;\n\n\t\treturn (bool) ilUtil::_getObjectsByOperations($this->getType(),'copy',$ilUser->getId(),1);\n\t}", "public function isValid($data)\n {\n if (!parent::isValid($data)) {\n return false;\n }\n\n $sourceKey = 'source' . $data['config']['sourceType'];\n if (empty($data['config'][$sourceKey])) {\n $this->getElement($sourceKey)->addError(\n \"You must enter a \" . $this->getElement($sourceKey)->getLabel() . \".\"\n );\n return false;\n }\n return true;\n }", "public function hasOtherSource() {\n return $this->_has(6);\n }", "private function process_array($value) {\n return is_array($value);\n }", "public function validate($payload)\n {\n // Mac-PHP line endings bugfix:\n ini_set('auto_detect_line_endings',true);\n\n $valid = true; \n\n // Memory hack...\n $payload = preg_split( '/\\R+/', trim($payload) );\n $ref =& $payload;\n // Bizarrely, PHP doesn't support multiline in getcsv :-/\n foreach($ref AS $idx => $line)\n {\n $csv = str_getcsv($line, \",\", '\"', '\\\\');\n if (count($csv) > 0)\n {\n foreach($csv AS &$val)\n {\n $val = str_replace('\\\\\"','\"', $val);\n }\n $this->parsed_array[] = $csv;\n }\n }\n if (count($this->parsed_array) == 0)\n {\n $valid = false;\n }\n\n unset($ref);\n unset($payload);\n gc_collect_cycles();\n\n return $valid;\n }", "public static function isSerializedArray($data)\n {\n return $data === null || (is_string($data) && preg_match('/^a:[0-9]+:{.*;}$/s', $data));\n }", "protected function validateActivity(&$json_array) {\n $test_array = [ \"Create\", \"Update\", \"Delete\", \"Follow\", \"Accept\", \"Reject\",\n \"Add\", \"Remove\", \"Like\", \"Block\", \"Undo\" ];\n // make sure it is an accepted ActivityPub activity type\n if (!isset($json_array['type']) || !in_array($json_array['type'],$test_array)) return false;\n // all Activities must have an actor and an id\n/*\n I need to figure out a different way of handling the id check, because client-server\n Activities are NOT supposed to have an id on them already and the server is supposed to\n generate one, while server-server Activities are REQUIRED to have an id...\n \n I guess I could have a client vs. server flag in this function which tests\n appropriately, and have the flag passed from the constructor? That way, the constructor\n could generate the unique id if it's from a client.\n*/ \n if (!isset($json_array['actor']) /* || !isset($json_array['id']) */) return false;\n // all Activities except for Deletes must have an object\n if ($json_array['type'] !== \"Delete\" && !isset($json_array['object'])) return false;\n // objects can be array or URI (treated as ID)\n if (isset($json_array['object']) && is_array($json_array['object'])) {\n // all Object arrays must have an ID and a type\n if (!isset($json_array['object']['id']) || !isset($json_array['object']['type'])) return false;\n // verify actor attribution\n if (isset($json_array['object']['attributedTo'])\n && $json_array['object']['attributedTo'] !== $json_array['actor']) return false;\n // verify addressing exists according to spec\n if (isset($json_array['object']['to'])) {\n if (!isset($json_array['to'])) return false;\n if ($json_array['to'] !== $json_array['object']['to']) return false;\n }\n if (isset($json_array['object']['cc'])) {\n if (!isset($json_array['cc'])) return false;\n if ($json_array['cc'] !== $json_array['object']['cc']) return false;\n }\n if (isset($json_array['object']['bcc'])) {\n if (!isset($json_array['bcc'])) return false;\n if ($json_array['bcc'] !== $json_array['object']['bcc']) return false;\n }\n }\n return true;\n }", "public function validateSource(): bool\n {\n return ($this->source and $this->source->isOpen());\n }", "function readIncoming()\n {\n\n $this->logDebug(\"Reading incoming messages.\");\n \n $payloadChain = '';\n $opCode = null;\n\n try\n {\n do\n {\n $frameInfo = $this->readFrame();\n $this->counter++;\n\n if($frameInfo === false)\n {\n $this->logError(\"Could not read frame. Breaking.\");\n return null;\n }\n \n $payloadChain .= $frameInfo['Payload'];\n \n if($opCode === null)\n $opCode = $frameInfo['OpCode'];\n \n } while($frameInfo['IsFinal'] == false);\n }\n \n catch(Exception $ex)\n {\n $this->logError(\"Could not processing incoming message because of exception [\" . get_class($ex) . \"]: \" . $ex->getMessage());\n return false;\n }\n \n if($this->removePreviousMessage() === false)\n {\n $this->logError(\"Could not remove message just processed.\");\n return false;\n }\n \n $messageInfo = array(\n 'OpCode' => $opCode,\n 'PayloadChain' => $payloadChain,\n );\n \n if($this->m->messageReceived($this->socket, $messageInfo) === false)\n {\n $this->logError(\"Message-received callback failed.\");\n return false;\n }\n \n return $messageInfo;\n }", "public function receive()\n {\n\n $source = $this->getValue();\n\n return true;\n }", "public function unparse($src) {\n\t\treturn $this->unparse_array($src,'');\n\t}", "protected function isValid()\n {\n $jsonMessage = json_decode($this->payload);\n $isValidKtbotsJson = (\n is_object($jsonMessage) &&\n isset($jsonMessage->handler, $jsonMessage->value) &&\n !empty($jsonMessage->handler) &&\n strpos($jsonMessage->handler, '@') !== false\n );\n return $isValidKtbotsJson;\n }", "function inArray($source, $target){\n for($j=0; $j<sizeof($source); $j++){\n if(in_array($source[$j], $target)){\n return true;\n }\n } \n }", "protected function isValidSource($data)\n {\n if (in_array($this->location($data), ['Wichita, KS', 'Wichita'])) {\n return false;\n }\n\n $badOrganizations = [\n 233446054037, 5386334244, 276436486174, 184961650433,\n 300421523337, 229369625393, 183656722434, 308256707370,\n 328509897191, 3069190992, 309235372404, 270797351629,\n 308401027589, 308410324213,\n ];\n\n if (in_array($data->organization_id, $badOrganizations)) {\n return false;\n }\n\n return true;\n }", "private function validPayload()\n {\n return [\n 'name' => 'Chefaa pharmacy',\n 'address' => 'Maadi',\n ];\n }", "function valid_gga_message($NavArray) \n{\n // Test for length and valid characters in datetime:\n $re = \"/^\\d{6}(\\.\\d*)?$/\";\n if (!preg_match($re, $NavArray[1])) {\n return false;\n }\n \n // Test for length and valid characters in lat:\n $re = \"/^\\d{4}(\\.\\d*)?$/\";\n if (!preg_match($re, $NavArray[2])) {\n return false;\n }\n \n // Test for valid North/South direction:\n $re = \"/^(N|S)$/\";\n if (!preg_match($re, $NavArray[3])) {\n return false;\n }\n \n // Test for length and valid characters in lon:\n $re = \"/^\\d{5}(\\.\\d*)?$/\";\n if (!preg_match($re, $NavArray[4])) {\n return false;\n }\n \n // Test for valid West/East direction:\n $re = \"/^(W|E)$/\";\n if (!preg_match($re, $NavArray[5])) {\n return false;\n }\n \n // Test for single digit for quality indicator:\n $re = \"/^\\d{1}$/\";\n if (!preg_match($re, $NavArray[6])) {\n return false;\n }\n \n // Test for single or double digit(s) for number of satellites:\n // $re = \"/^\\d{1,2}$/\";\n // if (!preg_match( $re, $NavArray[7] )) {\n // return false;\n // }\n \n // If no tests fail, return true:\n return true;\n \n}", "private function invalidPayload($data)\n {\n return ! is_array($data) || ! isset($data['iv']) || ! isset($data['str']) || ! isset($data['mac']);\n }", "function isValid(&$inMessage = '');", "private function checkSourceDataBlobFile(array $sourceData, array &$errorsBag)\n {\n $filesNotFound = [];\n $emptyFiles = [];\n $missingFiles = [];\n $notFoundInFile = [];\n foreach ($sourceData as $code => $file) {\n $exists = $this->fileRepository->existsFileByUrl($file);\n if (!$exists) {\n $filesNotFound[] = $file;\n continue;\n }\n $fileData = $this->fileRepository->getFileByUrl($file);\n $fileContent = $this->fileManager->getFileContents($fileData['id']);\n if (empty($fileContent)) {\n $emptyFiles[] = $file;\n continue;\n }\n $platformsIds = $this->platformRepo->getPlatformsIdsByCodeOrAll('all');\n $platforms = array_keys($platformsIds);\n $platformsCsv = $this->getPlatformsFromCsvBlob($fileContent);\n if ($code == 'all') {\n $missingPlatforms = array_diff($platforms, $platformsCsv);\n if (!empty($missingPlatforms)) {\n $missingFiles = array_merge($missingPlatforms, $missingFiles);\n continue;\n }\n }\n $notFoundPlatforms = array_diff($platformsCsv, $platforms);\n if (!empty($notFoundPlatforms)) {\n $notFoundInFile = array_merge($notFoundPlatforms, $notFoundInFile);\n continue;\n }\n $this->checkBlobCsvFormat($fileContent, $errorsBag);\n }\n $this->validateBlobArray($filesNotFound, 'files', 'not_found_file_blob', $errorsBag);\n $this->validateBlobArray($emptyFiles, 'files', 'empty_file_blob', $errorsBag);\n $this->validateBlobArray($missingFiles, 'platforms', 'missing_platforms', $errorsBag);\n $this->validateBlobArray($notFoundInFile, 'platforms', 'invalid_platforms', $errorsBag);\n }", "public function canConvertFrom($source, $targetType) {\n\t\treturn TRUE;\n\t}", "public function hasSourceType()\n {\n return $this->source_type !== null;\n }", "private function clean_mms_data()\n {\n // Set result default value to FALSE\n $_result = FALSE;\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n foreach ($this->_mms_data as $_key => $_value) {\n if (isset($_value['payload'])) {\n $_clean_str = $this->remove_escaped_chars($_value['payload']);\n if ($_clean_str && is_string($_clean_str)) {\n $this->_mms_data[$_key]['payload'] = $_clean_str;\n }\n \n // Check if the escaped backslash character has been removed from the payload value string\n $_result = preg_match_all('@\\\\\\\"|\\\\\\/@', $this->_mms_data[$_key]['payload']) ? FALSE : TRUE;\n }\n }\n }\n \n return $_result;\n }", "protected function validate()\r\n {\r\n return ( is_array( $this->bot ) && !empty( $this->channel ) );\r\n }", "public function checkMineType(array $file_data) {\n if (null != $this->_filterType) { //defined filter by Type\n $ext = explode(',', $this->_filterType);\n $mime = array();\n $mime = array();\n for ($i = 0; $i < sizeof($ext); ++$i) {\n $ext[$i] = strtolower(ltrim(trim($ext[$i]), '.'));\n $mime[$ext[$i]] = $this->_allowedMimeType[$ext[$i]];\n }\n } else {\n $mime = $this->_allowedMimeType;\n }\n $ext = $this->getExtension($file_data['name'], false);\n $expectMimeType = $this->getMimeTypeByExtension($ext, $mime);\n\n $fileMimeType = $this->_getUploadedFileMimeType($file_data);\n\n if (is_array($expectMimeType)) {\n if (!in_array($fileMimeType, $expectMimeType)) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (is_string($expectMimeType)) {\n if ($expectMimeType != $fileMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (false == $expectMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n\n return true;\n }", "function is_source_static($src)\n\t{\n\t\t// @since 1.3.0 check for query string in `$src`\n\t\tif (false !== strpos($src, '?'))\n\t\t{\n\t\t\t$src = explode('?', $src);\n\t\t\t$src = $src[0];\n\t\t}\n\n\t\t// Source that doesn't have .css or .js extesion is dynamic\n\t\tif (!preg_match('#.*\\.(css|js)$#ui', $src))\n\t\t\treturn false;\n\n\t\t// Source that contains =, & is dynamic\n\t\t// @since 1.3.0 ? is considered static\n\t\tif (strpos($src, '=') === false && strpos($src, '&') === false)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function convert_content_capableof($conversion) {\n global $settings;\n return is_array($settings['converters']) &&\n array_key_exists($conversion, $settings['converters']) &&\n function_exists($settings['converters'][$conversion]);\n}", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "function has_external_src() {\n // <site_url()>/wp-content/uploads/2017/01/IMG_0319-160x160.jpg\n $local_marker = sprintf('/wp-content/uploads', site_url());\n\n // src contains localhost marker?\n return strpos($this->src, $local_marker) === false;\n }", "static function checkObj(&$data) \n\t{\n\t\tif(!$data)\n\t\t\treturn false;\n\t\tif(preg_match('/((?![\\x20-\\x7E]).)/', $data)){\n\t\t\t//todo:now just int\n\t\t\t$data = unpack('I',$data);\n\t\t\t$data = $data[1];\n\t\t\treturn false;\n\t\t}\n\t\tif(substr_compare($data,'{',0,1)==0){\n\t\t\t$ndata = json_decode($data,true);\n\t\t\tif($ndata){\n\t\t\t\t$data = $ndata;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "private function saveSourceMessage()\n\t{\n\t\t$sourceMessage = new SourceMessage();\n\t\t$sourceMessage->category = $this->category;\n\t\t$sourceMessage->message = $this->message;\n\t\t\n\t\tif ($sourceMessage->save()){\n\t\t\t$this->id = $sourceMessage->id;\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function fix_MIME_from_sender($from_str)\n\t{\n\t\t// use a detector that is in the parent class\n\t\tif ($this->in_from($from_str))\n\t\t{\n\t\t\tif ( $this->PLAIN !== '' )\n\t\t\t{\n\t\t\t\tif (strpos($this->PLAIN,'<html>')<25)\n\t\t\t\t{\n\t\t\t\t\tif ($this->HTML ==='' )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function hasSourceId()\n {\n return $this->source_id !== null;\n }", "private function is_malformed($data) {\r\n\r\n if( !in_array($data[0], array_keys($this->header_type)) ){\r\n $this->malformed_msg = \"The transaction type is not known\";\r\n return TRUE;\r\n }\r\n\r\n if( in_array($data[0], array(\"TRNS\", \"SPL\")) AND !in_array($data[1], $this->trnstype) ){\r\n $this->malformed_msg = \"The transaction is multi-line, but the sub-type (e.g. INVOICE, BILL, etc) is not known\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->flag_multi == FALSE AND ($data[0] == \"SPL\" || $data[0] == \"ENDTRNS\") ){\r\n $this->malformed_msg = \"The record is SPL or ENDTRNS, but didn't start with TRNS\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->array_count($data) > count($this->default_headers[$data[0]]) ){\r\n $this->malformed_msg = \"There are more elements in the record, \".count($data).\", than in the header, \".count($this->default_headers[$data[0]]);\r\n return TRUE;\r\n }\r\n\r\n //Check these conditions if not in the first record of the file\r\n if( isset($this->prior_record) ){\r\n if( $this->prior_record[0] == \"TRNS\" AND $data[0] !== \"SPL\" ){\r\n $this->malformed_msg = \"A TRNS record is not followed by an SPL record\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->prior_record[0] == \"SPL\" AND !in_array($data[0], array(\"SPL\", \"ENDTRNS\")) ){\r\n $this->malformed_msg = \"An SPL record is not followed by another SPL record or ENDTRNS\";\r\n return TRUE;\r\n }\r\n }\r\n \r\n //Reaching this point means that the record is not malformed\r\n return FALSE;\r\n }", "public function dataProviderCheckSourceValue()\n\t{\n\t\t$photoCount = array(\n\t\t\t\t\tarray(\"computer_noFlash\",\"channelUpload\"),\n\t\t\t\t\tarray(\"appPicsCamera\",\"channelUpload\"),\n\t\t\t\t\tarray(\"iOSPicsCamera\",\"channelUpload\"),\n\t\t\t\t\tarray(\"iOSPicsGallery\",\"channelUpload\"),\n\t\t\t\t\tarray(\"mobPicsGallery\",\"channelUpload\"),\n\t\t\t\t\tarray(\"appPicsGallery\",\"channelUpload\"),\n\t\t\t\t\tarray(\"appPicsUpload\",\"channelUpload\"),\n\t\t\t\t\tarray(\"userCroppedProfilePic\",\"userCroppedProfilePic\"),\n\t\t\t\t\tarray(\"facebook\",\"picLinkUpload\"),\n\t\t\t\t\t);\n\t\treturn $photoCount;\n\t}", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "private function isPlainArray($line) {\n\t//--\n\treturn (($line[0] == '[') && (substr($line, -1, 1) == ']'));\n\t//--\n}", "private static function checkDataType($array)\n {\n if(count($array) <= 1)\n {\n return true;\n }\n\n $last = count($array) - 1;\n\n $type = self::getCustomDataType($array[$last]);\n\n if ($type != self::getCustomDataType($array[0]))\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "private function isArrayElement($line) {\n\t//--\n\tif(!$line) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif($line[0] != '-') {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(strlen($line) > 3) {\n\t\tif(substr($line, 0, 3) == '---') {\n\t\t\treturn false;\n\t\t} //end if\n\t} //end if\n\t//--\n\treturn true;\n\t//--\n}", "function validateImage($src) {\n\t\t$imageResult = '';\n\t\tif ($_FILES[$src]['tmp_name'] == '') {\n\t\t\tif (1 == $_FILES[$src]['error']) {\n\t\t\t\t$imageResult = 'Image Size is above server max upload size';\n\t\t\t}\n\t\t\t$imageResult .= '<br/>Image is empty!';\n\t\t}\n\t\tif (!is_uploaded_file($_FILES[$src]['tmp_name'])) {\n\t\t\t$imageResult .= '<br/>Image not uploaded';\n\t\t}\n\t\tif ($_FILES[$src]['size'] == 0) {\n\t\t\t$imageResult .= '<br/>Image size is 0';\n\t\t}\n\t\tif ($_FILES[$src]['size'] > 8388608) {\n\t\t\t$imageResult .= '<br/>Image size is greater than 8mb';\n\t\t}\n\t\t$size = GetImageSize($_FILES[$src]['tmp_name']);\n\t\tif ($size[2] != 1 && $size[2] != 2 && $size[2] != 3) {\n\t\t\t$imageResult .= '<br/>File Not an image';\n\t\t}\n\t\treturn ($imageResult == '') ? true : $imageResult;\n\t}", "public function checkConvertability()\n {\n }", "public function testOneDimensionalArrayInput() {\n $source = ['foo' => 'bar'];\n $this->expectException(MigrateException::class);\n $this->expectExceptionMessage('The input should be an array of arrays');\n $this->plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');\n }", "function parseIncomingData($origArr = array()) {\n\t\tglobal $TYPO3_DB;\n\n\t\tstatic $adodbTime = null;\n\n\t\t$parsedArr = array();\n\t\t$parsedArr = $origArr;\n\t\tif (is_array($this->conf['parseFromDBValues.'])) {\n\t\t\treset($this->conf['parseFromDBValues.']);\n\t\t\twhile (list($theField, $theValue) = each($this->conf['parseFromDBValues.'])) {\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',', $theValue, 1);\n\t\t\t\tforeach($listOfCommands as $k2 => $cmd) {\n\t\t\t\t\t$cmdParts = split(\"\\[|\\]\", $cmd); // Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd) {\n\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'adodb_date':\n\t\t\t\t\t\tif (!is_object($adodbTime))\t{\n\t\t\t\t\t\t\tinclude_once(PATH_BE_srfeuserregister.'pi1/class.tx_srfeuserregister_pi1_adodb_time.php');\n\n\t\t\t\t\t\t\t// prepare for handling dates before 1970\n\t\t\t\t\t\t\t$adodbTime = t3lib_div::makeInstance('tx_srfeuserregister_pi1_adodb_time');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = $adodbTime->adodb_date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\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\n\t\t$fieldsList = array_keys($parsedArr);\n\t\tforeach ($this->tca->TCA['columns'] as $colName => $colSettings) {\n\t\t\tif (in_array($colName, $fieldsList) && $colSettings['config']['type'] == 'select' && $colSettings['config']['MM']) {\n\t\t\t\tif (!$parsedArr[$colName]) {\n\t\t\t\t\t$parsedArr[$colName] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$valuesArray = array();\n\t\t\t\t\t$res = $TYPO3_DB->exec_SELECTquery(\n\t\t\t\t\t\t'uid_local,uid_foreign,sorting',\n\t\t\t\t\t\t$colSettings['config']['MM'],\n\t\t\t\t\t\t'uid_local='.intval($parsedArr['uid']),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'sorting');\n\t\t\t\t\twhile ($row = $TYPO3_DB->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$valuesArray[] = $row['uid_foreign'];\n\t\t\t\t\t}\n\t\t\t\t\t$parsedArr[$colName] = implode(',', $valuesArray);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $parsedArr;\n\t}", "public function isValidImage()\n\t{\n\t\t$src = $this->source_path;\n\t\t$extension = \\strtolower(\\substr($src, (\\strrpos($src, '.') + 1)));\n\n\t\tif (!\\in_array($extension, $this->image_extensions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$r = @\\imagecreatefromstring(\\file_get_contents($src));\n\n\t\treturn \\is_resource($r) && \\get_resource_type($r) === 'gd';\n\t}", "public function checkImported($object) {\n if (!empty($this->source->data)) {\n if (in_array($object['Key'], $this->source->data)) {\n return true;\n }\n }\n return false;\n }", "function isImage($path)\n {\n return is_array(getimagesize($path));\n }", "function file_source_can_be_displayed($filename) {\n return in_array(get_file_extension($filename), get_displayable_file_types());\n }", "public function isSetBoxContentsSource()\n {\n return !is_null($this->_fields['BoxContentsSource']['FieldValue']);\n }", "public function hasSourceAccessions(){\n return $this->_has(8);\n }", "public function is_valid_vb_spec($data_array) {\n\n // Check that there are at least two rows.\n if ( count($data_array) < 2 ) {\n $this->notifier->add('There must be at least two rows in the '\n . 'uploaded dataset.', 'error');\n return false;\n }\n\n // Split the dataset into the header row and the rest of the sheet\n $header = $data_array[0]; // Just the first row\n $data_array = array_slice($data_array, 1); // Everything but the first row\n\n // Count the number of timepoint columns and check that there is\n // at least one.\n $num_timepoint_cols = count(self::ordered_columns_of_type($header, 0));\n if ($num_timepoint_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one timepoint column. '\n . 'None were found. Note that syntax for timepoint column '\n . 'headers is strict: the fieldname must be machine-readable '\n . 'as a date. Try formats like \"2012\" or \"2012-08\" or \"3Q 2008\".'),\n 'error', 108);\n return false;\n }\n\n // Count the number of level columns and check that there is\n // at least one.\n $num_level_cols = count(self::ordered_columns_of_type($header, 1));\n if ($num_level_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one LEVEL column. '\n . 'None were found. Note that syntax for LEVEL column '\n . 'headers is strict: the fieldname must be of the form '\n . 'LEVEL<N>, where <N> is an integer.'),\n 'error', 109);\n return false;\n }\n\n return true;\n }", "private function readMessage()\n {\n $fromIp = \"\";\n $fromPort = 0;\n $msg = null;\n \n if (!@socket_recvfrom($this->socket, $msg, 65535, 0, $fromIp, $fromPort)) {\n $err_no = socket_last_error($this->socket);\n if ($err_no == 4) {\n \techo \"\\n\\nCaught SIGINT, quiting...\\n\";\n \t$this->keepRunning = false;\n }\n }\n\n if (!$msg) {\n \treturn false;\n }\n\n if ($this->fromIp === null && $this->fromPort === null) {\n \t$this->fromIp = $fromIp;\n \t$this->fromPort = $fromPort;\n } else if ($this->fromIp != $fromIp || $this->fromPort != $fromPort) {\n \tdie(sprintf(\"Error: sender changed from %s:%d to %s:%d, aborting...\\n\", $this->fromIp, $this->fromPort, $fromIp, $fromPort));\n }\n \n return [\n \t\"timestamp\"\t=> microtime(true),\n \t\"msg\" \t\t=> $msg,\n \t\"from_ip\" \t=> $fromIp,\n \t\"from_port\"\t=> $fromPort\n ];\n }", "public function isMessage(): bool\n {\n return $this->code >= CODE_CONTINUE &&\n $this->code < CODE_OK;\n }", "public function testSourceErrors()\n {\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam.jpg');\n $this->assertTrue($Image->status);\n // now errors.\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam-text.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTIMAGE, $Image->statusCode);\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'image-not-exists' . date('YmdHis') . '.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTEXISTS, $Image->statusCode);\n }", "protected function unparse_array($src,$prefix) {\n\t\tif (Core_Types::is_iterable($src)) {\n\t\t\t$out = '';\n\t\t\tforeach($src as $key => $value) {\n\t\t\t\tif (Core_Types::is_iterable($value)) {\n\t\t\t\t\t$value = $this->unparse_array($value,\"\\t$prefix\");\n\t\t\t\t\t$out .= \"$prefix$key = {\\n$value$prefix}\\n\";\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t$value = (string)$value;\n\t\t\t\t\t$out .= \"$prefix$key = $value\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $out;\n\t\t}\n\n\t\telse return (string)$src;\n\t}", "private function validateSender(){\n\t\tglobal $ENABLE_SECURITY;\n\t\tif(in_array($this->sender, $this->validSenders) || $ENABLE_SECURITY == false){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function valid_team_array() {\r\n if (!is_array($this->teams) || count($this->teams) < 2) {\r\n $this->error = 'Not enough teams in array shape passed';\r\n $this->reset_class_state();\r\n return false;\r\n }\r\n return true;\r\n }", "protected function hasSourceFieldChanged() {\n $source_field_name = $this->getSource()->getConfiguration()['source_field'];\n $current_items = $this->get($source_field_name);\n return isset($this->original) && !$current_items->equals($this->original->get($source_field_name));\n }", "public function valid()\n {\n\n if ($this->container['use_async_pattern'] === null) {\n return false;\n }\n if ($this->container['source_file_name'] === null) {\n return false;\n }\n if ($this->container['source_file_content'] === null) {\n return false;\n }\n if ($this->container['copy_metadata'] === null) {\n return false;\n }\n $allowed_values = [\"English\", \"Arabic\", \"Danish\", \"German\", \"Dutch\", \"Finnish\", \"French\", \"Hebrew\", \"Hungarian\", \"Italian\", \"Norwegian\", \"Portuguese\", \"Spanish\", \"Swedish\", \"Russian\"];\n if (!in_array($this->container['language'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"Slow but accurate\", \"Faster and less accurate\", \"Fastest and least accurate\"];\n if (!in_array($this->container['performance'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"None\", \"Whitelist\", \"Blacklist\"];\n if (!in_array($this->container['characters_option'], $allowed_values)) {\n return false;\n }\n return true;\n }" ]
[ "0.60716784", "0.5850032", "0.5319931", "0.529936", "0.52823", "0.5278292", "0.5214617", "0.5207451", "0.5122033", "0.50986505", "0.50984883", "0.5090112", "0.50509757", "0.50444126", "0.50192875", "0.49796367", "0.49753612", "0.4930771", "0.48941594", "0.4892276", "0.48618925", "0.48618457", "0.48609826", "0.4816316", "0.4813309", "0.4812332", "0.47943145", "0.47940797", "0.4787214", "0.47707924", "0.47676706", "0.47596017", "0.4711088", "0.47104216", "0.46868265", "0.46819636", "0.4677823", "0.46659434", "0.46603027", "0.4630864", "0.46270525", "0.46104327", "0.46016473", "0.4600297", "0.45998305", "0.45887586", "0.45809105", "0.45797405", "0.45764643", "0.4570971", "0.45687118", "0.45632797", "0.45597246", "0.45530552", "0.45483404", "0.45479986", "0.45336685", "0.45209292", "0.45164627", "0.45116463", "0.45078555", "0.45037472", "0.4498657", "0.44943392", "0.44828948", "0.44723815", "0.44663605", "0.44554073", "0.44529742", "0.44439933", "0.44371665", "0.44297332", "0.44168556", "0.44146943", "0.44135132", "0.44052076", "0.44052076", "0.44052076", "0.44052076", "0.43841887", "0.4382428", "0.43788227", "0.4370872", "0.43708235", "0.43694794", "0.43542436", "0.43527606", "0.4351715", "0.43516687", "0.4351072", "0.43484655", "0.4339526", "0.43328393", "0.43296576", "0.43237233", "0.43224922", "0.43201545", "0.43186072", "0.4318557", "0.43068004", "0.43017313" ]
0.0
-1
Get length from src packet
public function getLength($hexArray) { return hexdec($hexArray[2] . $hexArray[3]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPacketLength() : int {\n return $this->iPacketLength;\n }", "function getPayloadLength();", "public function getLen()\n {\n return $this->_len;\n }", "public function getLength()\n {\n return strlen($this->data);\n }", "public function origLen() { return $this->_m_origLen; }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }", "private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}", "public function getLength();", "function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}", "public function pipe($length)\n {\n $data = $this->connection->read($length);\n $this->buffer .= $data;\n\n return strlen($data);\n }", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLengthBytes()\n {\n return $this->length_bytes;\n }", "public function getHeaderLength()\n {\n return $this->headerLength;\n }", "protected function getSize()\n {\n return strlen($this->data);\n }", "public function get_data_length() {\n return $this->duration;\n }", "public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}", "public function length() {\r\n return strlen($this->contents);\r\n }", "public function getLen()\n {\n $value = $this->get(self::LEN);\n return $value === null ? (integer)$value : $value;\n }", "function getLength(): int\n {\n return $this->length;\n }", "protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }", "public function getLength() {\n return $this->_length;\n }", "public function getLength() {\r\n return $this->length;\r\n }", "public function getLength()\r\n {\r\n return $this->length;\r\n }", "function labelLength($pointer) {\r\n $oldPointer = $pointer;\r\n \r\n // See how many uncompressed bytes to next end of label/pointer\r\n while(($this->dnsResponse[$pointer] != chr(0)) &&\r\n (ord($this->dnsResponse[$pointer]) < 192)) {\r\n $pointer++;\r\n }\r\n // If pointer include next ocet as well\r\n if(ord($this->dnsResponse[$pointer]) >= 192) {\r\n $pointer++; \r\n }\r\n // Count the ocet we are reading\r\n $pointer++;\r\n return $pointer - $oldPointer;\r\n }", "public function getLength() {\n \n return $this->_length;\n }", "public function getLength() : int\n {\n return $this->b[$this->offset];\n }", "function getSize(): int {\n return \\strlen($this->buffer);\n }", "abstract public function getLength();", "public function length() {\n \n return $this->getLength();\n }", "public function getLength(): int;", "public function getLength(): int;", "public function getSize()\n {\n if ($this->isWrapped() || $this->isTemp()) {\n $wrapper_info = $this->getWrapperInfo();\n\n if (!in_array($wrapper_info['protocol'], static::$stat_able_protocols)) {\n return strlen($this->getRaw());\n }\n }\n\n // Just call our parent, otherwise\n return parent::getSize();\n }", "function length(){\n\t\t//return strlen($this->_String4);\n\t\treturn Translate::Length($this->_String4,$this->getEncoding());\n\t}", "public function length()\n {\n return $this->length;\n }", "function getLength() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_LENGTH);\n\t}", "function ContentLength($bytesOfAudio)\n {\n // for the \"RIFF\" and the count following\n return $bytesOfAudio + 12 + strlen($this->fmt) + 8;\n }", "public function getContentLength() { return $this->content_length; }", "public function getSize()\n {\n return $this->length;\n }", "function getContentLength(){\n\t\treturn $this->_OutputBuffer->getLength();\n\t}", "public function length()\n {\n return $this->provider->length();\n }", "function getSize()\n {\n return !isset($this->modulus) ? 0 : strlen($this->modulus->toBits());\n }", "public function getLength()\n {\n return $this->int_length;\n }", "public function length()\n {\n return UTF8::strlen($this->str, $this->encoding);\n }", "protected function get_line_len()\n {\n return count($this->buffer);\n }", "public function getLength()\n {\n return filesize($this->fullPath);\n }", "public function length();", "public function length();", "function gttn_tpps_file_len($fid) {\n $file = file_load($fid);\n $location = drupal_realpath($file->uri);\n $extension = gttn_tpps_get_path_extension($location);\n $count = 0;\n $options = array(\n 'count' => &$count,\n );\n if ($extension == 'vcf') {\n $options['skip_prefix'] = '#';\n }\n gttn_tpps_file_iterator($fid, 'gttn_tpps_file_len_helper', $options);\n return $count;\n}", "function getLength(): ?int;", "public function size()\n\t{\n\t\tif( !$this->valid ) { return 0; }\n\t\treturn \\gmp_intval( \\gmp_add( $this->net_broadcast_long, \\gmp_neg( $this->net_addr_long )));\n\t}", "public function getOutputLength();", "public function getSize(): int\n {\n return $this->buffer->getSize();\n }", "public function getContentLength()\n {\n $result = $this->headers->get('Content-Length');\n\n return $result ? (int)$result[0] : null;\n }", "public function downloadlength() {\n return $this->info['download_content_length'];\n }", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function getLength($atOffset = false);", "public function getContentLength() {\r\n return $this->__contentLength;\r\n }", "public function getSocketRecvSize()\n {\n return $this->socketRecvSize;\n }", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "protected function getNumPayloadBytes() {\n return (1 + $this->getNumPayloadBits()) / 8;\n }", "public static function sl($data)\n {\n return strlen($data);\n }", "protected function nextRecordLength()\r\n\t{\r\n\t\tlist($size, $temp) = ['', ''];\r\n\t\t\r\n\t\twhile ($temp != \",\" and $this->hasNext()) {\r\n\t\t\t$size .= $temp;\r\n\t\t\t$temp = Bin::toStr($this->readBits());\r\n\t\t}\r\n\r\n\t\treturn intval($size);\r\n\t}", "public function length() : int;", "public function getLength($id) {\r\n\t\t$contents = file_get_contents('http://m.youtube.com/watch?v=' . $id);\r\n\t\t$length = preg_match('/<div>([0-9:]*)&nbsp;/', $contents, $matches);\r\n\t\treturn ($this->JSON != 1) ? $matches[1] : json_encode($matches[1]);\r\n\t}", "private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }", "public function getLength($atOffset = false) {}", "public function getRemainingLength()\n {\n return $this->remaining_length;\n }", "function getSourceSize()\n {\n return $this->size;\n }", "public function getSize() {\n return 8 * (strlen(Util::base64url_decode($this->data['n'])) - 1);\n }", "public function getTotalLength();", "public function getTotalLength();", "public function getCharLength();", "public function getSize(): int {\n\t\treturn mb_strlen($this->getContent());\n\t}", "public function count()\n {\n return count($this->_loadedPackets);\n }", "function wpfc_get_filesize( $url, $timeout = 10 ) {\n\t$headers = wp_get_http_headers( $url);\n $duration = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;\n\t\n\tif( $duration ) {\n\t\t\tsscanf( $duration , \"%d:%d:%d\" , $hours , $minutes , $seconds );\n\t\t\t\n\t\t\t$length = isset( $seconds ) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes;\n\n\t\t\tif( ! $length ) {\n\t\t\t\t\t$length = (int) $duration;\n\t\t\t}\n\n\t\t\treturn $length;\n\t}\n\n\treturn 0;\t\n}", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "public function getFullLength()\n {\n $cmd_length = 1;\n\n $rl_length = strlen($this->remaining_length_bytes);\n\n return $cmd_length + $rl_length + $this->remaining_length;\n }", "function getLength(){\n\t\t$out = 0;\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$out = $out + $this->_Items[$i]->getLength();\n\t\t}\n\t\treturn $out;\n\t}", "public function getExtensionLength()\n {\n return $this->_fields['ExtensionLength']['FieldValue'];\n }", "public function getContentLength(): int\n {\n return $this->length;\n }", "private function countLength() {\n\n $this->_length = strlen($this->_value);\n }", "public function getRequestLength()\n\t{\n\t\treturn $this->elapsed;\n\t}", "public function getTotalLength() {}", "public function getTotalLength() {}", "static public function GetContentLength() {\n return (isset(self::$headers[\"content-length\"]))? (int) self::$headers[\"content-length\"] : 0;\n }", "private function get_maskLen()\n\t{\n\t\treturn $this->m_maskLen;\n\t}", "function length(): int;", "public function strlen(string $key): int\r\n\t{\r\n\t\treturn $this->connection->strlen($key);\r\n\t}", "public function NextReadSize() {\n switch($this->state) {\n case INITIAL:\n case IN_HEADER:\n case ENDOFDATA:\n return 1;\n case DATA:\n return $this->length - $this->position;\n case SUCCESS:\n return 0;\n default:\n throw new Exception(\"Invalid decoder state $this->state\");\n }\n }" ]
[ "0.7312739", "0.71702266", "0.6530342", "0.6498523", "0.6366839", "0.63406485", "0.6289942", "0.62582344", "0.62506145", "0.6229717", "0.6200054", "0.6183667", "0.6182874", "0.6182874", "0.6182874", "0.6169469", "0.6169469", "0.6169469", "0.6169469", "0.6169469", "0.6169469", "0.6169469", "0.6169469", "0.6159094", "0.6156526", "0.61370766", "0.6118018", "0.6116266", "0.61122257", "0.6104858", "0.6086707", "0.6086341", "0.6080984", "0.6066495", "0.6058403", "0.60477155", "0.60257965", "0.6018187", "0.6015614", "0.5993823", "0.59894", "0.5977608", "0.5977608", "0.5959557", "0.59383416", "0.59276754", "0.5915638", "0.5855318", "0.5814434", "0.58138967", "0.5809654", "0.57846624", "0.57688314", "0.575603", "0.57388186", "0.5726533", "0.5676578", "0.56518674", "0.56518674", "0.5651819", "0.56509507", "0.5618872", "0.56135213", "0.5613279", "0.560821", "0.5601862", "0.56000054", "0.5593831", "0.5588485", "0.55730325", "0.5569377", "0.55655307", "0.5555304", "0.55544734", "0.5525021", "0.55194193", "0.5517848", "0.54973876", "0.5485455", "0.5465448", "0.5464881", "0.545615", "0.545615", "0.54560107", "0.54310894", "0.54233164", "0.5422995", "0.54034054", "0.5403044", "0.5396491", "0.5377339", "0.53772396", "0.5369999", "0.53690946", "0.5361983", "0.5361286", "0.5355868", "0.5334323", "0.5313231", "0.5310993", "0.5310826" ]
0.0
-1
put your code here
static function get($pet) { if (!array_key_exists(1, $pet)) { $desarrolladoras = EmpresaDAO::get_desarrolladoras(); $editoras = EmpresaDAO::get_editoras(); $empresas = EmpresaDAO::get_empresas(); $data["empresas"] = $empresas; $data["desarrolladoras"] = $desarrolladoras; $data["editoras"] = $editoras; View::show("desarrolladora_list_view.php", $data); } else { if ($pet[1] == "nueva") { $data["hola"] = "hola"; View::show("insert_desarrolladora.php", $data); } else { $desarrolladora = EmpresaDAO::get_empresas_by_id($pet[1]); if (EmpresaDAO::is_desarrolladora($pet[1])) { $juegos = EmpresaDAO::get_juegos_of_desarrolladora($pet[1]); } else if (EmpresaDAO::is_productora($pet[1])) { $juegos = EmpresaDAO::get_juegos_of_productora($pet[1]); } else{ $juegos=array(); } $data["desarrolladora"] = $desarrolladora; $data["juegos"] = $juegos; View::show("desarrolladora_view.php", $data); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public function custom()\n\t{\n\t}", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "public function run()\r\n {\r\n\r\n }", "public function run(){\n parent::run();\n //Do stuff...\n }", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "function use_codepress()\n {\n }", "public function run()\n {\n // Put your code here;\n }", "function run()\r\n {\r\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run() {\n }", "public static function run() {\n\t}", "public function onRun()\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function run() {\n }", "public function render_content() {\n\t}", "public function main()\r\n {\r\n \r\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "function render() ;", "function execute()\n {\n }", "public function run(): void\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function render()\n {\n //\n }", "public function run(){\n echo CHtml::closeTag( \"div\" );\n $this->registerScript();\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "function __desctuct(){\r\n\t\t?>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\n\t\t<?php\r\n\t}", "public function run(){}", "public function demo()\n {\n // xu ly logic\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "public function render(){\n\t\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function render() {\r\n\t\t\r\n\t}", "public function main()\n\t{\n\t}", "function handle() ;", "public function execute() {\n\t}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run() {}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function _exec()\n {\n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "protected function after_load(){\n\n\n }", "public function work()\n {\n }", "function run();", "function run();", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "function tap_run_page_handler() \n {\n include(\"/var/www/html/run/tap_run.php\");\n \n $params = cargaArray('Torneo Argentino de Programación', $form, '');\n \n include('body.php'); \n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function helper()\n\t{\n\t\n\t}", "public function drawContent()\n\t\t{\n\t\t}" ]
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407", "0.56068903", "0.56068903", "0.56068903", "0.56016845", "0.5597219", "0.5595339", "0.5591545", "0.558057", "0.55636305", "0.55034596", "0.5487096", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.54594034", "0.5446425", "0.5446197", "0.54451364", "0.54319674", "0.5426377", "0.54072845", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.53981763", "0.5394762", "0.5392594", "0.5392164", "0.5391672", "0.5391672", "0.5391672", "0.5386191", "0.53823715", "0.5374112", "0.5373851", "0.5371084", "0.5369742", "0.53666246", "0.5365522", "0.5358571", "0.53542304", "0.5353158", "0.5345768", "0.5339915", "0.53389114", "0.53339213", "0.5332912", "0.5323722", "0.5323722", "0.5321411", "0.5318719", "0.53184503", "0.5300535", "0.5290181", "0.52723837", "0.52723306" ]
0.0
-1
array store all variable in URL
public function __construct() { $this->urlValues = $_GET; if (!isset($this->urlValues['c'])) { $this->controllerName = "home"; $this->controllerClass = "HomeController"; } else { $this->controllerName = strtolower($this->urlValues['c']); $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . "Controller"; } if (!isset($this->urlValues['a'])) { $this->action = "index"; } else { $this->action = $this->urlValues['a']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getUrls() {\n\t\t// reassign the array because of a php bug (solved later with php 5.2.x @see: http://bugs.php.net/39449)\n\t\t$arr = $this->formData;\n\n\t\t// build bas URL for replacement variables\n\t\t$protocol\t= 'http'\n . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ? 's' : '' )\n . '://';\n\t\t$url\t\t= $_SERVER['HTTP_HOST'] . dirname( $_SERVER['PHP_SELF'] ) . '/';\n $url = str_replace( '//', '/', $url ); // some server add 2 /\n $url = $protocol . $url . 'index.php?route=payment/directebanking/';\n\n\t\tif( $this->_param['successUrlStd'] ) {\n\t\t\t$arr['user_variable_0'] = $url . 'success'\n\t\t\t. '&transaction=-TRANSACTION-&security_criteria=-SECURITY_CRITERIA-'\n\t\t\t. '&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['successUrl'] ) {\n\t\t\t\t$arr['user_variable_0'] = $this->_param['successUrl'];\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_param['cancelUrlStd'] ) {\n\t\t\t$arr['user_variable_1'] = $url . 'cancel'\n\t\t\t. '&transaction=-TRANSACTION-&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['cancelUrl'] ) {\n\t\t\t\t$arr['user_variable_1'] = $this->_param['cancelUrl'];\n\t\t\t}\n\t\t}\n\n\t\t// and reassign again\n\t\t$this->formData = $arr;\n\n\t\tunset( $arr );\n\t}", "public function getUriVars(): array;", "static public function getUrlArray()\n {\n \tstatic $url_array = NULL;\n \tif( is_null( $url_array ) ) {\n\t\t\t$url_array = explode( '/', ltrim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ) );\n\t\t\tforeach( $url_array as &$url_part ) {\n\t\t\t\t$url_part = ( $url_part !== \"\" ) ? strtolower( $url_part ) : \"index\";\n\t\t\t}\n\t\t}\n\t\treturn $url_array;\n }", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "private static function setArray() {\n\tself::$requests = explode(\"/\", self::$uri);\n if(self::$requests[0] == 'api') {\n array_shift(self::$requests);\n self::$api = True;\n }\n }", "private function makeDataFromUrl(){\n if (empty($_GET)){\n Route::$controller='home';\n return true;\n }\n $routs= explode('/',strip_tags($_GET['route']));\n $result=array();\n foreach ($routs as $k=>$v){\n switch ($k){\n case 0:\n $result['controller']=$v;\n $result['method']='index';\n Route::$controller=$v;\n Route::$method='index';\n break;\n default: $result['data'][]=$v;\n }\n }\n if (!empty($result['data']))\n Route::$data=$result['data'];\n return true;\n }", "function _a2ua($name,$array){\n $urlarray = array();\n foreach((array) $array as $key => $val){\n $urlarray[$name.'['.$key.']'] = $val;\n }\n return $urlarray;\n }", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "function query_vars($vars) {\n $vars[] = 'hcard_url';\n\n return $vars;\n }", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "public function obtenerURLData(){\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\n\t\tself::$urlPath = $urldata;\n\t\tif($urldata == ''){\n\t\t\tself::$urlBits[] = 'home';\n\t\t\tself::$urlPath = 'home';\n\t\t}else{\n\t\t\t$data = explode('/', $urldata);\n\t\t\twhile (!empty($data) && strlen(reset($data)) === 0){\n\t\t \tarray_shift( $data );\n\t\t }\n\t\t while (!empty($data) && strlen(end($data )) === 0){\n\t\t array_pop($data);\n\t\t }\n\t\t\tself::$urlBits = $this->array_trim( $data );\n\t\t}\n\t}", "public function generateUrls()\n {\n $url_array[self::FORWARD_KEY] = $this->getForwardRoom();\n $url_array[self::LEFT_KEY] = $this->getLeftRoom();\n $url_array[self::RIGHT_KEY] = $this->getRightRoom();\n $url_array[self::BACK_KEY] = $this->getBackRoom();\n $url_array[self::CURRENT_KEY] = $this->getCurrentRoom();\n\n return $url_array;\n }", "private function getUrlValues($url): array {\n $data = [];\n $splittedUrl = explode('/', $url);\n $splittedServerUrl = explode('/', $_SERVER['REQUEST_URI']);\n if(sizeof($splittedUrl) === sizeof($splittedServerUrl)) {\n for($i = 0; $i < sizeof($splittedUrl); $i++) {\n if($splittedUrl[$i] === $splittedServerUrl[$i]) {\n continue;\n } else {\n if($splittedUrl[$i][0] === '{' && $splittedUrl[$i][strlen($splittedUrl[$i]) - 1] === '}') {\n $data[substr($splittedUrl[$i], 1, strlen($splittedUrl[$i]) - 2)] = $splittedServerUrl[$i];\n }\n }\n }\n }\n return $data;\n }", "private static function obtenerVariablesUrl($url) {\n $url = preg_replace('/\\/$/', '', $url);\n\n //separamos las partes/variables de la url y las contamos\n $variables = explode('/', $url);\n $cantVariables = count($variables);\n //limpiamos y acumulamos las variables\n for ($i = 0; $i < $cantVariables; $i++) {\n //Acumulamos los valores en un arreglo\n $variables[$i] = index::limpiar($variables[$i]);\n }\n\n return $variables;\n }", "function get_req_vars( array $arr_input){\n\t\t\t$ret = array();\n\t\tforeach($arr_input as $k => $v){\n\t\t\tif(isset($_GET[$k])&&strlen($_GET[$k])){\n\n\t\t\t\t$ret[$k] = $k.'='.$_GET[$k];\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$ret[$k] = $k.'='.$v;\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn implode('&',$ret);\n\t\t\n\t\t}", "private function getUrl() {\n $parameters = array();\n $url = parse_url($_SERVER['REQUEST_URI']);\n foreach (explode(\"/\", $url['path']) as $p)\n if ($p != '')\n $parameters[] = $p;\n\n return $parameters;\n }", "public function implodeArrayForUrlDataProvider() {}", "public function getUriArray(){\n\t\t$this->prepareRuta();\n\t\treturn $this->uriArray;\n\t}", "private function _add_vars()\n\t{\n\t\t// --------------------------------------\n\t\t// Only continue if request is a page\n\t\t// and we have segments to check\n\t\t// --------------------------------------\n\n\t\tif (empty(ee()->uri->segments) && $this->settings['set_all_segments'] == 'n') return;\n\n\t\t// --------------------------------------\n\t\t// Initiate uri instance\n\t\t// --------------------------------------\n\n\t\t$this->uri = new EE_URI;\n\t\t$this->uri->_fetch_uri_string();\n\n\t\tif ($this->settings['ignore_pagination'] == 'y')\n\t\t{\n\t\t\t// Get rid of possible pagination segment at the end\n\t\t\t$this->uri->uri_string = preg_replace('#/[PC]\\d+$#', '', $this->uri->uri_string);\n\t\t}\n\n\t\t$this->uri->_explode_segments();\n\t\t$this->uri->_reindex_segments();\n\n\t\t// --------------------------------------\n\t\t// Suggestion by Leevi Graham:\n\t\t// check for pattern before continuing\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->settings['uri_pattern']) && ! preg_match($this->settings['uri_pattern'], $this->uri->uri_string)) return;\n\n\t\t// --------------------------------------\n\t\t// Initiate some vars\n\t\t// $data is used to add to global vars\n\t\t// $cats is used to keep track of all category ids found\n\t\t// --------------------------------------\n\n\t\t$data = $cats = array();\n\n\t\t// Also initiate this single var to an empty string\n\t\t$data['segment_category_ids'] = '';\n\t\t$data['segment_category_ids_piped'] = '';\n\n\t\t// --------------------------------------\n\t\t// Number of segments to register - 9 is hardcoded maximum\n\t\t// --------------------------------------\n\n\t\t$num_segs = ($this->settings['set_all_segments'] == 'y') ? 9 : $this->uri->total_segments();\n\n\t\t// --------------------------------------\n\t\t// loop through segments and set data array thus: segment_1_category_id etc\n\t\t// --------------------------------------\n\n\t\tfor ($nr = 1; $nr <= $num_segs; $nr++)\n\t\t{\n\t\t\tforeach ($this->fields AS $field)\n\t\t\t{\n\t\t\t\t$data[\"segment_{$nr}_{$field}\"] = '';\n\t\t\t}\n\t\t}\n\n\t\t// Initiate last segment vars\n\t\tforeach ($this->fields AS $field)\n\t\t{\n\t\t\t$data[\"last_segment_{$field}\"] = '';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Force lowercase segment array\n\t\t// --------------------------------------\n\n\t\t$segment_array = array_map('strtolower', $this->uri->segment_array());\n\n\t\t// --------------------------------------\n\t\t// Execute the rest only if there are segments to check\n\t\t// --------------------------------------\n\n\t\tif ($segment_array)\n\t\t{\n\t\t\t// --------------------------------------\n\t\t\t// Query database for these segments\n\t\t\t// Use lowercase for case insensitive comparison,\n\t\t\t// for when DB collation is case sensitive\n\t\t\t// --------------------------------------\n\n\t\t\tee()->db->select('cat_url_title, '. implode(', ', array_keys($this->fields)))\n\t\t\t ->from('categories')\n\t\t\t ->where('site_id', $this->site_id)\n\t\t\t ->where_in('cat_url_title', $segment_array);\n\n\t\t\t// --------------------------------------\n\t\t\t// Filter by category groups set in settings\n\t\t\t// --------------------------------------\n\n\t\t\tif (isset($this->settings['category_groups']))\n\t\t\t{\n\t\t\t\tif ($groups = array_filter($this->settings['category_groups']))\n\t\t\t\t{\n\t\t\t\t\tee()->db->where_in('group_id', $groups);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// Execute query and get results\n\t\t\t// --------------------------------------\n\n\t\t\t$query = ee()->db->get();\n\n\t\t\t// --------------------------------------\n\t\t\t// If we have matching categories, continue...\n\t\t\t// --------------------------------------\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Associate the results\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$rows = $this->_associate_results($query->result_array(), 'cat_url_title');\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Load typography if private var is set\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tif ($this->format || $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t{\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// loop through segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tforeach ($segment_array as $n => $seg)\n\t\t\t\t{\n\t\t\t\t\t// Skip non-matching segments\n\t\t\t\t\tif ( ! isset($rows[$seg])) continue;\n\n\t\t\t\t\t// Get the category row\n\t\t\t\t\t$row = $rows[$seg];\n\n\t\t\t\t\t// Overwrite values in data array\n\t\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Format category name if private var is set\n\t\t\t\t\t\tif ($name == 'cat_name' && $this->format)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->format_characters($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Parse file paths\n\t\t\t\t\t\tif ($name == 'cat_image' && $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->parse_file_paths($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set value in for segment_x_yyy\n\t\t\t\t\t\t$data[\"segment_{$n}_{$field}\"] = $row[$name];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add found id to cats array\n\t\t\t\t\t$cats[] = $row['cat_id'];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Set last_segment_category_x vars\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$last = $this->uri->total_segments();\n\n\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t{\n\t\t\t\t\t$data['last_segment_'.$field] = $data['segment_'.$last.'_'.$field];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Create inclusive stack of all category ids present in segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$data['segment_category_ids'] = implode('&',$cats);\n\t\t\t\t$data['segment_category_ids_piped'] = implode('|',$cats);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Finally, add data to global vars\n\t\t// Swapping $data and existing global vars makes a difference in EE2.4+\n\t\t// --------------------------------------\n\n\t\tee()->config->_global_vars = array_merge(ee()->config->_global_vars, $data);\n\t\t//ee()->config->_global_vars = array_merge($data, ee()->config->_global_vars);\n\t}", "public function get_url_params()\n {\n }", "protected function _getUrlParams()\n {\n return array(\n '_store' => $this->getStore(),\n '_store_to_url' => true\n );\n }", "public function urlArguments()\n {\n return [\n 'id' => $this->id,\n ];\n }", "public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }", "private function setGetParameters() {\n\t\tforeach(array_keys($_GET) as $currentKey) {\n\t\t\t$this->getArray[$currentKey] = $_GET[$currentKey];\n\t\t}\n\t}", "public static function getAllURLParams()\n\t{\n\t\treturn explode('/', $_SERVER['REQUEST_URI']);\n\t}", "public function getUrl(){\n $urls = [];\n $url_rules = [];\n //Получаем массив URL из таблицы Sef\n $pages = PagesHelper::select(Yii::$app->params['pages'],[],[['attr_name' => 'is_active', 'operand'=> '=', 'value'=> '1'],\n ['attr_name' => 'show_sitemap', 'operand'=> '=', 'value'=> '1']]);\n\n //'shini_legko/all_sizes/R-<radius:\\d+>' => 'shini/radius',//все товары с выбраным радиусом\n $SQL = 'SELECT radius FROM tyres_radius WHERE is_passenger = 1';\n $tyres_radius = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($tyres_radius AS $tr){\n $tr = str_replace('.00','',(string)$tr);\n $url_rules[] = Url::to(['shini/radius', 'radius'=>$tr]);\n }\n unset($tyres_radius);\n\n //'shini_legko/all_sizes/R-<radius:\\d+>/<width:\\d+>-<profile:\\d+>' =>\n // 'shini/size',//все товары с выбраным размером\n $SQL = 'SELECT size_width, size_profile, radius\n FROM tyres_sizes \n JOIN tyres_radius ON tyres_radius.id = tyres_sizes.id_radius\n WHERE tyres_radius.is_passenger = 1';\n $tyres_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_sizes AS $ts){\n $url_rules[] = Url::to(['shini/size',\n 'radius'=>str_replace('.00','',(string)$ts['radius']),\n 'width'=>$ts['size_width'],\n 'profile'=>str_replace('.00','',(string)$ts['size_profile'])]);\n }\n unset($tyres_sizes);\n\n //'shini_legko/producers/<alias:\\S+>' => 'shini/producer',//все шины одного производителя\n //'shini_gruz/producers/<alias:\\S+>' => 'shini/gruz_producer',//все шины одного производителя\n $SQL = 'SELECT alias, is_truck, is_passenger FROM tyres_vendors';\n $tyres_vendors = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_vendors AS $tyres_vendor){\n if($tyres_vendor['is_passenger'])\n $url_rules[] =\n Url::to(['shini/producer',\n 'alias'=>$tyres_vendor['alias']]);\n if($tyres_vendor['is_truck'])\n $url_rules[] =\n Url::to(['shini/gruz_producer',\n 'alias'=>$tyres_vendor['alias']]);\n\n }\n unset($tyres_vendors);\n\n //'shini_legko/producers/<vendor:\\S+>/<model:\\S+>' => 'shini/model_tyre',//модель шины\n //'shini_gruz/producers/<vendor:\\S+>/<model:\\S+>' => 'shini/gruz_model_tyre',//модель шины\n $SQL = 'SELECT type, tyres_models.alias, tyres_vendors.alias AS vendor_alias FROM tyres_models\n JOIN tyres_vendors ON tyres_vendors.id_vendor = tyres_models.id_vendor';\n $tyres_models = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_models AS $tyres_model){\n if($tyres_model['type'] < 6)\n $url_rules[] =\n Url::to(['shini/model_tyre',\n 'vendor'=>$tyres_model['vendor_alias'],\n 'model'=>$tyres_model['alias']]);\n else\n $url_rules[] =\n Url::to(['shini/gruz_model_tyre',\n 'vendor'=>$tyres_model['vendor_alias'],\n 'model'=>$tyres_model['alias']]);\n }\n unset($tyres_models);\n\n //'shini_legko/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'shini/tyre',//шина\n //'shini_gruz/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'shini/gruz_tyre',//шина\n $SQL = 'SELECT type, tyres_models.alias AS model_alias, tyres_vendors.alias AS vendor_alias, id_size \n FROM tyres_model_sizes\n JOIN tyres_models ON tyres_models.id_model = tyres_model_sizes.id_model\n JOIN tyres_vendors ON tyres_vendors.id_vendor = tyres_models.id_vendor\n WHERE tyres_model_sizes.price > 0';\n $tyres_model_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_model_sizes AS $tyres_model_size){\n if($tyres_model_size['type'] < 6)\n $url_rules[] =\n Url::to(['shini/tyre',\n 'vendor'=>$tyres_model_size['vendor_alias'],\n 'model'=>$tyres_model_size['model_alias'],\n 'id'=>$tyres_model_size['id_size']]);\n else\n $url_rules[] =\n Url::to(['shini/gruz_tyre',\n 'vendor'=>$tyres_model_size['vendor_alias'],\n 'model'=>$tyres_model_size['model_alias'],\n 'id'=>$tyres_model_size['id_size']]);\n }\n unset($tyres_model_sizes);\n\n //'shini_legko/vendors_auto/<alias:\\S+>' => 'shini/vendor_auto', //все модели текущей марки авто\n //'wheels/vendors_auto/<alias:\\S+>'=> 'wheels/vendor_auto', //все модели текущей марки авто\n $SQL = 'SELECT alias FROM vehicles_vendors';\n $vehicles_vendors = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($vehicles_vendors AS $vehicles_vendor){\n $url_rules[] =\n Url::to(['shini/vendor_auto',\n 'alias'=>$vehicles_vendor,]);\n $url_rules[] =\n Url::to(['wheels/vendor_auto',\n 'alias'=>$vehicles_vendor,]);\n }\n unset($vehicles_vendors);\n\n //'wheels/R-<radius:\\d+>' => 'wheels/radius',//все товары с выбраным радиусом\n $SQL = 'SELECT radius FROM wheels_radius WHERE is_passenger = 1';\n $wheels_radius = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($wheels_radius AS $wr){\n $url_rules[] = Url::to(['wheels/radius', 'radius'=>$wr]);\n }\n unset($wheels_radius);\n\n //'wheels/producers/<alias:\\S+>' => 'wheels/producer',//все диски одного производителя\n //'wheels_gruz/producers/<alias:\\S+>' => 'wheels/gruz_producer',//все диски одного производителя\n $SQL = 'SELECT alias, is_truck, is_passenger FROM wheels_vendors';\n $wheels_vendors = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_vendors AS $wheels_vendor){\n if($wheels_vendor['is_passenger'])\n $url_rules[] =\n Url::to(['wheels/producer',\n 'alias'=>$wheels_vendor['alias']]);\n if($wheels_vendor['is_truck'])\n $url_rules[] =\n Url::to(['wheels/gruz_producer',\n 'alias'=>$wheels_vendor['alias']]);\n }\n unset($wheels_vendors);\n\n //'wheels/producers/<vendor:\\S+>/<model:\\S+>' => 'wheels/model_wheel',//модель диска\n //'wheels_gruz/producers/<vendor:\\S+>/<model:\\S+>' => 'wheels/gruz_model_wheel',//модель диска\n $SQL = 'SELECT type, wheels_models.model_alias, wheels_vendors.alias AS vendor_alias FROM wheels_models\n JOIN wheels_vendors ON wheels_vendors.id_vendor = wheels_models.id_vendor';\n $wheels_models = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_models AS $wheels_model){\n if($wheels_model['type'] != 2)\n $url_rules[] =\n Url::to(['wheels/model_wheel',\n 'vendor'=>$wheels_model['vendor_alias'],\n 'model'=>$wheels_model['model_alias']]);\n else\n $url_rules[] =\n Url::to(['wheels/gruz_model_wheel',\n 'vendor'=>$wheels_model['vendor_alias'],\n 'model'=>$wheels_model['model_alias']]);\n }\n unset($wheels_models);\n\n //'wheels/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'wheels/wheel',//диск\n //'wheels_gruz/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'wheels/gruz_wheel',//диск\n $SQL = 'SELECT type, wheels_models.model_alias, wheels_vendors.alias AS vendor_alias, id_size \n FROM wheels_model_sizes\n JOIN wheels_models ON wheels_models.id_model = wheels_model_sizes.id_model\n JOIN wheels_vendors ON wheels_vendors.id_vendor = wheels_models.id_vendor\n WHERE wheels_model_sizes.price > 0';\n $wheels_model_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_model_sizes AS $wheels_model_size){\n if($wheels_model_size['type'] != 2)\n $url_rules[] =\n Url::to(['wheels/wheel',\n 'vendor'=>$wheels_model_size['vendor_alias'],\n 'model'=>$wheels_model_size['model_alias'],\n 'id'=>$wheels_model_size['id_size']]);\n else\n $url_rules[] =\n Url::to(['wheels/gruz_wheel',\n 'vendor'=>$wheels_model_size['vendor_alias'],\n 'model'=>$wheels_model_size['model_alias'],\n 'id'=>$wheels_model_size['id_size']]);\n }\n unset($wheels_model_sizes);\n\n //'news/<alias:\\S+>' => 'news/new'\n $SQL = 'SELECT alias FROM news WHERE is_active = 1';\n $news = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($news AS $new){\n $url_rules[] = Url::to(['news/new','alias'=>$new,]);\n }\n unset($news);\n\n $url_rules = array_merge($url_rules, $this->getChildPages($pages,0));\n //Формируем двумерный массив. createUrl преобразует ссылки в правильный вид.\n //Добавляем элемент массива 'daily' для указания периода обновления контента\n // foreach ($url_rules as $url_rule){\n // $urls[] = array($url_rule,'daily');\n // }\n return $url_rules;\n }", "public function list(){\n\n $urls = Urls::all();\n \n $capturas = array();\n foreach($urls as $key=>$val){\n $status = $this->status_url($val['url']);\n $conteudo = $this->content_url($val['url']);\n /* bem simples. salva os dados no banco */\n $capturas[] = array('conteudo' => $conteudo, 'status' => $status, 'url_id' => $val['id']);\n }\n\n $this->salvar($capturas);\n }", "public function get_url(): array\n {\n // get the full url as an array\n $url['raw'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $url['array'] = explode(\"/\", $url['raw']);\n\n // shift the array to remove the first useless array key and remove blank values\n array_shift($url['array']);\n $url['array'] = array_filter($url['array']);\n\n // return the url array\n return $url['array'];\n }", "public function getURLData()\r\n\t{\r\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\r\n\t\tself::$urlPath = $urldata;\r\n\t\tif( $urldata == '' )\r\n\t\t{\r\n\t\t\tself::$urlBits[] = 'home';\r\n\t\t\tself::$urlPath = 'home';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data = explode( '/', $urldata );\r\n\t\t\twhile ( !empty( $data ) && strlen( reset( $data ) ) === 0 ) \r\n\t\t\t{\r\n\t\t \tarray_shift( $data );\r\n\t\t }\r\n\t\t while ( !empty( $data ) && strlen( end( $data ) ) === 0) \r\n\t\t {\r\n\t\t array_pop($data);\r\n\t\t }\r\n\t\t\tself::$urlBits = $this->array_trim( $data );\r\n\t\t}\r\n\t}", "function queryStringToArray($string) {\n $url = explode('&', $string);\n /* Request variable to store all parameters */\n $request = array();\n foreach ($url as $value) {\n $new = explode('=', $value);\n $request[$new[0]] = $new[1];\n }\n return $request;\n}", "function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }", "public function getParamsForUrl()\n {\n return array(\n 'restaurant_slug' => $this->getRestaurant()->getSlug(),\n 'locality_slug' => $this->getRestaurant()->getLocality()->getSlug(),\n 'country_slug' => $this->getRestaurant()->getCountry()->getSlug(),\n 'dish_slug' => $this->getSlug()\n );\n }", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n // Put URL parts into according properties\n // By the way, the syntax here is just a short form of if/else, called \"Ternary Operators\"\n // @see http://davidwalsh.name/php-shorthand-if-else-ternary-operators\n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\n // for debugging. uncomment this if you have problems with the URL\n # echo 'Controller: ' . $this->url_controller . '<br />';\n # echo 'Action: ' . $this->url_action . '<br />';\n # echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n # echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n # echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\n }\n }", "protected function getUrl() {\n\n\t\t\t$parsedUrls = [\n\t\t\t\t\"&parsedUrl=\". rawurlencode(static::AjaxUrl. \"?value=\". static::ValueValid),\n\t\t\t\t\"&parsedUrl=\". rawurlencode(static::AjaxUrl. \"?value=\". static::ValueInvalid),\n\t\t\t\t\"&parsedUrl=\". rawurlencode(static::AjaxUrl. \"?value=\". static::ValueInit),\n\t\t\t];\n\n\t\t\treturn $parsedUrls;\n\t\t}", "public function cgi_values_constructor($url_vars) \n\t{\n \tksort($url_vars);\n \t$count = 0;\n\t\t$output = NULL;\n\t\tforeach ($url_vars as $key => $val) {\n \tif ($count == 0) {\n \t$cgi_sep = '?';\n \t} else {\n \t$cgi_sep = '&';\n \t}\n \t$output .= $cgi_sep.$key.'='.$val;\n \t$count++;\n \t}\n \treturn $output;\n\t}", "public function splitURL(){\n global $url;\n\n $url = explode('/', $url);\n $this->controller = (!empty($url[0]) ? $url[0] : null);\n $this->action = (!empty($url[1]) ? $url[1] : null);\n $this->parameter1 = (isset($url[2]) ? $url[2] : null);\n $this->parameter2 = (isset($url[3]) ? $url[3] : null);\n $this->parameter3 = (isset($url[4]) ? $url[4] : null);\n }", "public function getUrls(): array;", "public function getUrls(): array;", "final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }", "private function prepareRuta(){\n\t\t$this->uriArray = array_slice(explode('/',$this->uri), $this->webPathNumber,3);\n\t}", "public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }", "protected function get() : array\n {\n $barra = explode('/', $_SERVER[\"REQUEST_URI\"]);\n\n array_shift($barra);\n\n return $barra;\n }", "private function url($lst) {\n\n return explode(\",\", $lst);\n\n }", "public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }", "public function get_arr_maps() {\r\n $arr = $this->app->model('article_indexs')->getList('*');\r\n $tmp = array();\r\n \r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => app::get('site')->router()->gen_url(array('app'=>'content', 'ctl'=>'site_article', 'act'=>'index', 'arg0'=>$row['article_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n return $tmp;\r\n }", "function get_custom_pages_url(){\r\r\n\t\t// init \r\r\n\t\t$custom_pages_url = array('register_url','profile_url','transactions_url','login_url','lostpassword_url',\r\r\n\t\t\t 'membership_details_url','membership_contents_url');\r\r\n\t\t// return var\r\r\n\t\t$return = array();\r\r\n\t\t// loop\r\r\n\t\tforeach($custom_pages_url as $page_url){\r\r\n\t\t\t// key\r\r\n\t\t\t$return[$page_url] = $this->setting[$page_url];\r\r\n\t\t}\r\r\n\t\t// return\r\r\n\t\treturn $return;\r\r\n\t}", "function set_allowed_uri_params_list()\r\n{\r\n //allowed params disabled. All allowed\r\n//\tif ($ar_params = func_get_args())\r\n//\t{\r\n//\t\tglobal $tpl_allowed_uri_params_list;\r\n//\r\n//\t\tif (is_array($tpl_allowed_uri_params_list))\r\n//\t\t{\r\n//\t\t\tforeach ($ar_params as $val)\r\n//\t\t\t{\r\n//\t\t\t\t$tpl_allowed_uri_params_list[] = $val;\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\telse\r\n//\t\t{\r\n//\t\t\t$tpl_allowed_uri_params_list = $ar_params;\r\n//\t\t}\r\n//\t}\r\n}", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "function buildURLArray ($filterarray) {\r\n global $urlfilter;\r\n global $i;\r\n // Iterate through each filter in the array\r\n foreach($filterarray as $itemfilter) {\r\n // Iterate through each key in the filter\r\n foreach ($itemfilter as $key =>$value) {\r\n if(is_array($value)) {\r\n foreach($value as $j => $content) { // Index the key for each value\r\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\r\n }\r\n }\r\n else {\r\n if($value != \"\") {\r\n $urlfilter .= \"&itemFilter($i).$key=$value\";\r\n }\r\n }\r\n }\r\n $i++;\r\n }\r\n return \"$urlfilter\";\r\n }", "private function getUrlRequests(): string\n {\n $arrRequests = [];\n if ('' != $this->states['title']) {\n $arrRequests[] = 'title=' . $this->states['title'];\n }\n // if(''!=$this->states['action']) $arrRequests[]='action='.$this->states['action'];\n return implode('&', $arrRequests);\n }", "public function getUrlAsArray(): array\n {\n return \\explode('/', $this->url);\n }", "public static function getURLParams()\n\t{\n\t\t$params = [];\n\t\t$urlParams = self::getAllURLParams();\n\t\tfor ($i = contrlPos + 2; $i < count($urlParams); $i++) {\n\t\t\t$params[] = $urlParams[$i];\n\t\t}\n\t\treturn $params;\n\t}", "private function splitUrl()\n {\n if (isset($_GET['apps'])) {\n\n $url = rtrim($_GET['apps'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\t\t\t\n\n // for debugging. uncomment this if you have problems with the URL\t\t\t\n\t\t\t/*\n\t\t\t echo '<br/><br/><br/><br/><br/><br/><br/><br/>';\n echo 'Controller: ' . $this->url_controller . '<br />';\n echo 'Action: ' . $this->url_action . '<br />';\n echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t*/\n }\n\t\telse\n\t\t{\n\t\t\tif (empty($_GET))\n\t\t\t{\n\t\t\t\t$this->url_controller = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->url_controller = '404';\n\t\t\t}\n\t\t}\n\t\t\n }", "private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }", "public function getActionParams() { return array_merge($_GET, $_POST); }", "private function generate_request_array()\n {\n while (list($req_key, $req_val) = each($_REQUEST)) {\n if (!defined('FS_CURL_DEBUG') && $req_key == 'fs_curl_debug') {\n define('FS_CURL_DEBUG', $req_val);\n }\n //$this -> comment(\"$req_key => $req_val\");\n $this->request[$req_key] = $req_val;\n }\n }", "public function initUrlKeys();", "function convArrayForSanitizing($src, &$array)\n{\n $array = array();\n foreach ($src as $key => $val) {\n if (key_exists($key, $_GET)) {\n array_push($array, sprintf(\"%s=%s\", $key, $val));\n }\n }\n}", "function params( $array ) {\n\t\t$this->params_list = $array;\n\t\t}", "private function loadURLs() {\r\n $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\tforeach ($this->_url as $scriptname => $modes)\r\n\t{\r\n\t\t$this->url[$scriptname] = $modes[$status];\r\n\t}\r\n }", "function buildUrl($parts=array()){\r\n\t$uparts=array();\r\n\tforeach($parts as $key=>$val){\r\n\t\tif(preg_match('/^(PHPSESSID|GUID|debug|error|username|password|add_result|domain_href|add_id|add_table|edit_result|edit_id|edit_table|)$/i',$key)){continue;}\r\n\t\tif(preg_match('/^\\_(login|pwe|try|formfields|action|view|formname|enctype|fields|csuid|csoot)$/i',$key)){continue;}\r\n\t\tif(!is_string($val) && !isNum($val)){continue;}\r\n\t\tif(!strlen(trim($val))){continue;}\r\n\t\tif($val=='Array'){continue;}\r\n\t\tarray_push($uparts,\"$key=\" . encodeURL($val));\r\n \t}\r\n $url=implode('&',$uparts);\r\n return $url;\r\n\t}", "function get_urls(){\n\tglobal $urllist;\n\t$list = file($urllist);\n\t//print_r($list);\n\treturn $list;\n}", "function _tsuiseki_tracking_extract_data_from_url($ref) {\n $ref = (string)($ref);\n $opts = array();\n if (!empty($ref)) {\n $ref = urldecode($ref);\n $parts = preg_split('/[&|?]/', $ref);\n if (!empty($parts)) {\n $p = array();\n foreach ($parts as $part) {\n if (preg_match('/\\w+?=.*\\/i=1/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1] .'='. $p[2];\n }\n else if (preg_match('/\\w+?=.*/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1];\n }\n } // foreach\n }\n }\n return $opts;\n}", "public function getPathVars($args=null)\n {\n $path = array();\n\n $path['baseUrl'] = Virtual::getBaseUrl();\n $path['baseSecureUrl'] = Virtual::getBaseUrl('link', true);\n\n return $path;\n }", "public function explodeUrl2ArrayDataProvider() {}", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }", "public function getUriParams()\n {\n $values = array();\n $string = parse_url(filter_input(INPUT_SERVER, 'REQUEST_URI'));\n if (isset($string['query'])) {\n $exp = explode('&', $string['query']);\n $count = count($exp);\n for ($i = 0; $i < $count; $i++) {\n $value = explode('=', $exp[$i]);\n $values[$value[0]] = self::setAntiInjection($value[1]);\n }\n }\n return $values;\n }", "public function getUrlParams()\n {\n\n if ($this->gc_publish_all_albums != 1)\n {\n if (!unserialize($this->gc_publish_albums))\n {\n return;\n }\n }\n\n if (\\Input::get('items'))\n {\n //aktueller Albumalias\n $this->strAlbumalias = \\Input::get('items');\n\n //Authentifizierung bei vor Zugriff geschützten Alben, dh. der Benutzer bekommt, wenn nicht berechtigt, nur das Albumvorschaubild zu sehen.\n $this->authenticate($this->strAlbumalias);\n\n //fuer jw_imagerotator ajax-requests\n if (\\Input::get('jw_imagerotator'))\n {\n return;\n }\n }\n\n //wenn nur ein Album ausgewaehlt wurde und Weiterleitung in den Inhaltselementeinstellungen aktiviert wurde, wird weitergeleitet\n if ($this->doRedirectOnSingleAlbum())\n {\n $arrAlbId = unserialize($this->gc_publish_albums);\n if ($this->gc_publish_all_albums)\n {\n //if all albums are selected\n $objAlbum = $this->Database->prepare('SELECT alias FROM tl_gallery_creator_albums WHERE published=?')\n ->execute('1');\n }\n else\n {\n $objAlbum = $this->Database->prepare('SELECT alias FROM tl_gallery_creator_albums WHERE id=?')\n ->execute($arrAlbId[0]);\n }\n\n //Authentifizierung bei vor Zugriff geschützten Alben, dh. der Benutzer bekommt, wenn nicht berechtigt, nur das Albumvorschaubild zu sehen.\n $this->authenticate($objAlbum->alias);\n\n \\Input::setGet('items', $objAlbum->alias);\n $this->strAlbumalias = $objAlbum->alias;\n }\n\n // Get the Album Id\n if (\\Input::get('items'))\n {\n $objAlbum = \\GalleryCreatorAlbumsModel::findByAlias($this->strAlbumalias);\n if ($objAlbum !== null)\n {\n $this->intAlbumId = $objAlbum->id;\n $this->DETAIL_VIEW = true;\n }\n }\n }", "function getallrequest(){\r\n\tglobal $_REQUEST;\r\n\tforeach($_REQUEST as $index => $value){\r\n\t\tglobal $$index;\r\n\t\t$$index = $value;\r\n\t}\r\n}", "function generateUrlString($post_array) {\n\tforeach ($post_array as $key => &$val) {\n\t\tif (is_array($val)) {\n\t \t$val = json_encode($val);\n\t }\n\t $post_params[] = $key.\"=\".urlencode($val);\n\t}\n\t$urlString = implode('&', $post_params);\n\treturn $urlString;\n}", "public function query_vars($query_vars) {\n $query_vars[] = 'download_report';\n return $query_vars;\n }", "function url_encode(array $values)\n{\n return http_build_query($values);\n}", "public static function makeGetVars($vars){\n\t\t\t$res='';\n\t\t\tforeach($vars as $key=>$value)$res.=urlencode($key).'='.urlencode($value).'&';\n\t\t\treturn $res;\n\t\t}", "public static function get_reload_link_parts() {\n $split = strpos($_SERVER['REQUEST_URI'], '?');\n // Convert the query parameters into an array.\n $gets = ($split !== FALSE && strlen($_SERVER['REQUEST_URI']) > $split + 1) ?\n explode('&', substr($_SERVER['REQUEST_URI'], $split + 1)) :\n [];\n $getsAssoc = [];\n foreach ($gets as $get) {\n $tokens = explode('=', $get);\n // Ensure a key without value in the URL gets an empty value.\n if (count($tokens) === 1) {\n $tokens[] = '';\n }\n $getsAssoc[$tokens[0]] = $tokens[1];\n }\n $path = $split !== FALSE ? substr($_SERVER['REQUEST_URI'], 0, $split) : $_SERVER['REQUEST_URI'];\n return array(\n 'path' => $path,\n 'params' => $getsAssoc,\n );\n }", "function data() {\n\t\t return array(\n\t\t\t // Check against an odd redirect\n\t\t\t array( '/page/2/', '/page/2/' ),\n\t\t\t array( '/?page=2', '/page/2/' ),\n\t\t\t array( '/page/1/', '/' ),\n\t\t\t array( '/?page=1', '/' ),\n\n\t\t\t // The page designated as the front page should redirect to the front of the site\n\t\t\t array( '/front-page/', '/' ),\n\t\t\t array( '/front-page/2/', '/page/2/' ),\n\t\t\t array( '/front-page/?page=2', '/page/2/' ),\n\t\t\t array( '/blog-page/?paged=2', '/blog-page/page/2/' ),\n\t\t );\n\t}", "private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }", "public function GetViewAllURL();", "private function createParam()\n\t{\n\t\t$this->param = Array('http' => Array(), 'url' => null);\n\t}", "public function getUrlParameters() {\n\t\t$parameters = $this->parameters;\n\t\tif ($this->profile) {\n\t\t\t$parameters['profile'] = $this->profile;\n\t\t}\n\t\treturn $parameters;\n\t}", "function parseURLCRON() {\n\treturn array(\n\t\t'job'\t\t=> isset($_GET['job']) ? trim($_GET['job']) : null,\n\t\t'meta'\t\t=> isset($_GET['meta']) ? trim($_GET['meta']) : null\n\t);\n}", "private function processURLtoArray($url) {\n #If the request isn't set then no url parameters have been used\n if (is_null($url)) {\n $this->exceptionWithResponseCode(400,$this->genericExceptionMessages[\"URLFormat\"]);\n }\n\n #Split the request into seperate parts, with the slash as a seperator\n #Note that apache will collapse multiple /'s into a single /)\n $requestArray = explode(\"/\",$url);\n\n #We should probably ignore trailing slashes, which will generate an empty array element\n #Using strlen so that '0' is not removed\n $requestArray = array_filter($requestArray, 'strlen');\n\n #The request url should have either 4 or 5 elements\n if(!in_array(count($requestArray),array(4,5))){\n $this->exceptionWithResponseCode(400,\n \"Request URL has the wrong number of elements. \" . $this->genericExceptionMessages[\"URLFormat\"]\n );\n }\n\n return $requestArray;\n }", "function actData (string $a, string $path, array $others = []): array {\n\t$return = str_removeFromStart(\n\t\tparseUrlGet(\n\t\t\tmergeArrays(\n\t\t\t\t['a' => $a, 'path' => $path],\n\t\t\t\t$others\n\t\t\t)\n\t\t), '?'\n\t);\n\n\treturn ['data-act' => $return];\n}", "function buildURLArray($filterarray)\n {\n global $urlfilter;\n global $i;\n // Iterate through each filter in the array\n foreach ($filterarray as $itemfilter) {\n // Iterate through each key in the filter\n foreach ($itemfilter as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $j => $content) { // Index the key for each value\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\n }\n } else {\n if ($value != \"\") {\n $urlfilter .= \"&itemFilter($i).$key=$value\";\n }\n }\n }\n $i++;\n }\n return \"$urlfilter\";\n }", "public function createUrlArgs()\n {\n $args = [];\n \n $args['id'] = $this['id'];\n \n if (property_exists($this, 'slug')) {\n $args['slug'] = $this['slug'];\n }\n \n return $args;\n }", "private function loadURLs()\r\n\t{\r\n\t\t$status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\t\tforeach ($this->url as $scriptname => $modes)\r\n\t\t\t$this->url_script[$scriptname] = $modes[$status];\r\n\t}", "public function getFullUrl(){\n return 'http://'. $_SERVER['HTTP_HOST'] .'/'. implode('/', self::$_request_vars);\n }", "public function getURLQuery() {\n\t\t$query = array();\n\t\tif (Request::getGET('key')) {\n\t\t\t$query['key'] = Request::getGET('key');\n\t\t}\n\t\treturn $query;\n\t}", "function add_query_vars_filter( $vars ){\n $vars[] = 'campaign';\n $vars[] = 'container';\n $vars[] = 'type';\n $vars[] = 'launchUrls';\n $vars[] = 'playUrls';\n $vars[] = 'countUrls';\n return $vars;\n}", "public function toArray(): array\n {\n return [\n 'url' => $this->url\n ];\n }", "private function __parseUrl()\n {\n if (isset($_GET['url'])) {\n return explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n return [];\n }", "function ObtenerCOMANDOS_EJECUCION() {\r\n\t$lista = array();\r\n\r\n\t$listaPares = split(\"&\",COMANDOS_EJECUCION);\r\n\tforeach ($listaPares as $parEjecucion) {\r\n\t\tlist($desc,$path) = split(\"=\",$parEjecucion);\r\n\t\t$lista[$desc]=$path;\r\n\t}\r\n\r\n\treturn $lista;\r\n}", "public static function getUrlParameters(): array\n {\n $parameterString = isset($_SERVER['PATH_INFO']) ?\n // If not using an apache server (ie. VSCode PHP Server), need to use PATH_INFO and remove leading slash\n ltrim($_SERVER['PATH_INFO'], '/') :\n // Otherwise, use a QUERY_STRING passed on by an .htaccess rewrite rule\n $_SERVER['QUERY_STRING'];\n\n return explode('/', self::sanitize($parameterString));\n }", "public static function formUrlParameters(array $variables) : string {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $variables);\n\n\t\t$variables = self::_applyFilter(get_class(), __FUNCTION__, $variables, array('event' => 'args'));\n\n\t\t$appendix = '?';\n\n\t\t$first = 1;\n\t\tforeach ($variables as $key => $value) {\n\t\t\tif ($first === 1) {\n\t\t\t\t$appendix .= $key . '=' . urlencode($value);\n\t\t\t} else {\n\t\t\t\t$appendix .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t\t$first = 0;\n\t\t}//end foreach\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $appendix, $variables);\n\t\t$appendix = self::_applyFilter(get_class(), __FUNCTION__, $appendix, array('event' => 'return'));\n\n\t\treturn $appendix;\n\n\t}", "public function urlarray($string = '') {\n $a = explode('/', strtolower($string));\n $array = array();\n $key = '';\n foreach($a as $k => $v){\n if($k % 2 == 0){\n $key = $v;\n } else {\n $array[$key] = $v;\n }\n }\n return $array;\n }", "protected function generateUrls()\n\t{\n\t\t// Video URL array\n\t\t$videoUrl = $this->videoUrl;\n\n\t\t// Array for URLs\n\t\t$urls\t= [];\n\n\t\t$query\t= '';\n\n\t\t$keywords = $this->keywords;\n\n\t\t// Check if there is at least one keyword\n\t\tif(count($keywords) < 1) return false;\n\n\t\t// Setup dev key\n\t\t$devKey = (! is_null($this->developerKey)) ? '&key=' . $this->developerKey : null;\n\n\t\t// Loop keywords\n\t\tforeach($keywords as $keyword)\n\t\t{\n\t\t\t// Check keyword string length\n\t\t\tif(strlen($keyword) < 4) continue;\n\n\t\t\tforeach($this->modList as $modword)\n\t\t\t{\n\t\t\t\t$query = str_replace('-', ' ', Str::slug($modword . ' ' . $keyword));\n\n\t\t\t\t$urls[] = $videoUrl . urlencode($query) . $devKey;\n\t\t\t}\n\t\t}\n\n\t\t// Update the URLs\n\t\t$this->urls = $urls;\n\n\t\treturn $urls;\n\t}", "public function createUrlArgs()\n {\n return [\n 'id' => $this->getId()\n ];\n }", "protected function addToCurrentUrl($arrParams)\r\n\t{\r\n\t\t$strUrl = $this->Environment->request;\r\n\t\t\r\n\t\tforeach($arrParams as $arrParam)\r\n\t\t{\r\n\t\t\t$strUrl .= (strpos($strUrl, '?') !== false) ? '&' : '?';\t\r\n\t\t\t$strUrl .= $arrParam[0] . '=' . $arrParam[1];\r\n\t\t}\r\n\t\t\r\n\t\treturn $strUrl;\r\n\t}", "function parsePath($url)\n{\n $vars = array();\n\n if (preg_match_all('#\\{(\\w+)\\}#', $url, $matches)) {\n // First we convert the action route with its {variable_name} format to a preg-able string...\n for ($i=0; $i<count($matches[0]); $i++) {\n $str = $matches[0][$i];\n $vars[] = $matches[1][$i]; // Get the list of variables in the route into a different array.\n }\n\n // // Match - assign the values to the assoc array for return.\n // $url_variables = array();\n // for($i=0; $i<count($vars); $i++) {\n // \t$url_variables[$vars[$i]] = $route_matches[$i+1][0];\n // }\n }\n\n return $vars;\n}", "function ind_query_var($vars) {\n\tarray_push($vars, 'chapter');\n\treturn $vars;\n}", "function tep_get_all_get_params($exclude_array = '') {\n\tglobal $HTTP_GET_VARS;\n\tif (!is_array($exclude_array)) $exclude_array = array();\n\t$get_url = '';\n\tif (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {\n\t\treset($HTTP_GET_VARS);\n\t\twhile (list($key, $value) = each($HTTP_GET_VARS)) {\n\t\t\tif ( (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {\n\t\t\t\t$get_url .= rawurlencode(stripslashes($key)) . '=' . rawurlencode(stripslashes($value)) . '&';\n\t\t\t}\n\t\t}\n\t}\n\treturn $get_url;\n}" ]
[ "0.7014364", "0.6878537", "0.6303714", "0.6296667", "0.62715894", "0.6180092", "0.6133697", "0.6070338", "0.60030735", "0.599364", "0.59775305", "0.59764713", "0.5969556", "0.5926766", "0.5903173", "0.58446574", "0.58291787", "0.5821779", "0.5736571", "0.57316", "0.5714869", "0.5692318", "0.56871885", "0.56871706", "0.56862235", "0.5684803", "0.5673381", "0.56679326", "0.5658852", "0.5656634", "0.56537324", "0.56524634", "0.5619058", "0.55952543", "0.5575268", "0.5562051", "0.5548608", "0.55377287", "0.55377287", "0.5533114", "0.5513721", "0.5513415", "0.5497877", "0.54918545", "0.5483808", "0.54699135", "0.5459767", "0.545646", "0.5453247", "0.5451343", "0.54184765", "0.5404244", "0.53992087", "0.53973925", "0.53867996", "0.53847736", "0.5371046", "0.536268", "0.53584105", "0.5346849", "0.5345516", "0.53315157", "0.53250134", "0.53231215", "0.53191864", "0.531453", "0.53134674", "0.5310721", "0.53031677", "0.53018826", "0.52985615", "0.52866584", "0.52818054", "0.52809906", "0.5273818", "0.52729625", "0.5271615", "0.52635986", "0.52577627", "0.52564496", "0.5254076", "0.5253714", "0.5252302", "0.5252082", "0.52499837", "0.5241789", "0.52415186", "0.52399397", "0.52369523", "0.523441", "0.5232727", "0.5225221", "0.5222709", "0.52206236", "0.5206114", "0.52060217", "0.5201454", "0.52003473", "0.519785", "0.5182682", "0.51791793" ]
0.0
-1
Export basic report about books.
public function export(Request $request){ $request->query->add('export', 'csv'); $books = $this->bookService->filters($request); return $this->bookService->export($books); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionBookingReport()\n {\n $year = '';\n $user = '';\n $searchModel = new RecordBookingSearch();\n $export = Yii::$app->request->get('export');\n $search = Yii::$app->request->get('search');\n if (isset(Yii::$app->request->queryParams['RecordBookingSearch']['user_id']))\n $user = Yii::$app->request->queryParams['RecordBookingSearch']['user_id'];\n if (isset(Yii::$app->request->queryParams['RecordBookingSearch']['year']))\n $year = Yii::$app->request->queryParams['RecordBookingSearch']['year'];\n if(isset($export) && !isset($search)) {\n $this->BookingExport($user,$year);\n }\n else{\n $q = new BookingProvider();\n $filterData = $q->search($user,$year);\n $provider = new ArrayDataProvider([\n 'allModels' =>$filterData,\n 'sort' => [\n 'attributes' => ['staff', 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],\n ],\n 'pagination' => [\n 'pageSize' => 10,\n ],\n ]);\n return $this->render('booking_index', [\n 'searchModel' => $searchModel,\n 'provider' => $provider,\n 'year' => $year,\n 'user' => $user,\n ]);\n }\n\n }", "public function assembleBook()\n {\n $book = $this->app->render('book.twig', array(\n 'items' => $this->app['publishing.items']\n ));\n $temp = tempnam(sys_get_temp_dir(), 'easybook_');\n fputs(fopen($temp, 'w+'), $book);\n\n // use PrinceXML to transform the HTML book into a PDF book\n $prince = $this->app->get('prince');\n $prince->setBaseURL($this->app['publishing.dir.contents'].'/images');\n\n // Prepare and add stylesheets before PDF conversion\n if ($this->app->edition('include_styles')) {\n $defaultStyles = tempnam(sys_get_temp_dir(), 'easybook_style_');\n $this->app->render('@theme/style.css.twig', array(\n 'resources_dir' => $this->app['app.dir.resources'].'/'\n ),\n $defaultStyles\n );\n\n $prince->addStyleSheet($defaultStyles);\n }\n\n // TODO: custom book styles could also be defined with Twig\n $customCss = $this->app->getCustomTemplate('style.css');\n if (file_exists($customCss)) {\n $prince->addStyleSheet($customCss);\n }\n\n // TODO: the name of the book file (book.pdf) must be configurable\n $errorMessages = array();\n $prince->convert_file_to_file($temp, $this->app['publishing.dir.output'].'/book.pdf', $errorMessages);\n\n // show PDF conversion errors\n if (count($errorMessages) > 0) {\n foreach ($errorMessages as $message) {\n echo $message[0].': '.$message[2].' ('.$message[1].')'.\"\\n\";\n }\n }\n }", "public static function exportGiudeReport()\n {\n /**\n * TODO\n */\n }", "#[Route('/reports', name: 'reports', methods: ['GET'])]\n public function index(BookRepository $bookRepository, AuthorRepository $authorRepository, EditorialRepository $editorialRepository): Response\n {\n $books = $bookRepository->findAll();\n $authors = $authorRepository->findAll();\n $editorials = $editorialRepository->findAll();\n\n $delimiter = \",\"; \n $filename = \"books_data_\" . date('Y-m-d') . \".csv\"; \n \n // Create a file pointer \n $f = fopen('php://temp', 'w'); \n \n // Set column headers \n $name = array('Books List'); \n fputcsv($f, $name, $delimiter); \n\n $fields = array('Id', 'Title', 'Author', 'Editorial', 'Published'); \n fputcsv($f, $fields, $delimiter); \n\n //set data\n foreach ($books as $key => $book) {\n $lineData = array($key+1, $book->getTitle(), $book->getAuthor(), $book->getEditorial(), $book->getPublishedDate()->format(\"M d Y\")); \n fputcsv($f, $lineData, $delimiter); \n }\n $name = array('Author List'); \n fputcsv($f, $name, $delimiter); \n\n // Set column headers \n $fields = array('Id', 'Name', 'Last Name', 'Phone Number', 'Address', 'Country'); \n fputcsv($f, $fields, $delimiter); \n\n //set data\n foreach ($authors as $key => $author) {\n $lineData = array($key+1, $author->getName(), $author->getLastName(), $author->getPhoneNumber(), $author->getAddress(), $author->getCountry()); \n fputcsv($f, $lineData, $delimiter); \n }\n \n $name = array('Editorial List'); \n fputcsv($f, $name, $delimiter); \n // Set column headers \n $fields = array('Id', 'Name', 'Address', 'Country', 'Phone Number'); \n fputcsv($f, $fields, $delimiter); \n\n //set data\n foreach ($editorials as $key => $editorial) {\n $lineData = array($key+1, $editorial->getName(), $editorial->getAddress(), $editorial->getCountry(), $editorial->getPhoneNumber()); \n fputcsv($f, $lineData, $delimiter); \n }\n \n \n fputcsv($f, array('Number of Books in Catalog', count($bookRepository->findAll())));\n fputcsv($f, array('Number of Authors in Catalog',count($authorRepository->findAll())));\n fputcsv($f, array('Number of Authors in Catalog',count($editorialRepository->findAll())));\n fseek($f, 0); \n \n $response = new Response(stream_get_contents($f), 200);\n $response->headers->set('Content-Type', 'text/csv');\n //it's gonna output in a testing.csv file\n $response->headers->set('Content-Disposition', 'attachment; filename=\"' . $filename . '\";');\n\n return $response;\n }", "public function allBooks ()\n {\n $books = $this->book->findAll();\n $this->show('admin/allbooks', ['books' => $books]);\n }", "function outputBooks() {\n $db = connectDB();\n $books = new BooksGateway($db);\n $sql = $books->getSelectStatement();\n // Subcategory filter\n if (!empty($_GET['subcategory']) && empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"';\n }\n // Imprint filter\n elseif(empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where Imprint =\"' . $_GET['imprint']. '\"';\n }\n // Both filter\n elseif(!empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"' . 'AND'.'Imprint =\"' . $_GET['imprint']. '\"';\n }\n // No filter\n else {\n // Print all books.\n }\n $sql .= ' group by Title order by Title ASC limit 0,20';\n $result = $books->getStatement($sql);\n //var_dump($result);\n foreach($result as $key => $value) {\n $img= '<img src=\"book-images/thumb/'.$result[$key]['ISBN10']. '.jpg\" alt=\"book\">';\n echo constructBookLink($result[$key]['ISBN10'], $img) .'<br/>';\n echo '<a href=\"single-book.php?ISBN10=' . $result[$key]['ISBN10'] . '\" class=\"';\n if (isset($_GET['ISBN10']) && $_GET['ISBN10'] == $result[$key]['ISBN10']) echo 'active';\n echo 'item\">';\n echo $result[$key]['Title'] . '</a><br/>'; \n echo '<p>';\n echo \"<span>Year: </span>\". $result[$key]['CopyrightYear'] . \"<br/>\";\n echo \"<span>Subcategory Name: </span>\". $result[$key]['SubcategoryName'] . \"<br/>\";\n echo \"<span>Imprint Name: </span>\". $result[$key]['Imprint']. \"<br/>\";\n echo '</P><br/>';\n }\n }", "public function exportAction()\r\n {\r\n $this->_setParam('outputformat', 'csv');\r\n $this->indexAction(); \r\n }", "public function exportAction() {\n\t\tInvoices::Export();\n\t}", "public function getEx11() {\n $books = \\App\\Book::orderBy('title','asc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `title` asc\n }", "public function exportExcelAction()\n {\n $fileName = 'coursedoc.xls';\n $content = $this->getLayout()->createBlock('bs_coursedoc/adminhtml_coursedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function index()\n {\n $this->booklist();\n }", "public function export(){\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Card.xls\");\n \n $data['card'] = $this->Card_model->get_all_card();\n $this->load->view('card/export', $data);\n }", "public function indexAction() {\n $books = Book::getAllBooks();\n require_once('views/bookList.php');\n }", "public function actionDoExport() {\n $years = $this->getParam('years');\n\n $subjectsModel = new \\SubjectsModel();\n $subjects = $subjectsModel->getSubjectsByYear($years);\n\n // get subject ids\n $subjectIds = array();\n foreach ($subjects as $subs)\n $subjectIds = array_merge($subjectIds, array_keys($subs)); \n\n $usersModel = new \\UsersModel();\n $students = $usersModel->getStudentsInSubjects($subjectIds);\n\n $this->template->students = $students;\n $this->template->years = $subjects;\n }", "public function assembleBook()\n {\n $this->app->edition('id', $this->app['publishing.id']);\n\n // variables needed to hold the list of images and fonts of the book\n $bookImages = array();\n $bookFonts = array();\n\n // prepare the temp directory used to build the book\n $bookTempDir = $this->app['app.dir.cache']\n .'/'.$this->app['publishing.book.slug']\n .'-'.$this->app['publishing.edition'];\n\n $this->app->get('filesystem')->mkdir(array(\n $bookTempDir,\n $bookTempDir.'/book',\n $bookTempDir.'/book/META-INF',\n $bookTempDir.'/book/OEBPS',\n $bookTempDir.'/book/OEBPS/css',\n $bookTempDir.'/book/OEBPS/images',\n $bookTempDir.'/book/OEBPS/fonts',\n ));\n\n // generate easybook CSS file\n if ($this->app->edition('include_styles')) {\n $this->app->renderThemeTemplate(\n 'style.css.twig',\n array('resources_dir' => '..'),\n $bookTempDir.'/book/OEBPS/css/easybook.css'\n );\n\n // copy book fonts and prepare font data for ebook manifest\n $this->app->get('filesystem')->copy(\n $this->app['app.dir.resources'].'/Fonts/Inconsolata/Inconsolata.ttf',\n $bookTempDir.'/book/OEBPS/fonts/Inconsolata.ttf'\n );\n $bookFonts[] = array(\n 'id' => 'font-1',\n 'filePath' => 'fonts/Inconsolata.ttf',\n 'mediaType' => 'application/octet-stream'\n );\n }\n\n // generate custom CSS file\n $customCss = $this->app->getCustomTemplate('style.css');\n if (file_exists($customCss)) {\n $this->app->get('filesystem')->copy(\n $customCss,\n $bookTempDir.'/book/OEBPS/css/styles.css',\n true\n );\n }\n\n // each book element will generate an HTML page\n // use automatic slugs (chapter-1, chapter-2, ...) instead of\n // semantic slugs (lorem-ipsum, dolor-sit-amet, ...)\n $this->app->set('publishing.slugs', array());\n $items = array();\n foreach ($this->app['publishing.items'] as $item) {\n $pageName = array_key_exists('number', $item['config'])\n ? $item['config']['element'].' '.$item['config']['number']\n : $item['config']['element'];\n\n $slug = $this->app->get('slugger')->slugify(trim($pageName));\n\n $item['slug'] = $slug;\n // TODO: document this new item property\n $item['fileName'] = $slug.'.html';\n $items[] = $item;\n }\n // update `publishing items` with the new slug value\n $this->app->set('publishing.items', $items);\n\n // generate one HTML page for every book item\n $items = array();\n foreach ($this->app['publishing.items'] as $item) {\n $this->app->renderThemeTemplate('chunk.twig', array(\n 'item' => $item,\n 'has_custom_css' => file_exists($customCss),\n ),\n $bookTempDir.'/book/OEBPS/'.$item['fileName']\n );\n }\n\n // copy book images and prepare image data for ebook manifest\n if (file_exists($imagesDir = $this->app['publishing.dir.contents'].'/images')) {\n $images = $this->app->get('finder')->files()->in($imagesDir);\n\n $i = 1;\n foreach ($images as $image) {\n $this->app->get('filesystem')->copy(\n $image->getPathName(),\n $bookTempDir.'/book/OEBPS/images/'.$image->getFileName()\n );\n\n $bookImages[] = array(\n 'id' => 'figure-'.$i++,\n 'filePath' => 'images/'.$image->getFileName(),\n 'mediaType' => 'image/'.pathinfo($image->getFilename(), PATHINFO_EXTENSION)\n );\n }\n }\n\n // look for cover images\n $cover = null;\n if (null != $image = $this->app->getCustomCoverImage()) {\n list($width, $height, $type) = getimagesize($image);\n $cover = array(\n 'height' => $height,\n 'width' => $width,\n 'filePath' => 'images/'.basename($image),\n 'mediaType' => image_type_to_mime_type($type)\n );\n\n // copy the cover image\n $this->app->get('filesystem')->copy(\n $image,\n $bookTempDir.'/book/OEBPS/images/'.basename($image)\n );\n }\n\n // generate book cover\n $this->app->renderThemeTemplate('cover.twig', array(\n 'cover' => $cover\n ),\n $bookTempDir.'/book/OEBPS/titlepage.html'\n );\n\n // generate OPF file\n $this->app->renderThemeTemplate('content.opf.twig', array(\n 'cover' => $cover,\n 'has_custom_css' => file_exists($customCss),\n 'fonts' => $bookFonts,\n 'images' => $bookImages\n ),\n $bookTempDir.'/book/OEBPS/content.opf'\n );\n\n // generate NCX file\n $this->app->renderThemeTemplate('toc.ncx.twig', array(),\n $bookTempDir.'/book/OEBPS/toc.ncx'\n );\n\n // generate container.xml and mimetype files\n $this->app->renderThemeTemplate('container.xml.twig', array(),\n $bookTempDir.'/book/META-INF/container.xml'\n );\n $this->app->renderThemeTemplate('mimetype.twig', array(),\n $bookTempDir.'/book/mimetype'\n );\n\n // compress book contents as ZIP file and rename to .epub\n // TODO: the name of the book file (book.epub) must be configurable\n Toolkit::zip($bookTempDir.'/book', $bookTempDir.'/book.zip');\n $this->app->get('filesystem')->copy(\n $bookTempDir.'/book.zip',\n $this->app['publishing.dir.output'].'/book.epub',\n true\n );\n\n // remove temp directory used to build the book\n $this->app->get('filesystem')->remove($bookTempDir);\n }", "public function getEx12() {\n $books = \\App\\Book::orderBy('published','desc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `published` desc\n\t}", "public function index(){\n $data = $this->Excel_model->get_stocks();\n \n \n $template = 'Myexcel.csv';\n //set absolute path to directory with template files\n $templateDir = __DIR__ . \"/../controllers/\";\n \n //set config for report\n $config = array(\n 'template' => $template,\n 'templateDir' => $templateDir\n );\n \n \n //load template\n $R = new PHPReport($config);\n \n $R->load(array(\n 'NEWS_ID' => 'news_paper',\n 'repeat' => TRUE,\n 'data' => $data \n )\n );\n \n // define output directoy \n $output_file_dir = \"/tmp/\";\n \n \n $output_file_excel = $output_file_dir . \"Myexcel.csv\";\n //download excel sheet with data in /tmp folder\n $result = $R->render('excel', $output_file_excel);\n }", "public function exportExcelAction()\n {\n $fileName = 'curriculumdoc.xls';\n $content = $this->getLayout()->createBlock('bs_curriculumdoc/adminhtml_curriculumdoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function actionIndex()\n {\n $searchModel = new BookSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new BookSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function export(){\n\t\t$this->db_tools->export();\n\t\t$this->db_tools->echo_export();\n\t}", "public function export()\n { \n $this->title = 'Export Data'; \n return view('mitra::Product.BOF.export')->with([\n 'page' => $this\n ]);\n }", "public function actionIndex()\n {\n $query = Books::find()->with(['authors', 'genres']);\n\t\t$pages = new Pagination(['defaultPageSize'=> 10, 'totalCount' => $query->count()]);\n\t\t$books = $query->offset($pages->offset)\n\t\t->limit($pages->limit)\n\t\t->all();\n return $this->render('index', compact('books', 'pages'));\n }", "public function export(){\r\n $specified = $this->__isExportFieldSpecified();\r\n if($specified){\r\n $csv = $this->Student->export($specified);\r\n $this->Response->csv($csv);\r\n }else{\r\n $schemas = $this->Student->export();\r\n $this->set(compact('specified', 'schemas'));\r\n }\r\n }", "public function getEx15() {\n $books = Book::all();\n $this->printBooks($books);\n\t}", "public function index()\n {\n $books = Book::all();\n return $this->setStatusCode(200)->respond([\n 'data' => $this->booksTransformer->transformCollection($books->all())\n ]);\n }", "public function books()\n {\n return $this->get('/books');\n }", "public function reportAction()\n {\n $peserta = $this->getDoctrine()->getManager()->getRepository('AppBundle:Peserta')->getReportData();\n $workbook = new Workbook();\n $sheet = new Sheet($workbook);\n $table = new Table();\n\n $i = 1;\n $table->setRow([\n 'NO',\n 'TANGGAL',\n 'NAMA',\n 'ALAMAT',\n 'EMAIL',\n 'PHONE',\n 'ASAL INSTITUSI',\n 'PRINT SERTIFIKAT',\n ]);\n foreach ($peserta as $p) {\n $table->setRow([\n $i,\n $p->getTimestamp()->format('d-m-Y'),\n $p->getName(),\n $p->getAddress(),\n $p->getEmail(),\n $p->getPhone(),\n $p->getOrigin(),\n $p->getCetak(),\n ]);\n $i++;\n }\n\n $sheet->addTable($table, new Coordinate(1,1));\n $workbook->addSheet($sheet);\n $d = date('Y-m-d');\n\n $writer = (new WriterFactory())->createWriter(new Excel5(__DIR__.'/../../../web/export/excel/'.$d.'-data-peserta.xls'));\n $phpExcel = $writer->convert($workbook);\n $writer->write($phpExcel);\n \n $filePath = __DIR__.'/../../../web/export/excel/'.$d.'-data-peserta.xls';\n\n $fs = new FileSystem();\n if (!$fs->exists($filePath)) {\n throw $this->createNotFoundException();\n }\n\n // prepare BinaryFileResponse\n $filename = $d.'-data-peserta.xls';\n $response = new BinaryFileResponse($filePath);\n $response->trustXSendfileTypeHeader();\n\n $response->setContentDisposition(\n ResponseHeaderBag::DISPOSITION_INLINE,\n $filename,\n iconv('UTF-8', 'ASCII//TRANSLIT', $filename)\n );\n\n return $response;\n }", "public function getEx1() {\n # Use the QueryBuilder to get all the books\n $books = \\DB::table('books')->get();\n $this->printBooks($books);\n }", "public static function index()\r\n\t{\r\n\t\t$title = 'Book List';\r\n\t\t$model = new Books();\r\n\t\t$books = $model->all();\r\n\t\t/*\r\n\t\t// compact do this (down):\r\n\t\t$data['title'] = 'Book List';\r\n\t\t$data['books'] = [];\r\n\t\t*/\r\n\t\tView::show('/books/index', compact('title','books'));\r\n\t}", "public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }", "public function index()\n {\n return BookResources::collection(Book::with(['user','categories','authors'])->get());\n }", "public function index()\n {\n $books = Book::all();\n $categories = Category::all();\n return view('dashboard.pages.books.index', ['books' => $books, 'categories' => $categories]);\n }", "function export()\n\t{\n\t\t$zip = $this->buildExportFile();\n\t\t\n\t ilUtil::deliverFile($zip, $this->object->getTitle().\".zip\", '', false, true);\n\t}", "public function reportExport()\n {\n \t$report = Report::join('report_natures', 'reports.report_nature', '=', 'report_natures.id')\n ->join('residents', 'reports.submitted_by', '=', 'user_id')\n ->select('reports.*', 'residents.name_first', 'residents.name_middle', 'residents.name_last', 'report_natures.nature_name')\n ->get();\n\n \t$pdf = PDF::loadView('exporttopdf');\n\n \t$html = '<html>' . \n\t\t\t\t\t'<style>' .\n\t\t \t\t\t'table {\n\t\t\t\t\t\t border-collapse: collapse;\n\t\t\t\t\t\t align: center;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttable, th, td {\n\t\t\t\t\t\t\tpadding-left: 5px;\n\t\t\t\t\t\t\tpadding-right: 5px;\n\t\t\t\t\t\t border: 1px solid black;\n\t\t\t\t\t\t text-align: center;\n\t\t\t\t\t\t}' .\n 'h3 {\n text-align: center;\n }' .\n\t\t\t\t\t'</style>' .\n \t\t\t\t'<body>' .\n '<h3> Reports List </h3><br>' .\n \t\t\t\t\t'<table>' . \n \t\t\t\t\t\t'<thead>' .\n \t\t\t\t\t\t\t'<tr>' .\n \t\t\t\t\t\t\t\t'<th><b>Report Nature</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Description</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Location</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Time Submitted</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Submitted By</b></th>' .\n \t\t\t\t\t\t\t'</tr>' .\n \t\t\t\t\t\t'</thead>' .\n \t\t\t\t\t\t'<tbody>'; \n\n \tforeach ($report as $details) \n \t{ \n \t\t$html .= \t\"<tr>\" .\n \t\t\t\t\t\"<td>\" . $details->nature_name . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->description . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->location . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->created_at . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->name_first . \" \" . $details->name_middle . \" \" . $details->name_last . \"</td>\" .\n \t\t\t\t\t\"</tr>\"; \n \t} \n \t\t$html .= \t'</tbody>' . \n \t\t\t\t\t\t'</table>' .\n \t\t\t\t\t\t\t'</body>' . \n \t\t\t\t\t\t\t\t'</html>'; \n\n \t\t$pdf->loadHTML($html); \n\n \t\treturn $pdf->stream('Report List');\n }", "function _export()\n\t{\n\t\t$title=get_page_title('EXPORT');\n\n\t\tif (!array_key_exists('tables',$_POST)) warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n\n\t\t$xml=export_to_xml($_POST['tables'],post_param_integer('comcode_xml',0)==1);\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_EXPORT_RESULTS_SCREEN',array('TITLE'=>$title,'XML'=>$xml));\n\t}", "private function exportAll()\n {\n $files = Mage::getModel('factfinder/export_type_product')->saveAll();\n echo \"Successfully generated the following files:\\n\";\n foreach ($files as $file) {\n echo $file . \"\\n\";\n }\n }", "function book($id, $file)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('book: invalid title id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n // TODO check file parameter?\n\n $details = $app->calibre->titleDetails($globalSettings['lang'], $id);\n if (is_null($details)) {\n $app->getLog()->warn(\"book: no book found for \" . $id);\n $app->notFound();\n }\n // for people trying to circumvent filtering by direct access\n if (title_forbidden($details)) {\n $app->getLog()->warn(\"book: requested book not allowed for user: \" . $id);\n $app->notFound();\n return;\n }\n\n $real_bookpath = $app->calibre->titleFile($id, $file);\n $contentType = Utilities::titleMimeType($real_bookpath);\n if (is_authenticated()) {\n $app->getLog()->info(\"book download by \" . $app->auth->getUserName() . \" for \" . $real_bookpath .\n \" with metadata update = \" . $globalSettings[METADATA_UPDATE]);\n } else {\n $app->getLog()->info(\"book download for \" . $real_bookpath .\n \" with metadata update = \" . $globalSettings[METADATA_UPDATE]);\n }\n if ($contentType == Utilities::MIME_EPUB && $globalSettings[METADATA_UPDATE]) {\n if ($details['book']->has_cover == 1) {\n $cover = $app->calibre->titleCover($id);\n } else {\n $cover = null;\n }\n // If an EPUB update the metadata\n $mdep = new MetadataEpub($real_bookpath);\n $mdep->updateMetadata($details, $cover);\n $bookpath = $mdep->getUpdatedFile();\n $app->getLog()->debug(\"book(e): file \" . $bookpath);\n $app->getLog()->debug(\"book(e): type \" . $contentType);\n $booksize = filesize($bookpath);\n $app->getLog()->debug(\"book(e): size \" . $booksize);\n if ($booksize > 0) {\n header(\"Content-Length: \" . $booksize);\n }\n header(\"Content-Type: \" . $contentType);\n header(\"Content-Disposition: attachment; filename=\\\"\" . $file . \"\\\"\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Transfer-Encoding: binary\");\n readfile_chunked($bookpath);\n } else {\n // Else send the file as is\n $bookpath = $real_bookpath;\n $app->getLog()->debug(\"book: file \" . $bookpath);\n $app->getLog()->debug(\"book: type \" . $contentType);\n $booksize = filesize($bookpath);\n $app->getLog()->debug(\"book: size \" . $booksize);\n header(\"Content-Length: \" . $booksize);\n header(\"Content-Type: \" . $contentType);\n header(\"Content-Disposition: attachment; filename=\\\"\" . $file . \"\\\"\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Transfer-Encoding: binary\");\n readfile_chunked($bookpath);\n }\n}", "public function exportBalanceReport() {\n $this->auth->checkIfOperationIsAllowed('native_report_balance');\n $this->load->model('leaves_model');\n $this->load->model('types_model');\n $this->load->model('organization_model');\n $this->load->library('excel');\n $data['refDate'] = date(\"Y-m-d\");\n if (isset($_GET['refDate']) && $_GET['refDate'] != NULL) {\n $data['refDate'] = date(\"Y-m-d\", $_GET['refDate']);\n }\n $data['include_children'] = filter_var($_GET['children'], FILTER_VALIDATE_BOOLEAN);\n $this->load->view('reports/balance/export', $data);\n }", "public function ReporteLibro(){\n\t\t$empresas = $this->ListarDatosEmpresa();\n\t\t$html_cabecera = $this->HtmlCabeceraReporte($empresas);\n\t\t//Listamos y organizamos los detalles del cuerpo del libro a mostrar\n\t\t$libro = $this->model_libro->VerLibro($_REQUEST['id']);\n\t\t$html_detalle = $this->HtmlDetalleReporteLibro($libro);\n\n\t\t$this->GenerarPDF($html_cabecera.$html_detalle);\n\t\t//echo $_REQUEST['id'];\n\t\t//var_dump($libro);\n\t\t//echo $html_detalle;\n\t}", "private function printBooks($books) {\n foreach($books as $book) {\n echo 'id:'.$book->id.' title: '.$book->title.'<br>';\n }\n }", "function perform_export()\n {\n global $CFG;\n require_once($CFG->dirroot.'/blocks/bcgt/lib.php');\n global $CFG, $USER;\n $name = preg_replace(\"/[^a-z 0-9]/i\", \"\", $this->get_name());\n \n ob_clean();\n header(\"Pragma: public\");\n header('Content-Type: application/vnd.ms-excel; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"'.$name.'.xlsx\"'); \n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false);\n\n require_once $CFG->dirroot . '/blocks/bcgt/lib/PHPExcel/Classes/PHPExcel.php';\n \n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()\n ->setCreator(fullname($USER))\n ->setLastModifiedBy(fullname($USER))\n ->setTitle($this->get_name())\n ->setSubject($this->get_name())\n ->setDescription($this->get_description());\n\n // Remove default sheet\n $objPHPExcel->removeSheetByIndex(0);\n \n $sheetIndex = 0;\n \n // Set current sheet\n $objPHPExcel->createSheet($sheetIndex);\n $objPHPExcel->setActiveSheetIndex($sheetIndex);\n $objPHPExcel->getActiveSheet()->setTitle(\"Report\");\n \n $rowNum = 1;\n\n // Headers\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $col = 0;\n foreach($this->header AS $head)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $head);\n $col++;\n }\n $rowNum++;\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $col = 0;\n foreach($row AS $rowObj)\n {\n $columnCount = $rowObj->colCount;\n $columnContent = $rowObj->content;\n //add all the cells, \n //thenmerge\n $startCol = $col;\n for($i=0;$i<$columnCount;$i++)\n {\n if($i == 0)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $columnContent);\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, '');\n }\n $col++;\n }\n $endCol = $col;\n if($columnCount != 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($startCol).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($endCol - 1).''.$rowNum);\n }\n \n \n }\n $rowNum++;\n }\n } \n \n }\n //data\n if(isset($this->data))\n {\n foreach($this->data AS $data)\n {\n $col = 0;\n foreach($data AS $cell)\n { \n if(is_a($cell, 'stdClass'))\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $this->build_excell_cell($cell));\n $objPHPExcel->getActiveSheet()->getStyle(''.PHPExcel_Cell::stringFromColumnIndex($col).''.$rowNum)->applyFromArray(\n array(\n 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => $this->get_excell_cell_color($cell)\n ),\n 'borders' => array(\n 'outline' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb'=>'cfcfcf')\n )\n )\n )\n ); \n if(isset($cell->colspan) && $cell->colspan > 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($col).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($col + ($cell->colspan - 1)).''.$rowNum);\n \n $col = $col + ($cell->colspan - 1);\n }\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $cell);\n }\n \n $col++;\n } \n $rowNum++;\n }\n }\n \n // Freeze rows and cols (everything to the left of D and above 2)\n $objPHPExcel->getActiveSheet()->freezePane($this->get_frozen_panes());\n \n // End\n $objPHPExcel->setActiveSheetIndex(0);\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\n ob_clean();\n $objWriter->save('php://output');\n \n exit;\n }", "public function actionIndex()\n {\n $searchModel = new BookSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, Book::STATUS_APPROVED);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $booket=Booket::all();\n\n return $this->showAll($booket);\n\n }", "public function get_book();", "public function index()\n {\n // return collection of all book's reviews\n return ReviewBookIndexResource::collection(ReviewBook::info()->get());\n }", "public function index()\n {\n $books = \\App\\book::all();\n\t\treturn view('book.index')->with('books',$books);\n }", "public function index()\n {\n return $this->successResponse($this->client->getBooks());\n }", "public function downloadBookCSV()\n {\n $bookList = $this->bookDao->getBookList();\n $filename = \"book.csv\";\n //write csv file\n $handle = fopen($filename, 'w+');\n fputcsv($handle, array('Title', 'Type', 'Price', 'Quantity', 'Released Date', 'Author Id'));\n foreach ($bookList as $row) {\n fputcsv($handle, array(\n $row->title, $row->type, $row->price, $row->quantity,\n date('Y/m/d', strtotime($row->releaseDate)), $row->author_id,\n ));\n }\n\n fclose($handle);\n\n $headers = array(\n 'Content-Type' => 'text/csv',\n );\n\n return response()\n ->download($filename, $filename, $headers)\n ->deleteFileAfterSend();\n }", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $catPuesto = CatPuesto::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $catPuesto = CatPuesto::model() -> findAll();\n }\n\n if ($catPuesto == null || count($catPuesto) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('catPuesto' => $catPuesto));\n }", "public function index()\n {\n $books = book::all();\n return view('backend.book.book_list',compact('books'));\n }", "public function index()\n {\n $book_details = array(\n array('key'=> 0, 'value'=> 'Kochi'),\n array('key'=> 1, 'value'=> 'Female Books'),\n array('key'=> 2, 'value'=> 'Male Books')\n );\n\n $books = Book::orderBy('id','desc')->paginate(4);\n $provinces = Province::select(['id', 'name_' . App::getLocale() . ' as name'])->get();\n $districts = District::select(['id', 'name_' . App::getLocale() . ' as name'])->get();\n $book_types = BookType::select(['id', 'name_' . App::getLocale() . ' as name'])->get();\n\n $assignees = User::select(['id', 'name'])->get();\n return view('book.book_list', compact('books', 'provinces', 'districts', 'book_types', 'book_details', 'assignees'));\n }", "public function index()\n {\n $this->statusText = 'success';\n $this->statusCode = 200;\n\n return response()->json([\n 'status_code' => $this->statusCode,\n 'status' => $this->statusText,\n 'data' => Book::all()\n ])->setStatusCode($this->statusCode, $this->statusText);\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function exportExcelAction()\n {\n $fileName = 'traineedoc.xls';\n $content = $this->getLayout()->createBlock('bs_traineedoc/adminhtml_traineedoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function getBooks()\n {\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n \n $result = $this->db->execute($sql);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }", "function ExportData() {\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\n\t\t$bSelectLimit = EW_SELECT_LIMIT;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->StartRec = 1;\n\n\t\t// Export all\n\t\tif ($this->ExportAll) {\n\t\t\tset_time_limit(EW_EXPORT_ALL_TIME_LIMIT);\n\t\t\t$this->DisplayRecs = $this->TotalRecs;\n\t\t\t$this->StopRec = $this->TotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->DisplayRecs <= 0) {\n\t\t\t\t$this->StopRec = $this->TotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->StartRec-1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\t$ExportDoc = ew_ExportDocument($this, \"h\");\n\t\t$ParentTable = \"\";\n\t\tif ($bSelectLimit) {\n\t\t\t$StartRec = 1;\n\t\t\t$StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\n\t\t} else {\n\t\t\t$StartRec = $this->StartRec;\n\t\t\t$StopRec = $this->StopRec;\n\t\t}\n\t\t$sHeader = $this->PageHeader;\n\t\t$this->Page_DataRendering($sHeader);\n\t\t$ExportDoc->Text .= $sHeader;\n\t\t$this->ExportDocument($ExportDoc, $rs, $StartRec, $StopRec, \"\");\n\t\t$sFooter = $this->PageFooter;\n\t\t$this->Page_DataRendered($sFooter);\n\t\t$ExportDoc->Text .= $sFooter;\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Export header and footer\n\t\t$ExportDoc->ExportHeaderAndFooter();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\t$ExportDoc->Export();\n\t}", "public function writingPapers() {\n\t\t$pageTitle = 'Writing Papers';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/writing-papers.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function index()\n {\n $data['languages'] = Language::getLanguages();\n $data['books'] = Book::getAll(3);\n return view('admin.books.index', $data);\n\n }", "public function index()\n {\n $books = Book::all();\n\n if(!$books){\n return $this->sendError('', 'Not Found', 404);\n }\n\n return $this->sendResponse($books, '');\n }", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function index()\n {\n return view('admin.book.index',[\n 'books'=>Book::all()\n ] );\n }", "public function export(){\n \n // Skrip berikut ini adalah skrip yang bertugas untuk meng-export data tadi ke excel\n header(\"Content-type: application/vnd-ms-excel\");\n header(\"Content-Disposition: attachment; filename=Data_Transaksi.xls\");\n \n $data['header_transaksi'] = $this->header_transaksi_model->listing();\n $this->load->view('admin/export/vw_laporan_excel', $data);\n\n }", "public function index()\n {\n $books = Book::orderBy('title')\n ->get();\n return view('admin.book.index', compact('books'));\n }", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll();\n }\n\n if ($cursoDisponibleServidorPublico == null || count($cursoDisponibleServidorPublico) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('cursoDisponibleServidorPublico' => $cursoDisponibleServidorPublico));\n }", "public function index()\n {\n $books = Book::all();\n \n return view('library/book/index', compact('books'));\n }", "public function getEx5() {\n $books = \\App\\Book::all();\n $this->printBooks($books);\n }", "public function indexAction() {\n\n\t\t// Connect to AmazonWebservice \n\t\t$query = new Zend_Service_Amazon(\n\t\t\t\t\t\t\t'AKIAI3S5LPYDW7CCEXFQ',\n\t\t\t\t\t\t\t'DE',\n\t\t\t\t\t\t\t'+vabmr8+C4eyYe5DbmISmHsBZc9NOHVX/QbK6WM9'\n \t\t); \n\t\t$results = $query->itemSearch(array(\n\t\t\t\t\t\t\t\t'SearchIndex' => 'Books',\n\t\t\t\t\t\t\t\t'Keywords'\t => 'tiere',\n\t\t\t\t\t\t\t\t'ResponseGroup' => 'Medium'\n\t\t\t\t\t\t));\n \n\t\t$books = array();\n \tforeach ($results as $result) {\n\t\t\t$books[] = array(\n\t\t\t\t'title' => $result->Title,\n\t\t\t\t'link'\t => $result->DetailPageURL,\n\t\t\t\t'image' => $result->MediumImage\n\t\t\t\t\t\t\t? $result->MediumImage->Url->getUri() : ''\n\t\t\t);\n \t}\n\t\t$this->view->books = $books;\n }", "function ExportData() {\r\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\r\n\t\t$bSelectLimit = FALSE;\r\n\r\n\t\t// Load recordset\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\r\n\t\t} else {\r\n\t\t\tif (!$this->Recordset)\r\n\t\t\t\t$this->Recordset = $this->LoadRecordset();\r\n\t\t\t$rs = &$this->Recordset;\r\n\t\t\tif ($rs)\r\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\r\n\t\t}\r\n\t\t$this->StartRec = 1;\r\n\t\t$this->SetUpStartRec(); // Set up start record position\r\n\r\n\t\t// Set the last record to display\r\n\t\tif ($this->DisplayRecs <= 0) {\r\n\t\t\t$this->StopRec = $this->TotalRecs;\r\n\t\t} else {\r\n\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\r\n\t\t}\r\n\t\tif (!$rs) {\r\n\t\t\theader(\"Content-Type:\"); // Remove header\r\n\t\t\theader(\"Content-Disposition:\");\r\n\t\t\t$this->ShowMessage();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->ExportDoc = ew_ExportDocument($this, \"v\");\r\n\t\t$Doc = &$this->ExportDoc;\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->StartRec = 1;\r\n\t\t\t$this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\r\n\t\t} else {\r\n\r\n\t\t\t//$this->StartRec = $this->StartRec;\r\n\t\t\t//$this->StopRec = $this->StopRec;\r\n\r\n\t\t}\r\n\r\n\t\t// Call Page Exporting server event\r\n\t\t$this->ExportDoc->ExportCustom = !$this->Page_Exporting();\r\n\t\t$ParentTable = \"\";\r\n\t\t$sHeader = $this->PageHeader;\r\n\t\t$this->Page_DataRendering($sHeader);\r\n\t\t$Doc->Text .= $sHeader;\r\n\t\t$this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, \"view\");\r\n\r\n\t\t// Export detail records (observacion_tutor)\r\n\t\tif (EW_EXPORT_DETAIL_RECORDS && in_array(\"observacion_tutor\", explode(\",\", $this->getCurrentDetailTable()))) {\r\n\t\t\tglobal $observacion_tutor;\r\n\t\t\tif (!isset($observacion_tutor)) $observacion_tutor = new cobservacion_tutor;\r\n\t\t\t$rsdetail = $observacion_tutor->LoadRs($observacion_tutor->GetDetailFilter()); // Load detail records\r\n\t\t\tif ($rsdetail && !$rsdetail->EOF) {\r\n\t\t\t\t$ExportStyle = $Doc->Style;\r\n\t\t\t\t$Doc->SetStyle(\"h\"); // Change to horizontal\r\n\t\t\t\tif ($this->Export <> \"csv\" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {\r\n\t\t\t\t\t$Doc->ExportEmptyRow();\r\n\t\t\t\t\t$detailcnt = $rsdetail->RecordCount();\r\n\t\t\t\t\t$observacion_tutor->ExportDocument($Doc, $rsdetail, 1, $detailcnt);\r\n\t\t\t\t}\r\n\t\t\t\t$Doc->SetStyle($ExportStyle); // Restore\r\n\t\t\t\t$rsdetail->Close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sFooter = $this->PageFooter;\r\n\t\t$this->Page_DataRendered($sFooter);\r\n\t\t$Doc->Text .= $sFooter;\r\n\r\n\t\t// Close recordset\r\n\t\t$rs->Close();\r\n\r\n\t\t// Call Page Exported server event\r\n\t\t$this->Page_Exported();\r\n\r\n\t\t// Export header and footer\r\n\t\t$Doc->ExportHeaderAndFooter();\r\n\r\n\t\t// Clean output buffer\r\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\r\n\t\t\tob_end_clean();\r\n\r\n\t\t// Write debug message if enabled\r\n\t\tif (EW_DEBUG_ENABLED && $this->Export <> \"pdf\")\r\n\t\t\techo ew_DebugMsg();\r\n\r\n\t\t// Output data\r\n\t\t$Doc->Export();\r\n\t}", "public function actionExport(){\n $dompdf = new Dompdf();\n\n\n $dompdf->loadHtml(include('GestorRestauranteWeb/GestorRestaurante/backend/web/index.php?r=fatura%2Findex'));\n\n// (Optional) Setup the paper size and orientation\n $dompdf->setPaper('A4', 'portatil');\n\n// Render the HTML as PDF\n $dompdf->render();\n\n// Output the generated PDF to Browser\n $dompdf->stream();\n exit;\n\n }", "public function exportXmlAction()\n {\n $fileName = 'coursedoc.xml';\n $content = $this->getLayout()->createBlock('bs_coursedoc/adminhtml_coursedoc_grid')\n ->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function actionIndex($report=null)\n {\n $searchModel = new ReestrSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\n if ($report!==null)\n {\n \tob_end_clean();\n \t\n \theader('Content-Type: application/vnd.ms-excel');\n \theader('Content-Disposition: attachment;filename=\"DM_'.date('d.m.Y').'.xls\"');\n \theader('Cache-Control: max-age=0');\n \techo $this->renderPartial('index', [\n\t 'searchModel' => $searchModel,\n\t 'dataProvider' => $dataProvider,\n\t ]);\n \t\n \t\\Yii::$app->end();\n \t\n } \n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $b = newbook::\n orderBy('id', 'desc')\n //take(10)\n ->get();\n\n return $b->toJson();\n \n }", "function ExportData() {\n\t\tglobal $scholarship_package;\n\t\t$utf8 = FALSE;\n\t\t$bSelectLimit = EW_SELECT_LIMIT;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $scholarship_package->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($scholarship_package->ExportAll) {\n\t\t\t$this->lDisplayRecs = $this->lTotalRecs;\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($scholarship_package, \"h\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_package_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->start_date);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->end_date);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->status);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->annual_amount);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->grant_package_grant_package_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->sponsored_student_sponsored_student_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_type);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_type_scholarship_type);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$scholarship_package->CssClass = \"\";\n\t\t\t\t$scholarship_package->CssStyle = \"\";\n\t\t\t\t$scholarship_package->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('scholarship_package_id', $scholarship_package->scholarship_package_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('start_date', $scholarship_package->start_date->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('end_date', $scholarship_package->end_date->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('status', $scholarship_package->status->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('annual_amount', $scholarship_package->annual_amount->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('grant_package_grant_package_id', $scholarship_package->grant_package_grant_package_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('sponsored_student_sponsored_student_id', $scholarship_package->sponsored_student_sponsored_student_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('scholarship_type', $scholarship_package->scholarship_type->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('scholarship_type_scholarship_type', $scholarship_package->scholarship_type_scholarship_type->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_package_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->start_date);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->end_date);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->status);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->annual_amount);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->grant_package_grant_package_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->sponsored_student_sponsored_student_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_type);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_type_scholarship_type);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($scholarship_package->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($scholarship_package->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($scholarship_package->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($scholarship_package->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}", "public function index()\n\t{\n\t\t//\n return Excel::create('Mastersheet BQu version', function($excel) {\n\n $excel->sheet('Marks-Input Sheet', function($sheet) {\n\n $sheet->loadView('export.input_sheet')\n ->with('student_module_marks_input',StudentModuleMarksInput::all()->reverse())\n ->with('module_element',ModuleElement::all())\n ->with('modules',Module::all())\n ->with('courses',ApplicationCourse::all())\n ->with('users',User::all());\n\n });\n $excel->setcreator('BQu');\n $excel->setlastModifiedBy('BQu');\n $excel->setcompany('BQuServices(PVT)LTD');\n $excel->setmanager('Rajitha');\n\n })->download('xls');\n\t}", "public function export_returns_report(){\n $sales_report = DB::table('returns')\n ->select('*')\n ->get();\n\n $sales_array[] = array('Invoice ID','Customer Name','Total', 'Discount','Sales Date');\n\n foreach ($sales_report as $item) {\n $customer_details = unserialize($item->customer_details);\n\n $sales_array[] = array(\n 'Invoice ID' => $item->inventory_id,\n 'Customer Name' => $customer_details['customer_name'],\n 'Total' => $item->total,\n 'Return Charge' => $item->return_charge,\n 'Sales Date' => date('d M Y', strtotime($item->created_at))\n );\n\n }\n //create excel\n Excel::create('Returns Report', function($excel) use($sales_array) {\n $excel->sheet('Returns Report', function($sheet) use($sales_array) {\n $sheet->fromArray($sales_array);\n });\n })->download('xls');\n\n }", "public function index()\n {\n $this->authorize('index', Booking::class);\n\n return $this->respond(\n 'Data Loaded Successfully',\n fractal(\n (new IndexResponse(Booking::with('customPackage')))->execute()\n , new BookingTransformer()\n )\n );\n }", "public function exportExcelAction()\n {\n $fileName = 'handovertwo.xls';\n $content = $this->getLayout()->createBlock('bs_handover/adminhtml_handovertwo_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function testBookView()\n {\n $response = $this->get('api/book/getBooks');\n\n $response->assertStatus(200);\n }", "public function export()\n {\n\n $leads = $this->leads->listAsAdmin();\n\n $sheets = collect([\n ['Leads' => 'admin.v1.leads.bulk.sheets.export', 'data' => $leads, 'format' => []],\n ]);\n\n $this->excel->template($sheets, 'Leads');\n }", "function ExportData() {\n\t\tglobal $t_tinbai_mainsite;\n\t\t$utf8 = TRUE;\n\t\t$bSelectLimit = EW_SELECT_LIMIT;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $t_tinbai_mainsite->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($t_tinbai_mainsite->ExportAll) {\n\t\t\t$this->lDisplayRecs = $this->lTotalRecs;\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($t_tinbai_mainsite->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($t_tinbai_mainsite, \"h\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->PK_TINBAI_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_CONGTY_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DMGIOITHIEU_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DMTUYENSINH_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DTSVTUONGLAI_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DTSVDANGHOC_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DTCUUSV_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_TITLE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_HIT_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_NEW_MYSEFLT);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_COMMENT_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_ORDER_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_STATUS_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_VISITOR_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_ACTIVE_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_NOTE);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_USER_ADD);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_ADD_TIME);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_USER_EDIT);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->C_EDIT_TIME);\n\t\t\t\t$ExportDoc->ExportCaption($t_tinbai_mainsite->FK_EDITOR_ID);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$t_tinbai_mainsite->CssClass = \"\";\n\t\t\t\t$t_tinbai_mainsite->CssStyle = \"\";\n\t\t\t\t$t_tinbai_mainsite->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($t_tinbai_mainsite->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('PK_TINBAI_ID', $t_tinbai_mainsite->PK_TINBAI_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_CONGTY_ID', $t_tinbai_mainsite->FK_CONGTY_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DMGIOITHIEU_ID', $t_tinbai_mainsite->FK_DMGIOITHIEU_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DMTUYENSINH_ID', $t_tinbai_mainsite->FK_DMTUYENSINH_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DTSVTUONGLAI_ID', $t_tinbai_mainsite->FK_DTSVTUONGLAI_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DTSVDANGHOC_ID', $t_tinbai_mainsite->FK_DTSVDANGHOC_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DTCUUSV_ID', $t_tinbai_mainsite->FK_DTCUUSV_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_DTDOANHNGHIEP_ID', $t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_TITLE', $t_tinbai_mainsite->C_TITLE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_HIT_MAINSITE', $t_tinbai_mainsite->C_HIT_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_NEW_MYSEFLT', $t_tinbai_mainsite->C_NEW_MYSEFLT->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_COMMENT_MAINSITE', $t_tinbai_mainsite->C_COMMENT_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_ORDER_MAINSITE', $t_tinbai_mainsite->C_ORDER_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_STATUS_MAINSITE', $t_tinbai_mainsite->C_STATUS_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_VISITOR_MAINSITE', $t_tinbai_mainsite->C_VISITOR_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_ACTIVE_MAINSITE', $t_tinbai_mainsite->C_ACTIVE_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_TIME_ACTIVE_MAINSITE', $t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_NGUOIDUNGID_MAINSITE', $t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_NOTE', $t_tinbai_mainsite->C_NOTE->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_USER_ADD', $t_tinbai_mainsite->C_USER_ADD->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_ADD_TIME', $t_tinbai_mainsite->C_ADD_TIME->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_USER_EDIT', $t_tinbai_mainsite->C_USER_EDIT->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('C_EDIT_TIME', $t_tinbai_mainsite->C_EDIT_TIME->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('FK_EDITOR_ID', $t_tinbai_mainsite->FK_EDITOR_ID->ExportValue($t_tinbai_mainsite->Export, $t_tinbai_mainsite->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->PK_TINBAI_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_CONGTY_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DMGIOITHIEU_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DMTUYENSINH_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DTSVTUONGLAI_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DTSVDANGHOC_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DTCUUSV_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_TITLE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_HIT_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_NEW_MYSEFLT);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_COMMENT_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_ORDER_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_STATUS_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_VISITOR_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_ACTIVE_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_NOTE);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_USER_ADD);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_ADD_TIME);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_USER_EDIT);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->C_EDIT_TIME);\n\t\t\t\t\t$ExportDoc->ExportField($t_tinbai_mainsite->FK_EDITOR_ID);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($t_tinbai_mainsite->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($t_tinbai_mainsite->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($t_tinbai_mainsite->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($t_tinbai_mainsite->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($t_tinbai_mainsite->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}", "public function index()\n {\n $bookRecord = BookRecord::with(['borrower','book']);\n return BookRecordResource::collection($bookRecord->paginate(20))->response();\n }", "public function BookingExport($user,$year)\n {\n $q = new BookingProvider();\n $filterData = $q->search($user,$year);\n $count = count($filterData);\n //echo $count;exit;\n $objPHPExcel = new PHPExcel();\n\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->SetCellValue('A1', 'STAFF');\n $objPHPExcel->getActiveSheet()->SetCellValue('B1', 'JAN');\n $objPHPExcel->getActiveSheet()->SetCellValue('C1', 'FEB');\n $objPHPExcel->getActiveSheet()->SetCellValue('D1', 'MAR');\n $objPHPExcel->getActiveSheet()->SetCellValue('E1', 'APR');\n $objPHPExcel->getActiveSheet()->SetCellValue('F1', 'MAY');\n $objPHPExcel->getActiveSheet()->SetCellValue('G1', 'JUN');\n $objPHPExcel->getActiveSheet()->SetCellValue('H1', 'JUL');\n $objPHPExcel->getActiveSheet()->SetCellValue('I1', 'AUG');\n $objPHPExcel->getActiveSheet()->SetCellValue('J1', 'SEP');\n $objPHPExcel->getActiveSheet()->SetCellValue('K1', 'OCT');\n $objPHPExcel->getActiveSheet()->SetCellValue('L1', 'NOV');\n $objPHPExcel->getActiveSheet()->SetCellValue('M1', 'DEC');\n\n for ($i = 2; $i < $count + 2; $i++) {\n $objPHPExcel->getActiveSheet()->SetCellValue('A' . $i, $filterData[$i - 2]['staff']);\n $objPHPExcel->getActiveSheet()->SetCellValue('B' . $i, $filterData[$i - 2]['jan']);\n $objPHPExcel->getActiveSheet()->SetCellValue('C' . $i, $filterData[$i - 2]['feb']);\n $objPHPExcel->getActiveSheet()->SetCellValue('D' . $i, $filterData[$i - 2]['mar']);\n $objPHPExcel->getActiveSheet()->SetCellValue('E' . $i, $filterData[$i - 2]['apr']);\n $objPHPExcel->getActiveSheet()->SetCellValue('F' . $i, $filterData[$i - 2]['may']);\n $objPHPExcel->getActiveSheet()->SetCellValue('G' . $i, $filterData[$i - 2]['jun']);\n $objPHPExcel->getActiveSheet()->SetCellValue('H' . $i, $filterData[$i - 2]['jul']);\n $objPHPExcel->getActiveSheet()->SetCellValue('I' . $i, $filterData[$i - 2]['aug']);\n $objPHPExcel->getActiveSheet()->SetCellValue('J' . $i, $filterData[$i - 2]['sep']);\n $objPHPExcel->getActiveSheet()->SetCellValue('K' . $i, $filterData[$i - 2]['oct']);\n $objPHPExcel->getActiveSheet()->SetCellValue('L' . $i, $filterData[$i - 2]['nov']);\n $objPHPExcel->getActiveSheet()->SetCellValue('M' . $i, $filterData[$i - 2]['dec']);\n }\n\n $objPHPExcel->getActiveSheet()->setTitle('Booking Report');\n\n// Redirect output to a client’s web browser (Excel5)\n $filename = \"Booking Report\" . date('m-d-Y_his') . \".xls\";\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"' . $filename . '\"');\n header('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n }", "private function _export() {\r\n $file = $this->writeJSON('load');\r\n if(file_exists($file)) {\r\n header('Content-Description: File Transfer');\r\n header('Content-Type: application/octet-stream');\r\n header('Content-Disposition: attachment; filename='.basename($file));\r\n header('Content-Transfer-Encoding: binary');\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($file));\r\n ob_clean();\r\n flush();\r\n readfile($file);\r\n exit;\r\n }\r\n }", "function index() \r\n\t{\r\n\t\t\r\n\t\t$this->file_type = $_REQUEST['file_type'];\r\n\t\t$this->report_from = date(\"Ymd\", strtotime($_REQUEST['from_date']));\r\n\t\t$this->report_to = date(\"Ymd\", strtotime($_REQUEST['to_date']));\r\n\t\t\r\n\t\tif (substr($this->report_from,0,-4)==substr($this->report_to,0,-4)){\t\r\n\t\t\t$result = $this->setTableData();\t\r\n\t\t\tif ($result == true) {\r\n\t\t\t\techo(\"{'success':false,'msg':'No records found.','error_code':'19'}\");\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ($this->file_type=='1') $this->printExcel();\r\n\t\t\t\telse $this->printPDF();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\techo(\"{'success':false,'msg':'Year should be the same.','error_code':'152'}\");\t\r\n\t\t}\t\t\r\n\t}", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function makeReport()\n {\n }", "public function actionCollectorReport() {\n /*Get result using model method*/\n $result = [\n ['a', 'b', 'c',],\n [1, 2, 3,],\n ];\n\n $fileName = 'debtorList' . date('Y-m-d');\n $this->createCSV($result, $fileName);\n\n //$subscribers = Subscriber::getSubscribers('collector');\n //$this->actionSendReport($fileName, $subscribers);\n\n }", "public function index()\n {\n $data = BoookModel::get();\n return view('admin.book.index',['data'=>$data]);\n }", "public function bookIndex(): array\n {\n return $this->bookRepository->findAllUserBooks(\\Auth::user()->getUid());\n }", "public function exportExcelAction()\n {\n $fileName = 'offer.xls';\n $content = $this->getLayout()->createBlock('mfb_myflyingbox/adminhtml_offer_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function createExport();", "public function export_sales_report(){\n $sales_report = DB::table('orders')\n ->select('*')\n ->get();\n\n $sales_array[] = array('Invoice ID','Customer Name','Total', 'Discount','Sales Date');\n\n foreach ($sales_report as $item) {\n $customer_details = unserialize($item->customer_details);\n\n $sales_array[] = array(\n 'Invoice ID' => $item->id,\n 'Customer Name' => $customer_details['customer_name'],\n 'Total' => $item->total,\n 'Discount' => $item->discount,\n 'Sales Date' => date('d M Y', strtotime($item->created_at))\n );\n\n }\n //create excel\n Excel::create('Sales Report', function($excel) use($sales_array) {\n $excel->sheet('Sales Report', function($sheet) use($sales_array) {\n $sheet->fromArray($sales_array);\n });\n })->download('xls');\n\n }", "function Page_Exporting() {\r\n\r\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\r\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\r\n\r\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\r\n\t}", "public function exportCsvAction()\n {\n $fileName = 'coursedoc.csv';\n $content = $this->getLayout()->createBlock('bs_coursedoc/adminhtml_coursedoc_grid')\n ->getCsv();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function actionIndex()\n {\n $searchModel = new WpIschoolSafecardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$column_arr = [\n \t'id',\n 'stuid',\n 'info',\n 'ctime:datetime',\n 'receivetime:datetime',\n ];\n if(\\yii::$app->request->get(\"type\") && \\yii::$app->request->get(\"type\") == \"export\")\n {\n \t$array_values = $searchModel->attributeLabels();\n \t$array_keys = array_keys($array_values);\n \t/*$all_data = \\yii\\helpers\\ArrayHelper::toArray($dataProvider->query->all(), [\n \t\t\t'backend\\models\\WpIschoolSchool' => $array_keys,\n \t]);*/\n \t\\moonland\\phpexcel\\Excel::export([\n \t\t\t'models' => $dataProvider->query->all(),\n \t\t\t'columns' => $column_arr,\n \t\t\t'headers' => $array_values,\n \t\t\t\"fileName\"=>\"safecard.xlsx\"\n \t]);\n }else \n {\n \t\treturn $this->render('index', [\n \t\t'searchModel' => $searchModel,\n \t\t'dataProvider' => $dataProvider,\n \t\t\t'columnsArray' => $column_arr\n \t\t]);\n }\n }" ]
[ "0.6384614", "0.61666477", "0.608932", "0.6089249", "0.6079309", "0.6004772", "0.60018903", "0.5979442", "0.5970809", "0.59567577", "0.5913291", "0.58458406", "0.5843162", "0.5819176", "0.58007264", "0.580043", "0.57876503", "0.57626724", "0.5754849", "0.5754595", "0.57365406", "0.57359403", "0.5722846", "0.5707786", "0.57061094", "0.56928945", "0.56921726", "0.5690508", "0.5679636", "0.567804", "0.5670093", "0.5653583", "0.5624461", "0.5620349", "0.5610458", "0.5609611", "0.56085336", "0.5601981", "0.55989546", "0.5594955", "0.55860615", "0.55856264", "0.5566835", "0.5560278", "0.55601954", "0.555972", "0.5559449", "0.5555525", "0.5548632", "0.55455005", "0.55418533", "0.5531566", "0.55203426", "0.5515639", "0.5514662", "0.5499422", "0.54832524", "0.5478878", "0.5476364", "0.5469233", "0.54619855", "0.54619855", "0.54619855", "0.54619855", "0.54619855", "0.54609907", "0.5457862", "0.5454766", "0.5453724", "0.5453636", "0.54535735", "0.54522514", "0.54493785", "0.5447803", "0.54459107", "0.54454875", "0.5445358", "0.54412764", "0.54402673", "0.54399073", "0.54368937", "0.54368025", "0.5436241", "0.543074", "0.5429142", "0.5418106", "0.54105526", "0.5409942", "0.54073787", "0.54057235", "0.54056156", "0.53993535", "0.5392984", "0.5391879", "0.53901786", "0.5388101", "0.5383556", "0.5381318", "0.53797853", "0.5375094" ]
0.57189345
23
Display a listing of the resource.
public function index() { $scores = Score::all(); return view( 'scores.index', compact( 'scores' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store( ) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show( Score $score ) { $user = Auth::user(); $implementation = Implementation::with( 'project', 'event', 'student' ) -> where( 'id', $score -> implementation_id ) -> first(); $meeting = Meeting::with( 'event', 'student', 'user' ) -> where( [ 'student_id' => $implementation -> student -> id, 'event_id' => $implementation -> event -> id ] ) -> first(); return view( 'scores.show', compact( 'user', 'score', 'implementation', 'meeting' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "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 show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit( Score $score ) { $user = Auth::user(); $implementation = Implementation::with( 'project', 'event', 'student' ) -> where( 'id', $score -> implementation_id ) -> first(); $meeting = Meeting::with( 'event', 'student', 'user' ) -> where( [ 'student_id' => $implementation -> student -> id, 'event_id' => $implementation -> event -> id ] ) -> first(); $_SESSION[ 'score' ] = $score -> score; $_SESSION[ 'comment' ] = $score -> comment; return view( 'scores.show', compact( 'user', 'score', 'implementation', 'meeting' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function update( Score $score ) { if ( isset( $_POST[ 'scoreId' ] ) ) { $scoreId = intval( $_POST[ 'scoreId' ] ); $score = Score::with( 'meeting', 'implementation' ) -> where( 'id', $scoreId ); if ( $score ) { //get all values from $_POST and validate them if ( isset( $_POST[ 'score' ] ) ) { $_SESSION[ 'score' ] = intval( $_POST[ 'score' ] ); } if ( isset( $_POST[ 'comment' ] ) ) { $_SESSION[ 'comment' ] = strval( $_POST[ 'comment' ] ); } if ( isset( $errors ) ) { //redirect to form } else { //update in DB DB::table( 'scores' ) -> where( 'id', $scoreId ) -> update( [ 'score' => $_SESSION[ 'score' ], 'comment' => $_SESSION[ 'comment' ] ] ); //redirect to newly updated score header( 'Location: ' . {{ route('scores.show', $scoreId ) }} ); die(); } } else { //error handling : score doesn't exist } } else { //error handling : no score id } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy( ) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
/ important for asset paths in build.js
function painter_head() { echo '<script>window.ideaspace_site_path = "' . url('/') . '";</script>'; echo '<script src="' . url('public/a-painter/vendor/aframe-input-mapping-component.js') . '"></script>'; echo '<script src="' . url('public/a-painter/build.js') . '"></script>'; echo '<script src="' . url('public/a-painter/vendor/aframe-teleport-controls.min.js') . '"></script>'; echo '<script src="' . url('public/a-painter/vendor/aframe-tooltip-component.min.js') . '"></script>'; echo '<link rel="stylesheet" href="' . url('public/a-painter/css/main.css') . '">'; echo '<link rel="manifest" href="' . url('public/a-painter/manifest.webmanifest') . '">'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asset_path($filename, $dir)\n{\n\n $site = base_url();\n $mode = \"\";\n\n /*\n * cache invalidation removed for js css libraries\n */\n\n if (is_null($dir)) {\n $final_url = $mode . $filename;\n return $final_url;\n }\n\n if (ENVIRONMENT == 'development') {\n $mode = 'dist/' . $dir . '/';\n return $mode . $filename;\n } else if (ENVIRONMENT == 'production') {\n $mode = 'public/' . $dir . '/';\n }\n\n $final_url = $mode . $filename . '?v='.getUIVersion();\n\n return $final_url;\n\n}", "function asset_url() {\n return url(\"/\");\n }", "function get_assets_path() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH . '/assets/';\n }", "public static function assetsPath()\n {\n return asset(config('onion_engine.options.public_assets_path')).'/';\n }", "function assets_url($path='') {\n\t\tif (substr($path, 0) == '/') {\n\t\t\treturn base_url().\"assets\".$path;\n\t\t} else {\n\t\t\treturn base_url().\"assets/\".$path;\n\t\t}\n\t}", "function asset($path = '')\n {\n \treturn (!empty($path)) ? BASE_URL . $path : BASE_URL ; \n }", "public function functional_asset_path() {\n\n\t\t$log_path = WP_CONTENT_DIR . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_path', $log_path );\n\n\t}", "function doo_asset_path($filename, $parent = false, $nomin = false)\n{\n $dist_url = DOO_PLUGIN_PRESET_URI . 'assets/';\n $dist_path = DOO_PLUGIN_PRESET_DIR . 'assets/';\n $directory = dirname($filename) . '/';\n $file = basename($filename);\n\n $file_parts = explode('.', $file);\n $ext = $file_parts[count($file_parts) - 1];\n $has_min_version = false;\n\n if ($file_parts[count($file_parts) - 2] != 'min') {\n $file_min = str_replace('.' . $ext, '.min.' . $ext, $file);\n\n if (file_exists($dist_path . $directory . $file_min)) {\n $has_min_version = true;\n }\n }\n\n $is_development = defined('WP_ENV') && (WP_ENV == 'development');\n\n if (!$is_development && $has_min_version && !$nomin) {\n return $dist_url . $directory . $file_min;\n } else {\n return $dist_url . $directory . $file;\n }\n}", "function _asset_url(string $path = '') {\n\t\treturn asset(config('asset.directory')) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "function asset_url(){\n return base_url().'assets/';\n}", "public function getAssetPath()\n {\n return WEB_PUBLIC_THEME . '/' . $this->directory;\n }", "function assets_path($path = '')\n {\n return phanda()->assetsPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public function getAssetsPath()\n\t{\n\t\treturn dirname(__FILE__) . '/assets';\n\t}", "protected function assets()\n {\n $output = [];\n if (!file_exists($this->config['build'] . 'node_modules')) {\n putenv('PATH=' . trim(shell_exec('echo $PATH')) . ':' . dirname(MODX_BASE_PATH) . '/');\n if (file_exists($this->config['build'] . 'package.json')) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Trying to install or update nodejs dependencies');\n $output = [\n shell_exec('cd ' . $this->config['build'] . ' && npm config set scripts-prepend-node-path true && npm install'),\n ];\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = array_merge($output, [\n shell_exec('cd ' . $this->config['build'] . ' && npm link gulp'),\n shell_exec('cd ' . $this->config['build'] . ' && gulp copy'),\n ]);\n }\n if ($output) {\n $this->modx->log(xPDO::LOG_LEVEL_INFO, implode(\"\\n\", array_map('trim', $output)));\n }\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = shell_exec('cd ' . $this->config['build'] . ' && gulp default 2>&1');\n $this->modx->log(xPDO::LOG_LEVEL_INFO, 'Compile scripts and styles ' . trim($output));\n }\n }", "public static function get_asset_path(): string {\n\t\treturn plugin_dir_url( dirname( __DIR__ ) );\n\t}", "function asset_url($uri = '', $protocol = NULL)\n{\n $debug = config('debug');\n\n $cache_busting_token = ! $debug ? '?' . config('cache_busting_token') : '';\n\n if (strpos(basename($uri), '.js') !== FALSE && strpos(basename($uri), '.min.js') === FALSE && ! $debug)\n {\n $uri = str_replace('.js', '.min.js', $uri);\n }\n\n if (strpos(basename($uri), '.css') !== FALSE && strpos(basename($uri), '.min.css') === FALSE && ! $debug)\n {\n $uri = str_replace('.css', '.min.css', $uri);\n }\n\n return base_url($uri . $cache_busting_token, $protocol);\n}", "function asset($path) {\n echo getAbsolutePath() . \"public/$path\";\n}", "function assets_url( $path = '' ) {\n\n\treturn home_url( 'Cece/Assets/' . $path );\n\n}", "public function __initPath()\n\t{\n\t\tdefine('IMG_PATH', STATIC_PATH . '/img');\n define('UPLOAD_PATH', STATIC_PATH . '/upload');\n define('CSS_PATH', STATIC_PATH . '/css');\n define('JS_PATH', STATIC_PATH . '/js');\n define('UPLOAD_THUMBAIL_PATH', UPLOAD_PATH . '/thumbnails');\n // Define url to image directory\n define('IMG_URL', STATIC_URL . '/img');\n define('UPLOAD_URL', STATIC_URL . '/upload');\n define('CSS_URL', STATIC_URL . '/css');\n define('JS_URL', STATIC_URL . '/js');\n define('UPLOAD_THUMBAIL_URL', UPLOAD_URL . '/thumbnails');\n\t}", "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 assets_url() {\n\t\t\treturn get_template_directory_uri() . '/assets/';\n\t\t}", "function assets($relativeUri)\n {\n if (Str::startsWith($relativeUri, 'styles') || Str::startsWith($relativeUri, 'scripts')) {\n return Url::shopUrl(\"resources/assets/dist/$relativeUri\") . \"?v=\" . config('app.version');\n } elseif (Str::startsWith($relativeUri, 'lang')) {\n return Url::shopUrl(\"resources/$relativeUri\");\n } else {\n return Url::shopUrl(\"resources/assets/$relativeUri\");\n }\n }", "function asset_url($url)\n\t{\n\t\tif (substr($url, 0, 4) !== 'http' && substr($url, 0, 2) !== '//')\n\t\t{\n\t\t\t$ci =& get_instance();\n\t\t\t$ci->config->load('cms', TRUE);\n\t\t\t$url .= '?v='.$ci->config->item('asset_version');\n\n\t\t\t// add assets/ if not present already\n\t\t\t$exploded_url = explode('/', ltrim($url, '/'));\n\t\t\tif ($exploded_url[0] !== 'assets')\n\t\t\t{\n\t\t\t\t$url = 'assets/' . ltrim($url, '/');\n\t\t\t}\n\t\t}\n\n\t\treturn base_url($url);\n\t}", "function get_static_js_path($file = NULL)\n {\n return get_static_asset($file, 'js/'); \n }", "public function assetPath($path = '')\n\t{\n\t\treturn $this['path.asset'].ltrim($path, '/');\n\t}", "function asset_base_path(string $path = '') {\n\t\t$path = trim($path, DIRECTORY_SEPARATOR);\n\t\treturn dirname(__DIR__) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "function assets_path( $relative, $file )\n {\n // Preparation\n $route = preg_replace( '/\\\\\\\\/', '/', $file );\n $path = rtrim( preg_replace( '/\\\\\\\\/', '/', get_wp_home_path() ), '/' );\n // Clean base path\n $route = preg_replace( '/.+?(?=wp-content)/', '', $route );\n // Clean project relative path\n $route = preg_replace( '/\\/app[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/assets[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/vendor[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n return $path.'/'.apply_filters( 'app_route_path', $route ).'/assets/'.$relative;\n }", "public function assetsDir(): string\n {\n return $this->root.'/www';\n }", "function asset($name) {\n $url;\n\n if (config('mode') === 'development') {\n $url = config('asset_url') . $name;\n } else {\n $url = config('app_url') . $name;\n }\n\n return $url;\n}", "function admin_asset(string $path = ''): string\n {\n return Admin::app()->asset($path);\n }", "function smarty_modifier_toAssetPath($string) {\n\n if (strpos($string, \"::\") !== false) {\n $parts = explode(\"::\", $string);\n $src = ModulesContext::instance()->getConfig()->get(\"businessRoot\", \"src\");\n $base = trim(str_replace(\"::\", \"/\", $src), \"/\");\n $result = \"$base/$parts[0]/assets/$parts[1]\";\n } else {\n $result = \"assets/$result\";\n }\n\n $resultingPath = Loader::toSinglePath($result, \".tpl\");\n\n return $resultingPath;\n}", "public static function asset(string $path): string\n {\n /*\n to DOOOO\n viewNamespaceToPath => /images/prova.png\n viewNamespaceToDir => c:\\var\\wwww\\test\\images\\prova.png\n viewNamespaceToAsset => http://example.com/images/prova.png\n */\n // dddx(\\Module::asset('blog:img/logo.img')); //localhost/modules/blog/img/logo.img\n\n if (Str::startsWith($path, 'https://')) {\n return $path;\n }\n if (Str::startsWith($path, 'http://')) {\n return $path;\n }\n\n if (File::exists(public_path($path))) {\n return $path;\n }\n\n if (Str::startsWith($path, '/theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, '/theme/pub');\n }\n\n if (Str::startsWith($path, 'theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, 'theme/pub');\n }\n\n $ns = Str::before($path, '::');\n $ns_after = Str::after($path, '::');\n if ($ns === $path) {\n $ns = inAdmin() ? 'adm_theme' : 'pub_theme';\n }\n\n $ns_after0 = Str::before($ns_after, '/');\n $ns_after1 = Str::after($ns_after, '/');\n $ns_after = str_replace('.', '/', $ns_after0).'/'.$ns_after1;\n\n if (Str::startsWith($ns_after, '/')) {\n $ns_after = Str::after($ns_after, '/');\n }\n if (\\in_array($ns, ['pub_theme', 'adm_theme'], true)) {\n $theme = config('xra.'.$ns);\n\n $filename_from = self::fixPath(base_path('Themes/'.$theme.'/Resources/'.$ns_after));\n // $filename_from = Str::replace('/Resources//', '/Resources/', $filename_from);\n $asset = 'themes/'.$theme.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n\n if (! File::exists($filename_to)) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n try {\n File::copy($filename_from, $filename_to);\n } catch (\\Exception $e) {\n throw new \\Exception('message:['.$e->getMessage().']\n path :['.$path.']\n file from ['.$filename_from.']\n file to ['.$filename_to.']');\n }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n }\n\n $module_path = Module::getModulePath($ns);\n if (Str::endsWith($module_path, '/')) {\n $module_path = Str::beforeLast($module_path, '/');\n }\n $filename_from = self::fixPath($module_path.'/Resources/'.$ns_after);\n $asset = 'assets/'.$ns.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n if (! File::exists($filename_from)) {\n throw new \\Exception('file ['.$filename_from.'] not Exists , path ['.$path.']');\n }\n\n // dddx(app()->environment());// local\n if (! File::exists($filename_to) || 'production' !== app()->environment()) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n // 105 If condition is always true.\n // if (File::exists($filename_from)) {\n File::copy($filename_from, $filename_to);\n // }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n\n // return asset(self::viewNamespaceToAsset($path));\n }", "function asset_url($uri = '', $protocol = NULL ,$ctype = '')\n{\n $ci =& get_instance();\n $cache_busting_token = (! Config::DEBUG_MODE )? '?' . $ci->config->item('cache_busting_token') : '';\n if($ctype != ''){\n if($ctype == 'css'){\n $cache_busting_token .= ! Config::DEBUG_MODE ? $ci->config->item('css_suffix') : '';\n }else if($ctype == 'js'){\n $cache_busting_token .= ! Config::DEBUG_MODE ? $ci->config->item('js_suffix') : '';\n }else{\n show_error('parameter ctype is wrong.');\n }\n }else{\n $cache_busting_token .= getSuffix($uri);\n }\n return base_url($uri . $cache_busting_token, $protocol);\n}", "protected function getAssetsPath() {\n return Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'assets');\n }", "public static function assets(){\n return self::adapterURI().\"assets/\";\n }", "function get_static_image_path($file = NULL)\n {\n return get_static_asset($file, 'images/'); \n }", "public function functional_asset_url() {\n\n\t\t$log_url = WP_CONTENT_URL . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_url', $log_url );\n\n\t}", "function assets( $type = 'css', $file = 'component.css' ) {\n\t\t\t\treturn implode( '/', array(\n\t\t\t\t\t\ttrim( $this->url, '/' ),\n\t\t\t\t\t\ttrim( $this->assets_dir, '/' ),\n\t\t\t\t\t\ttrim( $type, '/' ),\n\t\t\t\t\t\ttrim( $file, '/' )\n\t\t\t\t\t) );\n\t\t\t}", "protected function assetPath() {\n if (isset($this->config['assetPath']))\n {\n return $this->config['assetPath'];\n }\n return realpath('./assets');\n }", "function asset_url( ?string $path = null ): string\n {\n return Asset::url( '/', $path );\n }", "private function assets()\n {\n $relative_location = 'assets/';\n $assets_directory = realpath($this->args['location'] . DIRECTORY_SEPARATOR . '..') . DIRECTORY_SEPARATOR . $relative_location;\n if (!is_dir($assets_directory))\n {\n if (mkdir($assets_directory, 0755))\n {\n $message = \"\\tCreated folder: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n }\n }\n $assets_directories = array(\n 'css' => 'css' . DIRECTORY_SEPARATOR,\n 'img' => 'img' . DIRECTORY_SEPARATOR,\n 'js' => 'js' . DIRECTORY_SEPARATOR\n );\n foreach ($assets_directories as $asset_type => $asset_directory)\n {\n $ad = $assets_directory . $asset_directory;\n if (!is_dir($ad) && mkdir($ad, 0755))\n {\n $message = \"\\tCreated folder: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location . $asset_directory;\n }\n else\n {\n $message .= $relative_location . $asset_directory;\n }\n }\n\n if (!empty($this->args['subdirectories']))\n {\n $ad .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n if (!is_dir($assets_directory . $asset_directory . $this->args['subdirectories']) && mkdir($assets_directory . $asset_directory . $this->args['subdirectories'], 0755, TRUE))\n {\n $message = \"\\tCreated folder: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location . $asset_directory . $this->args['subdirectories'];\n }\n else\n {\n $message .= $relative_location . $asset_directory . $this->args['subdirectories'];\n }\n }\n }\n\n if (isset($message))\n {\n fwrite(STDOUT, $message . \"\\n\");\n unset($message);\n }\n\n if ($asset_type === 'img')\n {\n continue;\n }\n else\n {\n $ad .= $this->args['name'] . '.' . $asset_type;\n if (!is_file($ad) && touch($ad))\n {\n $message = \"\\tCreated asset: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location . $asset_directory;\n if (!empty($this->args['subdirectories']))\n {\n $message .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $message .= $this->args['name'] . '.' . $asset_type;\n }\n else\n {\n $message .= $relative_location . $asset_directory;\n if (!empty($this->args['subdirectories']))\n {\n $message .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $message .= $this->args['name'] . '.' . $asset_type;\n }\n \n fwrite(STDOUT, $message . \"\\n\");\n unset($message);\n }\n else\n {\n $message = \"\\tAsset already exists: \" . $relative_location . $asset_directory;\n if (!empty($this->args['subdirectories']))\n {\n $message .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $message .= $this->args['name'] . '.' . $asset_type;\n \n fwrite(STDOUT, $message . \"\\n\");\n unset($message);\n }\n }\n\n unset($ad);\n }\n \n return true;\n }", "public static function dashboardAssetsPath()\n {\n return asset(config('onion_engine.options.public_assets_path').'dashboard/assets').'/';\n }", "protected function getPathToModuleWebAssets(): string\n {\n return $this->requestStack->getCurrentRequest()->getBasePath() . '/modules/zikulacontent/';\n }", "function vcex_asset_dir_path( $part = '' ) {\n\treturn TTC_PLUGIN_DIR_PATH . 'inc/vcex/assets/' . $part;\n}", "function _asset($path, $secure = null)\n {\n if (! app()->environment('production')) {\n if (app()->environment('development')) {\n $path = 'assets/'.$path;\n }\n\n return asset($path, $secure);\n }\n\n return implode('/', [\n config('infoexam.static_url'),\n 'assets',\n json_decode(File::get(base_path('composer.json'), true), true)['version'],\n $path,\n ]);\n }", "protected function assetUrl() {\n if (isset($this->config['assetUrl']))\n {\n return $this->config['assetUrl'];\n }\n\n return '/assets';\n }", "function asset( $path ) {\n\n\t\tif ( ! $this->mix ) {\n\t\t\t$file = $this->path( 'public/mix-manifest.json' );\n\t\t\t$this->mix = (array) json_decode( file_get_contents( $file ), true );\n\t\t}\n\n\t\t// Make sure to trim any slashes from the front of the path.\n\t\t$path = '/' . ltrim( $path, '/' );\n\n\t\tif ( $this->mix && isset( $this->mix[ $path ] ) ) {\n\t\t\t$path = $this->mix[ $path ];\n\t\t}\n\n\t\treturn $this->uri( 'public' . $path );\n\t}", "protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }", "function assets(){\n\t\t\twp_enqueue_style( 'sp-2020-styles', get_template_directory_uri() .'/assets/css/main.css', array(), SPUTZNIK_2020_THEME_VERSION );\n\t\t\twp_enqueue_script( 'sp-2020-js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), SPUTZNIK_2020_THEME_VERSION, true );\n\n\t\t}", "function addExtraAssets()\n\t{\n\t\t$base = JURI::base(true);\n\t\t$regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';\n\n\t\tforeach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {\n\t\t\t//full path\n\t\t\t$afile = $bpath . '/etc/assets.xml';\n\t\t\tif (is_file($afile)) {\n\n\t\t\t\t//load xml\n\t\t\t\t$axml = JFactory::getXML($afile);\n\n\t\t\t\t//process if exist\n\t\t\t\tif ($axml) {\n\t\t\t\t\tforeach ($axml as $node => $nodevalue) {\n\t\t\t\t\t\t//ignore others node\n\t\t\t\t\t\tif ($node == 'stylesheets' || $node == 'scripts') {\n\t\t\t\t\t\t\tforeach ($nodevalue->file as $file) {\n\t\t\t\t\t\t\t\t$compatible = $file['compatible'];\n\t\t\t\t\t\t\t\tif ($compatible) {\n\t\t\t\t\t\t\t\t\t$parts = explode(' ', $compatible);\n\t\t\t\t\t\t\t\t\t$operator = '='; //exact equal to\n\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\tif (count($parts) == 2) {\n\t\t\t\t\t\t\t\t\t\t$operator = $parts[0];\n\t\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t//compare with Joomla version\n\t\t\t\t\t\t\t\t\tif (!version_compare(JVERSION, $operand, $operator)) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$url = (string)$file;\n\t\t\t\t\t\t\t\tif (substr($url, 0, 2) == '//') { //external link\n\n\t\t\t\t\t\t\t\t} else if ($url[0] == '/') { //absolute link from based folder\n\t\t\t\t\t\t\t\t\t$url = is_file(JPATH_ROOT . $url) ? $base . $url : false;\n\t\t\t\t\t\t\t\t} else if (!preg_match($regurl, $url)) { //not match a full url -> sure internal link\n\t\t\t\t\t\t\t\t\t$url = T3Path::getUrl($url); // so get it\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($url) {\n\t\t\t\t\t\t\t\t\tif ($node == 'stylesheets') {\n\t\t\t\t\t\t\t\t\t\t$this->addStylesheet($url);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->addScript($url);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// template extended styles\n\t\t$aparams = $this->_tpl->params->toArray();\n\t\t$extras = array();\n\t\t$itemid = JFactory::getApplication()->input->get ('Itemid');\n\t\tforeach ($aparams as $name => $value) {\n\t\t\tif (preg_match ('/^theme_extras_(.+)$/', $name, $m)) {\n\t\t\t\t$extras[$m[1]] = $value;\n\t\t\t}\n\t\t}\n\t\tif (count ($extras)) {\n\t\t\tforeach ($extras as $extra => $pages) {\n\t\t\t\tif (!is_array($pages) || !count($pages) || in_array (0, $pages)) {\n\t\t\t\t\tcontinue; // disabled\n\t\t\t\t}\n\t\t\t\tif (in_array (-1, $pages) || in_array($itemid, $pages)) {\n\t\t\t\t\t// load this style\n\t\t\t\t\t$this->addCss ('extras/'.$extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "static function asset_path($source)\n {\n if ($source) {\n $decoded_source = json_decode($source);\n if ($url = $decoded_source->url) {\n // if $url then the file is stored on the cloud \n return $url;\n } else {\n // else it is on the local storage ( generating the URL dynamically in this case so if the\n // the admin changes his Domain or base URL the assets will still work)\n $replace = preg_replace('/.*\\/storage/', '', $decoded_source->path);\n $url = asset('/storage' . $replace);\n return $url;\n }\n }\n }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "function asset_public($path = null)\n {\n return env('FRONT_PUBLIC', 'http://localhost/MY-PORTFOLIO/public/') . $path;\n }", "function asset($url = '')\n{\n return ASSET . $url;\n}", "public function testIncludeAssets() {\n\t\tRouter::setRequestInfo(array(\n\t\t\tarray('controller' => 'posts', 'action' => 'index', 'plugin' => null),\n\t\t\tarray('base' => '/some/dir', 'webroot' => '/some/dir/', 'here' => '/some/dir/posts')\n\t\t));\n\t\t$this->Helper->Html->webroot = '/some/dir/';\n\n\t\t$this->Helper->addScript('one.js');\n\t\t$result = $this->Helper->includeAssets();\n\t\t$this->assertRegExp('#\"/some/dir/cache_js/*#', $result, 'double dir set %s');\n\t}", "function get_static_css_path($file = NULL)\n {\n return get_static_asset($file, 'css/'); \n }", "function assets() {\n\t\tif ( ! is_admin() ) {\n\t\t\twp_enqueue_style( '_yourthemename-style', get_theme_file_uri( '/dist/css/bundle.css' ), array(), _YOURTHEMENAME_VER );\n\n\t\t\twp_deregister_script( 'jquery' );\n\t\t\twp_enqueue_script( '_yourthemename-scripts', get_theme_file_uri( '/dist/js/bundle.min.js' ), array(), _YOURTHEMENAME_VER, true );\n\t\t}\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t}", "public function assetUrl($url = '')\n\t{\n\t\treturn $this['url.asset'].ltrim($url, '/');\n\t}", "function asset_url($uri = null)\n{\n $CI =& get_instance();\n\n $cdn = $CI->config->item('asset_url');\n if (!empty($cdn))\n return $cdn . $uri;\n\n return $CI->config->base_url($uri);\n}", "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 loadConfigAssets()\r\n {\r\n $this->app->document->addScript('elements:imagebox/assets/js/myimage.js');\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/editoption.css');\r\n $this->app->document->addScript('elements:imagebox/assets/js/myoption.js');\r\n $this->app->document->addStylesheet('elements:option/option.css');\r\n }", "function assets_url( $path, $file, $scheme = null, $is_network = false )\n {\n // Preparation\n $route = preg_replace( '/\\\\\\\\/', '/', $file );\n $url = apply_filters(\n 'asset_base_url',\n rtrim( $is_network ? network_home_url( '/', $scheme ) : home_url( '/', $scheme ), '/' )\n );\n // Polylang support\n if ( function_exists( 'pll_current_language' ) ) {\n $lang = pll_current_language( 'slug' );\n if ( strpos( $url, '/' . $lang ) !== false && $lang !== false )\n $url = str_replace( '/' . $lang, '', $url );\n }\n // WPML support\n if ( function_exists( 'icl_object_id' ) && defined( 'ICL_LANGUAGE_CODE' ) ) {\n $url = preg_replace( '#([a-z])/' . ICL_LANGUAGE_CODE . '#', '\\\\1', $url );\n }\n // Clean base path\n $route = preg_replace( '/.+?(?=wp-content)/', '', $route );\n // Clean project relative path\n $route = preg_replace( '/\\/app[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/assets[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/vendor[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n return $url.'/'.apply_filters( 'app_route', $route ).'/assets/'.$path;\n }", "private function assetPublisher() {\n $assetOrigin = $this->getDir().$this->getPathConfig().'/assets';\n if ($this->fs->exists($assetOrigin)) {\n $assetDest = $this->getPublicPath($this->getPathConfig());\n $this->fs->copyDirectory($assetOrigin,$assetDest);\n }\n }", "function css_asset_path($filename) {\n\t\t\t$manifest_path = dirname(dirname(__FILE__)) . '/dist/assets/css/rev-manifest.json';\n\n\t\t\tif (file_exists($manifest_path)) {\n\t\t\t\t$manifest = json_decode(file_get_contents($manifest_path), TRUE);\n\t\t\t} else {\n\t\t\t\t$manifest = [];\n\t\t\t}\n\n\t\t\tif (array_key_exists($filename, $manifest)) {\n\t\t\t\treturn $manifest[$filename];\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t}", "function happys_getCssAssets() {\n\t \t $filepath = glob(\"wp-content/themes/happys/css/app-v*.css\");\n\t\t $filename = basename($filepath[count($filepath) - 1]).PHP_EOL;\n\t \t echo $filename;\n }", "public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }", "public function load_assets() {}", "function csco_child_assets() {\n\tif ( ! is_admin() ) {\n\t\t$version = wp_get_theme()->get( 'Version' );\n\t\twp_enqueue_style( 'csco_child_css', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array(), $version, 'all' );\n\t}\n}", "public\n function copyAssets() {\n $this->info('Clearing webroot and copying assets...');\n// if ($this->_clear($this->_assetDir, '^(?!cover)(?!dashboard)(?!signin)(?!baked-with-cakephp.svg).*$')) {\n// $this->success('All files cleared...');\n// }\n\n $files = [];\n $folders = [];\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-duration-picker/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-markdown-editor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-toggle');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'checkboxes.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'datepair.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'flatpickr/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-awesome-cursor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-mask-plugin/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'markitup/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'popper.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'select2/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'vue/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'signature_pad/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'sticky-sidebar/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'timepicker/dist');\n\n foreach ($folders as $folder) {\n foreach ($folder->findRecursive() as $file) {\n $files[] = new File($file);\n }\n }\n try {\n $this->_copy($files);\n } catch (\\Exception $exception) {\n $this->info('Some did not copy. Exception: ' . $exception->getMessage(), 1, ConsoleIo::VERBOSE);\n }\n\n }", "private static function _initViewScriptsFullPathBase () {\n\t\t$app = & \\MvcCore\\Application::GetInstance();\n\t\tself::$_viewScriptsFullPathBase = implode('/', [\n\t\t\t$app->GetRequest()->GetAppRoot(),\n\t\t\t$app->GetAppDir(),\n\t\t\t$app->GetViewsDir()\n\t\t]);\n\t}", "public static function exportReactViews()\n {\n File::copyDirectory(__DIR__.'/stubs/resources/js', resource_path('js'));\n }", "public function getPathAssets($append = ''){\n\t\treturn $this->paths['assets'].$append;\n\t}", "function my_asset($path = null)\n{\n return route('homepage') . env('ASSET_URL') . '/' . $path;\n}", "function cdn_asset(string $path)\n {\n return \\App\\Utils::cdnAsset($path);\n }", "public static function assetsMinification()\n {\n $config = \\Phalcon\\DI::getDefault()->getShared('config');\n\n foreach (array('Css', 'Js') as $asset) {\n $get = 'get' . $asset;\n $filter = '\\Phalcon\\Assets\\Filters\\\\' . $asset . 'min';\n\n foreach (\\Phalcon\\DI::getDefault()->getShared('assets')->$get() as $resource) {\n $min = new $filter();\n $resource->setSourcePath(ROOT_PATH . '/public/' . $resource->getPath());\n $resource->setTargetUri('min/' . $resource->getPath());\n\n if ($config->app->env != 'production') {\n if (!is_dir(dirname(ROOT_PATH . '/public/min/' . $resource->getPath()))) {\n $old = umask(0);\n mkdir(dirname(ROOT_PATH . '/public/min/' . $resource->getPath()), 0777, true);\n umask($old);\n }\n\n if ($config->app->env == 'development' || !file_exists(ROOT_PATH . '/public/min/' . $resource->getPath())) {\n file_put_contents(ROOT_PATH . '/public/min/' . $resource->getPath(), $min->filter($resource->getContent()));\n } elseif (md5($min->filter($resource->getContent())) != md5_file(ROOT_PATH . '/public/min/' . $resource->getPath())) {\n file_put_contents(ROOT_PATH . '/public/min/' . $resource->getPath(), $min->filter($resource->getContent()));\n }\n }\n }\n }\n }", "function getJsPath() {\r\n\t\t$baseDir = Core::getBaseDir();\r\n\t\treturn $baseDir . '/' . parent::getPluginPath() . '/js/';\r\n\t}", "public function resolveAssetPath($url);", "public function publishAssets() {\n $assets = dirname(__FILE__) . '/assets';\n $baseUrl = Yii::app() -> assetManager -> publish($assets);\n if (is_dir($assets)) {\n //the css to use\n Yii::app() -> clientScript -> registerCssFile($baseUrl . '/css/google_search.css');\n\t\t\t/* the js to use\n\t\t\tU must edit one line in it to work with your URL*/\n Yii::app() -> clientScript -> registerScriptFile($baseUrl. '/js/google_search.js', CClientScript::POS_HEAD);\n \n } else {\n throw new CHttpException(500, __CLASS__ . ' - Error: Couldn\\'t find assets to publish.');\n }\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addAssetInfo(\n array(\"js/jquery.cookie.js\" ),\n $this->getCommonAssetDir()\n );\n $this->addAssetInfo(\n \"smartScrollPane.css\",\n dirname(__FILE__) . \"/assets\"\n );\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo( \"buttonBar.css\", dirname(__FILE__) . \"/assets\" );\n $this->addGradientAssets(array(\n $this->gradient, $this->hoverGradient,\n $this->activeGradient, $this->selectedGradient,\n $this->separatorGradient, $this->selectedColor\n ));\n }", "private function requireAssets()\n {\n $css = config('asgard.media.assets.media-partial-required-assets.css');\n $js = config('asgard.media.assets.media-partial-required-assets.js');\n\n if (!empty($css)) {\n $this->assetPipeline->requireCss($css);\n }\n\n if (!empty($js)) {\n $this->assetPipeline->requireJs($js);\n }\n }", "function plasso_kirki_configuration() {\n return array('url_path' => get_stylesheet_directory_uri() . '/assets/works/vendor/kirki/');\n}", "public function getAssetsUrl()\n\t{\n\t\tif ($this->_assetsUrl === null) {\n\t\t\t$assetsPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'assets';\n\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\tif ($this->debug===true) {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\t} else {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\t}\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n \"ribbon.css\",\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->barGradient);\n }", "public function js_path(){\n return $this->js_path;\n }", "public function assets_css() {\n \n $data = '<link rel=\"stylesheet\" type=\"text/css\" href=\"//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . base_url() . 'assets/apps/dashboard/styles/css/dashboard.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n \n if ( $this->css_urls_widgets ) {\n \n foreach ( $this->css_urls_widgets as $url ) {\n \n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $url . '?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\"; \n \n }\n \n }\n \n return $data;\n \n }", "function admin_asset($assets, $secure = false)\n {\n return asset(\"modules/Admin/Assets/\" . $assets, $secure);\n }", "function my_assets() {\n wp_enqueue_style( 'style', get_stylesheet_uri(), array(), '1.0.0' );\n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( 'app', get_template_directory_uri() . '/js/app.js', array(), '1.0.0' );\n}", "public function getBaseAssetsDir()\n {\n return $this->paths->getBaseAssetsDir();\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n array( \"$this->style.css\", \"faq.js\"),\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->gradient);\n }", "protected function getAssetsUrl()\n {\n if (isset($this->_assetsUrl))\n return $this->_assetsUrl;\n else\n {\n $assetsPath = Yii::getPathOfAlias('labScript');\n $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);\n return $this->_assetsUrl = $assetsUrl;\n }\n }", "public static function asset($relativePath = '') {\n\t\t$relativePath = trim($relativePath, '/');\n\t\t$root = trim($_SERVER['SUBDIRECTORY'], '/');\n\n\t\tif (Application::routing() === 'legacy') {\n\t\t\t$uri = trim(config('app.paths.assets_legacy', ''), '/');\n\t\t\t$path = Path::join('/', $root, $uri, $relativePath);\n\t\t\t$path = str_replace('\\\\', '/', $path);\n\n\t\t\treturn $path;\n\t\t}\n\n\t\t$uri = trim(config('app.paths.assets', ''), '/');\n\t\t$path = Path::join('/', $root, $uri, $relativePath);\n\t\t$path = str_replace('\\\\', '/', $path);\n\n\t\treturn $path;\n\t}", "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }", "private function _getAssetsUrl()\n\t{\n\t\tif( $this->_assetsUrl===null )\n\t\t{\n\t\t\t$assetsPath = Yii::getPathOfAlias('ext.widgets.countupload.assets');\n\n\t\t\t// We need to republish the assets if debug mode is enabled.\n\t\t\tif( $this->debug===true )\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\telse\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected function addAssetNamespaceHint()\n {\n app('streams.asset')->addNamespace('asset', public_path('assets/' . APP_REF));\n }", "public function getAssetsUrl()\n\t{\n\t\treturn Yii::app()->getAssetManager()->publish($this->getAssetsPath());\n\t}", "function st_asset($file, $echo = false){\r $file = ST_THEME_URL.'assets/'.$file;\r if($echo){\r echo $file;\r }else{\r return $file;\r }\r}", "public function assetPath($asset) {\n\t\treturn self::$config['APP_ROOT'] . self::$config['ASSETS_DIR'] . $asset;\n\t}", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "public function getAssetBasePath()\n {\n return $this->assetBasePath;\n }" ]
[ "0.7224042", "0.7206397", "0.71286887", "0.69592005", "0.6887487", "0.6845926", "0.6832509", "0.66603976", "0.66215795", "0.6570375", "0.6517963", "0.6501918", "0.64927477", "0.6490666", "0.6480646", "0.64762473", "0.6471999", "0.6467381", "0.6460918", "0.646026", "0.64594644", "0.6437775", "0.6424754", "0.64056987", "0.6398644", "0.63960713", "0.6296324", "0.6274623", "0.62577146", "0.6253323", "0.61918604", "0.61786", "0.6171266", "0.61595887", "0.61592054", "0.6155602", "0.6154731", "0.61209553", "0.612", "0.61168784", "0.6107436", "0.6083759", "0.606581", "0.6063042", "0.6060886", "0.6032644", "0.60138965", "0.60129774", "0.5983363", "0.59794843", "0.5979089", "0.5974814", "0.59725654", "0.59540546", "0.5954001", "0.5949369", "0.59341425", "0.5918353", "0.5912845", "0.5912291", "0.5905584", "0.589473", "0.58939046", "0.5892361", "0.58876437", "0.58759284", "0.5852785", "0.5852526", "0.5846457", "0.5837492", "0.58257467", "0.58252406", "0.58143157", "0.5803138", "0.5800427", "0.5800203", "0.5796671", "0.5794082", "0.5792183", "0.5782752", "0.5778329", "0.5778226", "0.57764554", "0.57759166", "0.5762352", "0.57602096", "0.5758141", "0.5758007", "0.57577837", "0.5755557", "0.5752132", "0.5744798", "0.5737782", "0.57331026", "0.573202", "0.5722486", "0.57223994", "0.57203364", "0.57156223", "0.5714427", "0.5704337" ]
0.0
-1
Run the database seeds.
public function run() { DB::statement('SET foreign_key_checks = 0'); DB::table('tenants')->truncate(); DB::statement('SET foreign_key_checks = 1'); $data = [[ 'id' => 1, 'name' => 'Solatek', 'email' => 'solatek@gmail.com', 'phone' => '0123456789', 'address' => 'hà nội', 'created_at' => Carbon::now(), ], [ 'id' => 2, 'name' => 'Solashi', 'email' => 'solashi@gmail.com', 'phone' => '0123456789', 'address' => 'hà nội', 'created_at' => Carbon::now(), ], [ 'id' => 3, 'name' => 'Amela', 'email' => 'amela@gmail.com', 'phone' => '0123456789', 'address' => 'hà nội', 'created_at' => Carbon::now(), ], [ 'id' => 4, 'name' => 'Arrow Tech', 'email' => 'arrow@gmail.com', 'phone' => '0123456789', 'address' => 'hà nội', 'created_at' => Carbon::now(), ]]; DB::table('tenants')->insert($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
$u = new Application_Model_User();
public function AsignarTags() { // $result = $u->getGroupMembers($this->userData->OU_ID); // print_r($result); echo $this->view->partial('partials/dialogs/asignartags.phtml'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->user = new User();\n }", "function User ( ){\n }", "public function __construct()\n {\n $this->user=new User();\n }", "public function __construct()\n {\n $this->userobj = new User();\n }", "public function __construct()\n {\n $this->user = new User;\n }", "function getUser() : User {\n\treturn new User;\n}", "public function __construct(){\n $this->userModel = $this->model('User');\n\n }", "function __construct()\n {\n $this ->user = User::createInstance();\n }", "function user() {\r\r\r\n\t\t$this->_dao = DB_DataObject::factory('Users');\r\r\r\n\t}", "protected function getUserModel() {\n return new User();\n }", "static function Create() \n\t{\n if (NULL == self::$userModel) {\n self::$userModel = new UserModel();\n }\n return self::$userModel;\n }", "public function __construct() {\n require 'views/view_user.php';\n require 'models/model_user.php';\n $this->view = new view_user();\n $this->model = new model_user ();\n }", "function UserModel($username)\n \t{\n \t\t$this->username = $username;\n \t//\t$this->type = $this->get_type($username);\n\n \t\t\n \t}", "public function __construct() {\n // und lädt das zugehörige Model\n $this->userModel = $this->model('User');\n }", "function userModel() { \n $model = config('auth.model');\n return new $model;\n }", "function __construct() {\n parent::__construct();\n $this->load->model('user_model');\n }", "public function getModel()\n\t{\n\t\treturn new User;\n\t}", "function __construct()\n {\n parent::__construct();\n\n $this->load->model('user');\n \n }", "public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }", "function __construct()\n {\n parent::__construct();\n $this->load->model('Usermodel','um');\n \n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('User_model');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('user_model');\n }", "function __construct()\n {\n $this->object = new UserDAL();\n }", "public function __construct(){\n\t\tparent::__construct();\n $this->load->model('user_m');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->user = new User;\n\t}", "function __construct(){\n\t\tparent::__construct('user');\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('user_model');\n }", "function __construct()\n {\n parent::__construct();\n $this->auth();\n $this->load->model('user_model','UserModel');\n\n }", "private function loadModel()\n {\n require_once APP . '/model/User.php';\n // create new \"model\" (and pass the database connection)\n $this->model = new User($this->db);\n }", "function UserModel()\n\t\t{\n\t\t\t$this->QueryTool = new UserModelDataBasic(DB_NAME);\n\t\t}", "function __construct() {\n parent::__construct();\n $this->load->model('users_model');\n }", "public function data_user()\n {\n return new Data\\User;\n }", "function Usermodel()\r\n {\r\n parent::Model();\r\n }", "public function __construct( User $user )\n {\n $this->model = $user;\n }", "public function __construct( User $user )\n {\n $this->model = $user;\n }", "public function __construct()\r\n\t{\r\n\t\t// Call the CI_Model constructor\r\n\t\tparent::__construct();\r\n\t\t$this->load->model(\"usuario_model\");\r\n\t}", "public function __construct()\n {\n $this->Customer = new Customer();\n $this->User = new User();\n }", "function __construct(){\r\n\t\t\t$dbHelper = new DBhelper();\r\n\t\t\t$validation = new ValidationUser();\r\n\t\t}", "public function __construct()\n\t{\n\t\tparent::__construct(\"user\");\n\t}", "public function __construct(User $model)\n {\n $this->model = $model;\n }", "public function __construct(User $user)\n {\n $this->model = $user;\n }", "public function __construct(User $user)\n {\n $this->model = $user;\n }", "public function __construct(User $user)\n {\n $this->model = $user;\n }", "public function __construct()\n {\n $this->middleware('auth');\n //Init Entity Model\n $this->_userModel = new User();\n }", "public static function user() {\n $userClass = config('auth.providers.users.model');\n\n return new $userClass;\n }", "public static function instantiate(User $user);", "public function testCreateUser()\n {\n }", "function model()\n {\n return User::class;\n }", "public function __construct(){\n $this->userDAO = new UserDAOBD();\n }", "public function __construct()\r\n {\r\n try\r\n { \r\n parent::__construct(); \r\n $this->load->model('user_model');\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "public function get_user()\n {\n \t$user = factory(User::class)->create(array('uuid' => ''));\n\n \treturn $user;\n }", "public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }", "public function __construct(UserEntity $user)\n {\n self::$model = $user;\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "function model()\n\t{\n\t\treturn \\App\\Models\\User::class;\n\t}", "function user()\r\n {\r\n if ( $this->UserID != 0 )\r\n {\r\n $ret = new eZUser( $this->UserID );\r\n }\r\n return $ret;\r\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('users/users_model', 'usm', true);\n }", "function User() {\n\t\t$this->db = new DB();\n\t\tif($_SESSION['logged']) {\n\t\t\t$this->checkSession();\n\t\t} elseif(isset($_COOKIE['oldhatbooks_login'])) {\n\t\t\t$this->_checkRemembered($_COOKIE['oldhatbooks_login']);\n\t\t}\n\t\t$this->username = $_SESSION['username'];\n\t\t$this->email = $_SESSION['email'];\n\t}", "function __construct(&$user) {\n\t\t$this->User =& $user;\n\t}", "public function user()\r\n {\r\n $user = (new \\Users\\Models\\Users)->load(array('_id'=>$this->user_id));\r\n \r\n return $user;\r\n }", "public function getClassUser(){\n if (!$this->_classUser instanceof User) {\n $this->_classUser = new User($this);\n }\n return $this->_classUser;\n }", "public function __construct(){\r\n //$this->id = $id;\r\n //$this->email = $email;\r\n //$this->username = $username;\r\n //$this->password = $password;\r\n //$this->TDG = new UserTDG;\r\n }", "public function __construct(User $user){\n $this->user = $user;\n }", "public function __construct($user) \n {\n $this->user = $user;\n }", "private function getUser()\r\n {\r\n $UserId = -1;\r\n isset($_POST['UserId']) && intval($_POST['UserId']) > 0 ? $UserId = intval($_POST['UserId']) : $UserId = -1;\r\n $User = new User ($UserId);\r\n return $User;\r\n }", "public function __construct(){\n $this->user = $this->model('users');\n $this->mailer = $this->model('mailer');\n $this->friendModel = $this->model('Friends_relationship');\n }", "protected function model()\n {\n return User::class;\n }", "public function __construct()\n {\n $this->user = User::getMe();\n }", "public function __construct()\n {\n \n //creo la struttura dati \n $this->_userModel = new Application_Model_User();\n $this->_logger = Zend_Registry::get(\"log\"); //file log\n }", "function __construct(){\n\t\t$this -> modelo = new usuarioBss();\n\t}", "function CUser() {\n\t\t$this->CDpObject( 'users', 'user_id' );\n\t}", "public static function user()\n {\n\n }", "public function user()\n {\n return new User($this);\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('usuario_model');\n }", "public function __construct()\n {\n $this->Customer = new Customer();\n $this->Pelanggan = new Pelanggan();\n $this->User = new User();\n }", "public function getUser() : object\n {\n $user = new User();\n $user->setDb($this->db);\n $user->find(\"id\", $this->username);\n\n return $user;\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "function __construct(){\r\n\t\t$this->database = new Model;\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->library('session');\n $this->load->model('user_model');\n\t}", "public function __construct($correctUser) \r\n {\r\n require_once 'User.php';\r\n $this->correctUser = $correctUser;\r\n }", "public function __construct()\n {\n $this->ModelUser = new LoginRegisterModel();\n $this->modelCategorie = new CategoriesModel();\n\t\t/* ********** fin initialisation Model ********** */\n }", "public function setUp() {\n $this->user = new \\App\\Models\\User;\n }", "public function model()\n {\n return User::class;\n }", "public function createUser()\n {\n }", "public function __construct(UserModel $userModel)\n {\n $this->userModel = $userModel;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }" ]
[ "0.7775347", "0.7644697", "0.7633099", "0.762947", "0.7565205", "0.7517719", "0.73940927", "0.73627955", "0.72064835", "0.71970534", "0.7191847", "0.7171757", "0.71134216", "0.7108004", "0.70830435", "0.7072425", "0.7054955", "0.70520025", "0.7047133", "0.70320743", "0.7012539", "0.69930387", "0.6991825", "0.6964384", "0.6957818", "0.694956", "0.69389117", "0.6919085", "0.68809104", "0.6874484", "0.6855064", "0.68410367", "0.6836087", "0.68294716", "0.68294716", "0.67804736", "0.67674446", "0.673429", "0.66958594", "0.6692157", "0.6667025", "0.6667025", "0.6667025", "0.6657435", "0.664575", "0.6636419", "0.663208", "0.6628413", "0.66178286", "0.66061985", "0.6596083", "0.6586877", "0.65686536", "0.6562172", "0.6517228", "0.6506104", "0.65051323", "0.6488712", "0.6477305", "0.64758486", "0.64740866", "0.6472446", "0.64687777", "0.64674395", "0.64528644", "0.6450236", "0.6450114", "0.6445485", "0.64376014", "0.64369303", "0.64295924", "0.6411089", "0.6409423", "0.6395946", "0.6391531", "0.63885725", "0.637342", "0.637342", "0.63620734", "0.6359435", "0.6355211", "0.6351394", "0.63456583", "0.63410854", "0.6339488", "0.6333572", "0.6333047", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196", "0.63320196" ]
0.0
-1
Sets the view field
public function setView(Zend_View_Interface $view) { $this->view = $view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setView($value) {\r\n $this->view = $value;\r\n }", "public function setViewAttribute($input)\n {\n $this->attributes['view'] = $input ? $input : null;\n }", "public function setView(View &$view) {\n\t\t$this->view = $view;\n\t}", "public function setView(FW_Mvc_View $view){\n\t\t$this->view = $view;\n\t}", "public function setView($view) {\n\t\t$this->_view = $view;\n\t}", "public function setView($view) {\n\t\t$this->view = $view;\n\t}", "function testSetViewExpectsViewReplaced() {\n\t\t// Arrange\n\t\t$newView = new \\StdClass;\n\t\t$form = new TestNumberField();\n\n\t\t// act\n\t\t$form->set_view($newView);\n\n\t\t// Assert\n\t\t$this->assertInstanceOf('StdClass', $form->View, 'Not working.');\n\t}", "protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }", "public function setView($view)\n {\n $this->view = $view;\n }", "public function setView($view);", "public function setViewMode($input);", "public function setView(tx_egovapi_domain_model_view $view) {\n\t\t$this->view = $view;\n\t\treturn $this;\n\t}", "public function setView(\\Yaf\\View_Interface $view){ \r\n\t\t$this->_view = $view;\r\n\t}", "public function render(\\Opt_View $view)\n\t{\n\t\t$this->_view = $view;\n\t}", "public function setView(\\App\\View $view)\r\n {\r\n $this->view = $view;\r\n return $this;\r\n }", "public function setParamToView($key, $value);", "public function setViewID ($viewID) {\n $this->viewID = $viewID;\n }", "public function SetView (\\MvcCore\\IView $view) {\n\t\tparent::SetView($view);\n\t\treturn $this->SetLangAndLocale(\n\t\t\t$this->lang ?: $this->request->GetLang(), \n\t\t\t$this->locale ?: $this->request->GetLocale()\n\t\t);\n\t}", "function view($view){\r\r\n $this->view = $view;\r\r\n }", "public function setView($view): self\r\n {\r\n $this->extras['view'] = $view;\r\n return $this;\r\n }", "public function setView($view) {\n\t\t$this->view = $view;\n\t\treturn $this;\n\t}", "public function setNameView($name = NULL ){\n\t\t$this->nameView = $name ? $name : \"Ver \".$this->name;\n\t}", "public function setParamToView($key, $value){\n\t\tView::setViewParam($key, $value);\n\t}", "public function setView($view)\n {\n $this->_view = $view;\n return $this;\n }", "public function setForm(FormView $form): void\n {\n $this->formView = $form;\n }", "public function setView(Zend_View_Interface $view) {\n\t\t$this->_view = $view;\n\t}", "protected function _view()\r\n\t\t{\r\n\t\t\t((!is_object($this->_view)) ? $this->_view = init_class(VIEW_NAME) : '');\r\n\t\t}", "public function setView(View $view)\n {\n $this->view = $view;\n\n return $this;\n }", "public function setView (Zend_View_Interface $view)\n\t{\n\t\t$this->view = $view;\n\t}", "function set_payment_view($view) {\n\n // Set content view\n md_set_component_variable('payment_content_view', $view);\n \n }", "public function setView( Zend_View_Interface $view )\n {\n $this->view = $view;\n }", "protected function addNameToView($view) {\n // Pokud je name nastaveno ve form data, vezme se z nich\n $view->name = arr::get($this->form_data, 'name', '');\n\n //Pokud je name stale prazdne, zkusime ho nacit z modelu pomoci preview()\n //select ocekavam na atributu, ktery odpovida nazvu ciziho klice - tedy\n //[object]id\n $relobject = $this->virtual\n ? $this->config['relobject']\n : substr($this->attr, 0, -2);\n\n //pokud ma byt umozneno pridat relacni zaznam v ramci tohoto form. prvku\n //tak se zobrazi tlacitko pro to\n $view->new = arr::get($this->config, 'new', '');\n $view->new_label = arr::get($this->config, 'new_label', __($relobject.'.new_'.$relobject));\n\n //nazvy atributu musi vzdy jit pres metodu itemAttr rodicovske tridy Form\n $view->name_attr = $this->form->itemAttr($this->attr.'[name]');\n $view->value_attr = $this->form->itemAttr($this->attr.'[value]');\n\n // Pokud je specifikovano preview pro tento formItem, pouzijeme ho\n $preview = arr::get($this->config, 'preview', '');\n // A prelozime ho, jinak se pouzije defaultni preview modelu - viz ORM::preview()\n $preview = $preview != '' ? __($preview) : NULL;\n\n if ($this->virtual)\n {\n $relobject = ORM::factory($relobject, arr::get($this->form_data, 'value'));\n\n $view->name = $relobject->preview();\n }\n else\n {\n if ($this->model->{$relobject}->loaded())\n {\n $view->name = $this->model->{$relobject}->preview($preview);\n }\n //pokud neni relacni zaznam podle hodnoty PK nalezen, tak uz neexistuje\n //a do prvku se musi propsat prazdna hodnota\n else\n {\n $view->name = $view->value = NULL;\n }\n }\n\n // Pokud je name stale prazdne, vlozime watermark, pokud je specifikovan\n if (empty($view->name) and ($watermark = arr::get($this->config, 'watermark', '')) != '') {\n $view->name = $watermark;\n $view->watermark = TRUE; // rika ze se ma inputu pridat class watermark\n }\n $view->input_class = arr::get($this->config, 'input_class', 'input-block-level');\n }", "public function setView(Twig $view)\n {\n $this->view = $view;\n }", "protected function _onRender(Opt_View $view)\n\t{\n\t\t$this->setInternal('name', $this->_name);\n\t\t$this->setInternal('step', $this->_step);\n\t}", "public function setView (Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView (Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView (Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView (Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView (Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView(Zend_View_Interface $view) {\r\n\t\t$this->view = $view;\r\n\t}", "public function setView(Zend_View_Interface $view) {\r\n\t\t$this->view = $view;\r\n\t}", "public function setView($view)\n {\n $this->view = $view;\n return $this;\n }", "public function setView(Zend_View_Interface $view) \n\t{\n\t\t$this->view = $view;\n\t}", "public function setView(Zend_View_Interface $view) {\r\n $this->view = $view;\r\n }", "public function setView(Zend_View_Interface $view) {\r\n $this->view = $view;\r\n }", "public function setView(Zend_View_Interface $view) {\r\n $this->view = $view;\r\n }", "public function setView(ViewWritableInterface $view)\n {\n $this->view = $view;\n }", "protected function buildEntityViewsField() {\n }", "public function setViews($val)\n {\n $this->_propDict[\"views\"] = $val;\n return $this;\n }", "public function __set($key, $value) {\n if (method_exists($this, 'set_'.$key)) {\n $this->{'set_'.$key}($value);\n }\n $this->_view->{$key} = $value;\n }", "public function setView($view)\n {\n $this->view = $view;\n\n return $this;\n }", "public function setViewData($data)\n {\n $this->__viewData = $data;\n }", "public function set_view($param)\n\t{\n\t\t$this->view = (bool)$param;\n\t\treturn $this;\n\t}", "public function setView($view) {\n $this->checkNotStopped();\n $this->_view = $view;\n return $this;\n }", "public function setView(Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView(Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function setView(Zend_View_Interface $view)\n {\n $this->view = $view;\n }", "public function set_view( Pronamic_Mail_View $view ) {\n $this->view = $view;\n return $this;\n }", "public function setFullView(): void\n {\n $this->viewType = self::VIEW_FULL;\n }", "public function setView( \\Aimeos\\MW\\View\\Iface $view )\n\t{\n\t\t$this->view = $view;\n\t\treturn $this;\n\t}", "private function _setView()\n\t{\n\t\tif (preg_match('/^[a-z0-9_-]+$/', $this->_requestVars[1])) {\n\t\t\t$this->_view = $this->_requestVars[1];\n } else {\n \t$this->_view = $this->_requestVars[1] = self::DEFAULT_VIEW;\n }\n\n return $this;\n\t}", "public function setView(Zend_View_Interface $view) \n {\n $this->view = $view;\n return $this;\n\t}", "function setField($field) {\r\r\n\t\t$this->field = $field;\r\r\n\t}", "public function setField($field);", "public function setField($field);", "public function __set($name, $value)\n {\n $this->view->set($name, $value);\n }", "public function setView($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\PubSub\\V1\\SchemaView::class);\n $this->view = $var;\n\n return $this;\n }", "public function __construct( View $view ) {\n\t\t$this->view = $view;\n\t}", "protected function setToView($nameOrData, $value = null) {\n\t\tApplication::getInstance()->getDiContainer()->getViewDo()->set($nameOrData, $value);\n\t}", "public function setViewComponent( $viewComponent );", "public function setField(Field $field) {\n\t\t$this->field = $field; \n\t}", "protected function set($name, $value = null)\n {\n $this->view->set($name, $value);\n }", "public function __construct($view) {\n $this->view = $view;\n }", "public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}", "public function setView($sView) {\n \t\n \t// Set the view we \n \t// wish to render\n \t$this->sView = (string) $sView;\n \t\n \t// Return instance\n \treturn $this;\n }", "protected function setPath($view)\n {\n $this->viewModel = new View([], null, true);\n\n if ($view == null) {\n $view = $this->findView();\n }\n\n if (str_contains($view, '.')) {\n $view = SupportCollection::explode('.', $view)\n ->transform(function ($part) {\n return ucfirst($part);\n })\n ->implode('/');\n }\n\n $this->viewModel->view = $view;\n\n inertiaResolver()->collectDetails($this->viewModel);\n\n $this->path = $view;\n }", "public function setViewName($viewName)\n {\n $this->_viewName = $viewName;\n }", "public function setField($field) {\n\t\t$this->_field = $field;\n\t}", "public function setView($file = FALSE)\n {\n if($file)\n $this->fileName = $file;\n else\n _d('Class name: '.__CLASS__.' line: '.__LINE__.' function: '.__FUNCTION__.' You must set view file.',1);\n }", "public function setUserfield($value);", "public function __construct(View $view) {\n $this->view = $view;\n }", "public function view($view)\n {\n $this->view = $view;\n\n return $this;\n }", "public function setNumView($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->num_view !== $v || $v === 0) {\n\t\t\t$this->num_view = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::NUM_VIEW;\n\t\t}\n\n\t}", "public function registerView(View $view)\r\n\t{\r\n\t $this->m_View = $view; \r\n\t}", "public function setField($value) {\n\t\t$this->_field = $value;\n\t}", "public function setView( \\Aimeos\\MW\\View\\Iface $view )\n\t{\n\t\tparent::setView( $view );\n\n\t\t$this->client->setView( $view );\n\t\treturn $this;\n\t}", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function setField($field)\n {\n $this->_field = $field;\n }", "public function setView(Zend_View_Interface $view)\n {\n parent::setView($view);\n $this->jquery = $this->view->jQuery();\n $this->jquery->enable();\n return $this;\n }", "public function setField( WebLab_Data_Field $field ) {\n $this->_field = $field;\n }", "function init(&$view, $options) {\n $this->casetracker_fields = array();\n foreach ($this->definition['template']->properties as $property) {\n if ($property->views['display']) {\n\t$this->casetracker_fields['casetracker_' . $property->id] = $property->view_init($view, $this, $options);\n }\n }\n parent::init(&$view, $options);\n }", "public function setLibraryViewConfiguration()\r\n {\r\n // Gets the library configuration manager\r\n $this->libraryConfigurationManager = $this->getController()->getLibraryConfigurationManager();\r\n\r\n // Gets the view identifier\r\n $this->viewIdentifier = $this->libraryConfigurationManager->getViewIdentifier($this->viewType);\r\n\r\n // Gets the view configuration\r\n $this->libraryViewConfiguration = $this->libraryConfigurationManager->getViewConfiguration($this->viewIdentifier);\r\n }", "public function setView($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Area120\\Tables\\V1alpha1\\View::class);\n $this->view = $var;\n\n return $this;\n }", "public function setView($view, $type = 'page')\n\t{\n\t\t$this->_pageData['view'][$type] = $view;\n\t}", "public function initializeView() {}" ]
[ "0.70969415", "0.6878869", "0.68779284", "0.67435896", "0.65906787", "0.64792794", "0.6468066", "0.645294", "0.63559693", "0.63503927", "0.63155305", "0.63115174", "0.62998134", "0.6122572", "0.6090669", "0.6088068", "0.60829204", "0.6077526", "0.6069231", "0.6051919", "0.6037338", "0.60266584", "0.59496605", "0.59190494", "0.5910709", "0.59019697", "0.5870696", "0.58596796", "0.5859349", "0.58523786", "0.58509326", "0.5841121", "0.58300877", "0.5824613", "0.5823567", "0.5823567", "0.5823567", "0.5823567", "0.5823567", "0.5800024", "0.5800024", "0.57994103", "0.5753312", "0.5751656", "0.5751656", "0.5751656", "0.5747659", "0.5735233", "0.5722323", "0.57156044", "0.571531", "0.57078534", "0.5695954", "0.56942636", "0.5688316", "0.5688316", "0.5688316", "0.56686455", "0.56629664", "0.56449085", "0.56433624", "0.5635464", "0.5628229", "0.5610836", "0.5610836", "0.5603695", "0.5566438", "0.5554119", "0.55507934", "0.55394334", "0.55316913", "0.5524986", "0.55214", "0.551096", "0.55006385", "0.54976577", "0.54891825", "0.5486725", "0.5483397", "0.5477067", "0.5470641", "0.5468062", "0.54567224", "0.5452987", "0.54444563", "0.5439042", "0.54347086", "0.54345655", "0.54211193", "0.5413416", "0.5408988", "0.54036605", "0.5394579", "0.53842384", "0.53822476" ]
0.5818652
42
this should be global somewhere
public function __construct() { $this->oauth = new Coinbase_OAuth( Config::get('settings.client_id'), Config::get('settings.client_secret'), Config::get('settings.redirect_uri') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function __init(){}", "protected function __init__() { }", "protected function init() {return;}", "private function __() {\n }", "public function helper()\n\t{\n\t\n\t}", "private function init()\n\t{\n\t\treturn;\n\t}", "protected function init()\n\t{\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "public function init() {\t\t\n\n }", "protected function _init()\r\n\t{\r\n\t}", "public function _init() {\r\n\r\n }", "public function init() {\n\t\t\n\t}", "public function init ()\r\n {\r\n }", "protected function _init()\n {\n }", "public function _init() {}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "public function init(){\n\t\t\t\t}", "public function init()\n { \t\n }", "public function init(){\n\t\t\n\t}", "private function __construct()\t{}", "public function init ()\n {\n }", "public function init ()\n {\n }", "public function init() {\r\n\r\n\t\t}", "public function init()\n {\n \t\n }", "public function init()\n {\n \t\n }", "public function init(){\n\t\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "final private function __construct(){\r\r\n\t}", "public function _init(){}", "public function init() {\r\n\t}", "public function init(){\n\t}", "public function init(){\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function init()\n\t\t{\n\t\n\t\t}", "private function __construct() {\r\n\t\t\r\n\t}", "function __construct(){\n\t\t// nowt much...\n\t}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "abstract protected function _init();", "abstract protected function _init();", "private function _i() {\n }", "public static function init(){\n \n }", "protected function _init()\n {\n }", "private function __construct () {}", "public function init()\n {\n \n \n }", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\r\n\t {\r\n\t }", "public function init() {\r\n }", "protected function init()\n {\n\n }", "public function _init_(){\n //var_dump($this);\n }", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\n\t}", "public function init() {\n\n\t}", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }" ]
[ "0.69077927", "0.69077927", "0.69077927", "0.69077927", "0.69077927", "0.69077927", "0.6907789", "0.6907789", "0.6907789", "0.6907789", "0.69066167", "0.69066167", "0.68913716", "0.6853809", "0.68391126", "0.68383914", "0.6772643", "0.67661715", "0.66910535", "0.6665178", "0.66634834", "0.6649513", "0.6576194", "0.65745544", "0.65325326", "0.65106833", "0.6497647", "0.649355", "0.649355", "0.6492343", "0.64755875", "0.6466903", "0.64537746", "0.6429241", "0.6429241", "0.6414654", "0.64112455", "0.64112455", "0.64085937", "0.64039594", "0.64039594", "0.64039594", "0.64039594", "0.64039594", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6403666", "0.6400645", "0.6400091", "0.63943154", "0.63820064", "0.63820064", "0.6381073", "0.6375995", "0.6370119", "0.6360776", "0.6352918", "0.6352918", "0.6352918", "0.6352918", "0.63518286", "0.63518286", "0.6345251", "0.63399", "0.6338168", "0.6315008", "0.63135046", "0.63059485", "0.6303844", "0.6300221", "0.6298587", "0.6298558", "0.6296124", "0.6296124", "0.6296124", "0.6296124", "0.6296124", "0.62942886", "0.62942886", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635", "0.6288635" ]
0.0
-1
Display a listing of the resource.
public function index() { $clients = Client::all(); return $this->showAll($clients); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $rules = [ 'user_id'=> 'unique:clients,user_id', 'company_name' => 'required' ]; $this->validate($request, $rules); $user = Auth::user(); $data = $request->all(); if(isset($data['user_id']) && $user->id == $data['user_id'] || isset($data['user_id']) && $user->isAdmin()) { $client = Client::create($data); } else { $data['user_id'] = $user->id; $client = Client::create($data); } return $this->showOne($client, Response::HTTP_CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Client $client) { return $this->showOne($client); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "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 show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Client $client) { $user = Auth::user(); $authenticatedClientId = $user->client->id; if($client->id == $authenticatedClientId || $user->isAdmin()) { $client->fill($request->all()); if($client->isClean()) { return response()->json(['error' => 'You need to specify a different value to update', 'code' => Response::HTTP_UNPROCESSABLE_ENTITY], Response::HTTP_UNPROCESSABLE_ENTITY); } $client->save(); return $this->showOne($client); } else { return response()->json(['error' => 'Unauthorize Access', 'code' => Response::HTTP_UNAUTHORIZED], Response::HTTP_UNAUTHORIZED); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Client $client) { $client->delete(); return $this->showOne($client); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
pickFile.php basic browse to a file for uploading =69.GIAP=TUSHKA BOSWAR version 1.0 Nov 1, 2013 define function
function pickFile($returnpage) { // $returnpage is page to return to when done if (!isset($returnpage)) { $returnpage = '.'; } echo "<form id=\"campaignMgmtUploadForm\" action=\"uploadFile.php\" method=\"post\" enctype=\"multipart/form-data\" />\n"; echo " <div>\n"; // echo " Choose a file to upload: <br />\n"; echo " <fieldset id=\"inputs\">\n"; echo " <input type=\"hidden\" name=\"returnpage\" value=\"$returnpage\"/>\n"; echo " <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10485760\"/>\n"; echo " <input type=\"file\" name=\"userfile\" id=\"userfile\" size=\"50\" />\n"; echo " </fieldset>\n"; echo " <fieldset id=\"actions\">\n"; echo " <input id=\"SetupDone\" type=\"submit\" value=\"Upload File\" />\n"; echo " </fieldset>\n"; echo " </div>\n"; echo "</form>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clients_importDisplaySelectFile() {\n\tglobal $gSession;\n\t\n\t$current_group = intval($_GET['group']);\n\t\n\t## setup the template\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => ENGINE.\"modules/clients/interface/fileupload.tpl\"));\n\n\t$select_template->set_var('language_inputhead','<b>'.LANG_MODULE_CLIENTS_ImportSelectFile.'</b>');\n\t$select_template->set_var('language_inputbody',LANG_MODULE_CLIENTS_ImportSelectFileDesc.'<br>');\n\t\n\t$select_template->set_var('update',LANG_MODULE_CLIENTS_ImportUpdate);\n\t$select_template->set_var('explain_update',LANG_MODULE_CLIENTS_ImportUpdateDesc);\n\t\n\t$select_template->set_var('element_desc','Click the \\'Browse\\' button to locate the text file<br> containing the subscribers on your computer.');\n\t\n\t$targetURL = \"module.php?cmd=import&step=1&group=\".$current_group;\n\t$targetURL = $gSession->url($targetURL);\n\t$select_template->set_var('actionURL',$targetURL);\t\n\t\n\t$select_template->pfill_block(\"body\");\n\t\n}", "function media_choose()\r\n{\r\n\tglobal $CONF, $member, $manager;\r\n\r\n\t$currentCollection = media_requestVar('collection');\r\n\t// start modify by T.Kosugi 2006/08/26\r\n//\t$collections = MEDIA::getCollectionList();\r\n\t$collections = MEDIADIRS::getCollectionList();\r\n\t// modify end\r\n\r\n\tmedia_head();\r\n?>\r\n\t<h1><?php echo htmlspecialchars(_UPLOAD_TITLE); ?></h1>\r\n\r\n\t<p><?php echo htmlspecialchars(_UPLOAD_MSG); ?></p>\r\n<!--//added yama 20070928-->\r\n\t<?php echo _MEDIA_PHP_21; ?>\r\n<!--//end yama 20070928-->\r\n\r\n\t<form method=\"post\" enctype=\"multipart/form-data\" action=\"media.php\">\r\n\t<div>\r\n \t <input type=\"hidden\" name=\"action\" value=\"uploadfile\" />\r\n \t <?php $manager->addTicketHidden() ?>\r\n\t <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"<?php echo intVal($CONF['MaxUploadSize']); ?>\" />\r\n\t File:\r\n\t <br />\r\n\t <input name=\"uploadfile\" type=\"file\" size=\"40\" />\r\n\t<?php\t\tif (sizeof($collections) > 1) {\r\n?>\r\n\t\t<br /><br /><label for=\"upload_collection\">Collection:</label>\r\n\t\t<br /><select name=\"collection\" id=\"upload_collection\">\r\n\t\t\t<?php\r\n\t\t\t\t\tforeach ($collections as $dirname => $description) {\r\n\t\t\t\t\t\techo '<option value=\"' . htmlspecialchars($dirname) . '\"';\r\n\t\t\t\t\t\tif ($dirname == $currentCollection) {\r\n\t\t\t\t\t\t\techo ' selected=\"selected\"';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\techo '>' . htmlspecialchars($description) . '</option>';\r\n\t\t\t\t\t}\r\n\t\t\t?>\r\n\t\t</select>\r\n\t<?php\t\t} else {\r\n\t?>\r\n\t \t<input name=\"collection\" type=\"hidden\" value=\"<?php echo htmlspecialchars($currentCollection); ?>\" />\r\n\t<?php\t\t} // if sizeof\r\n\t?>\r\n\t <br /><br />\r\n\t <input type=\"submit\" value=\"<?php echo htmlspecialchars(_UPLOAD_BUTTON); ?>\" />\r\n\t</div>\r\n\t</form>\r\n<p><a href=\"javascript:history.back()\"><?php echo htmlspecialchars(_BACK); ?></a></p>\r\n\t<?php\r\n\tmedia_foot();\r\n}", "public function browse_files_page(){\r\n\t\tglobal $wpdb;\r\n\r\n\r\n\t\t$files_table = $this->files_table;\r\n\r\n\t\tif(isset($_GET['action']) && $_GET['action'] == 'edit'){\r\n\t\t\t$nonce = esc_attr( $_REQUEST['_editnonce'] );\r\n\t\t \tif ( ! wp_verify_nonce( $nonce, 'edit_file' )) {\r\n\t\t \tdie( 'Error' );\r\n\t\t \t// echo $_GET['action'];\r\n\t\t }else{\r\n\t \t\t$data = $this->MD_Model->get_file($_GET['id']);\r\n\t \t\t$slug = get_post_field( 'post_name', $_GET['post'] );\r\n\r\n\t \t\tif(isset($_POST['submit'])){\r\n\t \t\t\t$data = $this->edit_file();\r\n\t \t\t}\r\n\r\n\t \t\t$dl_path = wp_upload_dir()['basedir'].'/downloads/reports/'.$slug.'/'.$data['filename']; \r\n\t\t $dl_path = base64_encode($dl_path);\r\n\r\n\t\t \tinclude($this->admin_url . 'view/market-reports-edit-file.php');\r\n\t\t }\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tinclude($this->admin_url . 'view/market-reports-browse-files.php');\t\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "public function callback_file( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n $id = $args['section'] . '[' . $args['id'] . ']';\n $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File' );\n $mime_type = isset( $args['options']['mime'] ) ? $args['options']['mime'] : 'image';\n\n $html = '<fieldset>';\n $html .= sprintf( '<input type=\"text\" class=\"%1$s-text wpsa-url\" id=\"%2$s\" name=\"%2$s\" value=\"%3$s\" %4$s/>', $size, $name_id, $value, $disable );\n $html .= '<input type=\"button\" class=\"button wpsa-browse\" value=\"' . $label . '\" ' . $disable . '/>';\n $html .= '<input type=\"hidden\" class=\"wpsa-mime\" value=\"' . $mime_type . '\" />';\n $html .= $this->get_field_description( $args );\n $html .= '</fieldset>';\n\n echo $html;\n }", "function _field_file($val) \n {\n $res = \"\";\n $size = $this->_get_field_size();\n $size -= 12; // compensate for Browse.. button\n\n if (isset($this->attribs['ws_path'])) {\n $path = $this->attribs['ws_path'];\n }\n\n\n $res .= sprintf(\"<input type=\\\"file\\\" name=\\\"%s\\\" id=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s/>\\n\",\n $this->fname,\n $this->fname,\n $size,\n $this->attribs['maxlength'],\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n\n if (isset($this->attribs['show_current']) and !empty($val)) {\n $res .= sprintf('<br /><span style=\"font-size: 9px\">current file: <a href=\"%s/%s\" target=\"flashWin\">%s</a></span>', $path, $val, $val);\n }\n\n return $res;\n }", "function khLess_field_pill_cb($args)\n{\n $options = get_option('khLess_options');\n // output the field\n ?>\n <input type=\"file\" name=\"file\">\n\n <input type=\"submit\" name=\"open_file\" value=\"Загрузить расписание\"/>\n\n\n <?php\n}", "function fileForm($sqlType){ ?>\n\t\t<form name=\"eventInput\" action=\"<? printHTML(fullURL(getLangVar(\"fileURL\"), \"commit\")); ?>\" method=\"post\" enctype=\"multipart/form-data\">\n\t<?\tobjectForm(); ?>\n\t\t\t<div>\n\t\t\t\t<label for=\"file\">Filename:</label><input type=\"file\" name=\"file\" id=\"file\" />\n\t\t\t</div>\n\t\t\t<div class=\"fr\">\n\t\t\t\t<input type=\"submit\" value=\"Submit\"></input>\n\t\t\t</div>\n\t\t\t<input id=\"sqlType\" name=\"sqlType\" type=\"hidden\" value=\"<? printHTML($sqlType); ?>\"></input>\n\t\t\t<input id=\"fileId\" name=\"fileId\" type=\"hidden\" value=\"<? printHTML($GLOBALS['fileId']); ?>\"></input>\n\t\t</form>\n<?\t}", "function os_selectfile_add_meta_box() {\n\t//for general\n\tadd_meta_box('os_selectfile_meta_box', 'Select File', 'os_selectfile_meta_box_html', '', 'side');\n}", "function form_file($forms){\r\n\r\n\t$name = isset($forms['name']) ? $forms['name'] : rand(1000 , 9999 ) ;\r\n\t$class = isset( $forms['class'] ) ? $forms['class'] : $forms['name'] ;\r\n\t$value = isset( $forms['value'] ) ? $forms['value'] : \"\" ;\r\n\t$id = isset( $forms['id'] ) ? $forms['id'] : $forms['name'] ; \r\n\t\r\n\t$input = '<input onkeypress=\"return handleEnter(this, event)\" type=\"file\" size=\"52\" ';\r\n\t$input .= ' name=\"'.$name.'\" ';\r\n\t$input .= ' class=\"'.$class.'\" ';\r\n\t$input .= ' id=\"'.$id.'\" ';\r\n\t$input .= ' value=\"'.$value.'\" '; \r\n\t$input .= ' />';\r\n\r\n\treturn $input;\r\n}", "public function support($file);", "function ft_hook_upload($dir, $file) {}", "function upload_file() {\n upload_file_to_temp();\n }", "function setTokenPickupFile($value)\n {\n $this->_props['TokenPickupFile'] = $value;\n }", "function bab_pm_file_upload_form($label, $pophelp, $step, $id = '')\n{\n global $file_max_upload_size;\n\n if (!$file_max_upload_size || intval($file_max_upload_size) == 0) {\n $file_max_upload_size = 2*(1024*1024);\n }\n\n $max_file_size = (intval($file_max_upload_size) == 0) ? '' : intval($file_max_upload_size);\n\n $label_id = (@$label_id) ? $label_id : 'postmaster-upload';\n\n return '<form method=\"post\" enctype=\"multipart/form-data\" action=\"index.php\">'\n . '<div>'\n . (!empty($max_file_size)? n.hInput('MAX_FILE_SIZE', $max_file_size): '')\n . eInput('postmaster')\n . sInput('import')\n . graf(\n '<label for=\"'.$label_id.'\">'.$label.'</label>'.sp.\n fInput('file', 'thefile', '', 'edit', '', '', '', '', $label_id).sp.\n fInput('submit', '', gTxt('upload'), 'smallerbox')\n )\n . '<br /><input type=\"checkbox\" name=\"overwrite\" /> Overwrite subscribers that already exist'\n . '<br /><input type=\"checkbox\" name=\"dump_first\" /> Empty subscribers list before import'\n . '</div></form>';\n ;\n}", "public function it_shows_file_input_on_type_of_file()\n {\n // configure\n $inputs = [\n [\n 'type' => 'file',\n 'name' => 'tc',\n 'label' => 'Upload Terms and Conditions'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }", "function os_selectfile_meta_box_html() { \n\tglobal $post;\n echo '<input type=\"hidden\" name=\"os_selectfile_nonce\" value=\"'.wp_create_nonce(basename(__FILE__)).'\" />'; // Use nonce for verification\n\techo '<p id=\"os-selectfile-ajax\">';\n\techo '<label for=\"os_selectfile_file\"></label>';\n\techo '<select name=\"os_selectfile_file\" id=\"os_selectfile_file\">';\n\techo '<option value=\"\">-</option>';\n\t$val = get_post_meta($post->ID, 'os_selectfile_file', true);\n\t$q = get_posts('post_type=attachment&post_mime_type=application&posts_per_page=-1&orderby=title&order=ASC&post_parent='.$post->ID);\n\tforeach ($q as $obj) {\n\t\techo '<option value=\"'.$obj->ID.'\"';\n\t\techo $obj->ID == $val ? 'selected=\"selected\"' : '';\n\t\techo '>';\n\t\techo $obj->post_title;\n\t\t//echo ' ('.str_replace(\"application/\", \"\", $obj->post_mime_type).')';\n\t\techo '</option>';\n\t}\n\techo '</select>';\n\techo '</p>';\n\techo '<p>';\n\techo '<a href=\"media-upload.php?post_id='.$post->ID.'&TB_iframe=1\" class=\"button button-highlighted thickbox\">Upload File</a>';\n\techo ' <a href=\"#\" id=\"os-selectfile-ajaxclick\" class=\"button\">Refresh</a>';\n\techo ' <span id=\"os-selectfile-loading\" style=\"display:none;\"><img src=\"images/loading.gif\" alt=\"Loading...\" style=\"vertical-align:middle\" /></span>';\n\techo '</p>';\n}", "public function browse() {\n\n\t}", "public function getFile ();", "function fileview($status)\n{\n\t/*\n\tbring in global variables ($q is the appiontment id, $sid is the id of the student\n\t$hint is the output variable that has already been created by the calling page, the file upload will be appended\n\tto that variable\n\t*/\n\tglobal $q,$hint,$sid;\n\t//set part1 to be blank\n\t$part1=\"\";\n\t//set part 2 to be blank\n\t$part2=\"\";\n\t\n\t//if the appointment is still open, create the form for uploading files and attach it to $hint\n\tif ($status==\"open\")\n\t{\n\t\t$hint=$hint.'\n\t\t\t<p >File Upload:</p>\n\t\t\t<form action=\"add_file.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<input type=\"file\" name=\"uploaded_file\"><br>\n\t\t\t<input type=\"submit\" value=\"Upload file\">\n\t\t\t<input type=\"hidden\" name=\"apptid\" id=\"apptid\" value=\"'.$q.'\"/>\n\t\t\t<input type=\"hidden\" name=\"studentid\" id=\"studentid\" value=\"'.$sid.'\"/>\n\t\t\t</form>\n\t\t\t<br/><br/>';\n\t}\n\t//create title for uploaded files and attach to $hint\n\t$hint=$hint.'<p><u>Uploaded Files:</u><br/>';\n\t// Query for a list of all existing files and format the date\n\t$sql = \"select *,Date_FORMAT(created,'%Y-%d-%m %h:%m %p') as created from file where apptid = \".$q;\n\t//run the query\n\t$result = @mysql_query($sql);\n\t// Check if it was successfull\n\tif (@mysql_num_rows($result) !=0) \n\t{//open php rows if\n \t\t// Print the top of a table\n $part1= '<table>\n <tr>\n\t\t\t\t\t<td></td>\n <td><b>Name</b></td>\n <td><b>Size (bytes)</b></td>\n <td><b>Created</b></td>\n <td><b>&nbsp;</b></td>\n </tr>';\n \n\t\twhile ($row = @mysql_fetch_assoc($result))\n\t\t{//open php while\n\t\t\n\t\t\t//pick icon\n\t\t\t//set $mime to be the mimetype of the file in the db\n\t\t\t$mime=$row['mime'];\n\t\t\t//check to see if the uploaded files matches the description of the known file types\n\t\t\t$position1 = substr_count($mime, 'word');\n\t\t\t$position2= substr_count($mime, 'text');\n\t\t\t$position3 = substr_count($mime, 'pdf');\n\t\t\t$position4 = substr_count($mime, 'presentation');\n\t\t\t$position5 = substr_count($mime, 'spre');\n\t\t\tif ($position1 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/doc.bmp\";\n\t\t\t\t$doctype = \"Word Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position2 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/text.bmp\";\n\t\t\t\t$doctype = \"Text Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position3 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/pdf.bmp\";\n\t\t\t\t$doctype = \"PDF\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position4 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/ppt.bmp\";\n\t\t\t\t$doctype = \"PowerPoint Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position5 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/xls.bmp\";\n\t\t\t\t$doctype = \"Excel Document\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/file.bmp\";\n\t\t\t\t$doctype = \"Document\";\n\t\t\t}\n\t\t\t//once icon is determined, create the link and output file info in the table, do for each file found during loop\n\t\t\t$part2=$part2. \"\n <tr>\n\t\t\t\t\t<td align='right'><a href='get_file.php?id={$row['id']}'><img src='\".$iconLocation.\"' title='\".$doctype.\"' width='25' height='25' /></a></td>\n <td align='left'>{$row['name']}</td>\n <td>{$row['size']}</td>\n <td>{$row['created']}</td>\n <td><a href='get_file.php?id={$row['id']}'>Download</a></td>\n\t\t\t\t\t\";\n\t\t\tif($status == \"open\")\n\t\t\t{\n\t\t\t\t//if the appointment is still open, give link for deleting file, no file deleting after appointment is closed\n\t\t\t\t$part2=$part2.\"<td><a href='delete_file.php?id={$row['id']}&student=\".$sid.\"'>Delete</a></td>\";\n\t\t\t}\n $part2=$part2.\"</tr>\";\n\t\t}//close php while\n\t\t// Close table\n $part3='</table>';\n\t\t//add all parts to $hint\n\t\t$hint=$hint.$part1.$part2.$part3;\n\t}//close php rows if\n\t//if no files have been uploaded\n\telse\n\t{\t\n\t\t$hint=$hint.\"No uploaded files found for appointment number \".$q;\n\t}\n\t\n}", "function fileUpload()\n{\n\tglobal $files;\n\tglobal $herr;\n\tglobal $CONFIGVAR;\n\tglobal $dbapp;\n\tglobal $ajax;\n\n\t// Setup\n\t$basePath = $CONFIGVAR['files_base_path']['value'] . '/' .\n\t\t$CONFIGVAR['files_turned_in']['value'];\n\t$maxSize = $CONFIGVAR['files_max_upload_size']['value'];\n\t$extensions = $CONFIGVAR['files_allowed_extensions']['value'];\n\t$extList = explode(' ', $extensions);\n\n\t// Upload\n\t$filelist = $files->fileUpload($basePath, '/', $maxSize, true);\n\n\t// Verify that the extension of the file(s) are allowed.\n\tif (is_array($filelist))\n\t{\n\t\tforeach($filelist as $kx => $vx)\n\t\t{\n\t\t\t// Get the file extension\n\t\t\t$filename = basename($kx);\n\t\t\t$component = explode('.', $filename);\n\t\t\tif (!is_array($component)) continue;\n\t\t\tif (count($component) == 0) continue;\n\t\t\t$ext = $component[count($component) - 1];\n\n\t\t\t// Filter through the extension list. If it's not\n\t\t\t// on the list, then add to the error message.\n\t\t\t$eflag = true;\n\t\t\tforeach($extList as $kxa)\n\t\t\t{\n\t\t\t\tif (strcasecmp($ext, $kxa) == 0)\n\t\t\t\t{\n\t\t\t\t\t$eflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($eflag)\n\t\t\t{\n\t\t\t\t// Not on the list, so delete the file.\n\t\t\t\t$herr->puterrmsg('The file ' . $filename .\n\t\t\t\t\t' does not have a valid extension. File has been removed.');\n\t\t\t\tunlink($basePath . '/' . $vx);\n\t\t\t\t$filelist[$kx] = NULL;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\thandleError('Upload Error: No files received.');\n\t}\n\n\t// Parse the parameter block in the request header.\n\t$params = $_SERVER['HTTP_X_PARAMETER'];\n\tparse_str($params, $_POST);\n\t$student = $_SESSION['userId'];\n\t$assign = getPostValue('assignment');\n\t$step = getPostValue('step');\n\n\t// Get the assignment information\n\t$rxa = $dbapp->queryAssignment($assign);\n\tif ($rxa == false)\n\t{\n\t\tif ($herr->checkState())\n\t\t\thandleError($herr->errorGetMessage());\n\t\telse\n\t\t\thandleError('Database Error: Unable to retrieve assignment information.');\n\t}\n\n\t// Write the turnin data into the database.\n\t$result = $dbapp->insertTurnin($student, $assign, $step, $rxa['courseid'], time());\n\tif ($result == false)\n\t{\n\t\tif ($herr->checkState())\n\t\t\thandleError($herr->errorGetMessage());\n\t\telse\n\t\t\thandleError('Database Error: Unable to insert turnin information.');\n\t}\n\t$rxa = $dbapp->queryTurninStudentAssignAll($student, $assign);\n\tif ($rxa == false)\n\t{\n\t\tif ($herr->checkState())\n\t\t\thandleError($herr->errorGetMessage());\n\t\telse\n\t\t\thandleEerror('Database Error: Unable to retrieve turnin information.');\n\t}\n\n\t$maxCount = -1;\n\tforeach($rxa as $kx => $vx)\n\t{\n\t\tif ($vx['subcount'] > $maxCount) $maxCount = $vx['subcount'];\n\t}\n\n\tforeach($filelist as $kx => $vx)\n\t{\n\t\t$result = $dbapp->insertFilename($student, $assign, $step,\n\t\t\t$maxCount, $kx, $vx);\n\t\tif ($result == false)\n\t\t{\n\t\t\t$dbapp->deleteFilenameCount($student, $assign, $step, $maxCount);\n\t\t\tfileError($basePath, $filelist);\n\t\t\tif ($herr->checkState())\n\t\t\t\thandleError($herr->errorGetMessage());\n\t\t\telse\n\t\t\t\thandleEerror('Database Error: Unable to save file information.');\n\t\t}\n\t}\n\n\t// Refresh page\n\t$mainContent = formPage($assign, $step);\n\t$ajax->loadQueueCommand(ajaxClass::CMD_OKDISP,\n\t\t'Assignment has been submitted successfully.');\n\t$ajax->loadQueueCommand(ajaxClass::CMD_WMAINPANEL, $mainContent);\n\t$ajax->sendQueue();\n}", "function save_file ($file, $name, $arg, $type){\n //Generate name depending on arg\n switch($arg){\n case 'random':\n $ext = pathinfo($file.$name, PATHINFO_EXTENSION);\n $ext = strtolower($ext);\n if(in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))){\n if($type==='normal'){\n include_once(CONFIG_ROOT_PATH.'error_meow.php');\n exit(0);\n }else{\n exit('File type not allowed.');\n }\n }\n $file_name = gen_name('random', $ext);\n while(file_exists(CONFIG_FILES_PATH.$file_name)){\n $file_name = gen_name('random', $ext);\n }\n break;\n case 'custom_original':\n $name = stripslashes(str_replace('/', '', $name));\n $name = strip_tags(preg_replace('/\\s+/', '', $name));\n $file_name = gen_name('custom_original', $name);\n $ext = pathinfo($file_name, PATHINFO_EXTENSION);\n $ext = strtolower($ext);\n if(in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))){\n if($type==='normal'){\n include_once(CONFIG_ROOT_PATH.'error_meow.php');\n exit(0);\n }else{\n exit('File type not allowed.');\n }\n }\n while(file_exists(CONFIG_FILES_PATH.$file_name)){\n $file_name = gen_name('custom_original', $name);\n }\n break;\n }\n //Move the file to the above location with said filename\n move_uploaded_file($file,CONFIG_FILES_PATH.$file_name);\n //Check if html or plain text should be returned\n if($type==='tool'){\n //Return url+filename to the user (plain text)\n if(CONFIG_SUBUPLOAD_URL_ENABLED == \"true\"){\n echo CONFIG_SUBUPLOAD_URL.'/'.urlencode($file_name);\n }else{\n echo CONFIG_ROOT_URL.'/files/'.urlencode($file_name);\n }\n exit(0);\n }elseif($type==='normal'){\n //Return url+filename to the user (HTML)\n $n=urlencode($file_name);\n include_once(CONFIG_ROOT_PATH.'upload-done.php');\n exit(0);\n }\n}", "public function set_file($file){\n //error checking\n if(empty($file) || !$file || !is_array($file)){\n $this->errors[] =\"There was no file uploaded here\";\n return false; \n // Check if the file is uploaded \n }elseif($file['error'] !==0){\n \n $this->error[] = $this->upload_errors_array[$file['error']];\n return false;\n \n }else {\n //Submit data \n $this->user_image = basename($file['name']); //basename is function\n $this->tmp_path = $file['tmp_name'];\n $this->type = $file ['type'];\n $this->size = $file ['size'];\n }\n }", "function user_files($userid,$conn){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t//$dhandle = opendir('./cloud/'.$_SESSION['SESS_USER_ID'].'/');\r\n\t\t\t\t// define an array to hold the folders in the user's directory\r\n\t\t\t\t\t$files = array();\r\n\t\t\t\t\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\t\t\t\tif (is_dir($path)) {\r\n\t\t\t\t\tif ($dh = opendir($path)) {\r\n\t\t\t\t \twhile (($file = readdir($dh)) !== false) {\r\n\t\t\t\t \t\tif(is_file($path . $file)){\r\n\t\t\t\t $files[]=$file;\r\n\t\t\t\t \t\t}\r\n\t\t\t\t }\r\n\t\t\t\t \tclosedir($dh);\r\n\t\t\t\t \t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Now loop through the folders, echoing out a new select option for each one\r\n\t\t\t\t\tforeach( $files as $fname )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$extension=$ext = pathinfo($fname, PATHINFO_EXTENSION);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tswitch ($extension) {\r\n\t\t\t\t\t\t\tcase 'txt':\r\n\t\t\t\t\t\t\tcase 'doc':\r\n\t\t\t\t\t\t\t\t$file_icon=\"description\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase 'jpg':\r\n\t\t\t\t\t\t\tcase 'jpeg':\r\n\t\t\t\t\t\t\tcase 'png':\r\n\t\t\t\t\t\t\t\t$file_icon=\"image\";\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\tcase 'mp3':\r\n\t\t\t\t\t\t\tcase 'flac':\r\n\t\t\t\t\t\t\tcase 'wav':\r\n\t\t\t\t\t\t\t\t$file_icon=\"audiotrack\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase 'mp4':\r\n\t\t\t\t\t\t\tcase 'avi':\r\n\t\t\t\t\t\t\tcase 'flv':\r\n\t\t\t\t\t\t\tcase 'ts':\r\n\t\t\t\t\t\t\tcase 'mkv':\r\n\t\t\t\t\t\t\tcase 'mov':\r\n\t\t\t\t\t\t\tcase 'mpeg':\r\n\t\t\t\t\t\t\t\t$file_icon=\"videocam\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t$file_icon=\"insert_drive_file\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}//dir.php?folder='.$fname.'\r\n\t\t\t\t\t \tprintf('\r\n\t\t\t\t\t \t\t<div class=\"col-lg-2 col-md-3 col-sm-3 col-xs-3\">\r\n\t\t\t\t\t\t\t\t<a id=\"ufi\" href=\"#'.$file_icon.'\" data-toggle=\"modal\" data-whatever=\"./cloud/'.$_SESSION['SESS_USER_ID'].'/'.$fname.'\" data-name=\"'.$fname.'\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"card btn waves-attach\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"card-main\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-inner text-center\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<i id=\"ufic\" class=\"icon icon-3x text-center\">'.$file_icon.'</i>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"\">'.$this->truncateFilename($fname, $max = 15).'</p>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t}", "public function process_file() {\n //\n $done = false;\n $error = '';\n //\n $filelist = directory_map('/var/lib/mysql-files/uploads/', 1);\n //\n // returns the table selected in the drop down\n //\n $table_name = $this->input->post('tablename');\n //\n // returns the array position of the selected item on the \n // dropdown list\n $fileno = $this->input->post('filename');\n //\n // get text as an array of strings, the dropdown returns a number\n //\n $textarray = $this->read_text($filelist[$fileno]);\n //\n // gets the first line of the text file\n //\n $text_line = $textarray[0];\n //\n $return_value = $this->check_import_match($table_name, $text_line);\n //\n // get list of table columns\n //\n $filepath = '/var/lib/mysql-files/uploads/'.$filelist[$fileno];\n // \n // loads a list of table names into an array\n //\n $tables = $this->load_table_names();\n // send back to import page with message\n if ($return_value === 0) { \n $this->data_driver->load_data($table_name, $filepath);\n //\n $message = 'Your data has been successfully imported';\n // this checks that new users have a role assigned\n $this->check_access_type();\n }\n else\n {\n $message = $return_value; \n }\n // call page\n $this->call_page($tables, $filelist, $message);\n }", "function fileupload($controlname, $extention, $convert=false, $width, $height, $uploadfolder)\n{\n\t$uploadfolder = trim($uploadfolder,\"/\");\n\t//echo $uploadfolder ;\n\tif(isset($_FILES[$controlname]['tmp_name']))\n\t{\n\t\t //$_FILES[$controlname]['tmp_name']; \n\t\tif($_FILES[$controlname]['error']!=4)\n\t\t{\n\t\t\t\n\t\t\t$timestamp = date('U');\n\t\t\t$swatch = date('B');\n\t\t\t$now = $timestamp.$swatch;\n\t\t\t\n\t\t\t $fname=$_FILES[$controlname]['name'];\n\t\t\t//echo $fname; die;\n\t\t\t//echo \"--\".$uploadfolder.'/'.$fname; \n\t\t\t$tm=\"ps\";\n\t\t\t$tm.= $now.strtolower($this->getmixedno(1));\n\t\t\t$ext = pathinfo($fname, PATHINFO_EXTENSION);\n\t\t\t$ext = strtolower($ext);\n\t\t\t$fname=$tm.\".\".$ext;\n\t\t\t//echo $fname; \n\t\t\t$arrext = explode(\",\",$extention);\n\t\t\tif(in_array($ext,$arrext))\n\t\t\t{\n //echo \"getval\". $_FILES[$controlname]['tmp_name'];die;\n\t\t\t\tif(move_uploaded_file($_FILES[$controlname]['tmp_name'],\"$uploadfolder/$fname\"))\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($convert==true)\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo \"hello\";\n\t\t\t\t\t\tif($ext == 'jpg' || $ext == 'jpeg' || $ext == 'doc' || $ext == 'pdf' )\n\t\t\t\t\t\t$this->convert_image($fname,\"$uploadfolder/\",\"$width\",\"$height\");\n\t\t\t\t\t}\n\t\t\t\t\treturn $fname;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse\n\t\t\t\n\t\t\treturn 0;\n\t\t}\n\t}\n\telse\n\treturn 1;\n}", "function type_url_form_file()\n {\n }", "public function add_browse_files_page() {\r\n\t $hook = add_submenu_page( \r\n\t // 'edit.php?post_type=market-reports', //or 'options.php'\r\n\t null,\r\n\t 'Browse Files',\r\n\t 'Browse Files',\r\n\t 'publish_market_reports',\r\n\t 'browse-files',\r\n \tarray($this,'browse_files_page')\r\n\t );\r\n\r\n\t if(isset($_GET['page']) && $_GET['page'] == 'browse-files'){\r\n\t\t add_action( \"load-$hook\", array($this, 'screen_option') );\r\n\t\t}\r\n\r\n\t}", "function _setUploadForm()\r\n {\r\n global $_ARRAYLANG, $_CONFIG;\r\n\r\n\r\n //data we want to remember for handling the uploaded files\r\n\t\t$data = array();\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $data['path'] = $this->mediaTypePaths[$this->_mediaType][0].$this->_path;\r\n $data['webPath'] = $this->mediaTypePaths[$this->_mediaType][1].$this->_path;\r\n } else {\r\n $data['path'] = ASCMS_CONTENT_IMAGE_PATH.$this->_path;\r\n $data['webPath'] = ASCMS_CONTENT_IMAGE_WEB_PATH.$this->_path;\r\n }\r\n\r\n $comboUp = \\Cx\\Core_Modules\\Upload\\Controller\\UploadFactory::getInstance()->newUploader('exposedCombo');\r\n $comboUp->setFinishedCallback(array(ASCMS_CORE_MODULE_PATH.'/FileBrowser/Controller/FileBrowser.class.php','\\Cx\\Core_Modules\\FileBrowser\\Controller\\FileBrowser','uploadFinished'));\r\n $comboUp->setData($data);\r\n //set instance name to combo_uploader so we are able to catch the instance with js\r\n $comboUp->setJsInstanceName('exposed_combo_uploader');\r\n\r\n $this->_objTpl->setVariable(array(\r\n 'COMBO_UPLOADER_CODE' => $comboUp->getXHtml(true),\r\n ));\r\n //end of uploader button handling\r\n //check if a finished upload caused reloading of the page.\r\n //if yes, we know the added files and want to highlight them\r\n if (!empty($_GET['highlightUploadId'])) {\r\n $key = 'filebrowser_upload_files_'.intval($_GET['highlightUploadId']);\r\n if (isset($_SESSION[$key])) {\r\n $sessionHighlightCandidates = $_SESSION[$key]; //an array with the filenames, set in FileBrowser::uploadFinished\r\n }\r\n //clean up session; we do only highlight once\r\n unset($_SESSION[$key]);\r\n\r\n if(is_array($sessionHighlightCandidates)) //make sure we don't cause any unexpected behaviour if we lost the session data\r\n $this->highlightedFiles = $sessionHighlightCandidates;\r\n }\r\n\r\n $objFWSystem = new \\FWSystem();\r\n \r\n // cannot upload or mkdir in webpages view\r\n if ($this->_mediaType == \"webpages\") {\r\n return;\r\n }\r\n $this->_objTpl->addBlockfile('FILEBROWSER_UPLOAD', 'fileBrowser_upload', 'module_fileBrowser_upload.html');\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_UPLOAD_TYPE' => $this->_mediaType,\r\n 'FILEBROWSER_UPLOAD_PATH' => $this->_path,\r\n 'FILEBROWSER_MAX_FILE_SIZE' => $objFWSystem->getMaxUploadFileSize(),\r\n 'TXT_CREATE_DIRECTORY' => $_ARRAYLANG['TXT_FILEBROWSER_CREATE_DIRECTORY'],\r\n 'TXT_UPLOAD_FILE' => $_ARRAYLANG['TXT_FILEBROWSER_UPLOAD_FILE'],\r\n 'JAVASCRIPT' \t=> \\JS::getCode(),\r\n ));\r\n\r\n $this->_objTpl->parse('fileBrowser_upload');\r\n }", "function media_upload_file()\n {\n }", "public function uploadfile($refdoc){\n\t\t$filename = $_FILES['file']['name'];\n\t\t$filename = $filename;\n\t\t$location = \"./images/grfile/\". $filename;\n\t\t$temp = $_FILES['file']['tmp_name'];\n\t\t$fileType = pathinfo($location,PATHINFO_EXTENSION);\n\t\t$acak = rand(000000,999999);\t\n\n\t\t// move_uploaded_file($temp, $location);\n\t\t$this->model('Grpo_model')->uploadfile($refdoc, $temp, $location, $filename, $fileType);\n\t\tmove_uploaded_file($temp, $location);\n\t\t// /* Valid Extensions */\n\t\t// $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n\t\t// /* Check file extension */\n\t\t// if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n\t\t// \t$uploadOk = 0;\n\t\t// }\n\n\t\t// if($uploadOk == 0){\n\t\t// echo 0;\n\t\t// }else{\n\t\t// /* Upload file */\n\t\t// if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n\t\t// \techo $location;\n\t\t// }else{\n\t\t// \techo 0;\n\t\t// }\n\t}", "function setTokenUsePickupFile($value)\n {\n $this->_props['TokenUsePickupFile'] = $value;\n }", "function getFilename();", "private function import_start()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\t//check for form tampering\n\t\t$this->inp\t= JFactory::getApplication()->input;\n\t\t$files\t\t= $this->inp->files;\n\t\t$this->file\t= reset($files->getArray());\t\t\t//first (and only) file\n\t\t$this->ok\t= !empty($this->file);\t\t\t\t//file ok?\n\t\treturn\t\t$this->ok;\n\t}", "function post_file()\r\n\t{\r\n\r\n\t}", "public function browse() {\n\n \n $data['view_name'] = \"filebrowse\";\n\n $this->load->view(\"admin/common/template\", $data);\n }", "function upload()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',\t\t\tNOTSET,'any');\r\n\t\t$args->set('format_id', \tNOTSET,'any');\t\t\n\t\t$args->set('filename', \t\tNOTSET,'any');\t\t\r\n\t\t$args->set('userfile', \t\tNOTSET,'any');\t// must be the same declares in $_Files['userfile']\t\n\t\t$args->set('header', \t\t0,'any');\t\n\t\t$args->set('duplicate', \tNOTSET,'any');\n\t\t$args->set('related', \t\tNOTSET,'any');\t\t\t\t\t\t\t\r\n\t\t$args = $args->get(func_get_args());\r\n\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \n \n // set up the different files format supported\n\t\t$fileFormat = array(\r\n\t array ( 'format_id' => ',', \t\t'format_name' => lang('Generic CSV file with comma delimiter')),\r\n\t array ( 'format_id' => ';', \t\t'format_name' => lang('Generic CSV file with semicolon delimiter')),\r\n\t array ( 'format_id' => ' ', \t\t'format_name' => lang('Generic CSV file with space delimiter')),\r\n\t array ( 'format_id' => chr(9), \t\t'format_name' => lang('Generic CSV file with tab delimiter')),\n\t //array ( 'format_id' => 'xls2002', 'format_name' => lang('MS Excel 2002 file (.xls)')),\t \n\t //array ( 'format_id' => 'access', \t'format_name' => lang('MS Access 2002 file')),\t \t \n\t //array ( 'format_id' => 'xml', \t'format_name' => lang('XML file'))\t \r\n\t ); \n\t \n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display\r\n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) || !$GLOBALS['appshore']->rbac->checkPermissionOnFeature($this->appRole, 'import'))\r\n {\r\n\t\t\tmessagebox( ERROR_PERMISSION_DENIED, ERROR);\r\n\t\t\treturn execMethod( $this->appName.'.base.start', null, true);\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Next':\r\n\t\t\t\r\n\t\t\t\tif ( $args['header'] != 1)\r\n\t\t\t\t\t$args['header'] = 0;\n\t\t\t\tif ( $args['duplicate'] != 1)\r\n\t\t\t\t\t$args['duplicate'] = 0;\t\t\n\t\t\t\tif ( $args['related'] != 1)\r\n\t\t\t\t\t$args['related'] = 0;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t// test if upload gone well\r\n\t\t\t\tif (is_uploaded_file( $_FILES['userfile']['tmp_name']))\n\t\t\t\t{ \n\t\t\t\t\tmove_uploaded_file( $_FILES['userfile']['tmp_name'], $_FILES['userfile']['tmp_name'].'.imp');\n\t\t\t\t\t$args['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\n\t\t\t\t\t$_SESSION['import']['format_id'] = $args['format_id'] ;\n\t\t\t\t\t$_SESSION['import']['filename'] = $args['filename'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['userfile'] = $_FILES['userfile']['name'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['header'] = $args['header'];\n\t\t\t\t\t\n\t\t\t\t\tif( $this->isDuplicate )\t\t\n\t\t\t\t\t\t$_SESSION['import']['duplicate'] = $args['duplicate'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['duplicate']);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->isRelated )\t\t\n\t\t\t\t\t\t$_SESSION['import']['related'] = $args['related'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['related']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset( $args['key']);\t\t\t\t\t\t\n\t\t\t\t\t$result = $this->selectFields( $args);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t messagebox( ERROR_INVALID_DATA, ERROR);\t\n\t $result['error']['userfile'] = ERROR_MANDATORY_FIELD;\t\t\t\t\n\t\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t\t$result['format'] = $fileFormat;\t\n\t\t\t\t}\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\r\n\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t$result['format'] = $fileFormat;\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\n\t\t\t\t$result['import']['isDuplicate'] = $this->isDuplicate;\t\n\t\t\t\t$result['import']['isRelated'] = $this->isRelated;\t\t\t\t\t\t\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\r\n return $result;\r\n }", "function getTargetFile() ;", "function viewer_general ( $fp, $filename, $ext, $dir, $query_string ) {\r\n switch ( $ext ) {\r\n case \"gif\":\r\n $file[0] = \"image/gif\";\r\n break;\r\n case \"jpeg\":\r\n case \"jpg\":\r\n $file[0] = \"image/jpeg\";\r\n break;\r\n case \"tiff\":\r\n $file[0] = \"image/tiff\";\r\n break;\r\n case \"png\":\r\n $file[0] = \"image/png\";\r\n break;\r\n case \"html\":\r\n case \"htm\":\r\n case \"shtml\":\r\n $file[0] = \"text/html\";\r\n break;\r\n case \"mp3\":\r\n case \"mpeg\":\r\n $file[0] = \"audio/mpeg\";\r\n break;\r\n default:\r\n $file[0] = \"application/octet-stream\";\r\n }\r\n\r\n $file[1] = $fp;\r\n/*\r\n return array ( \"mimetype\" , \"fp\" );\r\n*/\r\n return $file;\r\n}", "function acf_upload_file($uploaded_file)\n{\n}", "private function register_filehandler()\r\n\t{\r\n\t\t$myid = CCMSFileElementsRegister::register_element($this->objectname, \"CCMSPictureShowFile\", $this->path,$this->webpath, $this->type, $this->size);\r\n\t\tCCMSFileElementsRegister::extend_register($myid, Array(\"width\" => $this->maxwidth, \"height\" => $this->maxheight, \"prewidth\"=> $this->preview_width));\r\n\t\t$this->myid = $myid;\r\n\t\treturn $myid;\r\n\t}", "public function acfedu_do_something_with_file() {\n\n\t\t\t\tif ( isset( $_POST[\"select_file_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"select_file_nonce\"], 'select-file-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_nonce_no_match', esc_html__( 'Something went wrong. Please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( ! isset( $_POST['file_name'] ) ) {\n\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_file_selected', esc_html__( \"You didn't select a file.\", 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$file_name = $_POST['file_name'];\n\t\t\t\t\t\t$import = ! empty( $_POST['import'] ) ? $_POST['import'] : false;\n\t\t\t\t\t\t$remove = ! empty( $_POST['remove'] ) ? $_POST['remove'] : false;\n\t\t\t\t\t\t$verify = ! empty( $_POST['verify'] ) ? $_POST['verify'] : false;\n\n\t\t\t\t\t\tif ( ! empty( $verify ) ) {\n\n\t\t\t\t\t\t\t$read_data = acfedu_read_file_only( $file_name[0] );\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $read_data );\n\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_no_errors_in_csv', esc_html__( 'Congratulations, there appear to be no errors in your CSV.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_verify' );\n\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( ! empty( $import ) ) {\n\n\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t$read_data = acfedu_read_file_only( $file_name[0] );\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $read_data );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_lines_imported', sprintf( esc_html__( 'Congratulations. You have successfully imported %d faculty.', 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import' );\n\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( ! empty( $remove ) ) {\n\n\t\t\t\t\t\t\tif ( isset( $_POST['file_name'] ) ) {\n\t\t\t\t\t\t\t\tforeach ( $_POST['file_name'] as $file_name ) {\n\t\t\t\t\t\t\t\t\t// delete file\n\t\t\t\t\t\t\t\t\tunlink( wp_upload_dir()['basedir'] . '/acfedu/' . $file_name );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( count( $_POST['file_name'] ) == 1 ) {\n\t\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_file_deleted', sprintf( esc_html__( 'File \"%s\" successfully deleted.', 'acf-faculty-selector' ), $file_name ) );\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_files_deleted', esc_html__( 'Files successfully deleted.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function pafd_metabox_file_cb() {\n\n\tglobal $pafd_textdomain, $post, $post_meta;\n\n\t$post_meta = get_post_meta( $post->ID);\n\t$revisions = get_post_meta( $post->ID, 'pafd-file' );\n\t$revisions = array_reverse( $revisions );\n\n\t$rand = mt_rand( 100000, 999999 );\n\n\t// Maximum upload size \n\t$max_upload_size = wp_max_upload_size();\n\tif ( ! $max_upload_size ) {\n\t\t$max_upload_size = 0;\n\t}\n\t\n\t$info = K::wrap(\n\t\t'<i class=\"dashicons dashicons-info\"></i> ' \n\t\t. sprintf( \n\t\t\t__( 'Allowed file size is &lt; <strong>%s</strong><br /><i class=\"dashicons dashicons-info\"></i> Allowed file types are listed in <a target= \"_blank\" href=\"%s\">the WordPress Codex</a>.' , $pafd_textdomain ),\n\t\t\tpafd_format_bytes( $max_upload_size ),\n\t\t\t'http://codex.wordpress.org/Uploading_Files#About_Uploading_Files_on_Dashboard'\n\t\t)\n\t\t, null\n\t\t, array( 'in' => 'em', 'return' => true )\n\t);\n\n\t// Print a nonce field\n\tK::input(\n\t\t'pafd-file-nonce',\n\t\tarray( 'type' => 'hidden', 'value' => wp_create_nonce( 'pafd_save_file' ) )\t\n\t);\n\n\t// Upload label\n\tK::wrap( __( 'Upload New Revision', $pafd_textdomain ), null , array( 'in' => 'h2' ) );\n\n\n\t// Print the revision name and version fields\n\techo \n\t\t'<div class=\"alignleft\" style=\"width: 47.5%;\" >'\n\t\t. K::input(\n\t\t\t'pafd-file[name]',\n\t\t\tarray(\n\t\t\t\t'class' => 'large-text',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'format' => '<p><label><strong>' . __( 'Revision Name', $pafd_textdomain ) . '</strong><br />:input</label></p>',\n\t\t\t\t'return' => true,\n\t\t\t)\n\t\t)\n\t\t. K::input(\n\t\t\t'pafd-file[version]',\n\t\t\tarray(\n\t\t\t\t'class' => 'large-text',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'format' => '<p><label><strong>' . __( 'Version', $pafd_textdomain ) . '</strong><br />:input</label></p>',\n\t\t\t\t'return' => true,\n\t\t\t)\n\t\t)\n\t\t. '</div>'\n\t;\n\n\t// Print the file field\n\tK::input(\n\t\t'pafd-file',\n\t\tarray(\n\t\t\t'enctype' => 'multipart/form-data',\n\t\t\t'id' => 'pafd-file',\n\t\t\t'style' => '\n\t\t\t\theight: 500px;\n\t\t\t\tleft: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\topacity: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tposition: absolute;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 0;\n\t\t\t\twidth: 100%;\n\t\t\t',\n\t\t\t'type' => 'file',\n\t\t),\n\t\tarray( 'format' => sprintf( '\n\t\t\t<div class=\"alignright\" style=\"width: 47.5%%;\">\n\t\t\t\t<div>\n\t\t\t\t\t<strong>%s</strong><br />\n\t\t\t\t\t<label style=\"\n\t\t\t\t\t\tborder: dashed 3px #2EA2CC;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\theight: 200px;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tpadding: 2%%;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\twidth: calc( 96%% - 6px );\n\t\t\t\t\t\">\n\t\t\t\t\t\t<p style=\"font-size: 1.5em; text-align: center;\">%s</p>\n\t\t\t\t\t\t<p style=\"text-align: center;\" >%s <span class=\"button\">%s</span></p>\n\t\t\t\t\t\t<p style=\"\n\t\t\t\t\t\t\tborder-top: solid 1px #CCC;\n\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\tfont-size: 1.1em;\n\t\t\t\t\t\t\tpadding-top: 1em;\n\t\t\t\t\t\t\tz-index: 999;\n\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\tbottom: 0px;\n\t\t\t\t\t\t\t\" id=\"pafd-file-name\">\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t:input\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<p>%s</p>\n\t\t\t</div>'\n\t\t\t, __( 'File', $pafd_textdomain )\n\t\t\t, __( 'Drop file here', $pafd_textdomain )\n\t\t\t, __( 'or', $pafd_textdomain )\n\t\t\t, __( 'Select file', $pafd_textdomain )\n\t\t\t, $info\n\t\t) )\n\t);\n\n\t// Print the file description field\n\tK::textarea(\n\t\t'pafd-file[description]',\n\t\tnull,\n\t\tarray(\n\t\t\t'format' => '<div class=\"clear\"><strong>' . __( 'Revision Description', $pafd_textdomain ) . '</strong><br />:textarea</div>',\n\t\t\t'editor' => true,\n\t\t)\n\t);\n\t\n\t// Revisions List Label\n\tK::wrap( __( 'Revisions', $pafd_textdomain ) , null , array( 'in' => 'h2' ) );\n\n\t// Prepare Revisions List\n\tif( $revisions ) {\n\t\t$revisions_list_tpl = '\n\t\t\t<table id=\"pafd-revisions\" class=\"wp-list-table widefat\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>' . __( 'Name', $pafd_textdomain ) . '</th>\n\t\t\t\t\t\t<th>' . __( 'Version', $pafd_textdomain ) . '</th>\n\t\t\t\t\t\t<th>' . __( 'Description', $pafd_textdomain ) . '</th>\n\t\t\t\t\t\t<th>' . __( 'Information/Download', $pafd_textdomain ) . '</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t:revisions\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t';\n\t\t$revision_row_tpl = '\n\t\t\t<tr class=\":current\">\n\t\t\t\t<td>:name</td>\n\t\t\t\t<td>:version</td>\n\t\t\t\t<td>:description</td>\n\t\t\t\t<td>:information</td>\n\t\t\t</tr>\n\t\t';\n\t\t$revisions_list = str_replace( ':revisions', \":revisions_$rand\", $revisions_list_tpl );\n\t\tforeach ( $revisions as $r => $revision ) {\n\n\t\t\t$revision[ 'author_display_name' ] = get_userdata( $revision[ 'author_ID' ] )->display_name;\n\t\t\t$revision[ 'date' ] = get_date_from_gmt ( date( 'Y-m-d H:i:s', ( int ) $revision[ 'timestamp' ] ), get_option( 'date_format' ) );\n\t\t\t$revision[ 'time' ] = get_date_from_gmt ( date( 'Y-m-d H:i:s', ( int ) $revision[ 'timestamp' ] ), get_option( 'time_format' ) );\n\n\t\t\t$revisions_list = str_replace(\n\t\t\t\t\":revisions_$rand\",\n\t\t\t\tstr_replace(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t':current',\n\t\t\t\t\t\t':version',\n\t\t\t\t\t\t':name',\n\t\t\t\t\t\t':description',\n\t\t\t\t\t\t':information',\n\t\t\t\t\t),\n\t\t\t\t\tarray( \n\t\t\t\t\t\t( $post_meta[ 'pafd-file-current' ][0] == $revision[ 'hash' ] ) ? 'pafd-current-revision' : '',\n\t\t\t\t\t\t$revision[ 'version' ],\n\t\t\t\t\t\t$revision[ 'name' ],\n\t\t\t\t\t\t$revision[ 'description' ],\n\t\t\t\t\t\tsprintf( ''\n\t\t\t\t\t\t\t. '<i class=\"dashicons dashicons-admin-users\"></i> %s<br />'\n\t\t\t\t\t\t\t. '<i class=\"dashicons dashicons-clock\"></i> %s &ndash; %s <em>(%s ago)</em><br />'\n\t\t\t\t\t\t\t. '<i class=\"dashicons dashicons-chart-bar\"></i> %s<br /><br />'\n\t\t\t\t\t\t\t. '<a class=\"button button-large pafd-download-link\" href=\"%s\">' . __( 'Download', $pafd_textdomain ) . ' (%s)</a> '\n\t\t\t\t\t\t\t. '<a class=\"button button-large button-primary pafd-restore-link\" href=\"%s\">' . __( 'Restore', $pafd_textdomain ) . '</a> '\n\t\t\t\t\t\t\t. '<a class=\"button button-large pafd-delete-link\" href=\"%s\">' . __( 'Delete', $pafd_textdomain ) . '</a> '\n\t\t\t\t\t\t\t, $revision[ 'author_display_name' ]\n\t\t\t\t\t\t\t, $revision[ 'date' ]\n\t\t\t\t\t\t\t, $revision[ 'time' ]\n\t\t\t\t\t\t\t, human_time_diff( $revision[ 'timestamp' ] )\n\t\t\t\t\t\t\t, sprintf( _n( '<span class=\"pafd-download-counter\">1</span> Download', '<span class=\"pafd-download-counter\">%s</span> Downloads', $revision[ 'downloaded' ], $pafd_textdomain ), $revision[ 'downloaded' ] )\n\t\t\t\t\t\t\t, wp_nonce_url( esc_url_raw( add_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'pafd_action' => 'download',\n\t\t\t\t\t\t\t\t\t'pafd_revision_hash' => $revision[ 'hash' ],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tget_edit_post_link()\n\t\t\t\t\t\t\t) ), 'pafd_action_download', 'pafd_nonce_action_download' )\n\t\t\t\t\t\t\t, pafd_format_bytes( $revision[ 'size' ] )\n\t\t\t\t\t\t\t, wp_nonce_url( esc_url_raw( add_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'pafd_action' => 'restore',\n\t\t\t\t\t\t\t\t\t'pafd_revision_hash' => $revision[ 'hash' ],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tget_edit_post_link()\n\t\t\t\t\t\t\t) ), 'pafd_action_restore', 'pafd_nonce_action_restore' )\n\t\t\t\t\t\t\t, wp_nonce_url( esc_url_raw( add_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'pafd_action' => 'delete',\n\t\t\t\t\t\t\t\t\t'pafd_revision_hash' => $revision[ 'hash' ],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tget_edit_post_link()\n\t\t\t\t\t\t\t) ), 'pafd_action_delete', 'pafd_nonce_action_delete' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t$revision_row_tpl) . \":revisions_$rand\",\n\t\t\t\t$revisions_list\n\t\t\t);\n\t\t}\n\t\t$revisions_list = str_replace( \":revisions_$rand\", '', $revisions_list );\n\t}\n\n\t// Output\n\tif( $revisions ) {\n\t\techo $revisions_list;\n\t} else {\n\t\tK::wrap(\n\t\t\t'<i class=\"btn dashicons dashicons-info\"></i> ' \n\t\t\t. __( 'No revisions uploaded yet.', $pafd_textdomain )\n\t\t\t, null\n\t\t\t, array( 'in' => 'em' )\n\t\t);\n\t}\n\n\t// Debugging information\n\tif ( PAFD_DEBUG ) {\n\t\t\n\t\t// Debugging Label\n\t\tK::wrap( __( 'Debugging', $pafd_textdomain ) , null , array( 'in' => 'h2' ) );\n\n\t\t!d( $post );\n\t\t!d( $post_meta );\n\t}\n}", "function print_upload($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<input class=\"option-input upload hana-upload\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"text\" value=\"'.$input_value.'\" />';\n\t\techo '<div id=\"'.$value['id'].'_button\" class=\"upload-button upload-logo hana-upload-btn\" ><a class=\"hana-button alignright\"><span>Upload</span></a></div><br/>';\n\t\t\n\t\t$this->close_option($value);\n\t}", "public function files();", "public function files();", "public function files();", "function get_real_file_to_edit($file)\n {\n }", "function fileDotPHP(){\n\t\t// Gets the file or files based on URL\n\t\tif(isset($_GET['file'])){\n\t\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t}else{\n\t\t\t$result = mysql_query(getFile(\"\"));\n\t\t}\n\t\t\n\t\t// Displays what was retrieved\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tif(isset($_GET['file'])){\n\t\t\t\t$GLOBALS['adminObjectId'] = $GLOBALS['fileId'];\n\t\t\t}\t?>\n\t\t\t<div class=\"clear\">\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t\t\t<h1><? printHTML($GLOBALS['objectTitle']); ?></h1>\n\t\t\t\t<?\t}else{ ?>\n\t\t\t\t\t\t<h2><a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'])); ?>\"><? printHTML($GLOBALS['objectTitle']); ?></a></h2>\n\t\t\t\t<?\t} ?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t<?\t$result2 = mysql_query(getUser($GLOBALS['createdId'], \"userId\"));\n\t\t\t\t\t\n\t\t\t\t\t$row2 = mysql_fetch_assoc($result2);\n\t\t\t\t\tgetUserGlobals($row2);\n\t\t\t\t?>\t<h3>Created By: <a href=\"<? printHTML(fullURL(getLangVar(\"userURL\")) . $GLOBALS['userId']); ?>\"><? printHTML($GLOBALS['userName']); ?></a></h3>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cl\">\n\t\t\t\t\t<? printHTML($GLOBALS['objectText']); ?>\n\t\t\t\t</div>\n\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t<div>\n\t\t\t\t\t<h3><a href=\"<? printHTML($GLOBALS['filePath']); ?>\">Download</a></h3>\n\t\t\t\t</div>\n\t\t\t<?\t}\t?>\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t\t<h4>Created: <? printHTML(date($GLOBALS['dateTimeFormat'], addDate($GLOBALS['createdOn'], $GLOBALS['timeOffset'], \"hour\"))); ?></h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t\t<h4><a href=\"<? printHTML(fullURL(getLangVar(\"eventURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Sub Event</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"messageURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Reply</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Attach File</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'], \"edit\")); ?>\">Edit</a></h4>\n\t\t\t\t</div>\n\t\t\t</div>\n\t<?\t}\n\t\t\n\t\t// Gets related objects\n\t\tif(isset($_GET['file'])){\n\t\t\tgetRelatedObjects($GLOBALS['objectId']);\n\t\t}\n\t}", "function fileEdit(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t$GLOBALS['adminObjectId'] = $_GET['file'];\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tfileForm(\"edit\");\n\t\t}\n\t}", "function uploadFiles () {\n\n}", "function theme_helper_import_file_select($form) {\n $header = array('', t('Filename'), t('Uploaded on'), t('Uploaded by'));\n $rows = array();\n\n foreach (element_children($form) as $child) {\n if (is_numeric($child)) {\n $element = $form[$child];\n $file = array(\n '#type' => 'item',\n '#value' => $element['filename']['#value'],\n '#description' => $element['filepath']['#value'] .' ('. $element['filesize']['#value'] .')',\n );\n unset($form['fid'][$child]['#title']);\n $rows[] = array(\n drupal_render($form['fid'][$child]),\n drupal_render($file),\n drupal_render($form[$child]['timestamp']),\n drupal_render($form[$child]['uid']),\n );\n unset($form[$child]);\n }\n }\n\n if (empty($rows)) {\n $rows[] = array(\n 'data' => array(\n array(\n 'data' => t('No files available.'),\n 'colspan' => count($header),\n ),\n ),\n );\n unset($form['fid']);\n }\n\n return theme('table', $header, $rows) . drupal_render($form);\n}", "function send_file_to_browser($download_name, $file_name) {\r\n\r\n // must be fresh start\r\n if(headers_sent())\r\n die('Headers Sent'); \r\n\t\r\n // file must exist\r\n if (!file_exists($file_name)) {\r\n die('file does not exist!');\r\n }\r\n\r\n $path_info = pathinfo($file_name);\r\n\r\n // check that extension key exists in array\r\n if (!array_key_exists('extension', $path_info)) {\r\n $path_info['extension'] = '';\r\n }\r\n \r\n // http://en.wikipedia.org/wiki/Mime_type#List_of_common_media_types\r\n switch (strtolower($path_info['extension'])) {\r\n\tcase 'exe':\r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n case 'doc':\r\n\t $mime_type = \"application/msword\";\r\n break;\r\n case 'docx':\r\n $mime_type = \"application/msword\";\r\n break;\r\n case 'gif':\r\n $mime_type = \"image/gif\";\r\n break;\r\n case 'jpg':\r\n $mime_type = \"image/jpg\";\r\n break;\r\n case 'jpeg':\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n case 'png':\r\n $mime_type = \"image/png\";\r\n break;\r\n case 'tiff':\r\n $mime_type = \"image/tiff\";\r\n break;\r\n case 'txt':\r\n $mime_type = \"text/plain\";\r\n break;\r\n case 'csv':\r\n $mime_type = \"text/csv\";\r\n break;\r\n case 'zip':\r\n $mime_type = \"application/zip\";\r\n break;\r\n case 'pdf':\r\n $mime_type = \"application/pdf\";\r\n break;\r\n case 'xls': \r\n\t $mime_type = \"application/vnd.ms-excel\";\r\n break;\r\n case 'ppt': \r\n\t $mime_type = \"application/vnd.ms-powerpoint\";\r\n break;\r\n case 'wav': \r\n\t $mime_type = \"audio/vnd.wave\";\r\n break;\r\n case 'mp3': \r\n\t $mime_type = \"audio/mpeg\";\r\n break;\t\t\t\t\t\r\n case 'mpeg': \r\n\t $mime_type = \"video/mpeg\";\r\n break; \r\n case 'mp4': \r\n\t $mime_type = \"video/mp4\";\r\n break; \r\n case 'ogg': \r\n\t $mime_type = \"video/ogg\";\r\n break; \r\n case 'mov': \r\n\t $mime_type = \"video/quicktime\";\r\n break; \r\n case 'webm': \r\n\t $mime_type = \"video/webm\";\r\n break; \r\n case 'mkv': \r\n\t $mime_type = \"video/x-matroska\";\r\n break; \r\n case 'wmv': \r\n\t $mime_type = \"video/x-ms-wmv\";\r\n break; \r\n case 'flv': \r\n\t $mime_type = \"video/x-flv\";\r\n break; \r\n default: \r\n $mime_type = \"application/force-download\";\r\n break;\r\n }\r\n\r\n header('Content-Description: File Transfer');\r\n header('Content-Type: '.$mime_type);\r\n header('Content-Disposition: attachment;filename=\"'.urlencode($download_name).'\"');\r\n header('Content-Transfer-Encoding: binary');\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Content-Length: '.filesize($file_name));\r\n \r\n @ob_clean();\r\n flush();\r\n readfile($file_name);\r\n exit;\r\n}", "function phptemplate_filefield_file($file) {\n if (empty($file['fid'])) {\n return '';\n }\n\n $path = $file['filepath'];\n $url = file_create_url($path);\n $icon = theme('filefield_icon', $file);\n\n // Set options as per anchor format described at\n $options = array(\n 'attributes' => array(\n 'type' => $file['filemime'] . '; length=' . $file['filesize'],\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file['data']['description'])) {\n $link_text = $file['filename'];\n }\n else {\n $link_text = $file['data']['description'];\n $options['attributes']['title'] = $file['filename'];\n }\n\n //open files of particular mime types in new window\n $new_window_mimetypes = array(\n 'application/pdf',\n 'text/plain'\n );\n if (in_array($file['filemime'], $new_window_mimetypes)) {\n $options['attributes']['target'] = '_blank';\n }\n\n return '<div class=\"filefield-file clear-block\">'. $icon . l($link_text, $url, $options) .'</div>';\n}", "function fileEdit($file=NULL)\r\n{\r\n global $PH;\r\n\r\n if(!$file) {\r\n $id= getOnePassedId('file','files_*'); # WARNS if multiple; ABORTS if no id found\r\n if(!$file= File::getEditableById($id)) {\r\n $PH->abortWarning(\"ERROR: could not get File\");\r\n return;\r\n }\r\n }\r\n\r\n if(!$project=Project::getVisibleById($file->project)) {\r\n $PH->abortWarning(\"ERROR: could not get Project\",ERROR_BUG);\r\n }\r\n\r\n ### set up page and write header ####\r\n {\r\n\r\n\r\n $page= new Page(array('use_jscalendar'=>true, 'autofocus_field'=>'file_name'));\r\n initPageForFile($page, $file, $project);\r\n\r\n if($file->id) {\r\n $page->title=__('Edit File','page title');\r\n }\r\n else {\r\n $page->title=__('New file','page title');\r\n }\r\n\r\n #$page->title_minor= sprintf(__('On project %s','page title add on'),$project->name);\r\n\r\n\r\n echo(new PageHeader);\r\n }\r\n echo (new PageContentOpen);\r\n\r\n $block=new PageBlock(array(\r\n 'id' =>'edit',\r\n 'reduced_header' => true,\r\n ));\r\n $block->render_blockStart();\r\n\r\n ### write form #####\r\n {\r\n require_once(confGet('DIR_STREBER') . 'render/render_form.inc.php');\r\n\r\n $form=new PageForm();\r\n $form->button_cancel=true;\r\n\r\n $form->add($file->fields['name']->getFormElement(&$file));\r\n\r\n $form->add($file->fields['description']->getFormElement(&$file));\r\n\r\n /**\r\n * until new file is added to database keep details in hiddenfields\r\n */\r\n if($file->id == 0) {\r\n $form->add(new Form_HiddenField('file_mimetype', '',urlencode($file->mimetype)));\r\n $form->add(new Form_HiddenField('file_filesize', '',intval($file->filesize)));\r\n $form->add(new Form_HiddenField('file_org_filename', '',urlencode($file->org_filename)));\r\n $form->add(new Form_HiddenField('file_tmp_filename', '',urlencode($file->tmp_filename)));\r\n $form->add(new Form_HiddenField('file_tmp_dir', '',$file->tmp_dir));\r\n $form->add(new Form_HiddenField('file_is_image', '',$file->is_image));\r\n $form->add(new Form_HiddenField('file_version', '',$file->version));\r\n $form->add(new Form_HiddenField('file_parent_item', '',$file->parent_item));\r\n $form->add(new Form_HiddenField('file_org_file', '',$file->org_file));\r\n }\r\n $form->add(new Form_HiddenField('file', '',$file->id));\r\n $form->add(new Form_HiddenField('file_project', '',$file->project));\r\n\r\n\r\n\r\n ### status ###\r\n {\r\n $st=array();\r\n global $g_status_names;\r\n foreach($g_status_names as $s=>$n) {\r\n if($s >= STATUS_NEW) {\r\n $st[$s]=$n;\r\n }\r\n }\r\n $form->add(new Form_Dropdown('file_status',\"Status\",array_flip($st), $file->status));\r\n }\r\n\r\n ### public-level ###\r\n if(($pub_levels= $file->getValidUserSetPublevel())\r\n && count($pub_levels)>1) {\r\n $form->add(new Form_Dropdown('file_pub_level', __(\"Publish to\"),$pub_levels,$file->pub_level));\r\n }\r\n\r\n echo ($form);\r\n\r\n $PH->go_submit='fileEditSubmit';\r\n }\r\n $block->render_blockEnd();\r\n\r\n echo (new PageContentClose);\r\n echo (new PageHtmlEnd);\r\n}", "public function ajaxFile()\n\t{\n\t\t$type = $_POST['type'];\n\t\t$id = $_POST['id'];\n\t\t$file_src = wp_get_attachment_url( $id );\n\t\t$have_file = !empty( $file_src );\n\t\tswitch ( $type ) {\n\t\t\tcase 'image':\n\t\t\t\t?>\n\t\t\t\t<img src=\"<?php echo esc_url( $file_src ); ?>\" alt=\"\" />\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\n\t\t\tcase 'audio':\n\t\t\t\techo wp_audio_shortcode( array(\n\t\t\t\t\t'src' => $file_src\n\t\t\t\t) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'video':\n\t\t\t\techo wp_video_shortcode( array(\n\t\t\t\t\t'src' => $file_src\n\t\t\t\t) );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$filename = basename( get_attached_file( $id ) );\n\t\t\t\t?>\n\t\t\t\t<span class=\"dashicons dashicons-media-default\"></span>\n\t\t\t\t<span class=\"file-name\"><?php echo wp_kses_post( $filename ); ?></span>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t}\n\t\twp_die();\n\t}", "function find_file( $ServerID, $AsteriskID, $QMUserID, $QMUserName ) {\n\tglobal $FILE_FOUND;\n\tglobal $FILE_LISTEN_URL;\n\tglobal $FILE_LENGTH;\n\tglobal $FILE_ENCODING;\n\tglobal $FILE_DURATION;\n\n\t$FILE_FOUND = true;\n\n\t// if found single file...\n\t// note that the parameters returned are just strings, so you can put anything in them\n\t$FILE_LISTEN_URL = \"http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName\";\n\t$FILE_LENGTH = \"125k\";\n\t$FILE_ENCODING = \"mp3\";\t\n\t$FILE_DURATION = \"1:12\"; \t\n\n\t// if found multiple files\n\t// add MULTI: to FILE_LISTEN_URL\n\t// separate entries with a space\n\t// add the same number of entries for each record\n\t//$FILE_LISTEN_URL = \"MULTI:http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName http://file2 http://file3\";\n\t//$FILE_LENGTH = \"125000 100 200\";\n\t//$FILE_ENCODING = \"mp3 - -\";\t\n\t//$FILE_DURATION = \"1:12 1:10 -\"; \t\n\n}", "function wpi_display_user_selection($file_path, $screen, $path) {\r\n global $wpdb;\r\n\r\n if ($screen != 'invoice_page_wpi_page_manage_invoice') {\r\n return $file_path;\r\n }\r\n if (empty($_REQUEST['wpi'])) {\r\n return $path . '/user_selection_form.php';\r\n }\r\n if (WPI_UD_F::is_older_wp_version('3.4')) {\r\n return $path = $path . '/invoice_page_wpi_page_manage_invoice_legacy.php';\r\n }\r\n\r\n return $file_path;\r\n }", "public function getFile()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filename = $this->input->get_post('filename');\r\n $alt = $this->input->get_post('alt');\r\n\r\n // insert userlog\r\n if (empty($alt))\r\n {\r\n $this->_insert_userlog(Userlog_model::FILE_PREVIEW);\r\n }\r\n\r\n if ($this->files_model->is_document($filename))\r\n {\r\n header('Location: /files/preview?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ($this->files_model->is_extension($filename, 'nes'))\r\n {\r\n header('Location: /files/jsnes?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ( ! $this->files_model->is_browser_viewable($filename))\r\n {\r\n header('Location: /files/show_download?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n\r\n $this->files_model->get_file($access_full_path, $filename, $alt);\r\n }", "function macgallery_upload() {\r\n\t$fieldName = 'uploadfile';\r\n\t\r\n\t// Any errors the server registered on uploading\r\n\t$fileError = $_FILES [$fieldName] ['error'];\r\n\r\n\tif ($fileError > 0) {\r\n\t\tswitch ($fileError) {\r\n\t\t\tcase 1 :\r\n\t\t\t\tJError::raiseWarning ( E_ERROR, JText::_('COM_MACGALLERY_CONTROLLERS_FILELARGEPHP') );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 2 :\r\n\t\t\t\tJError::raiseWarning ( E_ERROR, JText::_('COM_MACGALLERY_CONTROLLERS_FILELARGEHTML') );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 3 :\r\n\t\t\t\tJError::raiseWarning ( E_ERROR, JText::_('COM_MACGALLERY_CONTROLLERS_FILEERROR') );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 4 :\r\n\t\t\t\tJError::raiseWarning ( E_ERROR, JText::_('COM_MACGALLERY_CONTROLLERS_FILEERROR') );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Check for filesize\r\n\t$fileSize = $_FILES [$fieldName] ['size'];\r\n\r\n\tif ($fileSize > 20000000) {\r\n\t\techo JText::_('COM_MACGALLERY_BIGGER_THAN_20_MB');\r\n\t}\r\n\t\r\n\t// Check the file extension is ok\r\n\t$fileName = $_FILES [$fieldName] ['name'];\r\n\t$uploadedFileNameParts = explode ( '.', $fileName );\r\n\t$uploadedFileExtension = array_pop ( $uploadedFileNameParts );\r\n\t$validFileExts = explode ( ',', 'jpeg,jpg,png,gif,bmp' );\r\n\t\r\n\t// Assume the extension is false until we know its ok\r\n\t$extOk = false;\r\n\t\r\n\t// Check for valid extension\r\n\tforeach ( $validFileExts as $key => $value ) {\r\n\t\tif (preg_match ( \"/$value/i\", $uploadedFileExtension )) {\r\n\t\t\t$extOk = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/* The name of the file in PHP's temp directory that we are going to move to our folder\r\n\t * for security purposes, we will also do a getimagesize on the temp file (before we have moved it \r\n\t * to the folder) to check the MIME type of the file, and whether it has a width and height \r\n\t * lose any special characters in the filename */\r\n\t\r\n\tfor($code_length = 5, $newcode = ''; strlen ( $newcode ) < $code_length; $newcode .= chr ( ! rand ( 0, 2 ) ? rand ( 48, 57 ) : (! rand ( 0, 1 ) ? rand ( 65, 90 ) : rand ( 97, 122 )) ));\r\n\t\r\n\t$fileTemp = $_FILES [$fieldName] ['tmp_name'];\r\n\t$fileParts = explode ( \".\", trim ( $_FILES [$fieldName] ['name'] ) );\r\n\t$fileExtension = $fileParts [count ( $fileParts ) - 1];\r\n\t$fileName = preg_replace ( \"[^A-Za-z0-9.]\", \"-\", $fileName );\r\n\t$fileName = $fileParts [0] . \"__\" . $newcode . rand ( 1, 100000 ) . \".\" . $fileExtension;\r\n\t\r\n\t// Always use constants when making file paths, to avoid the possibilty of remote file inclusion\r\n\t$uploadPath = urldecode ( $_REQUEST [\"jpath\"] ) . $fileName;\r\n\t\r\n\tif (! move_uploaded_file ( $fileTemp, $uploadPath )) {\r\n\t\techo 'COM_MACGALLERY_CONTROLLERS_MOVEERROR';\r\n\t}\r\n\r\n\techo $fileName;\r\n\r\n\t// Crating thumb image\r\n\t$thumbWidth = ( int ) $_REQUEST [\"th\"] + ( int ) $_REQUEST [\"tw\"] + 50;\r\n\timageToThumb ( $fileName, $_REQUEST [\"th\"], $_REQUEST [\"tw\"], \"thumb_image\" );\r\n\timageToThumb ( $fileName, $_REQUEST [\"feath\"], $_REQUEST [\"featw\"], \"featured_image\" );\r\n\timageToThumb ( $fileName, $_REQUEST [\"ah\"], $_REQUEST [\"aw\"], \"album_image\" );\r\n\timageToThumb ( $fileName, $_REQUEST [\"fh\"], $_REQUEST [\"fw\"], \"full_image\" );\r\n}", "public function inputfile($name, $display, $classlabel=\"control-label\", $classselect=\"\"){\n return $this->surround('\n <label for=\"'.$name.'\" class='.$classlabel.'>'.$display.'</label>\n <input id=\"'.$name.'\" type=\"file\" name=\"'.$name.'\" class=\"file \"'.$classselect.'>');\n }", "function get_file($hash_id = null)\r\n\t{\r\n\t\t\r\n\t}", "public function upload_files_page(){\r\n\t\t$max_filesize = $this->get_max_filesize();\r\n\t\t$max_file = $this->get_max_files();\r\n\t\tinclude($this->admin_url . 'view/market-reports-upload-files.php');\r\n\t}", "function do_upload($field = 'userfile',$isTimestamp = false,$fname = \"\")\n\t{\n\t\tif ( ! isset($_FILES[$field]))\n\t\t{\n\t\t\t$this->set_error('upload_no_file_selected');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Is the upload path valid?\n\t\tif ( ! $this->validate_upload_path())\n\t\t{\n\t\t\t// errors will already be set by validate_upload_path() so just return FALSE\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Was the file able to be uploaded? If not, determine the reason why.\n\t\tif ( ! is_uploaded_file($_FILES[$field]['tmp_name']))\n\t\t{\n\t\t\t\n\t\t\t$error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error'];\n\n\t\t\tswitch($error)\n\t\t\t{\n\t\t\t\tcase 1:\t// UPLOAD_ERR_INI_SIZE\n\t\t\t\t\t$this->set_error('upload_file_exceeds_limit');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: // UPLOAD_ERR_FORM_SIZE\n\t\t\t\t\t$this->set_error('upload_file_exceeds_form_limit');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3: // UPLOAD_ERR_PARTIAL\n\t\t\t\t $this->set_error('upload_file_partial');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4: // UPLOAD_ERR_NO_FILE\n\t\t\t\t \n\t\t\t\t if($this->optional)\n\t\t\t\t {\n\t\t\t\t \t\treturn true;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $this->set_error('upload_no_file_selected');\n\t\t\t\t break;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase 6: // UPLOAD_ERR_NO_TMP_DIR\n\t\t\t\t\t$this->set_error('upload_no_temp_directory');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: // UPLOAD_ERR_CANT_WRITE\n\t\t\t\t\t$this->set_error('upload_unable_to_write_file');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8: // UPLOAD_ERR_EXTENSION\n\t\t\t\t\t$this->set_error('upload_stopped_by_extension');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault : $this->set_error('upload_no_file_selected');\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t// Set the uploaded data as class variables\n\t\t$this->file_temp = $_FILES[$field]['tmp_name'];\t\t\n\t\t\n\t\t$this->file_name = $this->_prep_filename($_FILES[$field]['name']);\n\t\t\n\t\tif($isTimestamp)\n\t\t{\n\t\t\t$parts\t\t= explode('.', $_FILES[$field]['name']);\n\t\t\t$ext\t\t= array_pop($parts);\n\t\t\t$filename\t= array_shift($parts);\n\t\t\t$this->file_name = $filename.\"_\".time().\".\".$ext;\n\t\t}\n\t\t\n\t\tif($fname <> \"\")\n\t\t{\n\t\t\t$this->file_name = $fname;\n\t\t}\n\t\t\n\t\t$this->file_size = $_FILES[$field]['size'];\t\t\n\t\t$this->file_type = preg_replace(\"/^(.+?);.*$/\", \"\\\\1\", $_FILES[$field]['type']);\n\t\t\n\t\t\n\t\t$this->file_type = strtolower($this->file_type);\n\t\t$this->file_ext\t = $this->get_extension($_FILES[$field]['name']);\n\t\t\n\t\t// Convert the file size to kilobytes\n\t\tif ($this->file_size > 0)\n\t\t{\n\t\t\t$this->file_size = round($this->file_size/1024, 2);\n\t\t}\n\n\t\t// Is the file type allowed to be uploaded?\n\t\tif ( ! $this->is_allowed_filetype($field))\n\t\t{\n\t\t\t$this->set_error('upload_invalid_filetype');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Is the file size within the allowed maximum?\n\t\tif ( ! $this->is_allowed_filesize())\n\t\t{\n\t\t\t$this->set_error('upload_invalid_filesize');\n\t\t\treturn FALSE;\n\t\t}\n\n\n\n\t\t// Are the image dimensions within the allowed size?\n\t\t// Note: This can fail if the server has an open_basdir restriction.\n\t\tif ( ! $this->is_allowed_dimensions())\n\t\t{\n\t\t\t$this->set_error('upload_invalid_dimensions');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Sanitize the file name for security\n\t\t$this->file_name = $this->clean_file_name($this->file_name);\n\t\t\n\t\t// Truncate the file name if it's too long\n\t\tif ($this->max_filename > 0)\n\t\t{\n\t\t\t$this->file_name = $this->limit_filename_length($this->file_name, $this->max_filename);\n\t\t}\n\n\t\t// Remove white spaces in the name\n\t\tif ($this->remove_spaces == TRUE)\n\t\t{\n\t\t\t$this->file_name = preg_replace(\"/\\s+/\", \"_\", $this->file_name);\n\t\t}\n\n\t\t/*\n\t\t * Validate the file name\n\t\t * This function appends an number onto the end of\n\t\t * the file if one with the same name already exists.\n\t\t * If it returns false there was a problem.\n\t\t */\n\t\t$this->orig_name = $this->file_name;\n\n\t\tif ($this->overwrite == FALSE)\n\t\t{\n\t\t\t$this->file_name = $this->set_filename($this->upload_path, $this->file_name);\n\t\t\t\n\t\t\tif ($this->file_name === FALSE)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\n\t\t * Move the file to the final destination\n\t\t * To deal with different server configurations\n\t\t * we'll attempt to use copy() first. If that fails\n\t\t * we'll use move_uploaded_file(). One of the two should\n\t\t * reliably work in most environments\n\t\t */\n\t\tif ( ! @copy($this->file_temp, $this->upload_path.$this->file_name))\n\t\t{\n\t\t\tif ( ! move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))\n\t\t\t{\n\t\t\t\t $this->set_error('upload_destination_error');\n\t\t\t\t return FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Run the file through the XSS hacking filter\n\t\t * This helps prevent malicious code from being\n\t\t * embedded within a file. Scripts can easily\n\t\t * be disguised as images or other file types.\n\t\t */\n\t\tif ($this->xss_clean == TRUE)\n\t\t{\n\t\t\t$this->do_xss_clean();\n\t\t}\n\n\n\t\t\n\t\t/*\n\t\t * Set the finalized image dimensions\n\t\t * This sets the image width/height (assuming the\n\t\t * file was an image). We use this information\n\t\t * in the \"data\" function.\n\t\t */\n\t\t$this->set_image_properties($this->upload_path.$this->file_name);\n\t\t\n\t\treturn TRUE;\n\t}", "public function getFile();", "public function getFile();", "function UploadSingleFile($file){\n\t//The available extentions for the pics\n\t$imageList = array(\"png\", \"jpeg\", \"jpg\", \"gif\");\n\t\n $medium = str_replace(\" \", \"_\", $file[\"name\"]);\n $ext = pathinfo($medium, PATHINFO_EXTENSION);\n\n if (in_array($ext, $imageList)) {\n //4 random numbers before filename for identification\t\t\n\t\t$digits = 4;\n\t\t$prename = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\t\t\n\t\t$server_url = \"/KBS/Project-KBS/bestanden/media/photo/\" . $prename . $medium;\n\t\t$url = $_SERVER[\"DOCUMENT_ROOT\"] . \"/KBS/Project-KBS/bestanden/media/photo/\" . $prename . $medium;\t\n\t\t\n\t if (move_uploaded_file($file[\"tmp_name\"], $url)) {\n\t \t$temp_conn = GetDatabaseConnection();\n\n\t\t\t$stmt = $temp_conn->prepare(\"INSERT INTO file (location, type) VALUES (?,?)\");\n\t\t\t$stmt->execute(array($server_url, \"photo\"));\n\t\t\t$file_id = $temp_conn->lastInsertId();\n\n\t\t\treturn $file_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n } else {\n \treturn 0;\n }\n}", "function upload_file($field,$directory,$filename='') {\n\t\t global $resizer;\n\t\t \n $_FILES[$field]['name']=$filename;\n if(move_uploaded_file($_FILES[$field]['tmp_name'],''.$directory.$_FILES[$field]['name'])) {\n\t\t \n\t\t \t\n\t\t //$this->createThumb(''.$directory.$_FILES[$field]['name'],''.$directory.$_FILES[$field]['name'],$width,$height);\n\t\t\t\treturn $_FILES[$field]['name'];\n\t\t\t \n\t\t\t \n\t }\n\t\t return false;\n }", "public static function drawFileSelector($pathToDir, $task)\n {\n if( ! $pathToDir || ! is_dir($pathToDir))\n {\n return jgettext('Invalid path');\n }\n\n //--just for highlighting\n $the_file = JRequest::getVar('file', NULL);\n\n //--get the file list\n $files = JFolder::files($pathToDir);\n\n echo NL.'<div id=\"ecr_filebutton\">';\n echo NL.'<ul>';\n foreach($files as $file)\n {\n $style = '';\n if( $file == $the_file )//highlight ?\n {\n $style = ' style=\"color: red; font-weight: bold;\"';\n }\n\n echo NL.'<li><a '.$style.'href=\"#\" onclick=\"document.adminForm.file.value=\\''\n .$file.'\\'; submitbutton(\\''.$task.'\\');\">'.$file.'</a></li>';\n }\n\n echo NL.'<ul>';\n echo NL.'</div>';\n }", "function OnUploadFile() {\n\t\t$uploadedFile = $this->Request->Value(\"uploadedFile\", REQUEST_FILES);\n\n\t\t$library_ID = $this->Session->Get(\"library_ID\");\n\t\t$package = $this->Session->Get(\"parent_package\");\n\t\t$max_size = $this->Kernel->Settings->GetItem(\"SETTINGS\", \"MaxFileSize\");\n\n\t\tif($library_ID!=\"\" && $package!=\"\"){\n\t\t\t$settings = $this->Page->Kernel->getPackageSettings($package);\n\t\t\t$_library_path=$settings->GetItem(\"main\",\"LibrariesRoot\");\n\t\t\t@$listSettings = &ConfigFile::GetInstance(\"ListSettings\",$_library_path.$library_ID.\".ini\".\".php\",$this->Kernel->CacheRoot);\n\t\t\t$listSettings->reParse();\n\t\t\t$fields_count = $listSettings->GetItem(\"LIST\", \"FIELDS_COUNT\");\n\t\t\t$element = $this->Request->ToString(\"element\", \"\", 1);\n\t\t\tfor($i=0; $i<$fields_count; $i++){\n\t\t\t\tif($listSettings->HasItem(\"FIELD_\".$i, \"FIELD_NAME\")){\n\t\t\t\t\t$field_name = $listSettings->GetItem(\"FIELD_\".$i, \"FIELD_NAME\");\n\t\t\t\t\tif($element == $field_name){\n\t\t\t\t\t\tif($listSettings->HasItem(\"FIELD_\".$i, \"MAX_SIZE\")){\n\t\t\t\t\t\t\t$max_size = $listSettings->GetItem(\"FIELD_\".$i, \"MAX_SIZE\");\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\tif (!is_array($uploadedFile) || !is_uploaded_file($uploadedFile[\"tmp_name\"]))\n\t\treturn;\n\n\t\tif ($this->Kernel->Settings->HasItem(\"settings\",\"AllowedExtensions\")){\n\t\t\t$allowed_extensions = $this->Kernel->Settings->GetItem(\"settings\",\"AllowedExtensions\");\n\t\t\t$extensions = explode(',',$allowed_extensions);\n\t\t\t$file_ext=strtolower(substr(strrchr($uploadedFile['name'], \".\"), 1) );\n\t\t\tif(!in_array($file_ext,$extensions)) {\n\t\t\t\t$this->AddErrorMessage(\"MESSAGES\",\"FORBIDDEN_TYPE\", $file_ext[1]);\n\t\t\t\treturn;\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\t$fileName = $uploadedFile[\"name\"];\n\t\tif($uploadedFile[\"size\"] > $max_size){\n\t\t\t$this->AddErrorMessage(\"MESSAGES\",\"FILE_TOO_BIG\", array($max_size));\n\t\t\t$this->fileUploaded = false;\n\t\t} else {\n\t\t\t$orig_mask = umask(0);\n\t\t\t@chmod($uploadedFile['tmp_name'], 0660);\n if (is_uploaded_file($uploadedFile['tmp_name']) && is_readable($uploadedFile['tmp_name'])){\n\t\t\t\tmove_uploaded_file($uploadedFile[\"tmp_name\"], $this->_fileStorage->fullPath . $fileName);\n\t\t\t\t@chmod($this->_fileStorage->fullPath . $fileName, octdec($this->Kernel->FileMode));\n\n\t\t\t\t//create Thumbnail if set CreateThumbnails\n\t\t\t\tif ($this->Kernel->Settings->HasItem(\"MAIN\", \"CreateThumbnails\"))\n\t\t\t\t\tif ($this->Kernel->Settings->GetItem(\"MAIN\", \"CreateThumbnails\")){\n\t\t\t\t\t\t$ThumbHeight=$this->Kernel->Settings->GetItem(\"MAIN\", \"ThumbnailHeight\");\n\t\t\t\t\t\t$ThumbWidth=$this->Kernel->Settings->GetItem(\"MAIN\", \"ThumbnailWidth\");\n\t\t\t\t\t\tif ($ThumbHeight!=\"\" && $ThumbWidth!=\"\"){\n\t\t\t\t\t\t\t$settings=array(\"width\" => $ThumbWidth,\n\t\t\t\t\t\t\t\"height\" => $ThumbHeight,\n\t\t\t\t\t\t\t\"filesfolder\" => \"files\",\n\t\t\t\t\t\t\t\"thumbfolder\" => \"thumbs\",\n\t\t\t\t\t\t\t\"self\" => &$this);\n\t\t\t\t\t\t\tThumbnailCreator::ThumbnailCreate($this->_fileStorage->fullPath.$fileName, $settings);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t$this->fileUploaded = true;\n\t\t\t}else {\n\t\t\t\t$this->fileUploaded = false;\n\t\t\t}\n\t\t}\n\t}", "public function userfileAction() {\r\n\t\tif ((int)$this->_getParam('_parent') < 0) {\r\n \t\t$this->_detailedView('user_file');\r\n\t\t} else {\r\n\t\t\t$this->_component = $this->_components['user_file'];\r\n\t\t\t$this->detailedAction();\r\n\t\t}\r\n\t}", "public function ov_file($name){\n $args = func_get_args(); array_shift($args);\n return $this->generate_input('file', $name, null, false, $args);\n }", "function processAndStoreUploadedFile()\n{\n\t$allowedFileTypes = array(\"image/png\", \"image/jpeg\", \"image/gif\", \"text/plain\", \"application/pdf\");\n\t$allowedExtensions = array('jpg', 'jpeg', 'png', 'gif', 'pdf');\n\t\n\t\n\tif(in_array($_FILES['fileUpload']['type'], $allowedFileTypes))\n {\n \t$dateiname = standardizeFileName($_FILES['fileUpload']['name']);\n \tmove_uploaded_file (\n $_FILES['fileUpload']['tmp_name'] ,\n 'uploadedFiles/'. $dateiname);\n \techo \"Hochladen war erfolgreich <br>\";\n \techo \"<a href='uploadedFiles/\" . $_FILES['fileUpload']['name'] . \"'> uploadedFiles/\" . $_FILES['fileUpload']['name'] . \" </a> <br> <br>\";\n\t}\n\telse echo \"Ungültiger Dateityp\";\t\n}", "function form_file($name = '') {\n\n\tif ($name == 'attachment') {\n\t\tunset($name);\n\t\t$name = \"\";\n\t}\n\n\t$value = html_form_escape($value, $override);\n\n\t$name = 'attachment' . $name;\n\treturn \"<input type=\\\"file\\\" name=\\\"$name\\\" />\";\n\n}", "function actionSource() {\r\n\r\n\t\t\t// Get the basename of the file\r\n\t\t\t$file = $_GET['id'];\r\n\r\n\t\t\t// Filepath should start with the directory of this file\r\n\t\t\t$basePath = strtolower( dirname( __FILE__ ) );\r\n\t\t\t$filePath = strtolower( dirname( realpath( $_GET['id'] ) ) );\r\n\r\n\t\t\t// Check if the file is in the right directory\r\n\t\t\tif ( substr( $filePath, 0, strlen( $basePath ) ) != $basePath ) {\r\n\t\t\t\t$this->forward( 'default' );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if the file exists\r\n\t\t\tif ( ! is_file( $file ) ) {\r\n\t\t\t\t$this->forward( 'default' );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Show the highlighted source\r\n\t\t\t$this->template->assign( 'file', $file );\r\n\t\t\t$this->template->assign( 'source', highlight_file( $file, 1 ) );\r\n\r\n\t\t\t// Output the template\r\n\t\t\t$this->template->display();\r\n\r\n\t\t}", "function getTokenPickupFile()\n {\n return $this->_props['TokenPickupFile'];\n }", "public function uploadFile($file = '')\n { //EM~\n if ($file == '') $file = $_FILES['fbupload'];\n switch ($file['error']) {\n case UPLOAD_ERR_OK:\n break;\n case UPLOAD_ERR_INI_SIZE:\n $this->errMsg['error_file_too_big_php'] = ini_get('upload_max_filesize') . ' upload_max_filesize';\n return;\n case UPLOAD_ERR_NO_TMP_DIR:\n $this->errMsg['error_missing_temp_folder'] = '';\n return;\n default:\n $this->errMsg['error_unknown'] = $file['error'] . ' ' . $file['name'];\n return;\n }\n\n // alternatively the following might be used:\n // $type = $this->linkType == 'images' ? 'images' : 'downloads';\n $type = getimagesize($file['tmp_name']) !== false\n ? 'images' : 'downloads';\n if (isset($this->maxFilesizes[$type])) {\n if ($file['size'] > $this->maxFilesizes[$type]) {\n $this->errMsg['error_file_too_big'] = $file['name'];\n return;\n }\n }\n\n if ($this->isAllowedFile($file['name']) == false) {\n $this->errMsg['error_no_proper_extension'] = $file['name'];\n return;\n }\n\n $filename = $this->browseBase . $this->currentDirectory\n . basename($file['name']);\n if (file_exists($filename)) {\n $newFilename = $this->newFilename($filename);\n if (!rename($filename, $newFilename)) {\n $this->errMsg['error_file_already_exists'] = $filename;\n return;\n }\n }\n\n if (move_uploaded_file($file['tmp_name'], $filename)) {\n chmod($filename, 0644);\n $this->fileWritten = $filename;\n return true;\n } else {\n $this->errMsg['error_not_uploaded'] = $filename;\n }\n }", "function upload_handler( $file ) {\n\t\t$this->add_ping( 'uploads', array( 'upload' => str_replace( $this->resolve_upload_path(), '', $file['file'] ) ) );\n\t\treturn $file;\n\t}", "function form_file_upload_handle($file_data, $field_config, $table_name = null) {\n $file_max_size = $field_config['file-max-size'] + 0;\n $file_type = $field_config['file-type'];\n if (strstr($file_data['type'], $file_type) === FALSE) {\n return \"The file type is {$file_data['type']} not {$file_type}\";\n }\n if ($file_data['size'] > $file_max_size) {\n return \"Size is bigger than \" . $file_max_size / 1024 . \"k\";\n }\n /**\n * ALL ok? then place the file and let it go... let it goooo! (my daughter Allison fault! <3 )\n */\n if (file_uploads::place_upload_file($file_data['tmp_name'], $file_data['name'], $table_name)) {\n return TRUE;\n } else {\n return file_uploads::get_last_error();\n }\n// $file_location = file_uploads::get_uploaded_file_path($file_data['name']);\n// $file_location_url = file_uploads::get_uploaded_file_url($file_data['name']);\n}", "function drawFile($f, $ts, $sel) {\n $fType = getFileType($f);\n $rFile = dataFilename($f);\n $fNumber = getFileIndex($f);\n $lapseCount = \"\";\n switch ($fType) {\n case 'v': $fIcon = 'video.png'; break;\n case 't': \n $fIcon = 'timelapse.png';\n $lapseCount = '(' . count(findLapseFiles($f)). ')';\n break;\n case 'i': $fIcon = 'image.png'; break;\n default : $fIcon = 'image.png'; break;\n }\n $duration ='';\n if (file_exists(MEDIA_PATH . \"/$rFile\")) {\n $fsz = round ((filesize(MEDIA_PATH . \"/$rFile\")) / 1024);\n $fModTime = filemtime(MEDIA_PATH . \"/$rFile\");\n if ($fType == 'v') {\n $duration = ($fModTime - filemtime(MEDIA_PATH . \"/$f\")) . 's';\n }\n } else {\n $fsz = 0;\n $fModTime = filemtime(MEDIA_PATH . \"/$f\");\n }\n $fDate = @date('Y-m-d', $fModTime);\n $fTime = @date('H:i:s', $fModTime);\n $fWidth = max($ts + 4, 140);\n echo \"<fieldset class='fileicon' style='width:\" . $fWidth . \"px;'>\";\n if ($fsz > 0) echo \"$fsz Kb $lapseCount $duration\"; else echo 'Busy';\n echo \"<br>$fDate<br>$fTime<br>\";\n if ($fsz > 0) echo \"<a title='$rFile' href='preview.php?preview=$f'>\";\n echo \"<img src='\" . MEDIA_PATH . \"/$f' style='width:\" . $ts . \"px'/>\";\n if ($fsz > 0) echo \"</a>\";\n echo \"<form method='get' action='twitter2.php'>\";\n echo \"<input type='hidden' name='img' value='$rFile'>\";\n echo \"<input type='hidden' name='twitter' value='1'>\";\n echo \"<input type='hidden' name='txt' value='#MobilePiCam Photo anderson.the-silvas.com'>\";\n echo \"<input type='submit' name='sub' value='Twitter'></form>\";\n\n echo \"</fieldset> \";\n }", "public static function all()\r\n\r\n {\r\n $form = '<form action=\"index.php?page=choosefile\" method=\"post\" enctype=\"multipart/form-data\">';\r\n \r\n $form .= '<input type=\"file\" name=\"fileToUpload\" id=\"fileToUpload\">';\r\n $form .= '<br> <br>';\r\n \r\n $form .= '<input type=\"submit\" value=\"Upload\" name=\"submit\">';\r\n $form .= '</form> ';\r\n return $form;\r\n\r\n }", "public function fileStart(): void;", "final function getFile();", "function acf_get_file_input($attrs = array())\n{\n}", "protected function _FILES()\n\t{\n\t\t\n\t}", "public function view_file() {\n\t\t$currentPath = implode('/', $this->passedArgs);\n\t\t$fullPath = $this->path . $currentPath;\n\t\t$previousPath = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -1));\n\t\t$upOneFolder = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -2));\n\n\t\tif (!file_exists($fullPath)) {\n\t\t\t$this->_notFound(__('No file exists with that name', true));\n\t\t}\n\t\ttry {\n\t\t\t$docs = $this->ApiFile->loadFile($fullPath);\n\t\t} catch(Exception $e) {\n\t\t\t$this->_notFound($e->getMessage());\n\t\t}\n\t\t$classIndex = ClassRegistry::init('ApiGenerator.ApiClass')->getClassIndex();\n\t\tlist($dirs, $files) = $this->ApiFile->read($this->path . $previousPath);\n\n\t\tif (!empty($docs)) {\n\t\t\t$this->set('showSidebar', true);\n\t\t\t$this->set('sidebarElement', 'sidebar/file_sidebar');\n\t\t\t$this->set(compact('currentPath', 'previousPath', 'upOneFolder', 'docs', 'dirs', 'files', 'classIndex'));\n\t\t} else {\n\t\t\t$this->set('previousPath', $previousPath);\n\t\t\t$this->render('no_class');\n\t\t}\n\t}", "public function getFsSelection() {}", "function _showFileBrowser() {\r\n global $_ARRAYLANG;\r\n\r\n $this->_objTpl->loadTemplateFile('module_fileBrowser_frame.html');\r\n\r\n switch($this->_mediaType) {\r\n case 'webpages':\r\n $strWebPath = 'Webpages (DB)';\r\n break;\r\n default:\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $strWebPath = $this->mediaTypePaths[$this->_mediaType][1].$this->_path;\r\n } else {\r\n $strWebPath = ASCMS_CONTENT_IMAGE_WEB_PATH.$this->_path;\r\n }\r\n }\r\n\r\n $this->_objTpl->setVariable(array(\r\n 'CONTREXX_CHARSET' => CONTREXX_CHARSET,\r\n 'FILEBROWSER_WEB_PATH' => $strWebPath,\r\n 'TXT_CLOSE' => $_ARRAYLANG['TXT_CLOSE']\r\n ));\r\n\r\n $this->_setNavigation();\r\n $this->_setUploadForm();\r\n $this->_setContent();\r\n $this->_showStatus();\r\n $this->_objTpl->show();\r\n }", "protected static function file()\n {\n }", "public function upload_photo($file , $path ,$prefix_type, $sub_id , $sub_title ,$P_is_slider ,$P_active )\n\t {\n\t\t //echo $file .' -- '. $path .' -- '.$prefix_type .' -- '. $sub_id .' -- '. $sub_title .' -- '.$P_is_slider .' -- '.$P_active ; exit;\n\t\t //\n \t foreach($_FILES[$file][\"name\"] as $key=>$val) {\t \n \t\t\tif(isset($_FILES[$file][\"type\"][$key]))\n\t\t\t{\n\t\t\t$new_image_name = time().'_'.$_FILES[$file][\"name\"][$key];\n \t\t\t\t$validextensions = array(\"jpeg\", \"jpg\", \"png\",\"gif\",\"doc\",\"pdf\",\"txt\",\"docx\",\"xlsx\",\"xls\");\n\t\t\t\t$temporary = explode(\".\", $new_image_name);\n\t\t\t\t$file_extension = end($temporary);\n\t\t\t\tif ( in_array($file_extension, $validextensions)) \n\t\t\t\t{\n\t\t\t\t if(($_FILES[$file][\"size\"][$key] > 20000))//Approx. 100kb files can be uploaded.\n\t\t\t\t {\n\t\t\t\t\tif ($_FILES[$file][\"error\"][$key] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$out = \"Return Code: \" . $_FILES[$file][\"error\"][$key] . \"<br/><br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (file_exists($path.\"/\" . $new_image_name)) {\n\t\t\t\t\t\t\t$out = $new_image_name . \" <span id='invalid'><b>already exists.</b></span> \";\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 $sourcePath = $_FILES[$file]['tmp_name'][$key]; //Storing source path of the file in a variable\n\t\t\t\t\t\t\t$targetPath = $path.$new_image_name; // Target path where file is to be stored\n\t\t\t\t\t // water mark here \n\t\t\t\t\t\t\t$photo_data = array(\n\t\t\t\t\t\t\t \t\t\t\t\t\"P_title_ar\" =>$sub_title ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"P_title_en\" =>$sub_title ,\n\t\t\t\t\t\t\t\t \"P_desc_ar\" =>'' ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"P_desc_en\" =>'' ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"P_photo\" => $targetPath , \n\t\t\t\t\t\t\t\t\t\t\t\t\"P_is_slider\" => $P_is_slider ,\n\t\t\t\t\t\t\t\t\t\t\t\t\"P_active\" => $P_active);\n \t\t\t\t\t\t\tmove_uploaded_file($sourcePath,$targetPath) ; // Moving Uploaded file\n\t\t\t\t\t\t\t$this->db->where(\"prefix_type\",$prefix_type);\n\t\t\t\t\t\t\t$this->db->where(\"Rcu_id\",$sub_id);\n\t\t\t\t\t\t\t$this->db->update(\"subject_photos\" , array(\"is_main\" => 0 )); //make all old photos zero main ...\n\t\t\t\t\t\t\t$this->db->insert(\"photos\",$photo_data);\n\t\t\t\t\t\t\t$generated_photo_id = $this->db->insert_id();\n\t\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t $is_main = 1;\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t $is_main = 0;\n\t\t\t\t\t\t\t$this->db->insert(\"subject_photos\" , \n\t\t\t\t\t\t\t array(\"Rcu_id\" => $sub_id ,\n\t\t\t\t\t\t\t\t\t\t\t \"Photo_id\"=> $generated_photo_id ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"prefix_type\"=> $prefix_type ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"is_main\" => $is_main,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"S_active\" => $P_active\n \t\t\t\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 }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t echo $this->lang->line('not_upload_photo');\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t }\n\t }", "function choose_image($file_name)\n{\n static $type, $image;\n\n /* TABLES INITIALISATION */\n if (!$type || !$image) {\n $type['word'] = array(\n 'doc',\n 'dot',\n 'rtf',\n 'mcw',\n 'wps',\n 'psw',\n 'docm',\n 'docx',\n 'dotm',\n 'dotx',\n );\n $type['web'] = array(\n 'htm',\n 'html',\n 'htx',\n 'xml',\n 'xsl',\n 'php',\n 'xhtml',\n );\n $type['image'] = array(\n 'gif',\n 'jpg',\n 'png',\n 'bmp',\n 'jpeg',\n 'tif',\n 'tiff',\n );\n $type['image_vect'] = array('svg', 'svgz');\n $type['audio'] = array(\n 'wav',\n 'mid',\n 'mp2',\n 'mp3',\n 'midi',\n 'sib',\n 'amr',\n 'kar',\n 'oga',\n 'au',\n 'wma',\n );\n $type['video'] = array(\n 'mp4',\n 'mov',\n 'rm',\n 'pls',\n 'mpg',\n 'mpeg',\n 'm2v',\n 'm4v',\n 'flv',\n 'f4v',\n 'avi',\n 'wmv',\n 'asf',\n '3gp',\n 'ogv',\n 'ogg',\n 'ogx',\n 'webm',\n );\n $type['excel'] = array(\n 'xls',\n 'xlt',\n 'xls',\n 'xlt',\n 'pxl',\n 'xlsx',\n 'xlsm',\n 'xlam',\n 'xlsb',\n 'xltm',\n 'xltx',\n );\n $type['compressed'] = array('zip', 'tar', 'rar', 'gz');\n $type['code'] = array(\n 'js',\n 'cpp',\n 'c',\n 'java',\n 'phps',\n 'jsp',\n 'asp',\n 'aspx',\n 'cfm',\n );\n $type['acrobat'] = array('pdf');\n $type['powerpoint'] = array(\n 'ppt',\n 'pps',\n 'pptm',\n 'pptx',\n 'potm',\n 'potx',\n 'ppam',\n 'ppsm',\n 'ppsx',\n );\n $type['flash'] = array('fla', 'swf');\n $type['text'] = array('txt', 'log');\n $type['oo_writer'] = array('odt', 'ott', 'sxw', 'stw');\n $type['oo_calc'] = array('ods', 'ots', 'sxc', 'stc');\n $type['oo_impress'] = array('odp', 'otp', 'sxi', 'sti');\n $type['oo_draw'] = array('odg', 'otg', 'sxd', 'std');\n $type['epub'] = array('epub');\n $type['java'] = array('class', 'jar');\n $type['freemind'] = array('mm');\n\n $image['word'] = 'word.gif';\n $image['web'] = 'file_html.gif';\n $image['image'] = 'file_image.gif';\n $image['image_vect'] = 'file_svg.png';\n $image['audio'] = 'file_sound.gif';\n $image['video'] = 'film.gif';\n $image['excel'] = 'excel.gif';\n $image['compressed'] = 'file_zip.gif';\n $image['code'] = 'icons/22/mime_code.png';\n $image['acrobat'] = 'file_pdf.gif';\n $image['powerpoint'] = 'powerpoint.gif';\n $image['flash'] = 'file_flash.gif';\n $image['text'] = 'icons/22/mime_text.png';\n $image['oo_writer'] = 'file_oo_writer.gif';\n $image['oo_calc'] = 'file_oo_calc.gif';\n $image['oo_impress'] = 'file_oo_impress.gif';\n $image['oo_draw'] = 'file_oo_draw.gif';\n $image['epub'] = 'file_epub.gif';\n $image['java'] = 'file_java.png';\n $image['freemind'] = 'file_freemind.png';\n }\n\n $extension = array();\n if (!is_array($file_name)) {\n if (preg_match('/\\.([[:alnum:]]+)(\\?|$)/', $file_name, $extension)) {\n $extension[1] = strtolower($extension[1]);\n\n foreach ($type as $generic_type => $extension_list) {\n if (in_array($extension[1], $extension_list)) {\n return $image[$generic_type];\n }\n }\n }\n }\n\n return 'defaut.gif';\n}", "public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }", "function get_file()\n\t{\n\t\treturn $this->file;\n\t}", "private function submitFile()\n {\n\n $encoded_url = urlencode($this->getFileUrl());\n\n wp_remote_get(self::GOOGLE_WEBMASTER_TOOLS_URL . $encoded_url);\n wp_remote_get(self::BING_WEBMASTER_TOOLS_URL . $encoded_url);\n\n }", "public function file_settings_do_upload($file)\n\t{\n\t\t$config['upload_path'] = './'.BID_ATTACHMENTS;//define in constants\n\t\t$config['allowed_types'] = 'doc|docx|xls|xlsx|pdf';\n\t\t$config['remove_spaces'] = TRUE;\t\t\n\t\t$config['max_size'] = '2000';\n\t\t// $config['max_width'] = '1000';\n\t\t// $config['max_height'] = '1000';\n\t\t$this->upload->initialize($config);\n\t\t//print_r($_FILES);\n\t\t\n\t\t$this->upload->do_upload($file);\n\t\tif($this->upload->display_errors())\n\t\t{\n\t\t\t$this->error_img = $this->upload->display_errors();\n\t\t\t// echo $this->error_img;\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->upload->data();\n\t\t\treturn $data;\n\t\t}\t\t\t\n\t}", "function handle_upload() {\n\t\tif ( !isset($_FILES['import']) ) {\n\t\t\t$file['error'] = '文件为空';\n\t\t}\n\t\t$temp_file = tempnam(sys_get_temp_dir(), 'chemcsv');\n\t\tmove_uploaded_file($_FILES[\"import\"][\"tmp_name\"], $temp_file);\n\t\t$file['file'] = $temp_file;\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\techo esc_html( $file['error'] ) . '</p>';\n\t\t\treturn false;\n\t\t} else if ( ! file_exists( $file['file'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\tprintf('无法读取导入的文件 <code>%s</code>.', esc_html( $file['file'] ) );\n\t\t\techo '</p>';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $file['file'];\n\t}", "function browse($name, $func, $file = '')\n {\n $this->initialize($name);\n\n //Put extension at end of filename again\n $type = array_search($this->request->accept[0], $this->request->mimetypes);\n if($type != 'html')\n $file .= '.' . $type;\n\n $file = urldecode($_SERVER['REQUEST_URI']);\n $file = substr($file, strpos($file, 'browse/') + 6);\n\n //Check if requested url is within the base path\n $basepath = realpath($this->settings['path']);\n $path = $basepath;\n if($file != '')\n $path .= '/' . $file;\n $path = realpath($path);\n\n if($path && $basepath && substr_compare($path, $basepath, 0, strlen($basepath)) != 0)\n throw new Tonic\\NotFoundException;\n\n //Handle directories\n if(is_dir($path))\n {\n $entries = array();\n $names = scandir($path);\n foreach($names as $filename)\n {\n if($filename[0] == '.')\n continue;\n if(!is_readable($path . '/' . $filename))\n continue;\n $entry = $this->app->uri(__CLASS__, array($name, $func));\n if($file != '')\n $entry .= '/' . $file;\n $entry .= '/' . $filename;\n if(is_dir($path . '/' . $filename))\n $entry .= '/';\n $entries[] = $this->encode_path($entry);\n }\n\n $res = array();\n $res['type'] = 'directory';\n $res['name'] = basename($path);\n if($path == $basepath)\n $res['name'] = $name;\n $res['entries'] = $entries;\n return json_encode($res, JSON_PRETTY_PRINT);\n }\n\n //Handle mp3 files\n if(is_file($path))\n {\n //Create new songinfo\n $tags = $this->getID3Tags($path);\n $res = new Song($path, $tags['title'], $tags['artist'], $path);\n $res->album = $tags['album'];\n $res->length = $tags['length'];\n return $res->toJSON();\n }\n\n throw new Tonic\\NotFoundException;\n }", "function zen_draw_file_field($name, $required = false) {\n $field = zen_draw_input_field($name, '', ' size=\"50\" ', 'file');\n\n return $field;\n }", "function uploadFile()\n{\n $uploaddir = 'files/';\n\n // TODO: handle duplicate names?\n // get file description?\n $query = \"\n INSERT INTO clipboard\n SET\n name = '{$_FILES['clipfile']['name']}',\n path = $uploaddir . $_FILES['clipfile']['name']',\n description = '',\n date = now(),\n clip_id = NULL\";\n \n query($query);\n testError($query);\n \n move_uploaded_file($_FILES['clipfile']['tmp_name'], $uploaddir . $_FILES['clipfile']['name'])\n or die('fucking file failed');\n \n print \"file {$_FILES['clipfile']['name']} uploaded successfully. Word Up!\";\n}", "public function file() {\n // get the post data\n $param = $_POST;\n\n // get the config data\n $hc_config = hc_config();\n\n // define the response first\n $res = $hc_config['response'];\n\n // just check if param is not empty\n if ( empty( $param ) || !is_array( $param ) || !isset( $param['type'] ) ) {\n $res['msg'] = hc_get_msg( 'ERR-01' );\n return $res;\n }\n\n // sanitize the input data if there's no error in checking\n foreach ( $param as $key => &$value ) {\n // sanitize for the email\n if ( $key === 'content' ) {\n $sanitize = sanitize_textarea_field( $value );\n $strip = stripslashes( $value );\n $param[$key] = str_replace( site_url(), '[url]', $strip );\n\n continue;\n }\n\n // do not sanitize the list of members for registration in file\n if ( $key === 'mem_data' ) {\n continue;\n }\n\n // sanitize all the params according to text\n $param[$key] = sanitize_text_field( $value );\n }\n\n // check input data first\n $checked = $this->check_file( $param );\n if ( $checked !== true ) {\n $res['msg'] = $checked;\n return $res;\n }\n\n switch ( $param['type'] ) {\n // ファイル登録\n case 'register':\n $insert = $this->insert_file( $param );\n // check if insert is unsuccessful\n if ( $insert === false ) {\n $res['msg'] = hc_get_msg( 'ERR-02' );\n\n return $res;\n }\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'file_id' => $insert,\n 'admin_url' => admin_url(),\n );\n\n return $res;\n break;\n\n // ファイル更新\n case 'detail':\n $update = $this->update_file( $param );\n // check if update is unsuccessful\n if ( $update === false ) {\n $res['msg'] = hc_get_msg( 'ERR-03' );\n\n return $res;\n }\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'file_id' => $param['file_id'],\n 'admin_url' => admin_url(),\n );\n\n return $res;\n break;\n\n // ファイル削除\n case 'delete':\n $delete = $this->delete_file( $param );\n // check if delete is unsuccessful\n if ( $delete === false ) {\n $res['msg'] = hc_get_msg( 'ERR-04' );\n\n return $res;\n }\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'admin_url' => admin_url(),\n );\n\n return $res;\n break;\n\n // ファイルとメンバー紐付け登録\n case 'file_mem_register':\n // check if registration is unsuccessful\n if ( !$this->file_member_register( $param ) ) {\n $res['msg'] = hc_get_msg( 'ERR-02' );\n\n return $res;\n }\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'admin_url' => admin_url(),\n 'id' => $param['file_id']\n );\n\n return $res;\n break;\n\n // ファイルとメンバー紐付け登録\n case 'file_mem_delete':\n // check if delete is unsuccessful\n if ( !$this->file_member_delete( $param ) ) {\n $res['msg'] = hc_get_msg( 'ERR-04' );\n\n return $res;\n }\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'admin_url' => admin_url(),\n 'id' => $param['file_id']\n );\n\n return $res;\n break;\n\n default:\n $res['msg'] = hc_get_msg( 'ERR-01' );\n break;\n }\n\n return $res;\n }", "public function upload(){\n \n if(!empty($_FILES['uploaded_file']))\n {\n $path = \"upload/\";\n $path = $path . basename( $_FILES['uploaded_file']['name']);\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n echo \"The file \". basename( $_FILES['uploaded_file']['name']). \n \" has been uploaded\";\n return $path;\n } else{\n echo \"There was an error uploading the file, please try again!\";\n }\n }\n }" ]
[ "0.6363006", "0.62833965", "0.62384033", "0.62169296", "0.6056647", "0.6047784", "0.6001638", "0.585078", "0.58043826", "0.5798377", "0.5792397", "0.57849336", "0.57621545", "0.57524824", "0.57440645", "0.5735864", "0.5727899", "0.57223624", "0.57156926", "0.5655948", "0.5646494", "0.5640869", "0.56213635", "0.56154245", "0.56099284", "0.5597814", "0.559763", "0.5593788", "0.55783755", "0.5576378", "0.5573259", "0.5573203", "0.5560402", "0.55590284", "0.5558935", "0.5550111", "0.55497754", "0.55426484", "0.5542449", "0.55382967", "0.5530097", "0.5524102", "0.55132526", "0.5512715", "0.5512715", "0.5512715", "0.55079406", "0.5499912", "0.54992914", "0.5483112", "0.54796976", "0.5474986", "0.54728526", "0.5467161", "0.5451023", "0.54489475", "0.54487205", "0.54418033", "0.543628", "0.5433802", "0.54329145", "0.5429865", "0.54243445", "0.54227", "0.54227", "0.54111785", "0.54057014", "0.53982866", "0.53972965", "0.5394695", "0.5392965", "0.5387923", "0.5386851", "0.53854114", "0.53847796", "0.53840977", "0.5381355", "0.53805536", "0.53655565", "0.5362281", "0.53619254", "0.53582525", "0.5358101", "0.53538567", "0.53517014", "0.5340226", "0.5336933", "0.53364474", "0.53330636", "0.5319502", "0.53117216", "0.5310972", "0.53015673", "0.5287648", "0.5286963", "0.5282889", "0.5280843", "0.5276767", "0.527654", "0.52634543" ]
0.74709755
0
Returns the classnames of the tokens this provider is responsible for.
public function getTokenClassNames() { return array(TwitterOAuthToken::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRegisteredClassNames(): ?array {\n $ctx = CompilerContext::getCurrentCompiler();\n if($ctx) {\n $reflections = $ctx->getValueCache()->fetchValue( FindExposedSymbolsCompiler::CACHE_CLASS_REFLECTIONS );\n return array_keys($reflections);\n }\n return NULL;\n }", "public function getClasses(): array\n {\n return $this->classes;\n }", "public function getProviderTokens()\n {\n return $this->provider_tokens;\n }", "public function classes(): array\n {\n return $this->classes;\n }", "public function getClasses() {\n return $this->classes;\n }", "public function getClasses() {\n return $this->robot->getIndexedClasses();\n }", "public function getClasses()\n\t{\n\t\treturn $this->classes;\n\t}", "public function getUsedClasses(): array\n {\n return [$this->getBeanClassName()];\n }", "public function getClasses() {\n\t\treturn $this->classes;\n\t}", "public function getAllClassNames() \n {\n\n }", "private static function classList()\n {\n // $path = __DIR__;\n $path = base_path(config('spatie-permission-generate.controllers_root_path'));\n $fqcns = array();\n\n $allFiles = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $phpFiles = new \\RegexIterator($allFiles, '/\\.php$/');\n foreach ($phpFiles as $phpFile) {\n $content = file_get_contents($phpFile->getRealPath());\n $tokens = token_get_all($content);\n $namespace = '';\n for ($index = 0; isset($tokens[$index]); $index++) {\n if (!isset($tokens[$index][0])) {\n continue;\n }\n if (T_NAMESPACE === $tokens[$index][0]) {\n $index += 2; // Skip namespace keyword and whitespace\n while (isset($tokens[$index]) && is_array($tokens[$index])) {\n $namespace .= $tokens[$index++][1];\n }\n }\n if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index +\n 2][0]) {\n $index += 2; // Skip class keyword and whitespace\n if ($namespace != 'App\\Http\\Controllers\\Auth') {\n $fqcns[] = $namespace . '\\\\' . $tokens[$index][1];\n }\n\n\n # break if you have one class per file (psr-4 compliant)\n # otherwise you'll need to handle class constants (Foo::class)\n break;\n }\n }\n }\n\n return $fqcns;\n }", "protected function getOrientClasses()\n {\n $classAnnotation = $this->getManager()->getMetadataFactory()->getClassAnnotation($this->getClassName());\n\n return explode(',', $classAnnotation->class);\n }", "public function getTokens() {\n\t\treturn array_keys($this->tokens);\n\t}", "public static function classes(): array;", "public function getAllClasses() {\n return array_unique(array_values($this->alias2class));\n }", "public function names() {\n $maps = $this->classRegistry->getClassMapping();\n \n $result = [];\n foreach($maps as $map) {\n $key = str_replace('\\\\','__',$map->getCurrentName());\n $result[$key] = $map->getCurrentName();\n }\n \n return $result;\n }", "protected function getRegisteredClasses() {}", "protected function getTagClassNames()\n {\n $tags = array_map(function ($tag) {\n return str_slug($tag);\n }, explode('|', $this->get('tags')));\n\n return implode(' ', $tags);\n }", "public function getClasses();", "public function getClasses();", "public function getClasses();", "public function getProvider()\n {\n return $this->tokens;\n }", "static public function getRegisteredClasses () {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:160: characters 3-19\n\t\t$result = new \\Array_hx();\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:161: lines 161-163\n\t\t$collection = Boot::$aliases;\n\t\tforeach ($collection as $key => $value) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:162: characters 4-39\n\t\t\t$x = Boot::getClass($key);\n\t\t\t$result->arr[$result->length] = $x;\n\t\t\t++$result->length;\n\n\t\t}\n\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:164: characters 3-16\n\t\treturn $result;\n\t}", "public function get_tokens()\n\t{\n\t\treturn $this->tokens;\n\t}", "public function getApprovedClasses()\n\t{\n\t\treturn $this->membership->getApprovedClasses() . ' and has access to karate classes';\n\t}", "public function getUsedClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) && $class->attribute( 'object_count' ) > 0 )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function getClassNames()\n {\n $classes = array_merge(\n parent::getClassNames(),\n [\n $this->IconSizeClass,\n $this->CornerStyleClass\n ]\n );\n \n return $classes;\n }", "public function classNames(): array {\n\t\treturn $this->m_attributes[\"class\"];\n\t}", "protected function scanClass()\n {\n return $this->scanInput('/^\\.([\\w-]+)/', 'class');\n }", "protected function getClassesToScan()\n\t{\n\t\t$classes = [];\n\n\t\tforeach ($this->scan as $class)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$classes[] = new ReflectionClass($class);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}", "public function getTokens()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('tokens');\n }", "public function getClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function getTokens();", "public function getValidClasses(): array\n {\n return $this->validClasses;\n }", "public function all()\n {\n return $this->classes;\n }", "public function getTokens()\n {\n return $this->tokens;\n }", "private function get_service_classes() {\n\t\treturn [\n\t\t\tAuthentication\\JavaScriptWebToken::class,\n\t\t\tAuthorisation\\IdeaManagerRole::class,\n\t\t\tAuthorisation\\AdminAccess::class,\n\t\t\tCustomPostType\\Idea::class,\n\t\t\tMetabox\\Reminder::class,\n\t\t];\n\t}", "public function tokensDataProvider(): array\n {\n return [\n 'PHP 7' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NS_SEPARATOR, '\\\\'],\n 2 => [T_STRING, 'Object'],\n 3 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ],\n 'PHP 8' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NAME_FULLY_QUALIFIED, '\\\\Object'],\n 2 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ]\n ];\n }", "public function getAvailableTokens()\n {\n return array_keys( $this->tokens );\n }", "protected function get_service_classes(): array {\n\t\treturn [];\n\t}", "public function getTokens(): array\n {\n return $this->tokens;\n }", "public function symbolClass(): array\n {\n $symbols = [];\n\n foreach ($this->tagsByType('SymbolClass') as $symbol) {\n $index = 0;\n\n foreach ($symbol->tags->item as $characterId) {\n $name = (string) $symbol->names->item[$index++];\n $symbols[$name] = (int) $characterId;\n }\n }\n\n return $symbols;\n }", "public function getClassNames($filename)\n {\n return $this->parse($filename)['classes'];\n }", "private function getFullStateClassNameList()\n {\n if (empty($this->fullStatesClassesNamesList)) {\n $fullStateClassNameList = [];\n\n foreach ($this->listStatesByClasses() as $stateName => $finderLoader) {\n $className = $finderLoader->getStatedClassName().'\\\\'.FinderInterface::STATES_PATH.'\\\\'.$stateName;\n $fullStateClassNameList[$className] = $className;\n }\n\n $this->fullStatesClassesNamesList = $fullStateClassNameList;\n }\n\n return $this->fullStatesClassesNamesList;\n }", "protected function _getCSSClassNames()\n {\n return $this->_classes;\n }", "public function getAllClass()\n {\n $routes = $this->createMap(route_path());\n return array_keys($routes);\n }", "public function getLoadedModulesName()\n\t{\n\t\treturn array_map('get_class', $this->getLoadedModules());\n\t}", "public function getTagClasses();", "public static function getAllNames(): array\n {\n $reflection = new \\ReflectionClass(__CLASS__);\n\n return \\array_values($reflection->getConstants());\n }", "public static function getAllNames(): array\n {\n $reflection = new \\ReflectionClass(__CLASS__);\n\n return \\array_values($reflection->getConstants());\n }", "protected function getSupportedClasses()\n {\n return array($this->class);\n }", "public function getDocumentedClasses(): array\n {\n return array_filter(\n $this->classes,\n fn ($class) => class_exists($class)\n );\n }", "public function getApprovedClasses()\n\t{\n\t\treturn $this->membership->getApprovedClasses() . ' and has access to boxing classes';\n\t}", "public function get_response_class_ids() {\n return array_keys($this->responseclasses);\n }", "public function getUserTokens();", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "public function classes()\n {\n\n $class = [];\n\n $color = $this->getColorClass();\n\n if ($color)\n {\n $class[$color] = $color;\n }\n\n $size = $this->getSizeClass();\n\n if ($size)\n {\n $class[$size] = $size;\n }\n\n $parent_classes = parent::classes();\n\n $class += $parent_classes;\n\n return $class;\n }", "protected function listEntityClasses()\n {\n $classNames = [];\n $classNames[] = 'MU\\FilesModule\\Entity\\CollectionEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\CollectionCategoryEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\FileEntity';\n $classNames[] = 'MU\\FilesModule\\Entity\\HookAssignmentEntity';\n \n return $classNames;\n }", "protected function getClassNameOptions()\n {\n $hidden = [];\n $classes = [];\n \n foreach ($this->dbObject('ClassName')->enumValues() as $class) {\n \n if ($class == self::class || !in_array($class, ClassInfo::subclassesFor($this))) {\n continue;\n }\n \n if ($hide = Config::inst()->get($class, 'hide_ancestor')) {\n $hidden[$hide] = true;\n }\n \n if (!$class::singleton()->canCreate()) {\n continue;\n }\n \n $classes[$class] = $class::singleton()->i18n_singular_name();\n \n }\n \n foreach ($hidden as $class => $hide) {\n unset($classes[$class]);\n }\n \n return $classes;\n }", "public function getClasses(): array\n {\n $suffix = $this->suffix;\n\n $directoryIterator = new RecursiveDirectoryIterator($this->directory);\n $recursive = new RecursiveIteratorIterator($directoryIterator);\n $iterator = new RegexIterator($recursive, \"/[A-Za-z0-9]*{$suffix}.php/\");\n \n $classes = [];\n\n foreach ($iterator as $file) {\n if ($file->isFile()) {\n $path = $file->getPathname();\n\n $class = \\str_replace($this->directory . DIRECTORY_SEPARATOR, $this->namespace, $path);\n $class = \\str_replace(DIRECTORY_SEPARATOR, '\\\\', $class);\n $class = \\rtrim($class, '.php');\n\n $classes[$path] = $class;\n }\n }\n \n $this->classes = $classes;\n\n return $this->classes;\n }", "public function provides()\n {\n return [__CLASS__];\n }", "protected function getNamespaceAndClass(array $tokens): string\n {\n $class = '';\n while (self::hasToken(\n [self::T_NS_SEPARATOR, self::T_STRING, self::T_NAME_QUALIFIED],\n $token = \\array_pop($tokens)\n )) {\n if (self::needCompleteClass($token)) {\n continue;\n }\n\n $class = $token[1].$class;\n }\n\n return $class;\n }", "protected function getExposedClasses(): ?array {\n $ctx = CompilerContext::getCurrentCompiler();\n if($ctx) {\n $symbols = $ctx->getValueCache()->fetchValue( FindExposedSymbolsCompiler::CACHE_EXPOSED_SYMBOLS );\n return array_keys($symbols[\"classes\"]);\n }\n return NULL;\n }", "protected function get_tokenname() {\n // This is unusual but should work for most purposes.\n return get_class($this).'-'.md5($this->scope);\n }", "static function getAvailableUserClasses() {\n return array('Administrator', 'Member');\n }", "public function getRegisteredRequestHandlerClassNames() {}", "public function classNamesString(): string {\n\t\treturn implode(\" \", $this->m_attributes[\"class\"]);\n\t}", "public function getClassMap()\n {\n return array();\n }", "public static function getClassifications()\n {\n return [\n static::HOURLY,\n static::SALARIED,\n static::COMMISSIONED,\n ];\n }", "public function getCustomClasses()\n {\n return $this->custom_classes;\n }", "public function getListClassNames()\n {\n $classes = ['links'];\n \n $classes[] = ($this->ShowIcons ? 'show-icons' : 'hide-icons');\n \n $this->extend('updateListClassNames', $classes);\n \n return $classes;\n }", "public function getContextClasses();", "function getMetadataClassNames() {\r\n\t\t// must be implemented by sub-classes\r\n\t\tassert(false);\r\n\t}", "abstract public function getClasses();", "public function getExtraClassesString()\n {\n return implode(' ', $this->getExtraClasses());\n }", "protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }", "public function getProviderNames();", "final private function _classesInScript ($code = '') {\n\t\t$classes = array();\n\n\t\t// Find tokens that are classes\n\t\t$tokens = token_get_all($code);\n\t\tfor ($i = 2; $i < count($tokens); $i++) {\n\n\t\t\t// Assess tokens to find class declarations of subclasses\n\t\t\tif (\n\t\t\t\t$tokens[$i-2][0] === T_CLASS and\n\t\t\t\t$tokens[$i-1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i][0] === T_STRING and\n\t\t\t\t$tokens[$i+1][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+2][0] === T_EXTENDS and\n\t\t\t\t$tokens[$i+3][0] === T_WHITESPACE and\n\t\t\t\t$tokens[$i+4][0] === T_STRING\n\t\t\t) {\n\t\t\t\t$inheritedFrom = $tokens[$i+4][1];\n\n\t\t\t\t// See if class extends Unitest\n\t\t\t\tif ($this->_isValidSuiteClass($inheritedFrom)) {\n\t\t\t\t\t$classes[] = $tokens[$i][1];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "protected static function getClassAliases()\n {\n return [];\n }", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public static function getClasses()\n {\n $classes = SchoolClass::all();\n $classes_array = [];\n foreach ($classes as $class) {\n $classes_array[$class->name] = [\n \"name\" => $class->name,\n \"year\" => $class->year,\n \"holder\" => $class->holder,\n \"delegate\" => $class->delegate,\n \"status\" => $class->status,\n ];\n }\n return $classes_array;\n }", "private static function userTypes(){\n $reflector = (new \\ReflectionClass(__CLASS__));\n return array_diff($reflector->getConstants(),$reflector->getParentClass()->getConstants());\n }", "public function getClassName() ;", "protected function _getClassNames(\\Zend_Form_Element $element = null)\n {\n if (null !== $element) {\n return explode(' ', $element->getAttrib('class'));\n }\n\n return explode(' ', $this->getAttrib('class'));\n }", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "static function getUserInstanciableClasses(){\n \n //get all the classes\n $AllClasses=get_declared_classes();\n \n foreach($AllClasses as $Class):\n \n $class = new ReflectionClass($Class);\n \n if($class->isInstantiable() && $class->isUserDefined()):\n \n $InstanciableClasses[]=$Class;\n \n endif;\n \n \n endforeach;\n \n return $InstanciableClasses;\n \n \n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassmap() : array\n {\n return $this->classmap;\n }", "public function classes(): array\n {\n $directives = [];\n\n foreach ($this->namespaces() as $directiveNamespace) {\n /** @var array<class-string> $classesInNamespace */\n $classesInNamespace = ClassFinder::getClassesInNamespace($directiveNamespace);\n\n foreach ($classesInNamespace as $class) {\n $reflection = new \\ReflectionClass($class);\n if (! $reflection->isInstantiable()) {\n continue;\n }\n\n if (! is_a($class, Directive::class, true)) {\n continue;\n }\n\n // Only add the first directive that was found\n $directives[self::directiveName($class)] ??= $class;\n }\n }\n\n return $directives;\n }", "public function uc_get_classlist($filter = FALSE)\n\t{\n\t\t$ret = array();\n\t\t$this->readTree(FALSE);\t\t\t\t// Make sure we have data\n\t\tforeach ($this->class_tree as $k => $v)\n\t\t{\n\t\t\tif (!$filter || check_class($filter))\n\t\t\t{\n\t\t\t\t$ret[$k] = array('userclass_name' => $v, 'userclass_description' => $v['userclass_description'], 'userclass_editclass' => $v['userclass_editclass']);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function getClasses() {\n $chartData = $this->curlGetJSON(\"http://api.highcharts.com/option/highcharts/main\");\n\n //Items to exclude when generating the chart API wrapper -- these are globally configured options and can't be set per-graph.\n $exclude = array('global', 'lang');\n $classes = array();\n $globalClasses = array();\n foreach ($chartData as $key => $value) {\n //Populate class list based on children of the main object\n if (array_search($value['name'], $exclude) !== false)\n $ex = true;\n else\n $ex = false;\n \n $name = $value['name'];\n $className = ucfirst($value['name']);\n if($className == 'Global')\n $className = 'HCGlobal';\n $description = $value['description'];\n \n if($value['returnType'] == 'Array<Object>')\n $returnType = $className . '[]';\n else\n $returnType = $className;\n //We just need the name, classname(generated), and description.\n if($ex)\n $globalClasses[] = array('name' => $name, 'className' => $className, 'description' => $description, 'returnType' => $returnType, 'originalName' => $name);\n else\n $classes[] = array('name' => $name, 'className' => $className, 'description' => $description, 'returnType' => $returnType, 'originalName' => $name);\n }\n return array('classes' => $classes, 'globals' => $globalClasses);\n }" ]
[ "0.66587985", "0.65607053", "0.65588343", "0.6554792", "0.65313447", "0.6526334", "0.64974535", "0.647101", "0.6461205", "0.6396203", "0.6359548", "0.62997866", "0.6230715", "0.62257826", "0.6186816", "0.6181094", "0.616548", "0.6120364", "0.6117181", "0.6117181", "0.6117181", "0.6104731", "0.60888416", "0.6080889", "0.607655", "0.6074306", "0.60591435", "0.60579085", "0.60509855", "0.6026228", "0.6019517", "0.60125923", "0.6002068", "0.5984814", "0.5951358", "0.5946658", "0.5946403", "0.5945062", "0.5926403", "0.59239477", "0.5914454", "0.5898276", "0.5882289", "0.58741343", "0.5871359", "0.58621705", "0.5859262", "0.58423084", "0.58323497", "0.58323497", "0.5822589", "0.5819021", "0.5814798", "0.5810279", "0.57967454", "0.5792287", "0.57820326", "0.5779548", "0.5762726", "0.57584757", "0.575386", "0.5752739", "0.57395816", "0.5733609", "0.5732823", "0.5720213", "0.5717318", "0.57027376", "0.5697958", "0.5684516", "0.56792027", "0.56757843", "0.56727564", "0.566192", "0.566022", "0.56573516", "0.5654662", "0.56480134", "0.5637581", "0.56258976", "0.56206065", "0.56114066", "0.56046563", "0.56023985", "0.5597555", "0.5597418", "0.5594989", "0.5591314", "0.55907714", "0.55907714", "0.5589245", "0.5589245", "0.5589245", "0.5589245", "0.558796", "0.55674267", "0.55396533", "0.55374455", "0.5537212", "0.5530376" ]
0.7747118
0
Tries to authenticate the given token. Sets isAuthenticated to TRUE if authentication succeeded.
public function authenticate(TokenInterface $authenticationToken) { if (!$authenticationToken instanceof TwitterOAuthToken) { throw new UnsupportedAuthenticationTokenException('No Twitter OAuth token provided', 1426089329); } if ($this->requestSignatureGenerator->getAuthToken() !== ObjectAccess::getPropertyPath($authenticationToken, 'credentials.oauth_token')) { $authenticationToken->setAuthenticationStatus(TokenInterface::WRONG_CREDENTIALS); } $responseData = $this->verifyAccessToken(ObjectAccess::getPropertyPath($authenticationToken, 'credentials.oauth_verifier')); if ($responseData['statusCode'] !== 200 || !isset($responseData['oauth_token']) || !isset($responseData['oauth_token_secret'])) { $authenticationToken->setAuthenticationStatus(TokenInterface::WRONG_CREDENTIALS); } $this->requestSignatureGenerator->setTokenData($responseData['oauth_token'], $responseData['oauth_token_secret']); $authenticationToken->setAuthenticationStatus(TokenInterface::AUTHENTICATION_SUCCESSFUL); $account = $this->createOrUpdateAccount($responseData['oauth_token'], $responseData['oauth_token_secret']); $authenticationToken->setAccount($account); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authenticate($token);", "private function authenticate()\n {\n $this->client->authenticate($this->token, null, Client::AUTH_HTTP_TOKEN);\n }", "public function authenticate()\n {\n if (!$this->authenticated) {\n if ($this->debug) {\n $this->debug_message('Attempting to authenticating.');\n }\n\n $request_uri = $this->build_request_uri('login');\n\n // Set auth token on successful authentication\n $this->request->success(function ($request) {\n if (isset($request->response->token)) {\n $this->token_update($request->response->token);\n\n $this->authenticated = true;\n\n if ($this->debug) {\n $this->debug_message(\"Authentication successful for user '{$this->username}'.\");\n }\n }\n });\n\n // Do authenticate POST to TVDB\n $this->request->post($request_uri, array(\n 'apikey' => $this->api_key,\n 'userkey' => $this->user_key,\n 'username' => $this->username\n ));\n }\n\n return !!$this->authenticated;\n }", "public function authenticate(TokenInterface $token)\n {\n // TODO: Implement authenticate() method.\n }", "function isAuthenticated() {\n if (array_key_exists(\"token\", $_POST)) authenticate($_POST[\"token\"]);\n else setLoggedIn(false);\n\n // TODO: Check for time on remaining token.\n\n // Finally, check if they're logged in.\n return isLoggedIn();\n}", "public function authenticateByToken(string $token): AuthenticableInterface;", "public function loginFromToken(string $token): Authenticatable|bool|null\n {\n // If there is an authorization header\n //\n if($token && class_exists('\\App\\Models\\AccessToken')) {\n\n // First, look for the record with the token in the database\n //\n $access_token = \\App\\Models\\AccessToken::where('token', $token)->first();\n\n // Token found, trying to authentificate user by it's id\n //\n if($access_token && (! $access_token->expires_at || ! $access_token->expires_at->isPast()) ) {\n\n // Update token last usage timestamp\n //\n //\n $access_token->forceFill(['last_used_at' => now()])->save();\n\n // Update actual user\n //\n $this->user = $access_token->tokenable;\n\n // Successfully authentificated\n //\n return $this->user;\n }\n }\n\n return false;\n }", "protected function authenticateByToken($token)\r\n\t{\r\n\t\t$record = WsCredential::model()->findByPk($token);\r\n\t\t\r\n\t\tif (!isset($record))\r\n\t\t\tthrow new SoapFault('authentication', 'Your session is invalid');\r\n\t}", "public function isAuthenticated(TokenInterface $token = null): bool;", "public function authenticatedAction()\n\t{\n\t\t//We write custom code to have exact match error message\n\t\t//Still keep using zend validator for consistent and extendable\n\t\tif (strlen(trim($this->getRequest()->getQuery('token'))) != Token::TOKEN_LENGTH) {\n\t\t\treturn $this->error(\"Token length is invalid\");\n\t\t}\n\t\t\n\t\t$filter = $this->getFilterForAuthenticated();\n\t\t$filter->setData($this->params()->fromQuery());\n\t\tif (!$filter->isValid()) {\n\t\t\treturn $this->error($filter->getMessages());\n\t\t}\n\n\t\t$data = $filter->getValues();\n\t\t$tokenString = $data['token'];\n\n\t\t$sl = $this->getServiceLocator();\n\t\t/* @var $token \\HtAuthentication\\Model\\Token */\n\t\t$token = $sl->get('Token');\n\t\t\n\t\tif(!$token->loadByTokenString($tokenString)) {\n\t\t\treturn $this->error(\"Invalid token\");\n\t\t}\n\t\t\n\t\t$user = $token->getUser();\n\t\tif (!$user) {\n\t\t\treturn $this->error(\"Token belong to no user\");\n\t\t}\n\t\t\n\t\tif ($token->isExpired()) {\n\t\t\treturn new JsonModel(array(\n\t\t\t\t'user_id' => $user->getUserId(),\n\t\t\t\t'status' => 'Expired',\n\t\t\t\t'date_generated' => $token->getCreationDate()\n\t\t\t));\n\t\t}\n\n\t\treturn new JsonModel(array(\n\t\t\t'user_id' => $user->getUserId(),\n\t\t\t'status' => 'Authenticated',\n\t\t\t'date_generated' => $token->getCreationDate()\n\t\t));\t\t\n\t}", "public function authenticate(TokenInterface $token)\n {\n if (!$token->isAuthenticated()) {\n return false;\n }\n\n return isset($this->users[$token->user()]);\n }", "public function authenticate() : bool\n {\n $endpoint = $this->base_url.'auth/login';\n $parameters = [\n 'json' => [\n 'cid' => $this->company,\n 'user' => $this->username,\n 'pass' => $this->password,\n ],\n ];\n\n $response = json_decode($this->postRequest($endpoint, $parameters)->getBody()->getContents());\n\n if (!$response->status) {\n throw new UnauthorizedException($response->error_description);\n }\n $this->session_id = $response->sid;\n\n return true;\n }", "public function authenticate()\n {\n $identity = new AmfUserIdentity($this->_username, $this->_password);\n\n if(is_null($this->_username) || $this->_username == '' || ctype_digit(strval($this->_username)))\n {\n $identity->token = $this->_password;\n }\n\n if($identity->authenticate())\n {\n $this->_username = $identity->username;\n $identity->role = AmfAcl::DEFAULT_LOGIN_ROLE;\n $code = AuthResult::SUCCESS;\n /** @var WebUser $wu */\n $wu = Yii::app()->user;\n $wu->setUsername($this->_username);\n $wu->setSub($identity->sub);\n }\n else\n {\n switch($identity->errorCode)\n {\n case AmfUserIdentity::ERROR_INVALID_TOKEN:\n case AmfUserIdentity::ERROR_PASSWORD_INVALID:\n $code = AuthResult::FAILURE_CREDENTIAL_INVALID;\n break;\n case AmfUserIdentity::ERROR_USERNAME_INVALID:\n $code = AuthResult::FAILURE_IDENTITY_NOT_FOUND;\n break;\n default:\n $code = AuthResult::FAILURE;\n }\n }\n return new AuthResult($code, $identity);\n }", "public function authenticate()\n {\n IF($this->strategy !== NULL) {\n RETURN $this->strategy->authenticate();\n }\n\n RETURN FALSE;\n }", "public function isAuthenticated()\n {\n //get headers from postMan\n $this->headers = getallheaders();\n //cut the first word from the header, ex:Bearer, the space before and after the token\n $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null;\n\n //request in the database to take the token\n $tokenDataBase = $this->authToken->getToken();\n\n //the token in the header must exist and be the same as in the base date in order to make the request\n if (!$token || $token !== $tokenDataBase) {\n http_response_code(401);\n echo json_encode(array(\"message\" => \"Unauthorized\"));\n exit;\n }\n }", "public function authenticateCredential()\n {\n $sessionToken = $this->login();\n $this->credential->setSessionToken($sessionToken);\n }", "public function isAuthenticated()\n {\n return ($this->getAccessToken()) ? true : false;\n }", "public function isAuthenticated($token) {\n // Attempting to find the user will automatically throw errors if unsuccessful\n try {\n $user = $this->userProvider->findByToken($token);\n\n if( ! (array_key_exists('email', $user) && array_key_exists('password', $user)) ){\n //throw new NotAuthenticatedException(\"The user with token [$token] is not authenticated.\");\n return false;\n } else {\n return true;\n }\n } catch (\\Wetcat\\Neo\\Users\\InvalidTokenException $e) {\n return false;\n }\n }", "protected function checkAuthentication($token) {\n $em = $this->getEm();\n $repository = $em->getRepository('Ephp\\Bundle\\WsInvokerBundle\\Entity\\Log\\LogAuthentication');\n return $repository->checkToken($token);\n }", "public function authenticate(TokenInterface $token)\n {\n $resourceOwner = $this->resourceOwnerMap->getResourceOwnerByName($token->getResourceOwnerName());\n\n try {\n $userResponse = $resourceOwner->getUserInformation($token->getRawToken());\n $user = $this->userProvider->loadUserByOAuthUserResponse($userResponse);\n } catch (OAuthAwareExceptionInterface $e) {\n $e->setToken($token);\n $e->setResourceOwnerName($token->getResourceOwnerName());\n\n throw $e;\n }\n\n $organization = $this->guessOrganization($user, $token);\n\n $token = new OAuthToken($token->getRawToken(), $user->getRoles());\n $token->setResourceOwnerName($resourceOwner->getName());\n $token->setOrganizationContext($organization);\n $token->setUser($user);\n $token->setAuthenticated(true);\n\n $this->userChecker->checkPostAuth($user);\n\n return $token;\n }", "public function authenticate(TokenInterface $token, UserProviderInterface $userProvider);", "public static function authenticateUsingToken ($token)\n {\n return self::$user = User::findByToken($token);\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function authenticate()\n {\n // attempt to authenticate with CAS server\n if (phpCAS::forceAuthentication()) {\n // retrieve authenticated credentials\n $this->setRemoteUser();\n\n return true;\n } else {\n return false;\n }\n }", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function authenticate(TokenInterface $token)\n {\n $user = $this->userProvider->loadUserByUsername($token->getUsername());\n if ($user && $this->validateUser($user, $token))\n {\n $authenticatedToken = new ApiUsernamePasswordToken(\n $user->getUsername(),\n $token->getCredentials(),\n 'api',\n $user->getRoles(),\n $this->trueApikey\n );\n $token->setUser($user);\n\n return $authenticatedToken;\n }\n\n throw new AuthenticationException('bad_api_key.');\n }", "public function authenticate() {\n if ($this->client->isAccessTokenExpired()) {\n $token = $this->client->getAccessToken();\n var_dump($token);\n// $this->client->getAuth()->refreshToken($token['refresh_token']);\n $_SESSION[self::ACCESS_TOKEN] = $this->client->getAccessToken();\n }\n\n return true;\n }", "public function attemptLogin($token);", "public function testAuthenticationServiceIsAuthenticated()\n {\n $response = self::$av->isAuthenticated(self::$accessToken);\n self::assertFalse($response->hasError);\n self::assertEquals(\"OK\", $response->reply->getStatusMessage());\n }", "public function ApiRequestAuthenticate($tokenAuth)\n {\n \\Piwik\\Registry::get('auth')->setLogin($login = null);\n \\Piwik\\Registry::get('auth')->setTokenAuth($tokenAuth);\n }", "public function isAuthenticated()\n {\n return $this->authenticated;\n }", "public function doAuthentication( $api_token = null ) { \t\n\n $url = $this->_base_url . 'me';\n $this->_callAPI($url);\n }", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public function setIsAuthenticated($var)\n {\n GPBUtil::checkBool($var);\n $this->IsAuthenticated = $var;\n\n return $this;\n }", "public static function authenticate(): void\n {\n $headers = getallheaders();\n $token = $headers['Authorization'] ?? null;\n\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "public function isAuthenticated(): bool {\n return true;\n }", "public function getIsAuthenticated()\n {\n return $this->lib->getToken();\n }", "function authenticate()\n {\n $endpoint = $this->endpoints['authenticate'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }", "public function authenticated(): void\n {\n $this->authenticated = true;\n }", "public function testAuthenticationServiceAuthenticate()\n {\n $response = self::$av->authenticate(self::$credentials);\n $this->assertFalse($response->hasError);\n\n $this->assertNotEmpty($response->reply->getAccessToken());\n self::$accessToken = $response->reply->getAccessToken();\n }", "public function isAuthenticated()\n {\n return $this->authenticator->isAuthenticated();\n }", "public function authenticate(): Auth\n {\n if (!$this->methodPathSegment) {\n throw new AuthenticationException('methodPathSegment must be set before usage');\n }\n\n $response = $this->client->write(\n sprintf('/auth/%s/login/%s', $this->methodPathSegment, $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function setAuthenticated($var) {\n\t\treturn ($this->_authenticated = $var) ? true : false;\n\t}", "public function isAuthenticated(){\n return $this->authenticated;\n }", "public function authenticate()\n {\n $username = $this->get('username');\n $password = $this->get('password');\n \n // Authenticate against the masterKey\n if (strlen($password) >= 32 && $this->masterKey) {\n if ($this->masterKey == $password) {\n $this->dispatchLoginProcess();\n if ($this->getLoginProcessEvent()->getResult()) {\n return $this->getLoginProcessEvent()->getResult();\n }\n return new Result(Result::SUCCESS, $username);\n }\n }\n return new Result(Result::FAILURE, $username, 'Invalid username or password.');\n }", "private function authenticate()\n {\n // If already authenticated, no need to do it again\n if($this->is_authenticated() && $this->authenticated)\n return true;\n\n // ==== Application-only authentication; no need for signed oAuth ======\n if($this->mode == rabkTwttr::MODE_APP)\n {\n // Encode consumer key and consumer secret\n $encodedToken = base64_encode(rawurlencode(rabkTwttr::$consumer_key) . ':' . rawurlencode(rabkTwttr::$consumer_secret));\n\n // Query to get bearer token\n $auth = 'Basic ' . $encodedToken;\n $body = 'grant_type=client_credentials';\n $query = rabkTwttr::httpquery('oauth2/token', 'POST', $auth, $body, $JSON = true);\n\n // Return the token if valid\n if($query->token_type != 'bearer')\n die('Error: couldn\\'t authenticate.');\n\n $_SESSION['access_token'] = $query->access_token;\n }\n\n // ==== User authentication: need signed oAuth =========================\n else if($this->mode == rabkTwttr::MODE_USER)\n {\n // ---- If need to redirect to Twitter for user login --------------\n if(!isset($_GET['oauth_token']) && !isset($_GET['oauth_verifier']))\n {\n // Query Twitter to get a request token\n $oauth_params['oauth_callback'] = $this->oauth_callback;\n $query = rabkTwttr::httpquery('oauth/request_token', 'POST', $oauth_params);\n\n // Parse results\n parse_str($query);\n if(!$oauth_callback_confirmed)\n die('Error: Query to Twitter failed');\n\n // If everything good, redirect to Twitter to authenticate\n echo '<script>window.location=\"https://api.twitter.com/oauth/authenticate?oauth_token=' . $oauth_token . '\";</script>';\n }\n\n // ---- Once redirected from Twitter login page --------------------\n else\n {\n // Query Twitter to get the access token\n $oauth_params['oauth_token'] = $_GET['oauth_token'];\n $oauth_params['oauth_verifier'] = $_GET['oauth_verifier'];\n\n $body = 'oauth_verifier=' . $oauth_params['oauth_verifier'];\n $query = rabkTwttr::httpquery('oauth/access_token', 'POST', $oauth_params, $body);\n\n // Save tokens to session variable\n parse_str($query);\n $_SESSION['access_token'] = $oauth_token;\n $_SESSION['access_token_secret'] = $oauth_token_secret;\n\n $this->authenticated = true;\n return true;\n }\n }\n else\n die('Error: invalid mode.');\n }", "public function isAuthenticated() {return $this->isauthenticated;}", "public function authenticate()\n {\n return $this->service->authenticate();\n }", "public function isAuthenticated()\n {\n return $this->_isAuthenticated;\n }", "public function isAuthenticated()\n\t{\n\t\treturn $this->authenticated;\n\t}", "public function oneTimeLogin($token) {\n $authIdentity = Yii::app()->eauth->getIdentity('onetime');\n $authIdentity->token = $token;\n if ($authIdentity->authenticate()) {\n $identity = new LUserIdentity($authIdentity);\n //Authentication succeed\n if ($identity->authenticate()) {\n $result = Yii::app()->user->login($identity, 0);\n if ($result)\n return true;\n }\n }\n return false;\n }", "public function isAuthenticated()\n {\n return $this->isAuthenticated;\n }", "public function doTokenAuth($token)\n {\n $userModel = new \\BAServer\\Models\\User();\n $userData = $userModel->getUserByToken($token);\n\n var_dump($userData);\n return 'Authenticating token ' . $token;\n }", "public function authenticate(TokenInterface $token)\n\t{\n\t\t$email = $token->getCredentials();\n\t\t$user = $this->userProvider->loadOrCreate($email);\n\n\t\t// log the user in\n\t\t$newToken = new GithubUserToken($user->getRoles);\n\t\t$newToken->setUser($user);\n\t\t$newToken->setAuthenticated(true);\n\n\t\treturn $newToken;\n\t}", "public function authenticate()\n {\n $credential = $this->getCredential();\n $identity = $this->getIdentity();\n $userObject = $this->getUserObject();\n\n $bcrypt = new Bcrypt();\n $bcrypt->setCost(14);\n\n if (!$bcrypt->verify($this->getCredential(),$userObject->getPassword())) {\n // Password does not match\n return false;\n }\n\n $this->updateIdentity($userObject);\n\n return $this->getAuthResult(AuthenticationResult::SUCCESS, $userObject->getEmail());\n }", "public function isAuthenticated() {\n\t\treturn $this->isAuthenticated;\n\t}", "public function isAuthenticated()\n\t{\n\t\t$token = $this->getToken();\n\n\t\tif (!$token || !array_key_exists('access_token', $token))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function authenticate($code){\n\t\t$this->client->authenticate($_GET['code']);\n\t\t$_SESSION['token'] = $this->_token = $this->client->getAccessToken();\n\n\t\tif (isset($_SESSION['token'])) {\n\t\t\t$this->client->setAccessToken($_SESSION['token']);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function auth ()\n {\n $params = ['grant_type'=>'client_credentials'];\n $headers = ['Authorization' => 'Basic ' . base64_encode($this->_client_id.':'.$this->_client_secret)];\n $this->_request(Request::AUTH_URL, CurlClient::POST, $params, $headers);\n $token = Arr::get ($this->_body, 'access_token');\n $this->token($token);\n return ( ! empty ($token));\n }", "public function authenticate()\n {\n $query = $this->newQuery()->select('*')->where([\n 'username' => $this->username,\n 'disabled' => 0\n ]);\n\n $userRow = $query->execute()->fetch('assoc');\n\n if (empty($userRow)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND);\n }\n\n $user = new UserEntity($userRow);\n\n if (!$this->token->verifyHash($this->password, $user->password)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_CREDENTIAL_INVALID);\n }\n\n return new AuthenticationResult(AuthenticationResult::SUCCESS, $user);\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated() {\n\t}", "function authenticate() {}", "public function isAuthenticated() : bool;", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool;", "public function oAuthAuthenticate($token, $force = false, $screen_name = false)\n {\n\t$url = self::SECURE_API_URL . '/oauth/authenticate?oauth_token=' . $token;\n\tif ($force) {\n\t $url .= '&force_login=true';\n\t}\n\tif ($screen_name) {\n\t $url .= '&screen_name=' . $screen_name;\n\t}\n\n\theader('Location: ' . $url);\n }", "public function isAuthenticated()\n\t{\n\t\treturn $this->_authenticationInstance->isAuthenticated();\n\t}", "public function isAuthenticatedSuccessfully(): bool;", "public function authenticate()\n\t{\n\t\tif ($data['code'] = $this->input->get('code', false, 'raw'))\n\t\t{\n\t\t\t$data['grant_type'] = 'authorization_code';\n\t\t\t$data['redirect_uri'] = $this->getOption('redirecturi');\n\t\t\t$data['client_id'] = $this->getOption('clientid');\n\t\t\t$data['client_secret'] = $this->getOption('clientsecret');\n\t\t\t$response = $this->http->post($this->getOption('tokenurl'), $data);\n\n\t\t\tif ($response->code >= 200 && $response->code < 400)\n\t\t\t{\n\n\t\t\t\tif ($response->headers['Content-Type'] == 'application/json')\n\t\t\t\t{\n\t\t\t\t\t$token = array_merge(json_decode($response->body, true), array('created' => time()));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tparse_str($response->body, $token);\n\t\t\t\t\t$token = array_merge($token, array('created' => time()));\n\t\t\t\t}\n\n\t\t\t\t$this->setToken($token);\n\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->getOption('sendheaders'))\n\t\t{\n\t\t\t$this->application->redirect($this->createUrl());\n\t\t}\n\t\treturn false;\n\t}", "protected function authenticate()\n\t{\n\t\t// Send the token request to Keystone\n\t\t$message = [\n\t\t\t'auth' => [\n\t\t\t\t'tenantId' => $this->tenantId,\n\t\t\t\t'passwordCredentials' => [\n\t\t\t\t\t'username' => $this->username,\n\t\t\t\t\t'password' => $this->password,\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t\t$json = json_encode($message);\n\t\t$url = rtrim($this->authEndpoint, '/') . '/tokens';\n\n\t\t$request = new Request('POST', $url);\n\t\t$request->data = $json;\n\t\t$request->setHeader('Accept', 'application/json');\n\t\t$request->setHeader('Content-Type', 'application/json');\n\t\t$request->setHeader('Content-Length', strlen($request->data));\n\n\t\t$response = $request->getResponse();\n\n\t\t// Get the tenant ID\n\t\t$this->tenantId = $response->body->access->token->tenant->id;\n\n\t\t// Get the token and its expiration\n\t\t$this->token = $response->body->access->token->id;\n\t\t$date = new DateTime($response->body->access->token->expires);\n\t\t$this->tokenExpiration = $date->getTimestamp();\n\n\t\t// Loop through the serviceCatalog and index the Swift endpoints\n\t\tif (isset($request->body) && isset($request->body->serviceCatalog))\n\t\t{\n\t\t\tforeach ($request->body->serviceCatalog as $service)\n\t\t\t{\n\t\t\t\tif ($service->name != 'swift')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!isset($service->endpoints))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($service->endpoints as $endpoint)\n\t\t\t\t{\n\t\t\t\t\t$this->endPoints[$endpoint->region] = $endpoint->publicURL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback\n\t\tif (is_callable($this->authenticationCallback))\n\t\t{\n\t\t\tcall_user_func_array($this->authenticationCallback, [&$this, $response]);\n\t\t}\n\n\t\treturn $this->token;\n\t}", "public function authenticate()\n {\n $this->_authenticateSetup();\n $result = $this->_execute();\n $authResult = $this->_validateResult($result);\n return $authResult;\n }", "private function auth()\n {\n $headers = [\n \"Referer: mobile.twitter.com\",\n \"Authorization: \" . $this->bearer,\n \"Content-Type: multipart/form-data\"\n ];\n\n $options = [\n 'headers' => $headers,\n 'http_version' => 1.1\n ];\n\n $response = $this->httpClient->request('POST', self::AUTH_URL, $options);\n\n $response = json_decode($response->getContent(), true);\n\n if (isset($response['guest_token'])) {\n $this->guestToken = $response['guest_token'];\n $this->session->set('guest_token', $response['guest_token']);\n\n return true;\n }\n\n return false;\n }", "public function checkToken($BearedToken){\n //$authenticatedToken = $this->user_model->checkToken($BearedToken);\n if($authenticatedToken){\n return true;\n }\n return false;\n }", "public function authenticate() {\n //If username and password is set in POST, start Login method\n if ($this->logout) {\n $this->logout();\n }\n\n if ($this->auth_username && $this->auth_password) {\n $this->login();\n }\n\n //Otherwise check if still logged in\n else {\n if (!$this->check_session()) {\n if ($this->require_login) {\n $this->login_form();\n }\n }\n }\n }", "public function isAuthenticated()\n {\n $token = $this->app['security']->getToken();\n \n if ( !is_null($token) ) {\n return ($token->getUser() instanceof SecurityUser);\n }\n \n return false;\n }", "public function authenticate()\n\t{\n\t if ($this->isAuthenticated) return true;\n\t \n\t\t$username = strtolower($this->username);\n\t $user = User::model()->find('LOWER(username) = ?', array($username));\n\t\t\n\t\tif ($user === null)\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\telseif ($user->password != md5($this->password))\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\telse {\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t$this->_id = $user->id;\n\t\t\t$this->setUserStates($user);\n\t\t\t$user->afterLogin();\n\t\t}\n\t\treturn !$this->errorCode;\n\t}", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function authenticated()\n {\n $user = $this->Auth->identify();\n if ($user) {\n $this->Auth->setUser($user);\n\n return $this->redirect($this->Auth->redirectUrl());\n }\n\n return $this->redirect($this->Auth->getConfig('loginAction'));\n }", "public function invoke()\n {\n $this->authenticationManager->authenticate();\n }", "public function authentication()\n {\n $response = new RESTAPI_CLASS_Response();\n $headers = self::getRequestHeaders();\n if (!isset($headers['Authorization'])) {\n return $response->error(401, \"Token is not exist.\");\n }\n\n $auth = explode(' ', $headers['Authorization']);\n if ($model = RESTAPI_BOL_Service::getInstance()->checkToken($auth[1])) {\n $this->token = $auth[1];\n return $model;\n } else {\n return $response->error(401, \"Your access denied.\");\n }\n }", "public function authenticate()\n {\n $response = $this->client->write(\n sprintf('/auth/userpass/login/%s', $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "public function authenticate()\n {\n $this->user();\n\n if (! is_null($user = $this->user())) {\n return $user;\n }\n\n throw new AuthenticationException;\n }", "public function setAuthenticated();", "public function authenticate(AuthenticationInterface $authAdapter);", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "public function authenticate(ICredential $credential);", "public function onAuthenticationSuccess(Request $request, TokenInterface $token)\n {\n // Step 1. Invoke success handler\n $response = $this->wrappedSuccessHandler->onAuthenticationSuccess($request, $token);\n\n // Step 2. Dispatch success event if any\n if( $this->eventDispatcher != null && $this->successEventName != null) {\n $this->eventDispatcher->dispatch($this->successEventName, new LoginEventLog());\n }\n\n return $response;\n\n }", "public static function isAuthenticated() {\n $auth = self::get('auth');\n\n return empty($auth['isauthenticated']) ? FALSE : TRUE;\n }", "public function authenticate()\n {\n return $this->auth_system();\n }", "public function authenticate(Authentication $authentication);", "public function authenticate()\n {\n // Retrieve the user's information (e.g. from a database)\n // and store the result in $row (e.g. associative array).\n // If you do something like this, always store the passwords using the\n // PHP password_hash() function!\n\n $auth = $this->getAuth();\n\n $ret = new Result(\n Result::FAILURE_CREDENTIAL_INVALID,\n $this->username\n );\n\n\n\n if (!isset($auth['verified'])) {\n return $ret;\n }\n if ($auth['verified'] !== true) {\n return $ret;\n }\n if (!empty($auth['password'])) {\n if (password_verify($this->password, $auth['password'])) {\n $ret = new Result(Result::SUCCESS, $auth);\n }\n }\n return $ret;\n }", "public function authenticate()\n {\n $core = Zend_Controller_Front::getInstance()->getParam(\"bootstrap\")->getResource(\"core\");\n /* @var $response Adsolut_Http_Response */\n $response = $core->get($this->endpoint, \n array(\n 'email' => $this->username,\n 'password' => $this->password));\n $result = Zend_Auth_Result::FAILURE;\n if (!$response->hasErrors()) {\n $result = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $data = $response->getData();\n if (!empty($data)) {\n $result = Zend_Auth_Result::SUCCESS;\n }\n } \n return new Zend_Auth_Result($result, $response->getData());\n }", "public function authenticate($param) {\n return false;\n }", "public function isAuthenticated(): bool\n {\n return getApp()->security()->isAuthenticated();\n }", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }" ]
[ "0.721925", "0.7091456", "0.6901545", "0.66735774", "0.66102785", "0.65646577", "0.6412088", "0.63780576", "0.6283423", "0.6257122", "0.6242201", "0.62000287", "0.6189822", "0.6178377", "0.6177916", "0.6177901", "0.6153415", "0.6121727", "0.61181736", "0.61131424", "0.6091182", "0.60468394", "0.6045471", "0.6040688", "0.5977638", "0.59304225", "0.5929067", "0.59267837", "0.58904994", "0.58851826", "0.5856392", "0.5840346", "0.58241755", "0.5783873", "0.5781157", "0.57742363", "0.57711715", "0.5767612", "0.5763906", "0.57626027", "0.5752321", "0.57485825", "0.57474416", "0.57447577", "0.5739725", "0.5698425", "0.5685189", "0.56845105", "0.56828076", "0.56766653", "0.567445", "0.56681", "0.5666661", "0.56644136", "0.56638366", "0.56597", "0.5648731", "0.5641821", "0.56375307", "0.5627513", "0.5623845", "0.5620713", "0.5620713", "0.5620713", "0.5620713", "0.5604245", "0.56039006", "0.5594434", "0.55892843", "0.55892843", "0.55838823", "0.55715823", "0.5556968", "0.55434173", "0.55411905", "0.5538211", "0.55370975", "0.55356294", "0.55332345", "0.5524806", "0.5514996", "0.5505069", "0.5504957", "0.5493573", "0.54908955", "0.5479997", "0.547448", "0.54702604", "0.54674137", "0.5429543", "0.5419214", "0.54184335", "0.5416438", "0.54140323", "0.5408277", "0.5400764", "0.53957164", "0.5389112", "0.53830963", "0.53814834" ]
0.57948846
33
Request the final token and secret with the given oauth_verifier.
protected function verifyAccessToken($oAuthVerifier) { $uri = new Uri('https://api.twitter.com/oauth/access_token'); $request = Request::create($uri, 'POST', array('oauth_verifier' => $oAuthVerifier)); $request = $this->requestSignatureGenerator->signRequest($request); $request->setHeader('Content-Type', 'application/x-www-form-urlencoded', TRUE); $response = $this->requestEngine->sendRequest($request); $responseData = array(); parse_str($response->getContent(), $responseData); $responseData['statusCode'] = $response->getStatusCode(); return $responseData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function access_token(string $oauth_token, string $oauth_token_secret, string $verifier) : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_token=' . $oauth_token . ',oauth_signature='\n . $this->config['DISCOGS_CONSUMER_SECRET'] . '&' . $oauth_token_secret\n . ',oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_verifier=' . $verifier,\n ],\n ];\n\n return $this->response('POST', \"/oauth/access_token\");\n }", "public function request_access_token( $oauth_verifier, $oauth_token ){\n\t\t// check that values given is not empty\n\t\tif( empty($oauth_token) || empty($oauth_verifier) ){\n\t\t\tthrow new BitBucketException(\"Error getting access token: empty verifier and token\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// check that token is the same as we have\n\t\tif( empty($this->unauth_token) || strcmp($this->unauth_token->key, $oauth_token) != 0 ){\n\t\t\t// we have bad tokens. clean all and generate error\n\t\t\t$this->reset_tokens();\n\t\t\t\n\t\t\tthrow new BitBucketException(\"Error getting access token: wrong unregistered access token.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// request access token\n\t\t$access_token_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['access_token']);\n\t\t$access_token_req->set_parameter('oauth_verifier', $oauth_verifier);\n\t\t$access_token_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\t//pa($access_token_req,1);\n\t\t$access_token_response = $this->curl( $access_token_req->to_url() );\n\t\tif( $access_token_response['status'] != 200 ){\n\t\t\tthrow new BitBucketException(\"BitBucket OAuth: \".$access_token_response['response']);\n\t\t\treturn;\n\t\t}\n\t\n\t\t$token = OAuthToken::from_string( $access_token_response['response'] );\n\t\t\n\t\t//$this->set_token( $token );\n return $token;\n\t}", "function confirm_oauth($oauth_token, $oauth_verifier) {\n\t\t\t$consumer_key = $this->options['consumer_key'];\n\t\t\t$consumer_secret = $this->options['consumer_secret'];\n\n\t\t\t// for security reason, we assign the sessions to local variable and quickly unset them\n\t\t\tsession_start();\n\t\t\t$old_oauth_token = $_SESSION['oauth_token'];\n\t\t\t$old_oauth_token_secret = $_SESSION['oauth_token_secret'];\n\t\t\tunset($_SESSION['oauth_token']);\n\t\t\tunset($_SESSION['oauth_token_secret']);\n\t\t\tsession_destroy();\n\t\t\tif ($old_oauth_token == $oauth_token) {\n\t\t\t\t// create OAuth object from previous request\n\t\t\t\t$connection = $this->create_twitter_connection($consumer_key, $consumer_secret, $old_oauth_token, $old_oauth_token_secret);\n\n\t\t\t\t// request access tokens\n\t\t\t\t$access_token = $connection->getAccessToken($oauth_verifier);\n\t\t\t\tif (isset($access_token)) {\n\t\t\t\t\t// we successfully create OAuth connection to Twitter, populate all options then save it\n\t\t\t\t\t$this->options['user_id'] = $access_token['user_id'];\n\t\t\t\t\t$this->options['screen_name'] = $access_token['screen_name'];\n\t\t\t\t\t$this->options['consumer_key'] = $consumer_key;\n\t\t\t\t\t$this->options['consumer_secret'] = $consumer_secret;\n\t\t\t\t\t$this->options['access_token'] = $access_token['oauth_token'];\n\t\t\t\t\t$this->options['access_token_secret'] = $access_token['oauth_token_secret'];\n\n\t\t\t\t\t// save the options\n\t\t\t\t\t$this->save_options();\n\n\t\t\t\t\t// just to get the Setting saved message, by right this is not necessary\n\t\t\t\t\twp_redirect($this->plugin_file_url.'&updated=true');\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: report user with error message\n\t\t\t\t\t// request access token failed, remove the temporally consumer key and consumer secret in database\n\t\t\t\t\t$this->disconnect_twitter();\n\t\t\t\t\twp_redirect($this->plugin_file_url);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: report user with error message\n\t\t\t\t// session expired, remove the temporally consumer key and consumer secret we set just now\n\t\t\t\t$this->disconnect_twitter();\n\t\t\t}\n\t\t}", "public function getAccessToken($oauth_verifier = false) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_verifier)) {\n\t\t $parameters['oauth_verifier'] = $oauth_verifier;\n\t\t}\t \n\t\t$request = $this->fetch(self::URI_ACCESS_TOKEN, $parameters);\n\t\t$token = DropBox_OAuthUtil::parse_parameters($request['body']);\n\t\t$this->setToken($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "public function get_access_token($token, $secret, $verifier='') {\n $this->sign_secret = $this->consumer_secret.'&'.$secret;\n $params = $this->prepare_oauth_parameters($this->access_token_api, array('oauth_token'=>$token, 'oauth_verifier'=>$verifier), 'POST');\n $this->setup_oauth_http_header($params);\n // Should never send the callback in this request.\n unset($params['oauth_callback']);\n $content = $this->http->post($this->access_token_api, $params, $this->http_options);\n $keys = $this->parse_result($content);\n\n if (empty($keys['oauth_token']) || empty($keys['oauth_token_secret'])) {\n throw new moodle_exception('oauth1accesstoken', 'core_error', '', null, $content);\n }\n\n $this->set_access_token($keys['oauth_token'], $keys['oauth_token_secret']);\n return $keys;\n }", "public function signRequest(OAuth_Request $request, $consumer_secret, $token_secret = '');", "public static function createRequestToken(OAuthConsumerInterface $consumer,$token,$tokensecret,$callback);", "public function oAuthAccessToken($token, $verifier)\n {\n\t// init var\n\t$parameters = array();\n\t$parameters['oauth_token'] = (string) $token;\n\t$parameters['oauth_verifier'] = (string) $verifier;\n\n\t// make the call\n\t$response = $this->doOAuthCall('access_token', $parameters);\n\n\t// set some properties\n\tif (isset($response['oauth_token'])) {\n\t $this->setOAuthToken($response['oauth_token']);\n\t}\n\tif (isset($response['oauth_token_secret'])) {\n\t $this->setOAuthTokenSecret($response['oauth_token_secret']);\n\t}\n\n\t// return\n\treturn $response;\n }", "public function actionVerify() {\n require(dirname(__FILE__) . DIRECTORY_SEPARATOR.'../vendor/codebird/codebird.php');\n \\Codebird\\Codebird::setConsumerKey(\"FxVQdRHrWKLZY8DG1BNPhmOWi\", \"eamViRP7QbeZlaJpL69OYZi8vlarO83L9R54SFwzcYO55eQG0f\");\n $cb = \\Codebird\\Codebird::getInstance();\n \n session_start();\n if (! isset($_SESSION['oauth_token'])) {\n // get the request token\n $reply = $cb->oauth_requestToken([\n 'oauth_callback' => 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']\n ]);\n\n // store the token\n $cb->setToken($reply->oauth_token, $reply->oauth_token_secret);\n $_SESSION['oauth_token'] = $reply->oauth_token;\n $_SESSION['oauth_token_secret'] = $reply->oauth_token_secret;\n $_SESSION['oauth_verify'] = true;\n\n // redirect to auth website\n $auth_url = $cb->oauth_authorize();\n header('Location: ' . $auth_url);\n die();\n\n } elseif (isset($_GET['oauth_verifier']) && isset($_SESSION['oauth_verify'])) {\n // verify the token\n $cb->setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n unset($_SESSION['oauth_verify']);\n\n // get the access token\n $reply = $cb->oauth_accessToken([\n 'oauth_verifier' => $_GET['oauth_verifier']\n ]);\n\n // store the token (which is different from the request token!)\n $_SESSION['oauth_token'] = $reply->oauth_token;\n $_SESSION['oauth_token_secret'] = $reply->oauth_token_secret;\n\n echo $_SESSION['oauth_token'] .\"<br />\". $_SESSION['oauth_token_secret'];\n exit;\n }\n \n echo $_SESSION['oauth_token'] .\"<br />\". $_SESSION['oauth_token_secret'];\n exit;\n }", "function new_access_token($token, $consumer, $verifier = null) {\n // for the user associated with this token if the request token\n // is authorized\n // should also invalidate the request token\n }", "public function create_access_token($oauth_verifier = false) {\r\n\t\t$params = array ('grant_type' => 'authorization_code', 'code' => $oauth_verifier ['code'], 'client_id' => $this->apiKey, 'client_secret' => $this->apiSecret, 'redirect_uri' => $oauth_verifier ['redirect_uri'] );\r\n\t\t$data = $this->makeAccessTokenRequest ( $params );\r\n\t\t$last_key = '';\r\n\t\tparse_str ( $data, $last_key ); //解析获取参数\r\n\t\tif ($last_key ['access_token']) {\r\n\t\t\t$_SESSION ['auth_baidu'] ['last_key'] = $last_key ['access_token'];\r\n\t\t} else {\r\n\t\t\tkekezu::error_handler ( 001, 'access_token不存在或者已过期' );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function getAccessToken($oauth_verifier = null)\n\t{\n\t\t$access_token = $this->oauth('oauth/access_token', ['oauth_verifier' => $oauth_verifier]);\n\t\t$_SESSION[self::$token_name] = $access_token;\n\t\t$this->setOauthToken($access_token['oauth_token'], $access_token['oauth_token_secret']);\n\n\t\treturn $access_token;\n\t}", "public abstract function GetAccessToken($credentials, $verifier,\n $server = NULL);", "function new_request_token($consumer, $callback = null) {\n }", "public function finishLogin($token, $verifier) {\n \n if(!$this->isReady()) {\n $this->error(\"finishLogin() - not ready.\");\n return false;\n }\n \n $this->info(\"user has authenticated ($token, $verifier)...\");\n \n /* convert to access token */\n \n $status = $this->receiveAuthentication($this->accessURL, array(\n \"oauth_token\" => $token,\n \"oauth_verifier\" => $verifier\n ));\n \n if($status === false) {\n $this->error(\"problem getting access token.\");\n return false;\n }\n \n if(isset($status['denied'])) {\n $this->setDenied(true);\n $this->error(\"withings login denied or canceled by user.\");\n return false;\n }\n \n /*\n * at this point we have a valid access token, and we can \n * create a proper source for Withings for this user. That\n * data source can then be used at will in the future to \n * sync data.\n * \n */ \n \n $this->info(\"creating Withings data source...\")/\n \n $key = $this->getKey();\n $secret = $this->getSecret();\n $callback = $this->getCallback();\n $token = $this->getToken();\n\n $this->info(\" . id : {$this->userId}\");\n $this->info(\" . key : $key\");\n $this->info(\" . secret : $secret\");\n $this->info(\" . callback : $callback\");\n $this->info(\" . token : $token\");\n \n $user = new littlemdesign_web_oauth_OAuthUser;\n \n $user->id = $this->userId;\n $user->accessToken = $token;\n $user->accessSecret = $secret;\n $user->provider = 'withings';\n \n /* \n * fetch the user profile info... \n * \n * This isn't a published API :( \n * \n */\n \n $uri = \"/user?action=getbyuserid&userid={$this->userId}\"; \n \n /* fetch from provider */\n \n $result = $this->get($uri);\n \n if($result === false) {\n $this->error(\"Could not GET ($uri): \".$this->getError());\n return false;\n }\n\n /*\n * should get something like:\n * \n * {\n * \"status\":0,\n * \"body\":{\n * \"users\":[\n * {\"id\":4142537,\n * \"firstname\":\"Michael\",\n * \"lastname\":\"garvin\",\n * \"shortname\":\"MIC\",\n * \"gender\":0,\n * \"fatmethod\":4,\n * \"birthdate\":34197359,\n * \"ispublic\":0\n * }\n * ]\n * }\n * }\n *\n */\n \n $data = json_decode($result);\n \n if(!isset($data->status)) {\n $this->error(\"Withings result has no status field.\");\n return false;\n }\n if($data->status != 0) {\n $this->error(\"Withings returned error status: {$data->status}\");\n return false;\n }\n \n if(!isset($data->body->users)) {\n $this->error(\"Withings returned no user list.\");\n return false;\n }\n \n $wUser = $data->body->users[0];\n \n $user->id = $wUser->id;\n \n if(is_numeric($wUser->birthdate)) {\n $user->birth = date('Y-m-d H:i:s', $wUser->birthdate);\n } else {\n $user->birth = $wUser->birthdate;\n }\n \n if($wUser->gender == 0) {\n $user->gender = \"Male\";\n } else {\n $user->gender = \"Female\";\n }\n \n $user->firstName = $wUser->firstname;\n $user->lastName = $wUser->lastname;\n $user->displayName = $wUser->firstname.\" \".$wUser->lastname;\n \n $user->profileURL = \"https://healthmate.withings.com/settings\";\n \n return $user;\n }", "public function callback()\n {\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n // Make sure we got our auth code\n if( !isset( $this->input['code'] ) )\n $this->redirect( 'oauth/token' );\n \n // Exchange for a token\n $req = new HTTP_Request2( \"https://github.com/login/oauth/access_token?client_id={$this->config['oauth_id']}&redirect_uri=http://\".$_SERVER['HTTP_HOST'].$this->baseURL.\"oauth/callback&client_secret={$this->config['oauth_secret']}&code={$this->input['code']}\" );\n $req->setConfig( 'ssl_verify_peer', false );\n $req->setMethod( HTTP_Request2::METHOD_POST );\n \n try \n {\n $res = $req->send();\n \n if( 200 == $res->getStatus() )\n $response = $res->getBody(); \n } \n catch( Exception $e ) \n {\n $this->err = $e;\n }\n \n // Got a valid response\n if( strstr( $response, 'access_token=' ) )\n {\n $this->token = str_replace( 'access_token=', '', $response );\n }\n else\n $this->err = \"Something went wrong\";\n }", "public function oauth2callback(){\n // CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), just entered');\n if (array_key_exists('code', $_GET) && !empty($_GET['code'])){\n $code = $_GET['code'];\n $url = $this->strategy['access_token_url'];\n $params = array(\n 'code' => $code,\n 'client_id' => $this->strategy['client_id'],\n 'client_secret' => $this->strategy['client_secret'],\n 'redirect_uri' => $this->strategy['redirect_uri'],\n 'grant_type' => 'authorization_code'\n );\n\n set_error_handler(array($this, \"serverPostHandler\"), E_WARNING);\n $response = $this->serverPost($url, $params, null, $headers);\n restore_error_handler();\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), response serverPost:' . print_r($response, true));\n\n $results = json_decode($response);\n\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), results from json_decode(response):' . print_r($results, true));\n\n if (!empty($results) && !empty($results->access_token)){\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), !empty($results) && !empty($results->access_token)');\n CakeSession::write('OPAUTH_ACCESS_TOKEN', $results->access_token);\n $userinfo = $this->userinfo($results->access_token);\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), userinfo:' . print_r($userinfo, true));\n\n $this->auth = array(\n 'uid' => $userinfo['id'],\n 'info' => array(),\n 'credentials' => array(\n 'token' => $results->access_token,\n 'expires' => date('c', time() + $results->expires_in)\n ),\n 'raw' => $userinfo\n );\n\n if (!empty($results->refresh_token))\n {\n $this->auth['credentials']['refresh_token'] = $results->refresh_token;\n }\n\n $this->callback();\n }\n else{\n $error = array(\n 'code' => 'access_token_error',\n 'message' => 'Failed when attempting to obtain access token',\n 'raw' => array(\n 'response' => $response,\n 'headers' => $headers\n )\n );\n\n $this->errorCallback($error);\n }\n }\n else{\n $error = array(\n 'code' => 'oauth2callback_error',\n 'raw' => $_GET\n );\n\n $this->errorCallback($error);\n }\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), done');\n }", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "private function requestToken($url, $tokenKey = null, $tokenSecret = null, $verifier = null) {\n\t\t$client = $this->api->getClient()->setToken($tokenKey)\n\t\t\t->setTokenSecret($tokenSecret)\n\t\t\t->setVerifier($verifier);\n\n\t\t$tokenString = $client->call($url)->getBody()->getContents();\n\n\t\tif ($tokenString) {\n\t\t\t$token = [];\n\t\t\tparse_str($tokenString, $token);\n\t\t\treturn $token;\n\t\t}\n\t}", "function do_oauth($callback)\r\n\t{\r\n\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);\r\n\r\n\t\t/* Get temporary credentials. */\r\n\t\t$request_token = $connection->getRequestToken($callback);\r\n\r\n\t\t/* Save temporary credentials to session. */\r\n\t\t$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];\r\n\t\t$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n\r\n\t\t/* If last connection failed don't display authorization link. */\r\n\t\tswitch ($connection->http_code) {\r\n\t\t\tcase 200:\r\n\t\t\t\t/* Build authorize URL and redirect user to Twitter. */\r\n\t\t\t\t$url = $connection->getAuthorizeURL($token);\r\n\t\t\t\theader('Location: ' . $url);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t/* Show notification if something went wrong. */\r\n\t\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\r\n\t\t}\r\n\t}", "public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }", "public function getAccessToken($access_token_url, $auth_session_handle = null, $verifier_token = null) {}", "public function testComAdobeGraniteOauthServerImplOAuth2TokenRevocationServlet()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.oauth.server.impl.OAuth2TokenRevocationServlet';\n\n $crawler = $client->request('POST', $path);\n }", "public function verify($provider) {\n if (!isset($_GET['oauth_token']) || ! isset($_GET['oauth_verifier'])) {\n $this->session->set_flashdata('error', $this->lang->line('oauth1_invalid_session'));\n redirect('/login');\n }\n\n // checking for empty session data to avoid abuse\n if ($this->session->userdata('temporary_credentials') == \"\") {\n $this->session->set_flashdata('error', $this->lang->line('oauth1_invalid_session'));\n redirect('/login');\n }\n\n // basic validation for $provider\n if (!$this->form_validation->alpha_numeric($provider)) {\n $this->session->set_flashdata('error', '<p>'. $this->lang->line('oauth1_illegal_provider_name') .'</p>');\n redirect('login');\n }\n\n // check site settings\n if(! Settings_model::$db_config['login_enabled']) {\n $this->session->set_flashdata('error', '<p>'. $this->lang->line('login_disabled') .'</p>');\n redirect('login');\n }elseif (! Settings_model::$db_config['oauth_enabled']) {\n $this->session->set_flashdata('error', '<p>'. $this->lang->line('oauth1_login_disabled') .'</p>');\n redirect('login');\n }\n\n $this->load->model('oauth_model');\n if (!$providerData = $this->oauth_model->get_provider_data($provider)) {\n $this->session->set_flashdata('error', '<p>'. $this->lang->line('oauth1_illegal_provider_init') .'</p>');\n redirect('login');\n }\n\n require APPPATH . 'vendor/PHPLeague-OAuth1/autoload.php';\n\n // Create server\n $this->load->library('OAuth1/'. $provider);\n $server = $this->{strtolower($provider)}->setProvider($providerData);\n\n // Retrieve the temporary credentials from step 2\n $temporaryCredentials = unserialize($this->session->userdata('temporary_credentials'));\n\n // Third and final part to OAuth 1.0 authentication is to retrieve token\n // credentials (formally known as access tokens in earlier OAuth 1.0\n // specs).\n $tokenCredentials = $server->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);\n\n // Now, we'll store the token credentials and discard the temporary\n // ones - they're irrelevant at this stage.\n $this->session->unset_userdata('temporary_credentials');\n $this->session->set_userdata('token_credentials', serialize($tokenCredentials));\n\n $user = $server->getUserDetails($tokenCredentials);\n\n $this->load->model('auth/Login_model');\n $userData = $this->Login_model->validate_login(null, null, false, false, null, true, $user->email);\n\n if ($userData) {\n\n // check banned\n if ($userData->banned) {\n $this->session->set_flashdata('error', $this->lang->line('account_is_banned'));\n redirect('login');\n }\n\n // check active\n if (!$userData->active) {\n $this->session->set_flashdata('error', $this->lang->line('oauth1_not_active'));\n redirect('login');\n }\n\n // user exists - set session data and log in\n $this->load->helper('session');\n session_init($userData);\n\n // create or renew cookie\n $this->load->helper('cookie');\n $cookie_domain = config_item('cookie_domain');\n $cookie = get_cookie('unique_token');\n\n if ($cookie) {\n // cookie is already set, renew it\n setcookie(\"unique_token\", $cookie, time() + Settings_model::$db_config['cookie_expires'], '/', $cookie_domain, false, false);\n }else{\n // needs new cookie\n setcookie(\"unique_token\", $userData->cookie_part . substr(uniqid(mt_rand(), true), -10) . $userData->cookie_part, time() + Settings_model::$db_config['cookie_expires'], '/', $cookie_domain, false, false);\n }\n\n // redirect to private section\n redirect('membership/'. strtolower(Settings_model::$db_config['home_page']));\n\n }else{\n // user does not exist\n $this->session->set_flashdata('provider', $provider);\n $this->session->set_flashdata('email', $user->email);\n\n // pass $user->email to view\n $content_data['nickname'] = $user->nickname;\n $content_data['email'] = $user->email;\n\n // show username creation form\n $this->quick_page_setup(Settings_model::$db_config['active_theme'], 'main', $this->lang->line('oauth1_add_username'), 'oauth1_user', 'header', 'footer', '', $content_data);\n }\n }", "public function get_access_token($oauth_token, $oauth_addon);", "function new_request_token($consumer) {\n }", "function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}", "protected function request_token() {\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/request_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_callback' => SocialHelper::php_self()\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$_SESSION['oauth'] = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->authorize();\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "protected function getAccessToken($oauth_token) {\n\n\t}", "static function requestAccessToken($consumer_key, $token, $usr_id, $method = 'POST', $options = array(), $curl_options = array())\n {\n OAuthRequestLogger::start();\n\n $store = OAuthStore::instance();\n $r = $store->getServerTokenSecrets($consumer_key, $token, 'request', $usr_id);\n $uri = $r['access_token_uri'];\n $token_name = $r['token_name'];\n\n // Delete the server request token, this one was for one use only\n $store->deleteServerToken($consumer_key, $r['token'], 0, true);\n\n // Try to exchange our request token for an access token\n $oauth = new OAuthRequester($uri, $method);\n\n if (isset($options['oauth_verifier'])) {\n $oauth->setParam('oauth_verifier', $options['oauth_verifier']);\n }\n if (isset($options['token_ttl']) && is_numeric($options['token_ttl'])) {\n $oauth->setParam('xoauth_token_ttl', intval($options['token_ttl']));\n }\n\n OAuthRequestLogger::setRequestObject($oauth);\n\n $oauth->sign($usr_id, $r, '', 'accessToken');\n $text = $oauth->curl_raw($curl_options);\n if (empty($text)) {\n throw new OAuthException2('No answer from the server \"' . $uri . '\" while requesting an access token');\n }\n $data = $oauth->curl_parse($text);\n\n if (!in_array((int)$data['code'], array(200, 201, 301, 302))) // patch for xing api\n {\n throw new OAuthException2('Unexpected result from the server \"' . $uri . '\" (' . $data['code'] . ') while requesting an access token');\n }\n\n $token = array();\n $params = explode('&', $data['body']);\n foreach ($params as $p)\n {\n @list($name, $value) = explode('=', $p, 2);\n $token[$oauth->urldecode($name)] = $oauth->urldecode($value);\n }\n\n if (!empty($token['oauth_token']) && !empty($token['oauth_token_secret'])) {\n $opts = array();\n $opts['name'] = $token_name;\n if (isset($token['xoauth_token_ttl'])) {\n $opts['token_ttl'] = $token['xoauth_token_ttl'];\n }\n $store->addServerToken($consumer_key, 'access', $token['oauth_token'], $token['oauth_token_secret'], $usr_id, $opts);\n }\n else\n {\n throw new OAuthException2('The server \"' . $uri . '\" did not return the oauth_token or the oauth_token_secret');\n }\n\n OAuthRequestLogger::flush();\n\n return $data; // patch for xing api\n }", "protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}", "protected function get_token()\n\t{\n\t\t$args = func_get_args();\n\t\t$url = \"\";\n\t\t$auto_load_response = false;\n\n\t\tforeach ($args as $v)\n\t\t{\n\t\t\tif (is_string($v))\n\t\t\t{\n\t\t\t\t$url = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_bool($v))\n\t\t\t{\n\t\t\t\t$auto_load_response = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!$url)\n\t\t{\n\t\t\ttrigger_error(\"Method get_token expects a url.\");\n\t\t}\n\n\t\t$this->execute_request($this->auth_http_method == SPOAuthClient::HTTP_AUTH_HEADER ? SPOAuthClient::HTTP_AUTH_GET : $this->auth_http_method, $url);\n\n\t\t//! remove oauth_token and oauth_secret, they will be loaded (if any returned) in the next lines of code)\n\t\t$this->oauth_token = null;\n\t\t$this->oauth_token_secret = null;\n\t\t$this->__oauth_access_token = null;\n\n\t\tif ($auto_load_response && $this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\t$response_data = SPUtils::parse_query($this->http_response_body);\n\n\t\t\tif (is_array($response_data))\n\t\t\t{\n\t\t\t\tforeach ($response_data as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$this->__oauth[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function oauthTwitter() {\n\n\t // get data from input\n\t $token = Input::get( 'oauth_token' );\n\t $verify = Input::get( 'oauth_verifier' );\n\n\t // get twitter service\n\t $tw = OAuth::consumer( 'Twitter' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $token ) && !empty( $verify ) ) {\n\n\t // This was a callback request from twitter, get the token\n\t $token = $tw->requestAccessToken( $token, $verify );\n\n\t // Send a request with it\n\t $response = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n\t // dd($result);\n\n\t // check if user already exists\n\t $user_id = $this->getUserIdGivenSocialId('twitter', (string)$response['id_str']);\n\n\t if($user_id) {\n\n\t \t// user already exists, sign them in\n\t \tAuth::login($user_id);\n\t\t\t\treturn Redirect::back();\n\t \n\t\t\t} else {\n\n\t\t\t\t// put google data into session var for use later\n\t\t\t\t$this->packSocialData('twitter', $response['id'], $response['screen_name'], null, null, 1);\n\n\t\t\t\t// send user to account create screen\n\t\t\t\treturn Redirect::to('users/create');\n\t\t }\n\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get request token\n\t $reqToken = $tw->requestRequestToken();\n\n\t // get Authorization Uri sending the request token\n\t $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n\t // return to twitter login url\n\t return Redirect::to( (string)$url );\n\t }\n\t}", "public function get_request_token($callback);", "public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}", "public function getAccessToken($verifier)\n {\n $access_token = $this->_request(null, array('oauth_verifier' => $verifier), 'GET', self::API_ACCESS_TOKEN_URL, false, true);\n parse_str($access_token, $parsed);\n return $parsed;\n }", "public function oauth2callback(Request $request)\n{\n $code = $request->get('code');\n $googleService = \\OAuth::consumer('Google');\n\n if (!is_null($code))\n {\n $token = $googleService->requestAccessToken($code);\n\n $this->token = $token->getaccessToken();\n $this->token_expires = $token->getendOfLife();\n\n session()->put('access_token', $this->token)->save();\n session()->put('access_token_expires', $this->token_expires)->save();\n\n return redirect('/');\n\n }\n // if not ask for permission first\n else\n {\n // get googleService authorization\n $url = $googleService->getAuthorizationUri();\n\n // return to google login url\n return redirect((string)$url);\n }\n}", "function getToken($post)\n{\n $old_server_method = $_SERVER['REQUEST_METHOD'];\n if (!empty($_SERVER['CONTENT_TYPE'])) {\n $old_content_type = $_SERVER['CONTENT_TYPE'];\n }\n $_SERVER['REQUEST_METHOD'] = 'POST';\n $_SERVER['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';\n $_POST = $post;\n OAuth2\\Autoloader::register();\n $oauth_config = array(\n 'user_table' => 'users'\n );\n $val_array = array(\n 'dsn' => 'pgsql:host=' . R_DB_HOST . ';dbname=' . R_DB_NAME . ';port=' . R_DB_PORT,\n 'username' => R_DB_USER,\n 'password' => R_DB_PASSWORD\n );\n $storage = new OAuth2\\Storage\\Pdo($val_array, $oauth_config);\n $server = new OAuth2\\Server($storage);\n if (isset($_POST['grant_type']) && $_POST['grant_type'] == 'password') {\n $val_array = array(\n 'password' => $_POST['password']\n );\n $users = array(\n $_POST['username'] => $val_array\n );\n $user_credentials = array(\n 'user_credentials' => $users\n );\n $storage = new OAuth2\\Storage\\Memory($user_credentials);\n $server->addGrantType(new OAuth2\\GrantType\\UserCredentials($storage));\n } elseif (isset($_POST['grant_type']) && $_POST['grant_type'] == 'refresh_token') {\n $always_issue_new_refresh_token = array(\n 'always_issue_new_refresh_token' => true\n );\n $server->addGrantType(new OAuth2\\GrantType\\RefreshToken($storage, $always_issue_new_refresh_token));\n } elseif (isset($_POST['grant_type']) && $_POST['grant_type'] == 'authorization_code') {\n $server->addGrantType(new OAuth2\\GrantType\\AuthorizationCode($storage));\n } else {\n $val_array = array(\n 'client_secret' => OAUTH_CLIENT_SECRET\n );\n $clients = array(\n OAUTH_CLIENTID => $val_array\n );\n $credentials = array(\n 'client_credentials' => $clients\n );\n $storage = new OAuth2\\Storage\\Memory($credentials);\n $server->addGrantType(new OAuth2\\GrantType\\ClientCredentials($storage));\n }\n $response = $server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send('return');\n $_SERVER['REQUEST_METHOD'] = $old_server_method;\n if (!empty($old_content_type)) {\n $_SERVER['CONTENT_TYPE'] = $old_content_type;\n }\n return json_decode($response, true);\n}", "public function issueRequestToken()\n {\n // 2legged OAuth\n $this->authenticate();\n\n // Check parameter\n $this->getRequest()->checkParameters(self::$_3l_request_params);\n $callback = $this->getRequest()->getParameter('oauth_callback');\n if (!preg_match('#^https?://.#', $callback)) {\n throw new HTTP_OAuthProvider_Exception('400 oauth_callback is not correct: '.$callback, 400);\n }\n\n // make token\n $store = $this->getStore();\n $store->issueRequestToken($this);\n $ok = $store->save();\n if (!$ok) {\n throw new HTTP_OAuthProvider_Exception('500 Store error', 500);\n }\n\n // response\n $resp = array(\n 'oauth_token' => $store->getToken(),\n 'oauth_token_secret' => $store->getSecret(),\n 'oauth_callback_confirmed' => 'true'\n );\n return http_build_query($resp);\n }", "public function callback()\n\t{\n\t\t$this->consumer = Consumer::make($this->config);\n\n\t\t// Load the provider\n\t\t$this->provider = Provider::make($this->provider);\n\t\t\n\t\tif ($token = \\Cookie::get('oauth_token'))\n\t\t{\n\t\t\t// Get the token from storage\n\t\t\t$this->token = unserialize(base64_decode($token));\n\t\t}\n\t\t\t\n\t\tif ($this->token and $this->token->access_token !== \\Input::get('oauth_token'))\n\t\t{ \n\t\t\t// Delete the token, it is not valid\n\t\t\t\\Cookie::forget('oauth_token');\n\n\t\t\t// Send the user back to the beginning\n\t\t\tthrow new Exception('invalid token after coming back to site');\n\t\t}\n\n\t\t// Get the verifier\n\t\t$verifier = \\Input::get('oauth_verifier');\n\n\t\t// Store the verifier in the token\n\t\t$this->token->verifier($verifier);\n\n\t\t// Exchange the request token for an access token\n\t\treturn $this->provider->access_token($this->token, $this->consumer);\n\t}", "public function exchangeOAuthCodeForAccessTokenUsingPKCE($code, $client_id, $client_secret, $redirect_uri, $code_verifier)\n {\n $post_data = array(\n 'code' => $code,\n 'client_id' => $client_id,\n 'client_secret' => $client_secret,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => $redirect_uri,\n 'code_verifier' => $code_verifier\n );\n return $this->startAnonymous()->uri(\"/oauth2/token\")\n ->bodyHandler(new FormDataBodyHandler($post_data))\n ->post()\n ->go();\n }", "public function testComAdobeGraniteOauthServerImplOAuth2RevocationEndpointServlet()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.oauth.server.impl.OAuth2RevocationEndpointServlet';\n\n $crawler = $client->request('POST', $path);\n }", "function ExchangeRequestForAccess()\n{\n $consumer_key = $_GET['consumer_key'];\n $oauth_token = $_GET['oauth_token'];\n $user_id = $_GET['usr_id'];\n\n try\n {\n OAuthRequester::requestAccessToken($consumer_key, $oauth_token, $user_id);\n }\n catch (OAuthException $e)\n {\n // Something wrong with the oauth_token.\n // Could be:\n // 1. Was already ok\n // 2. We were not authorized\n die($e->getMessage());\n }\n \n echo 'Authorization Given. <a href=\"index.php?action=Request\">Click to make a signed request</a>.';\n}", "public function finishLogin($token, $verifier) {\n return false; \n }", "protected function access_token() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token'] = $_SESSION['oauth']['oauth_token'];\r\n\t\t$this->tmhOAuth->config['user_secret'] = $_SESSION['oauth']['oauth_token_secret'];\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/access_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_verifier' => $_REQUEST['oauth_verifier']\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$token = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->conf->TwitterOAuthToken = $token['oauth_token'];\r\n\t\t\t$this->conf->TwitterOAuthSecret = $token['oauth_token_secret'];\r\n\t\t\t$this->conf->TwitterUsername = $token['screen_name'];\r\n\t\t\t$this->conf->write();\r\n\t\t\tunset($_SESSION['oauth']);\r\n\t\t\theader('Location: ' . SocialHelper::php_self());\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public function getSecretsForVerify ( $consumer_key, $token_key, $token_type = 'access' ) { \n\t\t$consumers = get_option('oauth_consumers');\n\t\tif (array_key_exists($consumer_key, $consumers)) {\n\t\t\t$consumer = $consumers[$consumer_key];\n\t\t}\n\n\t\tif ($token_type !== false) {\n\t\t\t$tokens = get_option('oauth_consumer_tokens');\n\t\t\tif (array_key_exists($token_key, $tokens)) {\n\t\t\t\t$token = $tokens[$token_key];\n\t\t\t}\n\t\t}\n\n\t\t$secrets = array(\n\t\t\t'consumer_key' => false,\n\t\t\t'consumer_secret' => false,\n\t\t\t'token' => false,\n\t\t\t'token_secret' => false,\n\t\t\t'user_id' => false,\n\t\t);\n\n\t\tif (@$consumer) { // TODO check $consumer['enabled']\n\t\t\t$secrets['consumer_key'] = $consumer['consumer_key'];\n\t\t\t$secrets['consumer_secret'] = $consumer['consumer_secret'];\n\t\t}\n\n\t\tif (@$token) { // TODO check $token['type']\n\t\t\t$secrets['token'] = $token['token'];\n\t\t\t$secrets['token_secret'] = $token['token_secret'];\n\t\t\t$secrets['user_id'] = $token['user'];\n\t\t}\n\n\t\treturn $secrets;\n\t}", "public function testComAdobeGraniteOauthServerImplOAuth2ClientRevocationServlet()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.oauth.server.impl.OAuth2ClientRevocationServlet';\n\n $crawler = $client->request('POST', $path);\n }", "public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {\n @$parameters or $parameters = array();\n $defaults = array(\"oauth_version\" => OAuthRequest::$version,\n \"oauth_nonce\" => OAuthRequest::generate_nonce(),\n \"oauth_timestamp\" => OAuthRequest::generate_timestamp(),\n \"oauth_consumer_key\" => $consumer->key);\n if ($token)\n $defaults['oauth_token'] = $token->key;\n\n $parameters = array_merge($defaults, $parameters);\n\n return new OAuthRequest($http_method, $http_url, $parameters);\n }", "public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL)\n {\n @$parameters or $parameters = array();\n $defaults = array(\"oauth_version\" => OAuthRequest::$version,\n \"oauth_nonce\" => OAuthRequest::generate_nonce(),\n \"oauth_timestamp\" => OAuthRequest::generate_timestamp(),\n \"oauth_consumer_key\" => $consumer->key);\n $parameters = array_merge($defaults, $parameters);\n\n if ($token)\n $parameters['oauth_token'] = $token->key;\n\n return new OAuthRequest($http_method, $http_url, $parameters);\n }", "function ObtainAccessToAServer()\n{\n $user_id = 1;\n\n // Obtain a request token from the server\n try\n {\n $token = OAuthRequester::requestRequestToken(CONSUMER_KEY, $user_id);\n }\n catch (OAuthException $e)\n {\n echo $e->getMessage();\n die('Failed');\n }\n\n // Callback to our (consumer) site, will be called when the user finished the authorization at the server\n $callback_uri = '?action=Exchange&consumer_key='.rawurlencode(CONSUMER_KEY).'&usr_id='.intval($user_id);\n\n // Now redirect to the autorization uri and get us authorized\n if (!empty($token['authorize_uri']))\n {\n // Redirect to the server, add a callback to our server\n if (strpos($token['authorize_uri'], '?'))\n {\n $uri = $token['authorize_uri'] . '&';\n }\n else\n {\n $uri = $token['authorize_uri'] . '?';\n }\n $uri .= 'oauth_token='.rawurlencode($token['token']).'&oauth_callback='.rawurlencode($callback_uri);\n }\n else\n {\n // No authorization uri, assume we are authorized, exchange request token for access token\n $uri = $callback_uri . '&oauth_token='.rawurlencode($token['token']);\n }\n\n header('Location: '.$uri);\n exit();\n}", "private function setOauthParams(?string $oauthToken): void {\r\n $params = [\r\n 'oauth_consumer_key' => $this->key,\r\n 'oauth_signature_method' => 'HMAC-SHA1',\r\n 'oauth_timestamp' => time(),\r\n 'oauth_version' => '1.0',\r\n 'oauth_callback' => \"oob\",\r\n 'oauth_nonce' => self::makeNonce()\r\n ];\r\n\r\n if(!is_null($oauthToken)){\r\n $params['oauth_token'] = $oauthToken;\r\n }\r\n\r\n ksort($params); //order alphabetically by key to match spec\r\n $this->clientParams = $params;\r\n }", "public function oauth($provider_id)\r\n {\r\n // Store the provider id for use on the callback function.\r\n $_SESSION['oauth_provider_id'] = $provider_id;\r\n\r\n // Redirect browser to google user content page.\r\n $this->load->library('Google_sync');\r\n header('Location: ' . $this->google_sync->get_auth_url());\r\n }", "private function get_token(&$request, $consumer, $token_type=\"access\") {\n $token_field = @$request->get_parameter('oauth_token');\n $token = $this->data_store->lookup_token(\n $consumer, $token_type, $token_field\n );\n if (!$token) {\n throw new OAuthException(\"Invalid $token_type token: $token_field\");\n }\n return $token;\n }", "public function fetch_request_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // no token required for the initial token request\n $token = NULL;\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $callback = $request->get_parameter('oauth_callback');\n $new_token = $this->data_store->new_request_token($consumer, $callback);\n\n return $new_token;\n }", "public function new_request_token($consumer)\n {\n return NULL;\n }", "function get_access_token($consumer_key, $consumer_secret, $request_token, $request_token_secret, $oauth_verifier, $usePost=false, $useHmacSha1Sig=true, $passOAuthInHeader=true)\n{\n $retarr = array(); // return value\n $response = array();\n\n $url = 'https://api.login.yahoo.com/oauth/v2/get_token';\n $params['oauth_version'] = '1.0';\n $params['oauth_nonce'] = mt_rand();\n $params['oauth_timestamp'] = time();\n $params['oauth_consumer_key'] = $consumer_key;\n $params['oauth_token']= $request_token;\n $params['oauth_verifier'] = $oauth_verifier;\n\n // compute signature and add it to the params list\n if ($useHmacSha1Sig) {\n $params['oauth_signature_method'] = 'HMAC-SHA1';\n $params['oauth_signature'] =\n oauth_compute_hmac_sig($usePost? 'POST' : 'GET', $url, $params,\n $consumer_secret, $request_token_secret);\n } else {\n $params['oauth_signature_method'] = 'PLAINTEXT';\n $params['oauth_signature'] =\n oauth_compute_plaintext_sig($consumer_secret, $request_token_secret);\n }\n\n // Pass OAuth credentials in a separate header or in the query string\n if ($passOAuthInHeader) {\n $query_parameter_string = oauth_http_build_query($params, true);\n $header = build_oauth_header($params, \"yahooapis.com\");\n $headers[] = $header;\n } else {\n $query_parameter_string = oauth_http_build_query($params);\n }\n\n // POST or GET the request\n if ($usePost) {\n $request_url = $url;\n logit(\"getacctok:INFO:request_url:$request_url\");\n logit(\"getacctok:INFO:post_body:$query_parameter_string\");\n $headers[] = 'Content-Type: application/x-www-form-urlencoded';\n $response = do_post($request_url, $query_parameter_string, 443, $headers);\n } else {\n $request_url = $url . ($query_parameter_string ?\n ('?' . $query_parameter_string) : '' );\n logit(\"getacctok:INFO:request_url:$request_url\");\n $response = do_get($request_url, 443, $headers);\n }\n\n // extract successful response\n if (! empty($response)) {\n list($info, $header, $body) = $response;\n $body_parsed = oauth_parse_str($body);\n if (! empty($body_parsed)) {\n logit(\"getacctok:INFO:response_body_parsed:\");\n print_r($body_parsed);\n }\n $retarr = $response;\n $retarr[] = $body_parsed;\n }\n\n return $retarr;\n}", "private function getRequestToken() {\n \n // send request for a request token\n $this->tmhOAuth->request('POST', $this->tmhOAuth->url('oauth/request_token', ''), array(\n\n // pass a variable to set the callback\n 'oauth_callback' => $this->tmhOAuth->php_self()\n ));\n\n\n if($this->tmhOAuth->response['code'] == 200) {\n\n // get and store the request token\n $response = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\n\t error_log($response);\n $_SESSION['authtoken'] = $response['oauth_token'];\n $_SESSION['authsecret'] = $response['oauth_token_secret'];\n\n // state is now 1\n $_SESSION['authstate'] = 1;\n\n // redirect the user to Twitter to authorize\n $url = $this->tmhOAuth->url('oauth/authorize', '') . '?oauth_token=' . $response['oauth_token'];\n header('Location: ' . $url);\n exit;\n }\n\n return false;\n }", "abstract public function after_oauth($response);", "public function getPartnerRequestToken()\n {\n $uri = $this->urlRequestToken();\n\n $client = $this->createHttpClient();\n\n $header = $this->temporaryPartnerRequestTokenProtocolHeader($uri);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n //echo \"dump data\";\n //var_dump($data);\n\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n //echo 'DECODE<br/>';\n //echo \"oauth_token: \" . $oauth_token.'<br/>';\n //echo \"oauth_secret\" . $oauth_token_secret.'<br/>';\n\n\n\n //////////////////////////////\n $uri = $this->urlAccessToken();\n\n $client = $this->createHttpClient();\n\n $credentials = $this->createClientCredentials(['identifier' => $oauth_token, 'secret' => $oauth_token_secret]);\n\n $header = $this->temporaryPartnerAccessTokenProtocolHeader($uri, $credentials);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n //var_dump($e);\n //exit;\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n\n //echo \"final:<br/>\";\n //var_dump($data);\n $resp = $data;\n\n return $resp;\n }", "static function confirm_authorization($consumer_key, $consumer_secret, $request_key, $request_secret, $healthurl) {\n \n list($base_url,$accid) = ApplianceApi::parse_health_url($healthurl);\n\n $api = new ApplianceApi($consumer_key, $consumer_secret, $base_url, $request_key, $request_secret);\n\n $result = $api->call($base_url . \"api/access_token.php\", array());\n\n if(preg_match(\"/oauth_token=[0-9a-zA-Z]{40}&oauth_token_secret=[0-9a-zA-Z]{40}/\",$result)!==1)\n throw new Exception(\"Unable to exchange request token for access token: $result\");\n\n // Parse the result to get the access token\n parse_str($result,$returned_token);\n\n return new ApplianceApi($consumer_key, $consumer_secret, $base_url, $returned_token['oauth_token'], $returned_token['oauth_token_secret']);\n }", "public function add_new_account($oauth_verifier, $profile_id) {\n\n $oauth_token = $this->_ci->session->userdata('oauth_token');\n $oauth_token_secret = $this->_ci->session->userdata('oauth_token_secret');\n\n $connection = new TwitterOAuth($this->_config['consumer_key'], $this->_config['consumer_secret'], $oauth_token, $oauth_token_secret);\n $token_credentials = $connection->getAccessToken($oauth_verifier);\n\n $tokens = array(\n 'token' => $token_credentials['oauth_token'],\n 'secret_token' => $token_credentials['oauth_token_secret']\n );\n\n try{\n\n if (empty($this->_user_id)) {\n throw new Exception(\"There in no active user to connect to twitter.\");\n }\n\n $tokens['username'] = $token_credentials['screen_name'];\n\n $socialFullInfo = $this->get_user_full_info($tokens['username']);\n if (empty($socialFullInfo->name)) {\n throw new Exception(\"Invalid twitter's user data. Please try to reconnect.\");\n }\n $tokens['name'] = $socialFullInfo->name;\n $tokens['image'] = $socialFullInfo->profile_image_url;\n\n $access_token = new Access_token();\n $token = $access_token->add_token($tokens, 'twitter', $this->_user_id);\n\n if (!$token->exists()) {\n throw new Exception(\"Cant save twitter access data. Please try to reconnect.\");\n }\n\n $social_group = new Social_group($profile_id);\n $social_group->save(array('access_token' => $token));\n\n } catch(Exception $e){\n throw $e;\n }\n\n $redirect_url = site_url('settings/socialmedia');\n return $redirect_url;\n }", "function twitter_oauth_callback() {\n if (isset($_GET['denied']) || empty($_GET['oauth_token'])) {\n drupal_set_message(t('The connection to Twitter failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Twitter account.\n drupal_goto('admin/config/services/twitter');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $_GET['oauth_token'];\n drupal_form_submit('twitter_oauth_callback_form', $form_state);\n}", "public function oauthLogin($key, $secret){\n\t\tif(isset($_GET['id'])){\n\t\t\t$uniek_id = $_GET['id'];\n\t\t}else{\n\t\t\t$uniek_id = 'unk';\n\t\t}\n\t\t$pageURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\")\n\t\t{\n\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER['PHP_SELF'];\n\t\t} \n\t\telse \n\t\t{\n\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER['PHP_SELF'];\n\t\t}\n\t\t$callback = $pageURL;\n\t\tif(empty($this->oauth_key) && empty($this->oauth_secret) && empty($this->oauth_callback)){\n\t\t\t$this->oauth_key = $key;\n\t\t\t$this->oauth_secret = $secret;\n\t\t\t$this->oauth_callback = $callback;\n\t\t}\n\t\tif(isset($_COOKIE[\"senseDashboardAccesToken_oauth_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]) && isset($_COOKIE[\"senseDashboardAccesToken_oauth_token_secret_\".$uniek_id.$this->oauth_key.$this->oauth_secret]) && !empty($this->oauth_key) && !empty($this->oauth_secret) ){\n\t\t\t$access_token = array();\n\t\t\t$access_token[\"oauth_token\"] = $_COOKIE[\"senseDashboardAccesToken_oauth_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret];\n\t\t\t$access_token[\"oauth_token_secret\"] = $_COOKIE[\"senseDashboardAccesToken_oauth_token_secret_\".$uniek_id.$this->oauth_key.$this->oauth_secret];\n\n\t\t\t// Create a CommonsenseOAuthClient object with consumer/user tokens.\n\t\t\t$this->oauth_connection = new CommonsenseOAuthClient(\n\t\t\t\t$this->oauth_key, \n\t\t\t\t$this->oauth_secret, \n\t\t\t\t$access_token[\"oauth_token\"],\n\t\t\t\t$access_token[\"oauth_token_secret\"]\n\t\t\t);\n\t\t\t$this->oauth_connection->setResponseFormat(\"html\");\n\t\t}else{\n\t\t\tif((empty($_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]) && empty($_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]) && (!empty($this->oauth_key) && !empty($this->oauth_secret) && !empty($this->oauth_callback))) || (empty($_GET['oauth_verifier']) && empty($_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]) && (!empty($this->oauth_key) && !empty($this->oauth_secret) && !empty($this->oauth_callback)))){\n\t\t\t\t$connection = new CommonsenseOAuthClient($key, $secret);\n\n\t\t\t\t// Get temporary credentials.\n\t\t\t\t$params = $connection->getRequestToken($this->oauth_callback);\n\t\t\t\t\n\t\t\t\tif (!isset($params[\"oauth_token\"])) {\n\t\t\t\t\tvar_dump($params);\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Save temporary credentials to session.\n\t\t\t\t$token = $params[\"oauth_token\"];\n\t\t\t\t$secret = $params[\"oauth_token_secret\"];\n\t\t\t\t\n\t\t\t\t$_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret] = array(\n\t\t\t\t\t\"oauth_token\" => $token,\n\t\t\t\t\t\"oauth_token_secret\" => $secret\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tswitch ($connection->httpCode) {\n\t\t\t\t case 200:\n\t\t\t\t // Build authorize URL and redirect user to the provider.\n\t\t\t\t //$url = $connection->getAuthorizeURL($token, \"\", $_GET['sessionid']);\n\t\t\t\t $parm = \"\";\n\t\t\t\t\tif(isset($_GET['id'])){\n\t\t\t\t\t\t$parm .= \"&id=\".$_GET['id'];\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['current_time'])){\n\t\t\t\t\t\t$parm .= \"&current_time=\".$_GET['current_time'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&current_time=0\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['start_time'])){\n\t\t\t\t\t\t$parm .= \"&start_time=\".$_GET['start_time'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&start_time=0\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['end_time'])){\n\t\t\t\t\t\t$parm .= \"&end_time=\".$_GET['end_time'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&end_time=0\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['size'])){\n\t\t\t\t\t\t$parm .= \"&size=\".$_GET['size'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&size=1x1\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['settings'])){\n\t\t\t\t\t\t$parm .= \"&settings=\".$_GET['settings'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&settings=false\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['share'])){\n\t\t\t\t\t\t$parm .= \"&share=\".$_GET['share'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&share=false\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_GET['details'])){\n\t\t\t\t\t\t$parm .= \"&details=\".$_GET['details'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$parm .= \"&details=false\";\n\t\t\t\t\t}\n\t\t\t\t $url = $connection->getAuthorizeURL($token).$parm;\n\t\t\t\t header(\"Location: \" . $url); \n\t\t\t\t break;\n\t\t\t\t \n\t\t\t\t default:\n\t\t\t\t \techo \"<strong><pre>Error: \".$connection->httpInfo.\"</pre></strong>\";\n\t\t\t\t}\n\t\t\t}else if(empty($_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret])){\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// If the oauth_token is old redirect to the connect page.\n\t\t\t\t\t\tif (isset($_REQUEST[\"oauth_token\"]) && \n\t\t\t\t\t\t\t$_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret][\"oauth_token\"] !== $_REQUEST[\"oauth_token\"]) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t \t$_SESSION[\"oauth_status\".$uniek_id] = \"oldtoken\";\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t\tunset($_SESSION[\"status_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\tunset($_SESSION[\"oauth_token\"]);\n\t\t\t\t\t\t\tunset($_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t/* Redirect to page with the connect to Twitter option. */\n\t\t\t\t\t\t\theader('Location: '.$this->oauth_callback);\n\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t// Create CommonsenseOAuthClient object with app key/secret and token \n\t\t\t\t\t\t// key/secret from default phase.\n\t\t\t\t\t\t$connection = new CommonsenseOAuthClient(\n\t\t\t\t\t\t \t$this->oauth_key, \n\t\t\t\t\t\t\t$this->oauth_secret, \n\t\t\t\t\t\t\t$_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret][\"oauth_token\"],\n\t\t\t\t\t\t\t$_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret][\"oauth_token_secret\"]\n\t\t\t\t\t\t);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Request access tokens from Commonsense.\n\t\t\t\t\t\t$access_token = $connection->getAccessToken($_REQUEST);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove no longer needed request tokens.\n\t\t\t\t\t\tunset($_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Save the access tokens. Normally these would be saved in a database \n\t\t\t\t\t\t// for future use.\n\t\t\t\t\t\t$_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret] = $access_token;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// If HTTP response is 200 continue otherwise send to connect page to \n\t\t\t\t\t\t// retry.\n\t\t\t\t\t\techo $connection->httpCode;\n\t\t\t\t\t\tif (200 == $connection->httpCode) {\n\t\t\t\t\t\t\t// The user has been verified and the access tokens can be saved for future use.\n\t\t\t\t\t\t\t$_SESSION[\"status_\".$uniek_id.$this->oauth_key.$this->oauth_secret] = \"verified\";\n\t\t\t\t\t\t\theader(\"Location: \".$this->oauth_callback);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunset($_SESSION[\"status_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\tunset($_SESSION[\"request_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\tunset($_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret]);\n\t\t\t\t\t\t\theader('Location: '.$this->oauth_callback);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tdie(\"OAuth Error: \".$e);\n\t\t\t\t\t}\n\t\t\t}else if($_SESSION[\"status_\".$uniek_id.$this->oauth_key.$this->oauth_secret] == \"verified\" && !empty($_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret])){\n\t\t\t\t// Get user access tokens out of the session.\n\t\t\t\t$access_token = $_SESSION[\"access_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret];\n\t\t\t\tsetcookie(\"senseDashboardAccesToken_oauth_token_\".$uniek_id.$this->oauth_key.$this->oauth_secret,$access_token[\"oauth_token\"]);\n\t\t\t\tsetcookie(\"senseDashboardAccesToken_oauth_token_secret_\".$uniek_id.$this->oauth_key.$this->oauth_secret,$access_token[\"oauth_token_secret\"]);\n\t\t\t\t\n\t\t\t\t// Create a CommonsenseOAuthClient object with consumer/user tokens.\n\t\t\t\t$this->oauth_connection = new CommonsenseOAuthClient(\n\t\t\t\t\t$this->oauth_key, \n\t\t\t\t\t$this->oauth_secret, \n\t\t\t\t\t$access_token[\"oauth_token\"],\n\t\t\t\t\t$access_token[\"oauth_token_secret\"]\n\t\t\t\t);\n\t\t\t\t$this->oauth_connection->setResponseFormat(\"html\");\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($this->oauth_connection)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }", "function oauth_get($url, $consumerKey, $consumerSecret, $accessKey, $accessSecret, $tokenInHeader = false, $method='HMAC-SHA1', $requestMethod='GET') {\r\n\t\t\t# Parse the url to be used in fsockopen\r\n\t\t\t$parts = parse_url($url);\r\n\t\t\t\r\n\t\t\t# Get and validate the ports\r\n\t\t\t$port = $parts['scheme'] == 'http' ? '80' : '443';\r\n\t\t\t/*if(!$port) {\r\n\t\t\t\ttrigger_error('Only HTTP is supported at this stage');\r\n\t\t\t\treturn false;\r\n\t\t\t}*/\r\n\t\t\t\r\n\t\t\t# Prepare construction of http header, and query string\r\n\t\t\t$query = array_filter(explode('&', @$parts['query']));\r\n\t\t\t$oauthParts[] = 'OAuth_Realm=\"\"';\r\n\t\t\t\r\n\t\t\t$nonce = md5(time());\r\n\t\t\t$time = time();\r\n\t\t\t//$nonce = 'kllo9940pd9333jh';\r\n\t\t\t//$time = '1191242096';//time();\r\n\t\t\t\r\n\t\t\t# Start OAuth\r\n\t\t\tif($tokenInHeader) {\r\n\t\t\t\t$oauthParts[] = 'oauth_consumer_key=\"'.urlencode($consumerKey).'\"';\r\n\t\t\t\t$oauthParts[] = 'oauth_token=\"'.urlencode($accessKey).'\"';\r\n\t\t\t\t$oauthParts[] = 'oauth_nonce=\"'.urlencode($nonce).'\"';\r\n\t\t\t\t$oauthParts[] = 'oauth_timestamp=\"'.urlencode($time).'\"';\r\n\t\t\t\t$oauthParts[] = 'oauth_signature_method=\"'.urlencode($method).'\"';\r\n\t\t\t\t$oauthParts[] = 'oauth_version=\"'.urlencode('1.0').'\"';\r\n\t\t\t} else {\r\n\t\t\t\tarray_unshift($query, 'oauth_version='.urlencode('1.0'));\r\n\t\t\t\tarray_unshift($query, 'oauth_token='.urlencode($accessKey));\r\n\t\t\t\tarray_unshift($query, 'oauth_timestamp='.urlencode($time));\r\n\t\t\t\tarray_unshift($query, 'oauth_signature_method='.urlencode($method));\r\n\t\t\t\tarray_unshift($query, 'oauth_nonce='.urlencode($nonce));\r\n\t\t\t\tarray_unshift($query, 'oauth_consumer_key='.urlencode($consumerKey));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Add the signature into the HTTP HEader\r\n\t\t\tswitch($method) {\r\n\t\t\t\tcase 'HMAC-SHA1':\r\n\t\t\t\t\t$signatureParts = array($requestMethod);\r\n\t\t\t\t\t$signatureParts[] = urlencode($parts['scheme'].'://'.$parts['host'].$parts['path']);\r\n\t\t\t\t\t$signatureParts[] = urlencode(implode('&', $query));\r\n\t\t\t\t\t$signatureBase = implode('&', $signatureParts);\r\n\t\t\t\t\t$signatureKey = urlencode($consumerSecret).(empty($accessSecret) ? '' : '&'.urlencode($accessSecret));\r\n\t\t\t\t\techo '<code>signature base string = '.htmlspecialchars($signatureBase).'</code><br />';\r\n\t\t\t\t\t$oauthParts[] = 'oauth_signature=\"'.base64_encode(hash_hmac(\"sha1\", $signatureBase, $signatureKey, true)).'\"';\r\n\t\t\t\t\t$query[] = 'oauth_signature=\"'.base64_encode(hash_hmac(\"sha1\", $signatureBase, $signatureKey, true)).'\"';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'PLAINTEXT':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$oauthParts[] = 'oauth_signature=\"'.urlencode($consumerSecret).'&'.urlencode($accessSecret).'\"';\r\n\t\t\t\t\t$query[] = 'oauth_signature='.urlencode($consumerSecret.'&'.$accessSecret);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# End OAuth\r\n\t\t\t\r\n\t\t\t# Prepare for the http request\r\n\t\t\t# Construct the quest string\r\n\t\t\t$query = implode('&', $query); \r\n\t\t\t# Construct the Authorization header\r\n\t\t\t$oauth = implode(\",\", $oauthParts);\r\n\t\t\t\r\n\t\t\t# Get the hostname and request URL \r\n\t\t\t$host = $_SERVER['SERVER_NAME'];\r\n\t\t\t$uri = $parts['path'];\r\n\t\t\t\r\n\t\t\t# Compose the http request\r\n\t\t\t\t$contentLength = 0;\r\n\t\t $reqheader = (empty($query) ? \"$requestMethod $uri\" : \"$requestMethod $uri?$query\") . \" HTTP/1.1\\r\\n\".\r\n\t\t \"Host: $host\\n\". \"User-Agent: OAuth\\r\\n\".\r\n\t\t \"Authorization: $oauth\\r\\n\".\r\n\t\t //\"Content-Type: application/x-www-form-urlencoded\\r\\n\".\r\n\t\t \"Accept: */*\\r\\n\".\r\n\t\t\t\t \"Accept-Language: en-us\\r\\n\".\r\n\t\t \"Connection: close\\r\\n\".\r\n\t\t \"Content-Length: $contentLength\\r\\n\\r\\n\".\r\n\t\t \"\\r\\n\"; \r\n\t\t\t\r\n\t\t # Debug\r\n\t\t //echo '<pre>'.htmlspecialchars('OPEN '.$parts['host'].':'.$port.\"\\n\".$reqheader).'</pre>';\r\n\t\t\t\r\n\t\t # Prepare fsockopen\r\n\t\t\t$host = $parts['host'];\r\n\t\t\r\n\t\t\t# Open connection\r\n\t\t\t$socket = fsockopen($host, 80, $errno, $errstr);\r\n\t\t\t\r\n\t\t\t# Validate connect\r\n\t\t\tif (!$socket) {\r\n\t\t\t $result[\"errno\"] = $errno;\r\n\t\t\t $result[\"errstr\"] = $errstr;\r\n\t\t\t return $result;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Send request\r\n\t\t\tfputs($socket, $reqheader);\r\n\t\t\t\r\n\t\t\t# Fetch server response\r\n\t\t\t$result = '';\r\n\t\t\twhile (!feof($socket)) {\r\n\t\t\t $result .= fgets($socket, 4096);\r\n\t\t\t}\r\n\t\t\tfclose($socket);\r\n\t\t\t\r\n\t\t\t# Split http header from body\r\n\t\t\treturn preg_split(\"/(\\r\\n?){2}/\", $result, 2);\r\n\t\t}", "public function auth() {\n \n // state 1 requires a GET variable to exist\n if($this->state == 1 && !isset($_GET['oauth_verifier'])) {\n $this->state = 0;\n }\n\n // Step 1: Get a request token\n if($this->state == 0) {\n return $this->getRequestToken();\n }\n\n // Step 2: Get an access token\n elseif($this->state == 1) {\n return $this->getAccessToken();\n }\n\n // Step 3: Verify the access token\n return $this->verifyAccessToken();\n }", "public function oauth_callback()\r\n {\r\n if ($this->input->get('code'))\r\n {\r\n $this->load->library('Google_sync');\r\n $token = $this->google_sync->authenticate($this->input->get('code'));\r\n\r\n // Store the token into the database for future reference.\r\n if (isset($_SESSION['oauth_provider_id']))\r\n {\r\n $this->load->model('providers_model');\r\n $this->providers_model->set_setting('google_sync', TRUE, $_SESSION['oauth_provider_id']);\r\n $this->providers_model->set_setting('google_token', $token, $_SESSION['oauth_provider_id']);\r\n $this->providers_model->set_setting('google_calendar', 'primary', $_SESSION['oauth_provider_id']);\r\n }\r\n else\r\n {\r\n $this->output->set_output('<h1>Sync provider id not specified!</h1>');\r\n }\r\n }\r\n else\r\n {\r\n $this->output->set_output('<h1>Authorization Failed!</h1>');\r\n }\r\n }", "public function getRequestToken($request_token_url, $callback_url = null, $http_method = 'GET') {}", "public function authorizeVerify() {\n\t\t// Authorization implementation goes here\n\t\t$token = $this->getParam(self::OAUTH_TOKEN, true);\n\n\t\tif(! isset($this->storages['request_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['request_token']);\n\t\t}\n\n\t\t$requestToken = $this->storages['request_token']->getRequestToken($token);\n\t\tif(! $requestToken) {\n\t\t\tthrow OAuthException::make(OAuthException::TOKEN_REJECTED,\n\t\t\t\t[\n\t\t\t\t\t'value' => $token\n\t\t\t\t]);\n\t\t}\n\n\t\t$state = $this->loadState();\n\n\t\t// We need to remember the callback\n\t\tif(empty($state['token']) || strcmp($state['token'], $requestToken['token'])) {\n\t\t\t$state['token'] = $requestToken['token'];\n\t\t\t$state['consumer_key'] = $requestToken['consumer_key'];\n\n\t\t\t$cb = $this->getParam(self::OAUTH_CALLBACK, true);\n\t\t\tif($cb) {\n\t\t\t\t$state['callback_url'] = $cb;\n\t\t\t} else {\n\t\t\t\t$state['callback_url'] = $requestToken['callback_url'];\n\t\t\t}\n\n\t\t\t$this->storeState($state);\n\t\t}\n\n\t\treturn $state;\n\t}", "public function executeLogin(sfRequest $request) {\n $consumer_key = sfConfig::get('app_sf_twitter_auth_consumer_key');\n $consumer_secret = sfConfig::get('app_sf_twitter_auth_consumer_secret');\n $user = $this->getUser(); /* @var $user myUser */\n\n /* If oauth_token is missing get it */\n if ($request->hasParameter('oauth_token') && $user->getAttribute('oauth_state', null, 'sfTwitterAuth') == 'start') {\n $user->setAttribute('oauth_state', 'returned', 'sfTwitterAuth');\n }\n\n /*\n * Switch based on where in the process you are\n *\n * 'default': Get a request token from twitter for new user\n * 'returned': The user has authorized the app on twitter\n */\n switch ($user->getAttribute('oauth_state', null, 'sfTwitterAuth')) {\n default:\n /* Create TwitterOAuth object with app key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret);\n /* Request tokens from twitter */\n $tok = $connection->getRequestToken($this->getController()->genUrl(array('sf_route' => 'login'), true));\n\n /* Save tokens for later */\n $user->setAttribute('oauth_request_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_request_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n $user->setAttribute('oauth_state', 'start', 'sfTwitterAuth');\n\n /* Build the authorization URL */\n $request_link = $connection->getAuthorizeURL($tok['oauth_token']);\n return $this->redirect($request_link);\n break;\n case 'returned':\n /* If the access tokens are already set skip to the API call */\n if ((!$user->getAttribute('oauth_access_token', null, 'sfTwitterAuth')) && (!$user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'))) {\n /* Create TwitterOAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_request_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_request_token_secret', null, 'sfTwitterAuth'));\n /* Request access tokens from twitter */\n $tok = $connection->getAccessToken($request->getParameter('oauth_verifier'));\n /* Save the access tokens. These could be saved in a database as they don't\n currently expire. But our goal here is just to authenticate the session. */\n $user->setAttribute('oauth_access_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_access_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n }\n /* Create TwitterOAuth with app key/secret and user access key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_access_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'));\n /* Run request on twitter API as user. */\n $result = $connection->get('account/verify_credentials');\n\n if ($result->id) {\n $guardUser = Doctrine::getTable('sfGuardUser')->findOneById($result->id);\n\n if (!$guardUser) {\n // Make a new user here\n $guardUser = $this->createUser($result);\n }\n\n $user->signIn($guardUser);\n\n foreach(Doctrine::getTable('sfGuardUser')->findByIds($connection->get('friends/ids')) as $speakrUser) {\n $speakrUser->Followers[] = $guardUser;\n $speakrUser->save();\n }\n\n // always redirect to a URL set in app.yml\n // or to the referer\n // or to the homepage\n $signinUrl = sfConfig::get('app_sf_twitter_auth_success_signin_url', $user->getReferer($request->getReferer()));\n\n return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');\n } else {\n $user->getAttributeHolder()->removeNamespace('sfTwitterAuth');\n $this->redirect('sfTwitterAuth/failed');\n }\n break;\n }\n }", "function twitter_oauth_callback_form($form, &$form_state) {\n $form['#post']['oauth_token'] = $_GET['oauth_token'];\n $form['oauth_token'] = array(\n '#type' => 'hidden',\n '#default_value' => $_GET['oauth_token'],\n );\n return $form;\n}", "public function oauth_access() {\n if ( !empty( $_GET[ 'yith-wcbk-google-auth' ] ) && !empty( $_GET[ 'code' ] ) ) {\n $code = $_GET[ 'code' ];\n $data = array(\n 'code' => $code,\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'redirect_uri' => $this->redirect_uri,\n 'grant_type' => 'authorization_code',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n $this->set_option( 'refresh-token', $body->refresh_token );\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token generated successfully', compact( 'access_token', 'expires_in', 'body' ) );\n\n $redirect_url = add_query_arg( array( 'page' => 'yith_wcbk_panel', 'tab' => 'google-calendar', ), admin_url( 'admin.php' ) );\n wp_safe_redirect( $redirect_url );\n exit();\n } else {\n $this->error( 'Error while generating Access Token: ', $response );\n }\n }\n }", "public function tokenHandler($provider)\n {\n// if(!$this->token->loaded) {\n// return OAUTH_TOKEN_REJECTED;\n// } else if($this->token->type==1 && $this->token->state==1) {\n// return OAUTH_TOKEN_REVOKED;\n// } else if($this->token->type==0 && $this->token->state==2) {\n// return OAUTH_TOKEN_USED;\n// } else if($this->token->type==0 && $this->token->verifier != $provider->verifier) {\n// return OAUTH_VERIFIER_INVALID;\n// }\n// $provider->token_secret = $this->token->secret;\n $provider->token_secret = 'token_secret';\n return OAUTH_OK;\n }", "abstract public function build_signature($request, $consumer, $token);", "abstract public function build_signature($request, $consumer, $token);", "public function fetch_access_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // requires authorized request token\n $token = $this->get_token($request, $consumer, \"request\");\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $verifier = $request->get_parameter('oauth_verifier');\n $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);\n\n return $new_token;\n }", "public static function getOAUTHToken(CommandRunner $runner)\n {\n // try composer stored oauth token\n $command = ['composer', 'config', '-g', 'github-oauth.github.com'];\n $error = \"Couldn't determine GitHub oAuth token. Please set GITHUB_API_TOKEN\";\n $result = $runner->runCommand($command, $error, true, false);\n return trim($result);\n }", "public function authorizeConsumerRequestToken( $token, $user_id, $referrer_host = '' ) { \n\t\t$tokens = get_option('oauth_consumer_tokens');\n\t\tif (array_key_exists($token, $tokens)) {\n\t\t\t$tokens[$token]['user'] = $user_id;\n\t\t\t$tokens[$token]['authorized'] = true;\n\t\t\tupdate_option('oauth_consumer_tokens', $tokens);\n\t\t}\n\t}", "public function oauth(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface {\n $provider = $request->getAttribute('provider');\n $companySlug = $request->getAttribute('companySlug');\n $credentialPubKey = $request->getAttribute('credentialPubKey');\n\n $command = $this->commandFactory->create('Widget\\\\OAuth')\n ->setParameter('provider', $provider)\n ->setParameter('response', $response)\n ->setParameter('companySlug', $companySlug)\n ->setParameter('queryParams', $request->getQueryParams())\n ->setParameter('credentialPubKey', $credentialPubKey);\n\n $result = $this->commandBus->handle($command);\n\n if ($result instanceof ResponseInterface) {\n return $response;\n }\n\n $command = $this->commandFactory->create('ResponseRedirect');\n $command\n ->setParameter('response', $response)\n ->setParameter('url', $result);\n\n return $this->commandBus->handle($command);\n }", "protected function _setOauthToken()\n {\n $this->_initHttpClient($this->_endpointUrls['access_token'], CurlHttpClient::POST);\n $this->_httpClient->setPostParam('client_id', $this->_config['client_id']);\n $this->_httpClient->setPostParam('client_secret', $this->_config['client_secret']);\n $this->_httpClient->setPostParam('grant_type', $this->_config['grant_type']);\n $this->_httpClient->setPostParam('redirect_uri', $this->_config['redirect_uri']);\n $this->_httpClient->setPostParam('code', $this->getAccessCode());\n $this->_oauthToken = $this->_getHttpClientResponse();\n }", "public function __construct($oauth_token = NULL, $oauth_token_secret = NULL){\n\t\t$key = Config::get('social.twitter.app_id');\n\n\t\t// Set the Consumer Secret\n\t\t$secret = Config::get('social.twitter.app_secret');\n\n\t\t$oauth_token = Config::get('social.twitter.access_token');\n\t\t$oauth_token_secret = Config::get('social.twitter.access_token_secret');\n\n\t\t// Log::info('app key '.$key);\n\t\t// Log::info('app secret '.$secret);\n\t\t// Log::info('client token '.$oauth_token);\n\t\t// Log::info('client token secret '.$oauth_token_secret);\n\t\t\n\t\tparent::__construct($key, $secret, $oauth_token, $oauth_token_secret);\n\t}", "public function authorize($callback){\n\t\t$req = OAuthRequest::from_consumer_and_token(\n\t\t\t$this->oauth_consumer, \n\t\t\tNULL, \n\t\t\t\"GET\",\n\t\t\t$this->e_authorize, \n\t\t\tarray(\n\t\t\t\t\"oauth_callback\" => $callback\n\t\t\t)\n\t\t);\n\t\t$req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->oauth_consumer, NULL);\n\t\treturn $req->to_url();\n\t}", "public function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t}\n\t\ttry {\n\t\t\t$request = $this->fetch(self::URI_REQUEST_TOKEN, $parameters);\n\t\t\t$token = DropBox_OAuthUtil::parse_parameters($request['body']);\n\t\t\t$this->setToken($token['oauth_token'], $token['oauth_token_secret']);\n\t\t\treturn $token;\n\t\t} catch (DropBox_OAuthException $e) {\n\t\t\tthrow new Dropbox_Exception_RequestToken('We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.', 0, $e);\n\t\t}\n\t}", "function new_access_token($token, $consumer) {\n // for the user associated with this token if the request token \n // is authorized \n // should also invalidate the request token \n }", "function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}", "function lti_verify_key_and_secret($key, $secret) {\n if ( ! ($key && $secret) ) return array(\"Missing key or secret\", \"\");\n $store = new DbTrivialOAuthDataStore();\n $store->add_consumer($key, $secret);\n\n $server = new OAuthServer($store);\n\n $method = new OAuthSignatureMethod_HMAC_SHA1();\n $server->add_signature_method($method);\n $request = OAuthRequest::from_request();\n\n $basestring = $request->get_signature_base_string();\n\n try {\n $server->verify_request($request);\n return true;\n } catch (Exception $e) {\n return array($e->getMessage(), $basestring);\n }\n}", "public function callback()\n\t{\n\t\tif (isset($_REQUEST['oauth_token']) && $this->session->userdata('oauth_token') !== $_REQUEST['oauth_token']) {\n\t\t $this->session->set_userdata('oauth_status','oldtoken');\n\t\t redirect('twitter/clear_sessions');\n\t\t} \n\t\t/* Set parameter after request token */\n\t\t$params = array('consumer_key' => '3zrlsDUOxHKycBWGjs29Hg',\n\t\t 'consumer_secret' => 'ftmz0LfGjvYLPA7agWy1tr5jxt0XLW2x2oDisaKkU',\n\t\t\t\t\t\t'oauth_token' => $this->session->userdata('oauth_token'),\n\t\t\t\t\t\t'oauth_token_secret' => $this->session->userdata('oauth_token_secret')\n\t\t);\n\t\t\n\t\t/* Load Library Twitter Oauth*/\n\t\t$this->load->library('twitteroauth',$params);\n\t\t\n\t /* Build TwitterOAuth object with client credentials. */\n\t\t$connection = $this->twitteroauth;\n\t\t\n\t\t/* Request access tokens from twitter */\n\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\n\t\t/* Save the access tokens. Normally these would be saved in a database for future use. */\n $this->session->set_userdata('access_token',$access_token ) ;\n\t\t\n\t\t/* Remove no longer needed request tokens */\n\t\t$this->session->set_userdata('oauth_token','') ;\n\t\t$this->session->set_userdata('oauth_token_secret','') ;\n\n\t\t/* If HTTP response is 200 continue otherwise send to connect page to retry */\n\t\tif (200 == $connection->http_code) {\n\t\t/* The user has been verified and the access tokens can be saved for future use */\n\t\t $this->session->set_userdata('status','verified') ;\n\t\t redirect('twitter/verified');\n\t\t} else {\n\t\t/* Save HTTP status for error dialog on connnect page.*/\n\t\t redirect('twitter');\n\t\t}\n\t\n\t}", "function request($consumer, $token, $url, $method = \"GET\", $data = null) {\n\n\t$sign = new OAuthSignatureMethod_HMAC_SHA1();\n\t$request = OAuthRequest::from_consumer_and_token(\n\t\t$consumer, $token, $method, $url, $data\n\t);\n\n\t$request->sign_request($sign, $consumer, $token);\n\t$ch = curl_init($request->get_normalized_http_url());\n\n\tif ($method == \"POST\") {\n\t\tcurl_setopt($ch, CURLOPT_POST ,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS , $request->to_postdata());\n\t}\n\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\tcurl_setopt($ch, CURLOPT_HEADER ,0); // DO NOT RETURN HTTP HEADERS\n\n\treturn curl_exec($ch);\n}", "public function handleCallback()\n {\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth');\n\n $accessToken = $this->getHttpClient()->requestAccessToken(\n $_GET['oauth_token'],\n $_GET['oauth_verifier'],\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth')->getRequestTokenSecret()\n );\n\n // Store the newly created access token\n $accessTokenObj = (new OAuthAccessToken)\n ->setUser($this->getUser())\n ->setServiceProvider($this->getServiceProvider())\n ->setForeignUserId($_GET['userid'])\n ->setToken($accessToken->getAccessToken())\n ->setSecret($accessToken->getAccessTokenSecret());\n\n $this->getPersistence()->persist($accessTokenObj);\n $this->getPersistence()->flush();\n }", "public function setAccessToken($oauth_token, $client_id, $user_id, $expires, $scope = null, $auth_id = null);", "protected function requestAnOAuthAccessToken($oauth, &$accessToken) {\n\t\t$url = $this->getTokenEndpoint();\n\t\t$options = [\n\t\t\t'resource' => 'OAuth access token',\n\t\t];\n\t\t$method = strtoupper($this->strategy->getTokenRequestMethod());\n\t\tswitch ($method) {\n\t\t\tcase 'GET':\n\t\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t$options['post_data_in_uri'] = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new OAuthClientException($method . ' is not a supported method to request tokens');\n\t\t}\n\t\tif (($response = $this->sendOAuthRequest($url, $method, [], $options, $oauth)) === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($response['oauth_token']) || !isset($response['oauth_token_secret'])) {\n\t\t\tthrow new OAuthClientAuthorizationException('it was not returned the access token and secret');\n\t\t}\n\t\t$accessToken = [\n\t\t\t'value' => $response['oauth_token'],\n\t\t\t'secret' => $response['oauth_token_secret'],\n\t\t\t'authorized' => true\n\t\t];\n\t\tif (isset($response['oauth_expires_in']) && $response['oauth_expires_in'] == 0) {\n\t\t\t$this->trace('Ignoring access token expiry set to 0');\n\t\t\t$this->setAccessTokenExpiry('');\n\t\t} elseif (isset($response['oauth_expires_in'])) {\n\t\t\t$expires = $response['oauth_expires_in'];\n\t\t\tif (strval($expires) !== strval(intval($expires)) || $expires <= 0) {\n\t\t\t\tthrow new OAuthClientException('OAuth provider did not return a supported type of access token expiry time');\n\t\t\t}\n\t\t\t$this->setAccessTokenExpiry(gmstrftime('%Y-%m-%d %H:%M:%S', $this->getResponseTime() + $expires));\n\t\t\t$this->trace('Access token expiry: ' . $this->getAccessTokenExpiry() . ' UTC');\n\t\t\t$accessToken['expiry'] = $this->getAccessTokenExpiry();\n\t\t} else {\n\t\t\t$this->setAccessTokenExpiry('');\n\t\t}\n\t\tif (isset($response['oauth_session_handle'])) {\n\t\t\t$accessToken['refresh'] = $response['oauth_session_handle'];\n\t\t\t$this->trace('Refresh token: ' . $accessToken['refresh']);\n\t\t}\n\t\treturn $this->storage->storeAccessToken($accessToken);\n\t}", "public function request_token() {\n\t\tif ($this->token->validate(\"request_token\")) {\n\t\t\t$co = new Config();\n\t\t\t$co->setPackageObject(Package::getByHandle('rest_wordpress'));\n\t\t\t$wp_rest_api_url = $co->get('WP_REST_API_URL');\n\t\t\t$oauth_key = $co->get('WP_REST_API_OAUTH_KEY');\n\t\t\t$oauth_secret = $co->get('WP_REST_API_OAUTH_SECRET');\n\t\t\t\n\t\t\t// Get Zend_Oauth_Consumer object\n\t\t\t$consumer = $this->getOauthConsumer($wp_rest_api_url, $oauth_key, $oauth_secret);\n\t\t\t\n\t\t\tif (is_object($consumer)) {\n\t\t\t\ttry {\n\t\t\t\t\t// Get Zend_Oauth_Token_Request object\n\t\t\t\t\t$token = $consumer->getRequestToken();\n\t\t\t\t\t$this->set('token', $token);\n\t\t\t\t\t$_SESSION['REQUEST_TOKEN'] = serialize($token);\n\t\t\t\t\t$consumer->redirect(array(\n\t\t\t\t\t\t'oauth_callback' => $this->getCollbackUrl()\n\t\t\t\t\t));\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tthrow new Exception($e->getMessage());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/settings','required');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->set('error', array($this->token->getErrorMessage()));\n\t\t}\n\t}", "public function actionTwitterCallback()\n {\n session_start();\n require_once('protected/vendors/twitteroauth-master/twitteroauth/twitteroauth.php');\n require_once('protected/vendors/twitteroauth-master/config.php');\n\n /* If the oauth_token is old redirect to the connect page. */\n if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) {\n $_SESSION['oauth_status'] = 'oldtoken';\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n\n }\n\n if (!isset($_REQUEST['oauth_verifier']))\n {\n echo \"ok\";\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n }\n\n /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n\n /* Request access tokens from twitter */\n $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\n /* Save the access tokens. Normally these would be saved in a database for future use. */\n $_SESSION['access_token'] = $access_token;\n\n \n\n /* Remove no longer needed request tokens */\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n\n /* If HTTP response is 200 continue otherwise send to connect page to retry */\n if (200 == $connection->http_code) {\n /* The user has been verified and the access tokens can be saved for future use */\n $_SESSION['status'] = 'verified';\n\n $user = $connection->get('account/verify_credentials');\n $this->GuardarEnBD($user->name,$access_token[\"oauth_token_secret\"]);\n \n } else \n {\n /* Save HTTP status for error dialog on connnect page.*/\n unset($_SESSION['access_token']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n }\n }", "public function testComAdobeGraniteOauthServerImplOAuth2TokenEndpointServlet()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.oauth.server.impl.OAuth2TokenEndpointServlet';\n\n $crawler = $client->request('POST', $path);\n }", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function lookup_token($consumer, $token_type, $token)\n {\n return new OAuthToken($consumer, \"\");\n }", "public function callbackAction (Request $request)\n {\n // receive the authorization code\n $code = $request->get('code');\n\n // request the access-token to the oauth server\n $url = $this->get('router')->generate('fos_oauth_server_token', [\n 'client_id' => $this->getParameter('oauth_test_client_id'),\n 'client_secret' => $this->getParameter('oauth_test_client_secret'),\n 'redirect_uri' => $this->getParameter('oauth_test_redirect_uri'),\n 'grant_type' => 'authorization_code',\n 'code' => $code\n ], UrlGenerator::ABSOLUTE_URL);\n\n $client = new Client();\n $res = $client->request('GET', $url);\n if($res->getStatusCode() !== 200) {\n throw new \\Exception($res->getReasonPhrase());\n }\n\n // process the response\n $response = json_decode($res->getBody(), TRUE);\n $now = new \\DateTime();\n $response['creation_date'] = $now->format('c');\n $now->add(\\DateInterval::createFromDateString($response['expires_in'] . ' seconds'));\n $response['expiration_date'] = $now->format('c');\n\n // store the response\n $request->getSession()->set('api_sandbox_token_response', $response);\n\n // redirect to the explorer\n return $this->redirectToRoute('api_sandbox_explorer');\n }", "public function main()\n {\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n // If we're already configured, we just need a token now.\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth/token' );\n }", "protected function prepareOauth1( $url, $params )\n {\n if ( is_null( $this->options['token'] ) )\n {\n throw new RestException( 'No token key provided!' );\n }\n elseif ( is_null( $this->options['secret'] ) )\n {\n throw new RestException( 'No secret key provided!' );\n }\n\n $oauth = [\n 'oauth_nonce' => $this->generateNonce(),\n 'oauth_signature_method' => strtoupper( \"HMAC-{$this->options['algorithm']}\" ),\n 'oauth_timestamp' => time(),\n 'oauth_token' => $this->options['token'],\n 'oauth_version' => '1.0',\n ];\n\n $params = array_merge( $params, $oauth );\n $paramList = [];\n\n foreach ( $params as $key => $value )\n {\n $paramList[rawurlencode( $key )] = rawurlencode( $value );\n }\n\n // array needs to be sorted for a valid signature\n ksort( $paramList );\n\n $query = \"\";\n\n foreach ( $paramList as $key => $value )\n {\n $query .= \"{$key}={$value}&\";\n }\n\n $query = rtrim( $query, \"&\" );\n $string = strtoupper( $this->method ) . \"&\" . rawurlencode( $url ) . \"&\" . rawurlencode( $query );\n\n // the & is important and has to be added, even if there's no secret *troll*\n $secret = \"&\" . rawurlencode( $this->options['secret'] );\n $signature = base64_encode( hash_hmac( $this->options['algorithm'], $string, $secret, true ) );\n\n $oauth['oauth_signature'] = rawurlencode( $signature );\n\n $oauthString = \"\";\n\n foreach ( $oauth as $key => $value )\n {\n $oauthString .= $key . '=\"' . $value . '\",';\n }\n\n $this->options['headers']['Authorization'] = \"OAuth \" . rtrim( $oauthString, ',' );\n }" ]
[ "0.68836284", "0.67531246", "0.67520773", "0.6203714", "0.61567706", "0.61362875", "0.60874194", "0.6037181", "0.5997169", "0.5987139", "0.59780264", "0.5976227", "0.59136605", "0.5849605", "0.5727903", "0.57028437", "0.56608826", "0.5631216", "0.5585723", "0.5552327", "0.5550056", "0.545115", "0.544477", "0.5433222", "0.54240245", "0.5397918", "0.5396669", "0.53899676", "0.5375108", "0.53389096", "0.53251964", "0.5319804", "0.53030497", "0.5292926", "0.5272112", "0.52566", "0.52502155", "0.52407306", "0.52277046", "0.5214515", "0.51806265", "0.5178992", "0.51755404", "0.51529765", "0.5124774", "0.51142305", "0.5104495", "0.51014423", "0.50937533", "0.5085128", "0.50621134", "0.5061395", "0.5060178", "0.5046749", "0.5038532", "0.5029388", "0.5025202", "0.50214094", "0.50163573", "0.5013153", "0.5012758", "0.5011457", "0.5006884", "0.49989808", "0.49975875", "0.49970093", "0.49922097", "0.4981592", "0.49657524", "0.4948114", "0.4947347", "0.4945957", "0.4940459", "0.49325323", "0.49213544", "0.49213544", "0.49133998", "0.49120715", "0.49094266", "0.4905423", "0.49028683", "0.48998323", "0.48973215", "0.4879522", "0.48749328", "0.48631543", "0.48528144", "0.48524573", "0.48456857", "0.4843234", "0.48404738", "0.48326516", "0.48289418", "0.48173657", "0.4814444", "0.4814374", "0.4811012", "0.48096865", "0.48070383", "0.48066568" ]
0.5119926
45
check for an existing user account and either return that or create a fresh account for the authenticated user.
protected function createOrUpdateAccount($token, $tokenSecret) { $uri = new Uri('https://api.twitter.com/1.1/account/verify_credentials.json'); $request = Request::create($uri, 'GET'); $request = $this->requestSignatureGenerator->signRequest($request); $request->setHeader('Content-Type', 'application/x-www-form-urlencoded', TRUE); $response = $this->requestEngine->sendRequest($request); $userData = json_decode($response->getContent(), TRUE); /** @var $account Account */ $account = NULL; $providerName = $this->name; $accountRepository = $this->accountRepository; $this->securityContext->withoutAuthorizationChecks(function () use ($userData, $providerName, $accountRepository, &$account) { $account = $accountRepository->findByAccountIdentifierAndAuthenticationProviderName($userData['screen_name'], $providerName); }); if ($account === NULL) { $defaultRole = $this->policyService->getRole('Flowpack.TwitterApi:AuthenticatedUser'); $account = new Account(); $account->setAccountIdentifier($userData['screen_name']); $account->setAuthenticationProviderName($providerName); $account->addRole($defaultRole); $this->accountRepository->add($account); } $account->setCredentialsSource($token . '&' . $tokenSecret); $this->accountRepository->update($account); $this->persistenceManager->whitelistObject($account); return $account; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createUserAccount() {\n\t\treturn new UserAccount();\n\t}", "private function getOrCreateUser()\n {\n $user = User::firstOrCreate([\n 'email' => $this->user->email\n ]);\n $user->name = $this->user->fullname;\n $user->save();\n\n return $user;\n }", "protected function getOrCreateUserAccount($accountName) {\n\t\t$rep = $this->entityManager->getRepository('GravityApiBundle:UserAccount');\n\t\t$account = $rep->findOneBy(array('accountName'=>$accountName));\n\t\tif ($account) {\n\t\t\treturn $account;\n\t\t}\n\t\t$newAccount = $this->createUserAccount();\n\t\t$newAccount->setAccountName($accountName);\n\t\t$this->entityManager->persist($newAccount);\n\t\t$this->entityManager->flush();\n\t\treturn $newAccount;\n\t}", "public function getLoggedInUserAccount() {\n\t\tLoggerRegistry::debug('CustomerModule::getLoggedInUserAccount()');\n\t\t$account = null;\n\t\t$email = $this->getEngine()->getUserManager()->getLoggedInUserEmail();\n\t\tif (!is_null($email)) {\n\t\t\t$account = $this->getRepository('Account')->findOneBy(array( 'email' => 'ben@leftclick.com.au' ));\n\t\t\tif (is_null($account)) {\n\t\t\t\t$account = new Account();\n\t\t\t\t$account->setEmail($email);\n\t\t\t\t$this->getEngine()->doctrine()->getEntityManager()->persist($account);\n\t\t\t}\n\t\t}\n\t\treturn $account;\n\t}", "function renren_account_auto_create($renren_user = null) {\n global $user;\n if (!isset($renren_user)) {\n $renren_user = renren_user_profile();\n if (!isset($renren_user)) {\n return false;\n }\n }\n // renren account is already exists\n if ($hishanghai_uid = hishanghai_account_uid_with_renren($renren_user->uid)) {\n $account = user_load($hishanghai_uid);\n if ($account) {\n $user = $account;\n drupal_goto('');\n }\n else {\n return;\n }\n }\n else {\n // renren account is not already exists\n // we create for user\n $user_edit = array(\n 'name' => check_plain($renren_user->name),\n 'mail' => 'renren@renren.com',\n 'pass' => user_password(),\n 'status' => 1,\n 'init' => check_plain($renren_user->name),\n 'access' => time(),\n );\n // check the user name \n if ($account = user_load(array('name' => $user_edit['name']))) {\n drupal_set_message(t('Sorry, We already have %name in our %site', array('%name' => $account->name, '%site' => variable_get('site_name', ''))));\n return;\n }\n else {\n $account = user_save(NULL, $user_edit);\n if ($account->uid) {\n if (!renren_account_insert($account->uid, $renren_user->uid)) {\n drupal_set_message(t('Sorry, there have errors accours.Please contact site adminstrator for support'));\n return;\n }\n else {\n $user = $account;\n drupal_set_message(t('Please complete the follow register form to create account on %site', array('%site' => variable_get('site_name', ''))));\n drupal_goto(\"user/$account->uid/settings\");\n }\n }\n else {\n drupal_set_message(t('Sorry, there have errors accors.Please contact site adminstrator for support'));\n return;\n }\n }\n }\n}", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "public function findOrCreateUser($name)\n {\n $name = $this->convertToSamaccountname($name);\n $user = $this->em\n ->getRepository('AppBundle:FOSUser')\n ->findOneBy(array('username' => $name));\n\n if ($user) {\n return $user;\n } else {\n $user = $this->createUser($name);\n return $user;\n }\n }", "public function user_createorlogin($user) {\n $existed_user = db_select('user', 'u')\n ->fields('u')\n ->condition('email', $user->getEmail())\n ->execute()\n ->fetchObject();\n\n if($existed_user){\n db_update('user')\n ->fields(array(\n 'accessed' => time(),\n ))\n ->condition('uid', $existed_user->uid)\n ->execute();\n session()->set('curuser', $existed_user);\n }else{\n $uid = db_insert('user')\n ->fields(array(\n 'username' => $user->getName() ? $user->getName() : $user->getEmail(),\n 'password' => hunter_password_hash('password'),\n 'nickname' => $user->getNickname() ? $user->getNickname() : $user->getName(),\n 'email' => $user->getEmail(),\n 'provider' => $user->getProviderName(),\n 'avatar' => $user->getAvatar() ? $user->getAvatar() : '/theme/hunter/assets/avatar/'.rand(0,38).'.jpg',\n 'status' => 1,\n 'created' => time(),\n 'updated' => time(),\n 'accessed' => time()\n ))\n ->execute();\n\n $new_user = db_select('user', 'u')\n ->fields('u')\n ->condition('uid', $uid)\n ->execute()\n ->fetchObject();\n\n session()->set('curuser', $new_user);\n }\n }", "public function loginExistingUser() {\n\n // Check whether remote account with requested email exists:\n try {\n $this->sso = dosomething_canada_get_sso();\n\n if ($this->sso->authenticate($this->email, $this->password)) {\n $this->remote_account = $this->sso->getRemoteUser();\n }\n }\n catch (Exception $e) {\n\n // The only users that exist locally but not remotely should be admin\n // accounts that were created before SSO integration. These should be\n // created remotely as well.\n $this->sso->propagateLocalUser(\n $this->email,\n $this->password,\n dosomething_canada_create_sso_user($this->email, $this->password, $this->local_account)\n );\n }\n return TRUE;\n }", "public function createUser($data){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($data, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT),\n Mage::helper('core')->jsonEncode($data)\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasConflicted()){\n Mage::log(\"User already exists.\");\n } else if($this->hasFailed()) {\n Mage::log(\"User account creation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account creation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User creation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "public function create()\n {\n return $this->userService->create();\n }", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}", "function create_account($db, $name, $username, $password, $password_confirmation)\n{\n global $signup_messages;\n\n global $sticky_signup_username;\n global $sticky_signup_name;\n\n $name = trim($name);\n $username = trim($username);\n $password = trim($password);\n $password_confirmation = trim($password_confirmation);\n\n $sticky_signup_username = $username;\n $sticky_signup_name = $name;\n\n $account_valid = True;\n\n $db->beginTransaction();\n\n // check if username is unique, give error message if not.\n if (empty($username)) {\n $account_valid = False;\n array_push($signup_messages, \"Please provide a username.\");\n } else {\n $records = exec_sql_query(\n $db,\n \"SELECT username FROM users WHERE (username = :username);\",\n array(\n ':username' => $username\n )\n )->fetchAll();\n if (count($records) > 0) {\n $account_valid = False;\n array_push($signup_messages, \"Username is already taken, please pick another username.\");\n }\n }\n\n // TODO: check if password meets security requirements.\n if (empty($password)) {\n $account_valid = False;\n array_push($signup_messages, \"Please provide a password.\");\n }\n\n // Check if passwords match\n if ($password != $password_confirmation) {\n $account_valid = False;\n array_push($signup_messages, \"Password confirmation doesn't match your password. Please reenter your password.\");\n } else {\n // hash the password\n $hashed_password = password_hash($password, PASSWORD_DEFAULT);\n }\n\n if ($account_valid) {\n $result = exec_sql_query(\n $db,\n \"INSERT INTO users (name, username, password) VALUES (:name, :username, :password);\",\n array(\n ':name' => $name,\n ':username' => $username,\n ':password' => $hashed_password\n )\n );\n if ($result) {\n // account creation was successful. Login.\n password_login($db, $messages, $username, $password);\n } else {\n array_push($messages, \"Password confirmation doesn't match your password. Please reenter your password.\");\n }\n }\n\n $db->commit();\n}", "function create_account($firstname, $lastname, $email, $password) {\n\t$query = \"SELECT * FROM \" . $GLOBALS['db_name'] . \".users WHERE email = '$email' LIMIT 1\";\n\t$result = $GLOBALS['db_connection'] -> query($query);\n\t\n\tif ($result -> num_rows > 0) {\n\t\treturn \"E-Mail address already registered\";\n\t}\n\t\n\t// create account\n\t$unique_id = uniqid();\n\t$query = \"INSERT INTO \" . $GLOBALS['db_name'] . \".users (firstname, lastname, email, password, user_id) VALUES ('$firstname', '$lastname', '$email', '$password', '$unique_id')\";\n\t\t\n\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\treturn TRUE;\n\t} else {\n\t\tdisplay_sql_error();\n\t}\n}", "function insert_new_user($username, $password, $email)\n{\n global $conn;\n \n if (does_exist($username)) // if the user exist\n // You can use a function defined in the above\n return false;\n else {\n $current_date = date('Ymd');\n $sql = \"INSERT into Users (username, password, email, date)VALUES ('$username', '$password', '$email', '$current_date')\";\n $result = mysqli_query($conn, $sql);\n return $result;\n }\n}", "function execute() {\n\t\tif ($this->existingUser) {\n\t\t\t// Existing user in the system\n\t\t\t$userDao = &DAORegistry::getDAO('UserDAO');\n\t\t\t$user = &$userDao->getUserByUsername($this->getData('username'));\n\t\t\tif ($user == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$userId = $user->getUserId();\n\t\t\t\n\t\t} else {\n\t\t\t// New user\n\t\t\t$user = &new User();\n\t\t\t\n\t\t\t$user->setUsername($this->getData('username'));\n\t\t\t$user->setFirstName($this->getData('firstName'));\n\t\t\t$user->setMiddleName($this->getData('middleName'));\n\t\t\t$user->setInitials($this->getData('initials'));\n\t\t\t$user->setLastName($this->getData('lastName'));\n\t\t\t$user->setAffiliation($this->getData('affiliation'));\n\t\t\t$user->setEmail($this->getData('email'));\n\t\t\t$user->setUrl($this->getData('userUrl'));\n\t\t\t$user->setPhone($this->getData('phone'));\n\t\t\t$user->setFax($this->getData('fax'));\n\t\t\t$user->setMailingAddress($this->getData('mailingAddress'));\n\t\t\t$user->setBiography($this->getData('biography'));\n\t\t\t$user->setInterests($this->getData('interests'));\n\t\t\t$user->setDateRegistered(Core::getCurrentDate());\n\t\t\n\t\t\tif ($this->profileLocalesEnabled) {\n\t\t\t\t$site = &Request::getSite();\n\t\t\t\t$availableLocales = $site->getSupportedLocales();\n\t\t\t\t\n\t\t\t\t$locales = array();\n\t\t\t\tforeach ($this->getData('userLocales') as $locale) {\n\t\t\t\t\tif (Locale::isLocaleValid($locale) && in_array($locale, $availableLocales)) {\n\t\t\t\t\t\tarray_push($locales, $locale);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$user->setLocales($locales);\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($this->defaultAuth)) {\n\t\t\t\t$user->setPassword($this->getData('password'));\n\t\t\t\t// FIXME Check result and handle failures\n\t\t\t\t$this->defaultAuth->doCreateUser($user);\n\t\t\t\t$user->setAuthId($this->defaultAuth->authId);\n\t\t\t\t$user->setPassword(Validation::encryptCredentials($user->getUserId(), Validation::generatePassword())); // Used for PW reset hash only\n\t\t\t} else {\n\t\t\t\t$user->setPassword(Validation::encryptCredentials($this->getData('username'), $this->getData('password')));\n\t\t\t}\n\t\t\t\n\t\t\t$userDao = &DAORegistry::getDAO('UserDAO');\n\t\t\t$userDao->insertUser($user);\n\t\t\t$userId = $user->getUserId();\n\t\t\tif (!$userId) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$sessionManager = &SessionManager::getManager();\n\t\t\t$session = &$sessionManager->getUserSession();\n\t\t\t$session->setSessionVar('username', $user->getUsername());\n\t\t}\n\n\t\t$journal = &Request::getJournal();\n\t\t$roleDao = &DAORegistry::getDAO('RoleDAO');\n\t\t\n\t\t// Roles users are allowed to register themselves in\n\t\t$allowedRoles = array('reader' => 'registerAsReader', 'author' => 'registerAsAuthor', 'reviewer' => 'registerAsReviewer');\n\n\t\t$journalSettingsDao = &DAORegistry::getDAO('JournalSettingsDAO');\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegReader')) {\n\t\t\tunset($allowedRoles['reader']);\n\t\t}\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegAuthor')) {\n\t\t\tunset($allowedRoles['author']);\n\t\t}\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegReviewer')) {\n\t\t\tunset($allowedRoles['reviewer']);\n\t\t}\n\t\t\n\t\tforeach ($allowedRoles as $k => $v) {\n\t\t\t$roleId = $roleDao->getRoleIdFromPath($k);\n\t\t\tif ($this->getData($v) && !$roleDao->roleExists($journal->getJournalId(), $userId, $roleId)) {\n\t\t\t\t$role = &new Role();\n\t\t\t\t$role->setJournalId($journal->getJournalId());\n\t\t\t\t$role->setUserId($userId);\n\t\t\t\t$role->setRoleId($roleId);\n\t\t\t\t$roleDao->insertRole($role);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$this->existingUser) {\n\t\t\t// Send welcome email to user\n\t\t\timport('mail.MailTemplate');\n\t\t\t$mail = &new MailTemplate('USER_REGISTER');\n\t\t\t$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));\n\t\t\t$mail->assignParams(array('username' => $this->getData('username'), 'password' => $this->getData('password')));\n\t\t\t$mail->addRecipient($user->getEmail(), $user->getFullName());\n\t\t\t$mail->send();\n\t\t}\n\n\t\t// By default, self-registering readers will receive\n\t\t// journal updates. (The double set is here to prevent a\n\t\t// duplicate insert error msg if there was a notification entry\n\t\t// left over from a previous role.)\n\t\tif (isset($allowedRoles['reader']) && $this->getData($allowedRoles['reader'])) {\n\t\t\t$notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO');\n\t\t\t$notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, false);\n\t\t\t$notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, true);\n\t\t}\n\n\t\tif (isset($allowedRoles['reader']) && $this->getData('openAccessNotification')) {\n\t\t\t$userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO');\n\t\t\t$userSettingsDao->updateSetting($userId, 'openAccessNotification', true, 'bool', $journal->getJournalId());\n\t\t}\n\t}", "public static function getUserRecord()\n {\n // we cache the user entry per request\n if(self::$user)\n return self::$user;\n\n $res = getDb()->getUser();\n // if null create, onerror return false\n if($res === null)\n {\n // user entry does not exist, create it\n $res = self::create();\n if(!$res)\n return false;\n }\n elseif($res === false)\n {\n return false;\n }\n\n self::$user = $res;\n return self::$user;\n }", "public function createOrGetUser(ProviderUser $providerUser)\n {\n \n\n $account = SocialLoginAccount::where('provider', 'google')\n ->where('provider_user_id', $providerUser->getId())\n ->first();\n\n if ($account) {\n\n return $account->user; //relationship to user table\n \n\n } else {\n\n $account = new SocialLoginAccount([\n 'provider_user_id' => $providerUser->getId(),\n 'provider' => 'google'\n ]);\n\n $user = User::where('email', $providerUser->getEmail())->first();\n\n if (!$user) {\n \n \n $user = User::create([\n 'fk_usertype'=> 1008, //Normal User. Default User Access\n 'uname'=> $providerUser->getEmail(),\n 'fname'=> $providerUser->user['given_name'],\n 'lname'=> $providerUser->user['family_name'],\n 'fullname'=> $providerUser->getName(),\n 'email' => $providerUser->getEmail(),\n 'password'=> 'test', //default password\n 'fk_country'=> 229, //USA default,\n 'state'=> 'Alabama', //default state from db,\n 'city'=> 'Alabama',\n 'shippingcountry'=> 229, //USA default,\n 'shippingstate'=> 'Alabama', //default state from db,\n 'activation_token'=> null, //email automatically activated\n 'fk_referredby'=> session('yeslife_referrer_id'), //initialize @App/Providers/AppServiceProvider.php\n 'issubscribed'=> 1,\n 'istext'=> 1,\n 'stat'=> 1\n ]);\n \n $token = MyHelperClass::generateRandomString(10).''.$user->id;\n $user->update([\n 'affiliate_token'=> $token,\n 'password'=> bcrypt($token), //default password\n ]);\n \n }elseif( !$user->fname ){\n\n //check for empty info then update details base on social media.\n //empty for \"Special Offers for Subscription\" user\n\n $user->update([\n 'fname'=> $providerUser->user['given_name'],\n 'lname'=> $providerUser->user['family_name'],\n 'fullname'=> $providerUser->getName(),\n 'activation_token'=> null, //email automatically activated\n 'issubscribed'=> 1,\n 'istext'=> 1,\n 'stat'=> 1\n ]);\n\n\n }//END if !$user\n \n \n //setup relationship to SocialLoginAccount\n $account->user()->associate($user);\n $account->save();\n\n return $user;\n \n }//END else $account\n \n }", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "public function create()\n\t{\n\t\tif (Auth::check()) {\n\t\t\tSession::flash('info_message', 'You are already logged into an account!');\n\t\t\treturn Redirect::route('users.index');\n\t\t} else {\n\t\t\treturn view('users.create');\n\t\t}\n\t}", "function createUser()\n{\n $userCheck = UsersQuery::create()->findOneByUsername($_POST['username']);\n if ($userCheck == \"\") {\n // next add user to db\n $user = new Users();\n $user->setUsername($_POST['username']);\n $user->setPassword($_POST['password']);\n $user->setName($_POST['name']);\n $user->setEmail($_POST['email']);\n $user->setStatus(\"active\");\n $user->setPicture(\"none\");\n $user->setCreated(time());\n $user->setModified(time());\n\n $user->save();\n\n if ($user != null) {\n echo \"user added successfully\";\n }\n } else {\n echo \"user already registered\";\n }\n}", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function findOrRegister($user)\n {\n if ($userExist = User::where($user['email'])->first()) {\n return $userExist; \n }\n $newUser = User::create($user);\n return $newUser;\n }", "private function new_account($username){\n\t\t\t\t\n\t\t$stmt = $this->db->prepare('SELECT * FROM account WHERE username=:username');\n\t\t$stmt->execute(['username'=>$username]);\n\t\t$result = $stmt->fetch();\n\t\t//the if loop checks if the account exists\n\t\tif(is_array($result) && count($result) > 0){\n\t\t\treturn false;//does exists\n\t\t}\n\t\treturn true;//does not exist\n\t}", "function createAccount($name, $displayName, $phone, $address, $zip, $email, $password, $type){\n\t//connect and select db\n\t$connection = new mysqli(\"ninthlife.czilv4k1yhiv.us-east-2.rds.amazonaws.com\", \"admin\", \"ninthlife\");\n\t//make sure account doesn't already exist\n\t$connection->query(\"select * from `Users` where password='$password' AND email='$email'\");\n\t$result = $connection->query($sql);\n\tif($result->num_rows >= 1){ //if email, password are the same\n\t\t$connection->close();\n\t\theader(\"location:register.php?status=failed\");\n\t}//end if($rows >=1)\n\telse{//if it does not exist, check email and type (in case pw is wrong)\n\n\t\t$angel = 0;\n\t\t$owner = 0;\n\t\tif($type == 'angel'){\n\t\t\t$angel = 1;\n\t\t\t$owner = 0;\n\t\t}\n\t\telse{\n\t\t\t$angel = 0;\n\t\t\t$owner = 1;\n\t\t}\n\n\t\t$connection = new mysqli(\"ninthlife.czilv4k1yhiv.us-east-2.rds.amazonaws.com\", \"admin\", \"ninthlife\", \"ninth_life\");\n\t\t$connection->query(\"INSERT INTO `Users` (`password`, `email`, `phone`, `streetAddress`, `zipCode`, `fullName`, `displayName`, `rating`, `angel`, `owner`) VALUES (\\\"\".$password.\"\\\", \\\"\". $email .\"\\\", \\\"\". $phone . \"\\\", \\\"\". $address. \"\\\", \\\"\". $zip .\"\\\", \\\"\" . $name . \"\\\", \\\"\" . $displayName . \"\\\", 0, \" . $angel . \", \" . $owner . \");\");\n\t\t$connection->close();\n\n\t\tlogin($email,$password);\t\n\t}//end first else\n}", "private function createUser()\n {\n $sl = $this->getServiceManager();\n $userService = $sl->get(\"zfcuser_user_service\");\n $randomness = \"mockuser_\".mt_rand();\n $data = array(\n \"username\" => \"{$randomness}\",\n \"password\" => \"password\",\n \"passwordVerify\" => \"password\",\n \"display_name\" => \"MOCKUSER\",\n \"email\" => \"{$randomness}@google.com\"\n );\n $user = $userService->register($data);\n\n return $user;\n }", "public function createOrGetUser($provider)\n {\n $providerUser = \\Socialite::driver($provider)->user();\n $account = SocialAccount::whereProvider($provider)\n ->whereProviderUserId($providerUser->getId())\n ->first();\n if ($account) {\n return $account->user;\n } else {\n $account = new SocialAccount([\n 'provider_user_id' => $providerUser->getId(),\n 'provider' => $provider\n ]);\n $user = User::whereEmail($providerUser->getEmail())->first();\n if (!$user) {\n DB::beginTransaction();\n try {\n $user = User::create([\n 'role_id' => 2,\n ]);\n Profile::create([\n 'user_id' => $user->id,\n 'name' => $providerUser->name,\n 'avatar' => $providerUser->avatar,\n ]);\n DB::commit();\n } catch (Exception $e) {\n Log::error($e);\n DB::rollback();\n }\n }\n $account->user()->associate($user);\n $account->save();\n return $user;\n }\n }", "public function createFromRemote() {\n $edit = array(\n 'mail' => $this->email,\n 'name' => $this->email,\n 'pass' => $this->password,\n 'status' => 1,\n 'created' => REQUEST_TIME,\n );\n\n $dob = new DateObject($this->remote_account->DOB);\n $fields = array(\n 'birthdate' => $dob->format(DATE_FORMAT_DATE),\n 'first_name' => $this->remote_account->Name,\n 'country' => variable_get('dosomething_user_address_country'),\n 'user_registration_source' => DOSOMETHING_CANADA_USER_SOURCE,\n );\n dosomething_user_set_fields($edit, $fields);\n\n try {\n $account = user_save('', $edit);\n }\n catch (Exception $e) {\n watchdog_exception(DOSOMETHING_CANADA_WATCHDOG, $e);\n return FALSE;\n }\n\n $this->local_account = $account;\n return $this->local_account;\n }", "public function create() {\n\n if ($this->getIsNewRecord() == false) {\n throw new \\RuntimeException('Calling \"' . __CLASS__ . '::' . __METHOD__ . '\" on existing user');\n }\n\n $transaction = $this->getDb()->beginTransaction();\n\n try {\n $this->password = $this->password == null ? Password::generate(8) : $this->password;\n\n $this->trigger(self::BEFORE_CREATE);\n\n if (!$this->save()) {\n $transaction->rollBack();\n return false;\n }\n\n $this->confirm();\n\n $this->mailer->sendWelcomeMessage($this, null, true);\n $this->trigger(self::AFTER_CREATE);\n\n $transaction->commit();\n\n return true;\n } catch (\\Exception $e) {\n $transaction->rollBack();\n \\Yii::warning($e->getMessage());\n throw $e;\n }\n\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public static function user()\n {\n if(static::$_auth_user) {\n return static::$_auth_user;\n }\n\n #Check for authenticated session\n $auth_id = Session::get(static::$_auth_name);\n $instance = static::getConfig('instance');\n\n if($auth_id) {\n static::$_auth_user = new $instance($auth_id);\n return static::$_auth_user;\n }\n\n #Check for user auto log cookie\n $cookie_token = Cookie::get(static::$_auth_name);\n\n if($cookie_token) {\n $user_id = static::validateAuthCookieToken($cookie_token);\n\n if(!$user_id) {\n static::logout();\n return false;\n }\n\n static::$_auth_user = new $instance($user_id);\n #update cookie\n static::setUserCookieToken($user_id);\n return static::$_auth_user;\n }\n\n return false;\n }", "private function checkUser($_AdUser)\n {\n //get the user path from config\n $u = config('azureAdAuth.user_model');\n $theUser = $u::where('email', $_AdUser->userPrincipalName)->first();\n if($theUser == null){\n // create the user\n $usr = new $u();\n $usr->email = $_AdUser->userPrincipalName;\n $usr->name = $_AdUser->displayName;\n $usr->password = Hash::make($_AdUser->id);\n $usr->save();\n\n $theUser = $usr;\n }\n Auth::login($theUser);\n return Auth::check();\n }", "public static function get_temp_user() {\n\t\tglobal $wpdb;\n\n\t\t$id = LP()->session->get( 'temp_user' );\n\n\t\t// If temp user is not set or is not exists\n\t\tif ( ! $id || ! get_user_by( 'id', $id ) ) {\n\n\t\t\t// Force to enable cookie\n\t\t\tLP()->session->set_customer_session_cookie( true );\n\n\t\t\t// Find temp user is not used\n\t\t\t$query = $wpdb->prepare(\n\t\t\t\t\"\n\t\t\t\tSELECT ID\n\t\t\t\tFROM {$wpdb->users} u\n\t\t\t\tINNER JOIN {$wpdb->usermeta} um ON u.ID = um.user_id AND um.meta_key = %s AND um.meta_value = %s\n\t\t\t\tLEFT JOIN {$wpdb->usermeta} um2 ON u.ID = um2.user_id AND um2.meta_key = %s\n\t\t\t\tWHERE um2.meta_value IS NULL\n\t\t\t\tLIMIT 0, 1\n\t\t\t\",\n\t\t\t\t'_lp_temp_user',\n\t\t\t\t'yes',\n\t\t\t\t'_lp_expiration'\n\t\t\t);\n\n\t\t\t$id = $wpdb->get_var( $query );\n\n\t\t\t// If there is no user, create one\n\t\t\tif ( ! $id ) {\n\t\t\t\t$username = 'user_' . date( 'YmdHis' );\n\t\t\t\t$email = sprintf( '%s@%s', $username, $_SERVER['HTTP_HOST'] );\n\t\t\t\tif ( ! preg_match( '~\\.([a-zA-Z])$~', $email ) ) {\n\t\t\t\t\t$email .= '.com';\n\t\t\t\t}\n\t\t\t\t$thing = wp_create_user( $username, 'test', $email );\n\t\t\t\tif ( ! is_wp_error( $thing ) ) {\n\t\t\t\t\t$id = $thing;\n\t\t\t\t\tupdate_user_meta( $id, '_lp_temp_user', 'yes' );\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $id ) {\n\n\t\t\t\t// Set session and temp user expiration time\n\t\t\t\tupdate_user_meta( $id, '_lp_expiration', time() + DAY_IN_SECONDS * 2 );\n\n\t\t\t\tdelete_user_meta( $id, 'wp_capabilities' );\n\n\t\t\t\t// Set session\n\t\t\t\tLP()->session->set( 'temp_user', $id );\n\t\t\t}\n\t\t}\n\n\t\tif ( $id ) {\n\t\t\t$expiring = get_user_meta( $id, '_lp_expiration', true );\n\t\t\t// Update new expiration time if time is going to reach\n\t\t\tif ( time() > $expiring - HOUR_IN_SECONDS ) {\n\t\t\t\tupdate_user_meta( $id, '_lp_expiration', time() + DAY_IN_SECONDS * 2 );\n\t\t\t}\n\t\t}\n\n\t\treturn new LP_User_Guest( $id );\n\t}", "public function createUser()\n {\n $c = $this->getConnectionWithConfig('default');\n\n // First we create the record that we need to update\n $create = 'CREATE (u:User {name: $name, email: $email, username: $username})';\n // The bindings structure is a little weird, I know\n // but this is how they are collected internally\n // so bare with it =)\n $createCypher = $c->getCypherQuery($create, array(\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'username' => $this->user['username'],\n ));\n\n return $this->client->run($createCypher['statement'], $createCypher['parameters']);\n }", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "function new_user($firstName,$lastName,$email,$password){\t\n $salt = generate_salt();\n $encPassword = encrypt_password($password,$salt);\n\n //$user = create_user_object($firstName,$lastName,$email,$encPassword,$salt,$userType);\n save_user_info($firstName,$lastName,$email,$encPassword,$salt);\n \n return true;\n}", "private function getResourceAccount()\n\t{\n\t\tif (!$this->account) {\n\t\t\t$payload = [\n\t\t\t\t'onlyReturnExisting' => true,\n\t\t\t];\n\n\t\t\t$this->requestResource('POST', ResourcesDirectory::NEW_ACCOUNT, $payload);\n\t\t\t$this->account = $this->getHttpClient()->getLastLocation();\n\t\t}\n\n\t\treturn $this->account;\n\t}", "public function createOrGetUser(Request $request)\n {\n $portal = $this->getUserInfo($request);\n\n // retrive account\n $account = SocialAccount::whereProvider('portal')\n ->whereProviderUserId($portal->{'id'})\n ->first();\n // if exist\n if ($account) {\n return $account->user;\n } else {\n // no exist, create user\n $account = new SocialAccount([\n 'provider_user_id' => $portal->{'id'},\n 'provider' => 'portal'\n ]);\n $user = User::create([\n 'email' => $portal->{'id'} . '@cc.ncu.edu.tw',\n 'name' => $portal->{'name'},\n // 'real_name' => $portal->{'name'},\n 'id' => $portal->{'id'},\n 'phone' => '無資料',\n 'level' => '一般使用者'\n // 'unit' => $portal->{'unit'},\n // 'type' => $portal->{'type'}\n ]);\n\n // social_accounts associate to user\n $account->user()->associate($user);\n $account->save();\n\n return $user;\n }\n }", "function createUser($name, $password)\n{\n global $db;\n $query = getAllUsers(); //Query for getting all users from the database\n $existingUsers = db_select($db, $query); //Array of all the users in the database\n //check if username ($name) already exists in the database\n foreach ($existingUsers as $value) {\n if ($value['username'] == $name) {\n //username already taken\n return false;\n }\n }\n $hashedPassword = password_hash($password, PASSWORD_DEFAULT); //hashed password to store in database\n $queryAddUser = addUser($name, $hashedPassword); //Query for adding a new user to the database\n db_query($db, $queryAddUser); //Add the user to the database\n //Create a new session with the newly created user (login user)\n $_SESSION['userId'] = $name;\n return true;\n}", "private function findAccount() {\n\t\t\tassertArray($this->errorMsgs);\n\t\t\t// find existing email/login\n\t\t\t$result = $this->dbh->query(\"SELECT `affiliateID`, `email`, `password` FROM `affiliates` WHERE `email` = '\".prepDB($this->registrationForm['email']).\"'\");\n\t\t\tif (isset($_REQUEST['affiliateLogin'])) {\n\t\t\t\t// login\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t// already logged in\n\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['password'] != $this->registrationForm['password']) {\n\t\t\t\t\t\t// login, incorrect password\n\t\t\t\t\t\t$this->errorMsgs[] = 'Incorrect password for '.$this->registrationForm['email'];\n\t\t\t\t\t\taddErrorField('password');\n\t\t\t\t\t} elseif (!$this->affiliateID) {\n\t\t\t\t\t\t// affiliate id is the logged in flag\n\t\t\t\t\t\t// the only way affiliate id can be set is if user successfully creates a new account or logs in\n\t\t\t\t\t\t$this->affiliateID = $row['affiliateID'];\n\t\t\t\t\t\t// update login count\n\t\t\t\t\t\t$this->dbh->query(\"UPDATE `affiliates` SET `totalLogins` = `totalLogins` + 1 WHERE `affiliateID` = '\".prepDB($this->affiliateID).\"'\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// no email found\n\t\t\t\t\t$this->errorMsgs[] = 'Email not found';\n\t\t\t\t}\n\t\t\t} elseif ($this->affiliateID) {\n\t\t\t\t// affiliate changing account info\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['affiliateID'] != $this->affiliateID) {\n\t\t\t\t\t\t// user entered an existing address/login that belongs to another account\n\t\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please enter a different email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are currently using this email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t// new account\n\t\t\t\t$row = $result=>fetchAssoc();\n\t\t\t\tif ($row['email'] == prepDB($this->registrationForm['email'])) {\n\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please log in or enter a different email address';\n\t\t\t\t\taddErrorField('email');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function _createUser() {\n\t\t$user = System_Locator_TableLocator::getInstance()->get('User')->createRow();\n\t\t$user->username = $this->getUsername();\n\t\t$user->setPassword($this->getPassword());\n\t\t$user->email = $this->getEmail();\n\t\t$user->countryCode = $this->getCountryCode();\n\t\t$user->createdAt = date(DATE_ISO8601); \n\t\treturn $user;\n\t}", "public function account()\n {\n if ($response = $this->request('account')) {\n if (isset($response->success) && $response->success == true) {\n return $response->account;\n }\n }\n return false;\n }", "public function adduseraccount() {\n\n $usr = new UserAccount();\n\n if(!$usr->access()) {\n\n return \"connection failure!\";\n\n }\n\n if($this->ruseript('name', 'username')) {\n\n return \"username already exists\";\n\n }\n\n else if($this->ruseript('mail', 'email')) {\n\n return \"email already exists\";\n\n }\n\n else {\n\n $usr->insertuserinfo($_POST);\n\n return;\n\n }\n\n }", "public function createAccount(){\n\t\t\n\t\t$email = trim($_POST['signupemail']);\n\t\t$uname = trim($_POST['uname']);\n\t\t\n\t\t$v = sha1(time());\n\t\t//check for previous uses of that username\n\t\t$sql = \"SELECT COUNT(uname) AS theCount FROM user where uname=:uname\";\n\t\t\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uname\", $uname, PDO::PARAM_STR);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']!=0){\n\t\t\t\treturn \"Sorry, that username is already on the system.\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$sql = \"SELECT COUNT(email) AS theCount FROM user where email=:email\";\n\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":email\", $email, PDO::PARAM_STR);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']!=0){\n\t\t\t\treturn \"Sorry, that email is already on the system. \";\n\t\t\t}\n\t\t\tif(!$this->sendVerificationEmail($email, $v)){\n\t\t\t\treturn \"There was an error sending the verification email.\";\n\t\t\t}\n\t\t\t$stmt ->closeCursor();\n\t\t}\n\t\t\n\t\t$sql = \"INSERT INTO user(email, uname, ver_code) VALUES(:email, :uname, :ver)\";\n\t\tif($stmt = $this->_db->prepare($sql)) {\n\t\t\t$stmt->bindParam(\":email\", $email, PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":ver\", $v, PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":uname\", $uname, PDO::PARAM_STR);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->closeCursor();\n\t\t}\n\t\telse{\n\t\t\treturn \"Could not create the user\";\n\t\t}\n\t}", "public function signupUser()\n { \n $user = User::findByUserEmail($this->email);\n if($user == null) { \n $user = new User();\n $user->user_full_name = $this->username;\n if(!empty($this->phone)) {\n $user->phone_number = $this->phone;\n }\n if(!empty($this->email)) { \n $user->email = $this->email;\n }\n $user->password_hash = md5($this->password);\n $user->login_method = 'email';\n $user->save();\n } \n return $user;\n }", "private function createNewUser():User\n {\n $entityManager = $this->getDoctrine()->getManager();\n\n //create user\n $user = new User();\n $user->setEmail($this->request->request->get('email'));\n $user->setPassword('');\n $entityManager->persist($user);\n $entityManager->flush();\n //create user\n\n //encode user password\n $user->setPassword($user->encodePassword($this->request->request->get('password')));\n $entityManager->persist($user);\n $entityManager->flush();\n //encode user password\n return $user;\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public static function create($data) {\n try {\n /**\n * Database Eloquent access\n */\n $user = User::create($data);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n /**\n * See xxx_user_table.php \n * migrations files sequentially for futher infos.\n */\n return false;\n }\n /**\n * Well user is available.\n */\n return $user;\n }", "public function getUserRecord()\n {\n // we cache the user entry per request\n if($this->user)\n return $this->user;\n\n $res = $this->db->getUser();\n // if null create, onerror return false\n if($res === null)\n {\n // user entry does not exist, create it\n $res = $this->create();\n if(!$res)\n return false;\n\n // fetch the record to return\n $res = $this->db->getUser();\n if(!$res)\n return false;\n }\n elseif($res === false)\n {\n return false;\n }\n\n $this->user = $res;\n return $this->user;\n }", "function messenger_find_user_or_create($uid)\n{\n $user = user_load($uid);\n\n $error = new stdClass();\n $error->message = \"User not found\";\n $error->error = True;\n\n if (!isset($user->uid)) {\n return drupal_json_output($error);\n }\n\n $result = messenger_find_or_create_user($user);\n\n\n if ($result) {\n $success = new stdClass();\n $success->data = $result;\n\n\n return drupal_json_output($success);\n } else {\n $error->message = \"An error\";\n return drupal_json_output($error);\n }\n}", "protected function existingResource() : Employee\n {\n // return the auth user itself\n return $this->authUser->makeHidden('salon');\n }", "public function create() {\n $username = Input::get('reg_username');\n $email = Input::get('email');\n $password = Input::get('reg_password');\n $confirm_password = Input::get('confirm_password');\n\n // Make sure that both passwords are identical\n if (strcmp($password, $confirm_password) == 0) {\n $hashed_password = Hash::make($password);\n try {\n $user = new User;\n $user -> username = $username;\n $user -> email = $email;\n $user -> password = $hashed_password;\n $user -> save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'Error: Failed to register user in database.',\n 'alert-class' => 'alert-danger'\n ));\n }\n\n // Login the new user automatically\n $user = User::where('username', '=', $username) -> first();\n Auth::login($user);\n\n return Redirect::route('home') -> with(array(\n 'alert-message' => 'Welcome! You have successfully created an account, and have been logged in.',\n 'alert-class' => 'alert-success'\n ));\n }\n\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'The attempt to create an account was unsuccessful!',\n 'alert-class' => 'alert-danger'\n ));\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function Create_Account(){\n\n $name_user = strip_tags($this->input->post('nom'));\n $email_user = strip_tags($this->input->post('email'));\n $pseudo_user = strip_tags($this->input->post('pseudo'));\n $pass_user = sha1($this->input->post('pwd'));\n $confirm_pass_user = sha1($this->input->post('pwdc'));\n if ($pass_user == $confirm_pass_user && filter_var($email_user,FILTER_VALIDATE_EMAIL)) {\n $verify_user_exist = $this->compte_model->Sign_In_User($pseudo_user,$pass_user);\n if ($verify_user_exist == false) {\n\n $this->compte_model->Create_Account_User($name_user,$email_user, $pseudo_user, $pass_user);\n echo \"VOUS AVEZ CREE UN COMPTE ET BIENVENU CHEZ NOUS!\";\n }\n }else{\n redirect('HTTP_REFERERER');\n }\n }", "protected function create(array $data)\n {\n $user = $this->userService->createUser($data);\n if(!$user) \n return redirect()->back()->with([\"status\" => \"error\", \"msg\"=>\"An Error Occured While Creating a user\"]);\n $this->capsuleService->createParty(PartyDto::fromUser($user)); // create a party on capsule crm for representing registered user\n $this->capsuleService->notifySalesHeadOfNewUserSignup($user); // Send a notification to app sales head on user signup\n return $user;\n }", "public function account() {\n $connection = new HTTPConnector($this);\n $url = $this->credential->getRequestUrl(BitcasaConstants::METHOD_USER . BitcasaConstants::METHOD_PROFILE);\n if (!BitcasaUtils::isSuccess($connection->get($url))) {\n return null;\n }\n\n $response = $connection->getResponse(true);\n\n $accountInfo = Account::getInstance($response);\n return $accountInfo;\n }", "private function findOrCreateUser($providerUser, $service)\n {\n\n $account = SocialAuth::whereProvider($service)\n ->whereProviderId($providerUser->getId())\n ->first();\n\n if ($account) {\n return $account->user;\n } else {\n $account = new SocialAuth([\n 'provider_id' => $providerUser->getId(),\n 'provider' => $service\n ]);\n\n $user = User::whereEmail($providerUser->getEmail())->first();\n\n if (!$user) {\n $user = User::create([\n 'email' => $providerUser->getEmail(),\n 'avatar' => $providerUser->getAvatar(),\n 'name' => $providerUser->getName(),\n 'password' => bcrypt(rand(1,10000)),\n ]);\n }\n\n $account->user()->associate($user);\n $account->save();\n\n return $user;\n }\n }", "function db_create_account_with_values($username, $account_values)\n{\n if (!is_array($account_values) || !$username)\n return false;\n $account = db_get_account($username);\n if (!$account) {\n return db_save_object('Account', 'login', $username, $account_values);\n }\n return false;\n}", "public static function checkAccount () {\n $user_id = session::getUserId();\n if ($user_id) {\n $a = q::select('account')->filter('id =', $user_id)->fetchSingle();\n \n // user may have been deleted\n if (empty($a)) {\n self::killSessionAll($user_id);\n return false;\n } \n \n if ($a['locked'] == 1) {\n self::killSessionAll($user_id);\n return false;\n }\n }\n return true;\n }", "protected /*User_Provider*/ function enforceExistence(/*string*/ $netid)\n\t{\n\t\t// Attempt to get the user record.\n\t\t$service = App::getUserService();\n\t\t$user = $service->loadByName($netid);\n\n\t\t// If we have not yet seen this user, we need to make a database record.\n\t\tif($user === null) {\n\t\t\t$stmt = $this->db->prepare(\"INSERT INTO `users` (`username`) VALUES (?);\");\n\t\t\t$res = $stmt->execute($netid);\n\t\t\t$user = $service->load($res->insertId);\n\t\t}\n\n\t\treturn $user;\n\t}", "private function ensureAuthed()\n\t{\n\t\t$auth = AuthBackend::getInstance();\n\t\tif (!($this->username = $auth->getCurrentUser()))\n\t\t{\n\t\t\tthrow new Exception('you are not logged in', E_PERM_DENIED);\n\t\t}\n\t\treturn $auth;\n\t}", "protected function create(array $data)\n {\n\n $user = User::create([\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'email' => $data['email'],\n 'password' => md5($data['password']),\n ]);\n\n if ($user) {\n //create stripe account first\n $company_email = $data['email'];\n //create company's stripe account\n Stripe::setApiKey(getenv('STRIPE_API_KEY'));\n\n //check whether stripe account exists with this email\n $last_customer = null;\n $customer_looking_for = null;\n while (true) {\n $stripe_customers = Account::all(array(\"limit\" => 100, \"starting_after\" => $last_customer));\n foreach ($stripe_customers->autoPagingIterator() as $stripe_customer) {\n if ($stripe_customer->email == $company_email) {\n\n $customer_looking_for = $stripe_customer;\n break 2;\n }\n\n }\n if (!$stripe_customers->has_more) {\n break;\n }\n $last_customer = end($stripe_customers->data);\n }\n\n $id = '';\n\n if ($customer_looking_for) {\n\n $id = $customer_looking_for->id;\n\n } else {\n $stripe_account_data = [\n \"type\" => \"standard\",\n \"email\" => $company_email,\n \"country\" => \"us\"\n ];\n\n $error_occur = false;\n try {\n $result = Account::create($stripe_account_data);\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n $body = $e->getJsonBody();\n $err = $body['error'];\n //print('Message is:' . $err['message'] . \"\\n\");\n $error_occur = true;\n return redirect()->back()->with('error', 'STRIPE ERROR: ' . $err['message']);\n }\n\n if (!$error_occur) {\n $id = $result[\"id\"];\n }\n }\n\n if ($id != \"\") {\n $user->stripe_account = $id;\n $user->save();\n }\n }\n\n return $user;\n }", "function master_add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password, $user_picture){\n //encrypt email\n $user_email = encrypt_user_email($user_email);\n //encrypt password\n $user_password = encrypt_user_password($user_password);\n\n if($this->user->add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password,\n upload_user_profile_picture()) == true){\n // alert user not added\n //add user details to session\n }\n else{\n //alert user not added\n //allow user to try or ask if pass is forgotten\n }\n }", "public function store()\n {\n $valid = User::isValid(Input::all());\n \n if($valid === true) {\n // Ensure that password is set\n if(Input::get('password') == null) {\n return $this->respondConflict(\"password must be set\");\n }\n \n // Check for if user has already been created\n try {\n User::create(array(\n \"firstname\" => Input::get(\"first\"),\n \"lastname\" => Input::get(\"last\"),\n \"email\" => Input::get(\"email\"),\n \"password\" => Hash::make(Input::get(\"password\"))\n ));\n } catch (Exception $e) {\n return $this->respondConflict(\"User already exists\");\n }\n \n return $this->respond(array(\"message\" => \"User Created\"));\n \n } else {\n return $this->respondConflict($valid);\n }\n }", "public function save() {\n\t\tif (!$this->validate()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach($this->attributeNames() as $name) {\n\t\t\tif ($name != 'password2') {\n\t\t\t\t$this->user->$name = $this->$name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->getScenarioIsCreation()) {\n\t\t\t$this->user->isNewRecord = true;\n\t\t}\n\t\tif (!$this->user->save(false, $this->getSafeAttributeNames())) {\n\t\t\t$this->addError('', 'Save account failed');\n\t\t\treturn false;\n\t\t}\n\t\t$msg = $this->getScenarioIsCreation()\n\t\t\t? 'Add Account successfull' : 'Save Account successfull'; \n\t\tYii::app()->console->addSuccess($msg);\n\t\treturn true;\n\t}", "function create_user($post_array) {\n\t\t$db = connect_to_db();\n\n\t\t// Get field information from Create Account page\n\t\t$username = $post_array['username'];\n\t\t$password = md5($post_array['password']);\n\t\t$confirm_password = md5($post_array['confirm_password']);\n\n\t\tif (\n\t\t\tis_null($username) || is_null($password) || is_null($confirm_password)\n\t\t\t|| $username == \"\" || $password == \"\" || $confirm_password == \"\"\n\t\t) {\n\t\t\techo\n\t\t\t\t\"Please fill out all fields.<br>\" .\n\t\t\t\t\"<a href = /smartlots/admin/create_account.php>\" .\n\t\t\t\t\t\"Try again\" .\n\t\t\t\t\"</a>\"\n\t\t\t;\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\tif ( $password != $confirm_password ) {\n\t\t\techo\n\t\t\t\t\"Passwords don't match!<br>\" .\n\t\t\t\t\"<a href = /smartlots/admin/create_account.php>\" .\n\t\t\t\t\t\"Try again\" .\n\t\t\t\t\"</a>\"\n\t\t\t;\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t// Check if username exists\n\t\t$check_user_name_query = \"select id from users where username = ?\";\n\t\t$stmt = $db->prepare($check_user_name_query);\n\n\t\t$stmt->bind_param(\"s\", $username);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($check_user_name_query_result);\n\t\t$stmt->fetch();\n\t\t$stmt->free_result();\n\n\t\t// $check_user_name_query_result;\n\n\t\tif ($check_user_name_query_result != null) {\n\t\t\techo\n\t\t\t\t\"We're sorry, the username '\" . $username . \"' has already been taken.<br>\" .\n\t\t\t\t\"<a href = /smartlots/admin/create_account.php>\" .\n\t\t\t\t\t\"Try again\" .\n\t\t\t\t\"</a>\"\n\t\t\t;\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t// Prepare user query\n\t\t$create_user_query = \"insert into users (username, password) values (?, ?)\";\n\t\t$stmt = $db->prepare($create_user_query);\n\n\t\t// Bind the parameters to the query\n\t\t$stmt->bind_param(\"ss\", $username, $password);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\t// Result was false (error inserting into database)\n\t\t\techo\n\t\t\t\t\"Error: Your account was not successfully created. Please try again later.<br>\" .\n\t\t\t\t\"<a href = /smartlots/admin/create_account.php>\" .\n\t\t\t\t\t\"Try again\" .\n\t\t\t\t\"</a>\"\n\t\t\t;\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t// Close the database connection\n\t\t$db->close();\n\n\t}", "public function attempt(array $credentials) {\n $user = $this->users->retrieveByCredentials($credentials);\n\n if($user instanceof UserInterface && $this->users->validateCredentials($user, $credentials)) {\n return $this->create($user);\n }\n\n return false;\n }", "public function checkUser()\n {\n // Prepare ids used to avoid SQL injections(bad code)\n // we store them in the var $sql\n // we select the id and password from the table users where the username equals what was put it\n $sql = $this->db->prepare('SELECT id, password FROM admin WHERE username = ?');\n // Then we bind the parameters, its a string so we use 's', then we execute the statment\n $sql->bind_param('s', $_POST['username']);\n $sql->execute();\n // Now we store the results\n $sql->store_result();\n\n //if the returned rows are greater then 0\n // we bind the results the variblesand then fetch them \n if ($sql->num_rows > 0) {\n $sql->bind_result($id, $password);\n $sql->fetch();\n // If the rows are more then 0 we know the account name exist, now lets check the password!\n // we werify our hashed password if user name and password are right we create a new session\n // Note: remember to use password_hash in your registration file to store the hashed passwords.\n if (password_verify($_POST['password'], $password)) {\n // new session created with a var for being loged in set to true\n //the name is equal to the name from the field\n // and the id is equal to the users id\n session_regenerate_id();\n $_SESSION['loggedin'] = TRUE;\n $_SESSION['person'] = $_POST['username'];\n $_SESSION['id'] = $id;\n } else {\n // Incorrect password\n echo 'Wrong username or password';\n }\n } else {\n // wrong credentials\n echo 'Wrong username or password';\n }\n//we close the prepared statment\n $sql->close();\n }", "public static function auth() : ?object\n {\n // Retrieve the \"full user\" just one time\n if (self::$fullUser) {\n return self::$fullUser;\n }\n\n if (! $token = $_COOKIE['NameYourGoat_User_Token'] ?? null) {\n return null;\n }\n\n if (! $user = Repository\\User::byToken($token)) {\n setcookie('NameYourGoat_User_Token', null, 0, '/');\n return null;\n }\n\n self::authCookie($token);\n\n return self::$fullUser = $user;\n }", "private function findOrCreateUser($githubUser)\n {\n if ($authUser = User::where('email', $githubUser->email)->first()) {\n return $authUser;\n }\n\n return User::create([\n 'name' => $githubUser->name,\n 'email' => $githubUser->email,\n 'password' => Hash::make('123456789'),\n ]);\n }", "public function create(User $user)\n {\n return Auth::check();\n }", "public function create(User $user)\n {\n return Auth::check();\n }", "protected function getUserOrImpersonateUser() {\n if ($this->get('security.authorization_checker')->isGranted('ROLE_CDG')) {\n $session = $this->get('session');\n $userId = $session->get('user_id');\n $userRepository = $this->getDoctrine()->getRepository('UserBundle:User');\n $user = $userRepository->find($userId);\n $session->set('user_siret', $user->getUsername());\n } else {\n $user = $this->getUser();\n }\n\n return $user;\n }", "protected function _createAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\tif(!check($this->_email)) return;\n\t\t\n\t\t$data = array(\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password,\n\t\t\t'name' => $this->_username,\n\t\t\t'serial' => $this->_serial,\n\t\t\t'email' => $this->_email\n\t\t);\n\t\t\n\t\tif($this->_md5Enabled) {\n\t\t\t$query = \"INSERT INTO \"._TBL_MI_.\" (\"._CLMN_USERNM_.\", \"._CLMN_PASSWD_.\", \"._CLMN_MEMBNAME_.\", \"._CLMN_SNONUMBER_.\", \"._CLMN_EMAIL_.\", \"._CLMN_BLOCCODE_.\", \"._CLMN_CTLCODE_.\") VALUES (:username, [dbo].[fn_md5](:password, :username), :name, :serial, :email, 0, 0)\";\n\t\t} else {\n\t\t\t$query = \"INSERT INTO \"._TBL_MI_.\" (\"._CLMN_USERNM_.\", \"._CLMN_PASSWD_.\", \"._CLMN_MEMBNAME_.\", \"._CLMN_SNONUMBER_.\", \"._CLMN_EMAIL_.\", \"._CLMN_BLOCCODE_.\", \"._CLMN_CTLCODE_.\") VALUES (:username, :password, :name, :serial, :email, 0, 0)\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }", "static function doCreateUser()\n {\n global $controller;\n runtime_csfr::Protect();\n $currentuser = ctrl_users::GetUserDetail();\n $formvars = $controller->GetAllControllerRequests('FORM');\n if ($formvars['inAccess'] == 1) {\n $access = \"%\";\n } else {\n $access = $formvars['inAccessIP'];\n }\n if (self::ExecuteCreateUser($currentuser['userid'], $formvars['inUserName'], $formvars['inDatabase'], $access))\n return true;\n return false;\n }", "public function account()\n {\n return $this->hasOne(UserAccount::class);\n }", "function SignUpUser()\n {\n if (functions\\CheckFormat::CheckUsername($this->mUsername) && functions\\CheckFormat::CheckPassword($this->mPassword))\n $mAvailableUsername = $this->GetUsernameAvailability($this->mUsername);\n else {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Your username/password does not match the required format.\\\";\n\t\t\t\t\t\t</script>\";\n return -1;\n }\n\n if (!$mAvailableUsername) {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Username already exists\\\";\n\t\t\t\t\t\t\t\t</script>\";\n return -2;\n }\n if (!$this->CheckPasswordMatch($this->mPassword, $this->mPasswordConfirm)) {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Passwords don't match\\\";\n\t\t\t\t\t\t\t\t</script>\";\n return -3;\n }\n $this->mUserId = $this->NewUserToDb($this->mUsername, $this->mPassword);\n return $this->mUserId;\n }", "protected function signupUser($userInfo, $idToken = '') {\n // If the user doesn't exist we need to either create a new one, or assign him to an existing one.\n $isDatabaseUser = FALSE;\n\n $user_sub_arr = explode( '|', $userInfo['user_id'] );\n $provider = $user_sub_arr[0];\n\n if ('auth0' === $provider) {\n $isDatabaseUser = TRUE;\n }\n \n $joinUser = false;\n\n $config = \\Drupal::service('config.factory')->get('auth0.settings');\n $user_name_claim = $config->get('auth0_username_claim');\n if ($user_name_claim == '') {\n $user_name_claim = 'nickname';\n }\n $user_name_used = ! empty( $userInfo[ $user_name_claim ] )\n ? $userInfo[ $user_name_claim ] :\n // Drupal usernames do not allow pipe characters\n str_replace( '|', '_', $userInfo['user_id'] );\n \n if ( $config->get('auth0_join_user_by_mail_enabled') && ! empty( $userInfo['email'] ) ) {\n \\Drupal::logger('auth0')->notice($userInfo['email'] . 'join user by mail is enabled, looking up user by email');\n // If the user has a verified email or is a database user try to see if there is\n // a user to join with. The isDatabase is because we don't want to allow database\n // user creation if there is an existing one with no verified email.\n if ($userInfo['email_verified'] || $isDatabaseUser) {\n $joinUser = user_load_by_mail($userInfo['email']);\n }\n } else {\n \\Drupal::logger('auth0')->notice($user_name_used . ' join user by username');\n\n \t if (!empty($userInfo['email_verified']) || $isDatabaseUser) {\n \t $joinUser = user_load_by_name($user_name_used);\n }\n }\n\n if ($joinUser) {\n \\Drupal::logger('auth0')->notice($joinUser->id() . ' drupal user found by email with uid');\n\n // If we are here, we have a potential join user.\n // Don't allow creation or assignation of user if the email is not verified,\n // that would be hijacking.\n if (!$userInfo['email_verified']) {\n throw new EmailNotVerifiedException();\n }\n $user = $joinUser;\n }\n else {\n \\Drupal::logger('auth0')->notice($user_name_used.' creating new drupal user from auth0 user');\n\n // If we are here, we need to create the user.\n $user = $this->createDrupalUser($userInfo);\n \n // Update field and role mappings\n $this->auth0_update_fields_and_roles($userInfo, $user);\n }\n\n return $user;\n }", "public function newUser($request)\r\n {\r\n /*\r\n * As before we set $params1 'Username'. We need this to check if user exist in database beacuse we don't allow\r\n * two user in database with the same username.\r\n */\r\n $params1 = [\r\n 'Username' => $request['username']\r\n ];\r\n if ($this->existUser($params1) == True) {\r\n /*\r\n * If in the database exits user with the same username then you return false (user must change username)\r\n */\r\n\r\n return False;\r\n } else {\r\n\r\n /*\r\n * Next step is creating a valid activation hash code. We need this for security (in URL you dont want to show UserID\r\n * beacuse in this case attacker has more information about your database)\r\n * Each of users in database has unique activation hash code. Activation hash code we need for activation account and\r\n * reseting password.\r\n *\r\n * Now,follow algorithm for creating unique activation hash code.\r\n */\r\n while (True) {\r\n $params2 = [\r\n 'Activation' => password_hash(rand(), PASSWORD_DEFAULT)\r\n ];\r\n\r\n if ($this->existUser($params2) != True) {\r\n break;\r\n }\r\n }\r\n\r\n /*\r\n * Next step is set params which need to create new user into database.\r\n */\r\n\r\n $params3 = [\r\n 'Username' => $request['username'],\r\n 'Email' => $request['email'],\r\n 'Password' => password_hash($request['password'], PASSWORD_DEFAULT),\r\n 'IsDeleted' => '0',\r\n 'Registration' => (new DateTime('now'))->format('Y-m-d h:s'),\r\n 'Activation' => $params2['Activation']\r\n ];\r\n\r\n $userID = $this->create();\r\n\r\n /*\r\n * Creating link which is send to user mail at registration for activating his account.\r\n */\r\n $link = \"http://www.mdtohtml.com/index.php?activation=\" . $params3['Activation'];\r\n\r\n /*\r\n * Inserting new user in database\r\n */\r\n $this->update($userID, $params3);\r\n\r\n /*\r\n * Now we have to prepare data to send activation mail to user (mail).\r\n */\r\n\r\n $data = [\r\n 'email' => $request['email'],\r\n 'title' => 'Registration support',\r\n 'body' => \"Hello!\\n\\nClick on below link to confirm your registration.\\n\\n$link\",\r\n 'subject' => 'Confirm password',\r\n 'user' => $request['username'],\r\n 'link' => $link,\r\n 'username' => 'markdownmarkdown@gmail.com',\r\n 'password' => 'preskok123'\r\n\r\n ];\r\n\r\n /*\r\n * At the end sending activating mail to user.\r\n */\r\n\r\n $this->send_mail($data);\r\n return True;\r\n }\r\n\r\n }", "protected function authenticateUser()\n {\n $inviteCode = \\Yii::$app->request->get('invite');\n\n /**\n * @var $user User\n */\n $user = null;\n\n if (is_string($inviteCode)) {\n $user = User::getUserFromInviteCode($inviteCode);\n }\n\n if ($user === null) {\n /*\n * If invite code is not recognized, fail over to normal login\n */\n\n /** @var AuthnInterface $auth */\n $auth = \\Yii::$app->auth;\n /** @var AuthUser $authUser */\n $authUser = $auth->login($this->getReturnTo(), \\Yii::$app->request);\n\n /*\n * Get local user instance or create one.\n * Use employeeId since username or email could change.\n */\n $user = User::findOrCreate(null, null, $authUser->employeeId);\n }\n\n return $user;\n }", "public function userExists(User $user) {\n $query = $this->_db->prepare('SELECT * '\n . 'FROM user '\n . 'WHERE pseudo=:pseudo '\n . 'AND pwd=:pwd');\n $query->bindValue(':pseudo', $user->getPseudo());\n $query->bindValue(':pwd', $user->getPwd());\n $query->execute();\n $user = $query->fetch(PDO::FETCH_ASSOC);\n $query->closeCursor();\n if(!empty($user)){\n return new User($user);\n }\n }", "public function createOrGetUser(ProviderUser $user, $provider) {\n\n\t\t$account = User::whereProvider($provider)->whereProviderUserId($user->getId())->first();\n\n\t\tif (!$account) {\n\t\t\t$account = User::create([\n\t\t\t\t'email' => $user->getEmail(),\n\t\t\t\t'name' => $user->getName(),\n\t\t\t\t'password' => md5(rand(1111, 9999)),\n\t\t\t\t'provider_user_id' => $user->getId(),\n\t\t\t\t'provider' => $provider\n\t\t\t]);\n\n\t\t\t$account->save();\n\t\t}\n\n\t\treturn $account;\n\t}", "public function authenticate() {\n if ($this->email == null || $this->password == null) {\n return new Result(Result::FAILURE);\n }\n $UserMapper = $this->getServiceLocator()->get(\"Profond\\Mapper\\User\");\n $UserMapper->setServiceLocator($this->getServiceLocator());\n $User = $UserMapper->getOneUserByEmail($this->email);\n if ($User != null) {\n if ($this->password == $User->getPassword()) {\n return new Result(Result::SUCCESS, $User);\n } else {\n return new Result(Result::FAILURE_CREDENTIAL_INVALID, null);\n }\n } else {\n return new result(Result::FAILURE_IDENTITY_NOT_FOUND, null);\n }\n }", "function create_account($username, $password, $group_id, $salt){\n\n\t$password_hash = hash_password($password);\n\t\n\t$insert_row = \"INSERT INTO `account`.`account` (`account_id`, \n\t`username`, `password_hash`, `group_id`, `salt`, `failed_attempts`, \n\t`last_failed_time`) VALUES (NULL, '\".$username.\"', '\"\n\t.$password_hash.\"', '\".$group_id.\"', NULL, NULL, NULL);\";\n\n//\t$insert_row = \"INSERT INTO `account`(`account_id`, `username`, `password_hash`, `group_id`, `salt`, `failed_attempts`, `last_failed_time`, `last_active_login`, `first_name`, `last_name`, `sex`, `BMI`, `email`, `description`, `ethnicity`, `weight`, `height`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15],[value-16],[value-17]);\"\n\n\t$conn = connect_db();\n\t\n\t$query_user = \"SELECT username FROM account where username='\".$username.\"';\";\n\t$result = db_query($conn, $query_user);\n\t\n\tif (!$result and $username!=\"\"){\n\t\tif ($conn->query($insert_row) === TRUE) {\n\t\t\techo \"<br/>\",$username,\" created successfully\";\n\t\t} else {\n\t\t\techo \"<br/>Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\t}\n\telse{\n\t\techo \"<br/> Username is taken, try a different name\";\n\t}\n}", "public function checkUser(): CheckUser\n {\n return new CheckUser($this->_provider);\n }", "private function findOrCreateUser($facebookUser)\n {\n $authUser = User::where('facebook', $facebookUser->id)->first();\n \t\t\n if ($authUser){\n return $authUser;\n }\n \n return User::create([\n 'name' => $facebookUser->name,\n 'email' => $facebookUser->email,\n 'facebook' => $facebookUser->id,\n 'avatar' => $facebookUser->avatar\n ]);\n }", "public function getUser(): AccountInterface;", "public function create(){\r\n\t\t\t$data['title'] = \"Accounts | Create Account\";\r\n\t\t\t$data['userData'] = $this->session->userdata();\r\n\r\n\t\t\tif (!empty($this->input->post())){\r\n\t\t\t\t$accountCreateValidation = $this->form_validation->run();\r\n\r\n\t\t\t\tif($accountCreateValidation){\r\n\t\t\t\t\t$_POST['userID'] = $data['userData']['userID'];\r\n\t\t\t\t\t$createCheck = $this->account_model->createAccount($_POST);\r\n\t\t\t\t\tif ($createCheck){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'You have successfully created an account.');\r\n\t\t\t\t\t\tredirect('accounts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$this->session->set_flashdata('danger', 'Something internally happened. Please try again.');\r\n\t\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t}\r\n\t\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function writeNewUser () {\n if (! $this->Writeable()){\n throw new Exception('User object is not writeable, cannot write to DB');\n }\n\n if ($this->exists($this->loginId)) {\n throw new Exception('User already exists, cannot be created');\n }\n\n $i = new folksoDBinteract($this->dbc);\n if ($i->db_error()) {\n throw new Exception('DB connect error: ' . $i->error_info());\n }\n\n $i->sp_query(\n sprintf(\"call create_user(\"\n .\"'%s', '%s', '%s', '%s', '', %d, '%s', '%s', '%s')\",\n $i->dbescape($this->nick),\n $i->dbescape($this->firstName),\n $i->dbescape($this->lastName),\n $i->dbescape($this->email),\n $i->dbescape($this->loginId),\n $i->dbescape($this->institution),\n $i->dbescape($this->pays),\n $i->dbescape($this->fonction)));\n\n if ($i->result_status == 'DBERR') {\n throw new Exception('DB query error on create FB user: ' . $i->error_info());\n }\n }", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "public static function checkacct($fb_id)\n {\n $user = User::find('one', array('conditions' => array('fb_id=?', $fb_id)));\n return $user;\n }", "public function register() {\n\n // If it is not a valid password\n if (!$this->valid_password()) {\n return \"Invalid Password. It must be six characters\";\n }\n\n // If the mobile is valid\n if (!$this->valid_mobile()) {\n return \"Mobile Number is Invalid. It must be 10 numeric digits\";\n }\n\n // If there is a user with that username\n if (User::find($this->username, 'username') !== null) {\n return \"Username already taken\";\n }\n\n // Now we create the user on the database\n if ($this->create_record()) {\n echo \"<br><br>Record Created\";\n // We update the sync the object with the database\n if ($this->update_object('username')) {\n return true;\n echo \"<br><br>Object Updated\";\n }\n }\n\n return \"Sorry, an error has ocurred. Try again later\";\n }", "public function getUser()\n {\n $identity = $this->session->get('auth-identity');\n if (isset($identity['id'])) {\n $user = Users::findFirstById($identity['id']);\n if ($user == false) {\n // throw new Exception('The user does not exist');\n }\n\n return $user;\n }\n\n return false;\n }", "public function findOrCreateUser($keycloakUser)\n {\n $user = User::where('provider_id', $keycloakUser->getId())->first();\n\n if (!$user) {\n $user = new User;\n $user->create([\n 'id' => $keycloakUser->getId(),\n 'name' => $keycloakUser->getNickname(),\n 'email' => $keycloakUser->getEmail(),\n 'provider_id' => $keycloakUser->getId(),\n 'first_name' => $keycloakUser->first_name,\n 'last_name' => $keycloakUser->last_name,\n // 'gender' => $keycloakUser->gender,\n ]);\n }\n\n return $user;\n }", "public function testCreateAndUpdateUser()\n {\n $username = 'user@example.com';\n\n $currentEmail = $username;\n $newEmail = 'something@example.com';\n\n $raw = $this->getUser($username, $currentEmail);\n\n // Create\n $this->adapter->send(new Request(array(\n $raw,\n )));\n\n $real = static::$repository->getUserService()->loadUserByLogin($username);\n $this->assertInstanceOf(User::class, $real);\n $this->assertEquals($currentEmail, $real->email);\n\n // Update\n $raw->data['email'] = $newEmail;\n $this->adapter->send(new Request(array(\n $raw,\n )));\n\n $real = static::$repository->getUserService()->loadUserByLogin($username);\n $this->assertInstanceOf(User::class, $real);\n $this->assertEquals($newEmail, $real->email);\n }" ]
[ "0.7216162", "0.6819702", "0.6714649", "0.66241205", "0.6501642", "0.6497548", "0.6459904", "0.64420956", "0.64170396", "0.6396694", "0.6370085", "0.6347452", "0.62838906", "0.627016", "0.62652487", "0.6259856", "0.6239198", "0.6219045", "0.61351395", "0.61329746", "0.6131942", "0.61170894", "0.61020905", "0.6099323", "0.6091906", "0.6088497", "0.6085106", "0.60819966", "0.6066179", "0.6061596", "0.6056664", "0.6051846", "0.6028044", "0.602359", "0.6020271", "0.6013025", "0.60041374", "0.6001689", "0.5990173", "0.59896964", "0.598528", "0.5961788", "0.5959967", "0.5956373", "0.5952963", "0.5952248", "0.5940193", "0.5938898", "0.5938898", "0.5938898", "0.5938898", "0.5900473", "0.5892386", "0.5872034", "0.58628666", "0.5860916", "0.5835031", "0.5833576", "0.58310354", "0.58239496", "0.5819229", "0.58058995", "0.57991445", "0.57959956", "0.5794555", "0.57806766", "0.5772897", "0.5771638", "0.57669264", "0.57605153", "0.5758085", "0.5754449", "0.5751938", "0.5751582", "0.57453924", "0.57453924", "0.57444656", "0.5731933", "0.57300466", "0.5729126", "0.5727113", "0.5725139", "0.5714979", "0.57099926", "0.57017463", "0.56953686", "0.56874096", "0.56786156", "0.5675194", "0.5670272", "0.5659304", "0.56549656", "0.5654937", "0.56503004", "0.56466275", "0.5638096", "0.56357026", "0.56353396", "0.56344295", "0.5622562", "0.56168085" ]
0.0
-1
Default constructor We enable the authentication middleware for all functions of this controller
public function __construct() { $this->middleware('auth:api'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n\n\t\t$this->middleware( 'auth' );\n\n\t}", "public function __construct() {\n\t\t$this->middleware ( 'auth' );\n\t}", "public function __construct()\n {\n // Forces to be authenticated.\n // $this->middleware('auth');\n // $this->middleware('check_role:admin');\n // $this->middleware('fetch_objective');\n }", "public function __construct()\n\t{\n\t\t$this->middleware('token_auth', [\n\t\t\t'except' => [\n\t\t\t\t'register',\n\t\t\t\t'login',\n\t\t\t\t'token',\n\t\t\t\t'showToken',\n\t\t\t\t'refreshToken',\n\t\t\t\t'update',\n\t\t\t\t'delete'\n\t\t\t]\n\t\t]);\n\t\t$this->middleware('credentials_auth', [\n\t\t\t'except' => [\n\t\t\t\t'register',\n\t\t\t\t'show',\n\t\t\t\t'showOptions',\n\t\t\t\t'updateOptions',\n\t\t\t\t'exportAll_deprecated',\n\t\t\t\t'exportAll',\n\t\t\t\t'importAll_deprecated',\n\t\t\t\t'importAll'\n\t\t\t]\n\t\t]);\n\t}", "public function __construct(){\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n\t {\n\t $this->middleware('auth');\n\t }", "public\n\n\tfunction __construct() {\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\n\t}", "public function __construct() {\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n {\n // Allow access to only authenticated users\n $this->middleware('web');\n $this->middleware('auth'); // Some reason adding both middleware is the only way to go!\n }", "public function __construct() {\n\t\t$this->middleware('auth');\n\n\t}", "public function __construct()\n {\n $this->middleware(Authenticate::class);\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('active');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('lock');\n\t\t//$this->middleware('is_admin');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('admin');\n\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n\t\t\n\t\t//Controladores de usuarios\n $this->middleware('admin');\n }", "public function __construct() {\n $this->middleware( 'auth' );\n }", "public function __construct() {\n $this->middleware( 'auth' );\n }", "public function __construct() {\n\t\t$this->middleware('auth:api');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('role');\n\t}", "public function __construct()\n {\n // Middleware to require authenticate\n $this->middleware('auth', ['except' => ['index', 'show', 'men', 'women', 'kids']]);\n }", "public function __construct()\n {\n $this->middleware('auth');\n\t\tparent::__construct();\n }", "public function __construct()\n {\n $this->middleware('auth');\n\t\tparent::__construct();\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\r\n\t{\r\n\t\t$this->middleware('auth');\r\n\t}", "public function __construct()\r\n\t{\r\n\t\t$this->middleware('auth');\r\n\t}", "function __construct(){\n\t\t$this->middleware('auth', ['only' => ['add', 'index']]);\n\t}", "public function __construct()\n\t{\n //attach auth middleware to ensure login before accessing this controller\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t $this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t $this->middleware('auth');\n\t}", "public function __construct()\n {\n // Require the user to be logged in\n // for every action this controller does\n $this->middleware('auth');\n }", "public function __construct()\n {\n // Setting the auth middleware for this controller\n $this->middleware('auth');\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('admin', ['only' => ['index', 'add']]);\n }", "public function __construct()\n {\n\t\t// Ce middleware impose d'être connecté avant de pouvoir utiliser une méthode du controller\n $this->middleware('auth');\n }", "public function __construct()\n {\n\n $this->middleware('auth');\n\t\tparent::__construct();\n\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('tipo_usuario');\n\t}", "public function __construct()\n {\n \t$this->middleware('auth');\n }", "public function __construct()\n {\n\t\t$this->middleware('auth');\n }", "public function __construct()\n\t{\n//\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n }", "public function __construct()\n {\n // We could add middleware specific for this controller like so:\n // $this->middleware('auth');\n }", "public function __construct()\n {\n parent::__construct();\n \n $this->middleware('auth');\n \n }", "public function __construct()\n {\n // $this->middleware('auth');\n\n //if trying to access this controller without being authenticated, it will ask him for authentication\n // $this->middleware ('auth');\n }", "public function __construct()\n {\n $this->middleware('authenticate');\n }" ]
[ "0.8487099", "0.8452674", "0.8334273", "0.8328403", "0.83078444", "0.82923084", "0.82868683", "0.82840616", "0.82823646", "0.8262363", "0.82555324", "0.82404006", "0.82111305", "0.8210959", "0.82047033", "0.82000524", "0.8190222", "0.8190222", "0.8182205", "0.8177968", "0.8165446", "0.81551474", "0.81551474", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81510675", "0.81400514", "0.81400514", "0.8133432", "0.81258285", "0.8125089", "0.8125089", "0.8123336", "0.8119082", "0.8110185", "0.8098618", "0.809284", "0.80918455", "0.80890906", "0.8077733", "0.8069931", "0.8067356", "0.8067356", "0.8066348", "0.8065151", "0.8055847", "0.8055556" ]
0.0
-1
Display a listing of the resource.
public function index() { // Get transactions // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page $transactions = Transaction::paginate(10); return TransactionResource::collection($transactions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // Use Laravel’s validation function, using Request classes // validate the required fields $request->validate([ 'transaction_date' => 'nullable|date', 'amount' => 'required|numeric', ]); // find the parent client for the transaction $client = Client::find($request->client_id); if(!isset($client)) { return response()->json(['error' => 'Client not found'], 404); } // create a new transaction and add it on the client $transaction = new Transaction; // if transaction date wasn't provided, assign it the current datetime $transaction->transaction_date = $request->transaction_date ?? new \DateTime(); $transaction->amount = $request->amount; $transaction->client_id = $client->id; // save it $transaction->save(); return new TransactionResource($transaction); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Transaction $transaction) { return new TransactionResource($transaction); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "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 show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Transaction $transaction) { // Use Laravel’s validation function, using Request classes // validate the required fields $request->validate([ 'transaction_date' => 'nullable|date', 'amount' => 'required|numeric', ]); // find the parent client for the transaction $client = Client::find($request->client_id); if(!isset($client)) { return response()->json(['error' => 'Client not found'], 404); } // if transaction date was given, then update it on the model also if(isset($request->transaction_date)) { $transaction->transaction_date = $request->transaction_date; } $transaction->amount = $request->amount; $transaction->client_id = $client->id; // save it $transaction->save(); return new TransactionResource($transaction); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Transaction $transaction) { $transaction->delete(); return response()->json(null, 204); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
The default action show the home page
public function indexAction () { // grab the paginator from the RoleTable $paginator = $this->getRoleTable()->fetchAll(true); // set the current page to what has been passed in query string, or to 1 if none set $paginator->setCurrentPageNumber((int) $this->params()->fromQuery('page', 1)); // set the number of items per page to 10 $paginator->setItemCountPerPage(10); return new ViewModel(array( 'paginator' => $paginator )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionHome(){\n\t\t\n\t\t$this->getContent('home');\n\t\t\n\t}", "public function home()\n\t{\n\n\t\tView::show(\"home.php\", \"Accueil Mon MVC !\");\n\t}", "public function homeAction()\n {\n View::render('Pages/home.html.twig');\n }", "public function home()\n\t{\n\t\tView::show(\"home.php\", \"Accueil !\");\n\t}", "public function actionDefault(){\n \n $this->redirect('Homepage:');\n }", "public function actionIndex()\n {\n //$this->redirect(array('site/login'));\n $this->render('home', array());\n }", "public function homeAction(){\n return $this->render('HMMainBundle:Default:index.html.twig');\n }", "public function homeAction()\n {\n return $this->render('AdvertBundle:Default:index.html.twig');\n }", "public function home()\n {\n\t\tif(!$_SESSION['logged_in'])\n\t\t\tredirect('administrator');\n\t\t\n $data = array(\n 'admin' => $_SESSION['username']\n );\n $this->page('administrator/home',$data);\n }", "public function home()\n {\n $listItem = $this->Item->getAll();\n $this->set(['title' => 'Home', 'items' => $listItem]);\n $this->render('home');\n }", "public function actionKnprHome()\n { \n return $this->render('knpr/knpr-home');\n }", "public function index() {\n\t\t$this->redirect(array('action' => 'home'));\n\t}", "public function home()\n {\n $this->render('home/content');\n }", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index() {\n\t\t$this->redirect(array('action' => 'home'));\n }", "public function home() {\n $posts = $this->postManager->getPosts();\n $view = new View(\"Home\");\n $view->generate(array('posts' => $posts));\n }", "public function home()\n\t{\n\t // show the form\n\t return $this->homeRepository->home();\n\t}", "public function index() {\n $this->home(); \n }", "public function goHome()\n {\n $this->redirect(config('default_module').'/'.config('default_controller').'/'.config('default_action'));\n }", "public function home()\n {\n $this->privateAccess(true);\n //Set content type as html page\n $this->contentType(\n 'html',\n 'Management Proof',\n [\n $this->_assets_path . 'js/Core/datatables.min.js',\n $this->_assets_path . 'js/Apps/ManagementResults/home.js'\n ], [\n $this->_assets_path . 'css/Core/datatables.min.css'\n ]\n );\n\n //add management subject view\n include 'Apps/ManagementResults/view/home.php';\n\n }", "public function actionHome()\n {\n return $this->render('home');\n}", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function actionMultiregionalHome() {\n return $this->render('multiregional/multiregional-home');\n }", "public function index()\n {\n $this->render('home/home');\n }", "function home(){\n\n\t\tredirect('home');\n\t}", "public function defaultAction(){\n\t\t$pseudo = \"Test\";\n\n\t\t//Affiche moi la vue home;\n\t\t$installer = new installer;\n\t\tif(!$installer->checkInstall() xor file_exists('.env.prod')){\n\t\t\theader('location: /installer');\n\t\t}else{\n\t\t$page = new Page();\n\t\t$acceuil = $page->getpageaccueil();\n\t\tif(!empty($acceuil)){\n\t\t\t$view = new View(\"page\", \"front\");\n\t\t\t$view->assign(\"page\",$acceuil[0]);\n\t\t\t$articles = $page->getArticleByIdPage($acceuil[0][\"id\"]);\n\t\t\t$view->assign('articles',$articles);\n\t\t\t$view->assign(\"title\",$acceuil[0]['slug']);\n\t\t}\n\t\telse{\n\t\t\t$view = new View();\n\t\t\t$view->assign(\"title\",\"Votre site\");\n\t\t}\n\t\t\n\t}\n\n\t\t//envoyer le pseudo à la vue\n\t}", "public function actionHome()\n\t{\n $this->setMetaTag();\n \n $user_id = Yii::$app->user->getId();\n $issue = isset($_GET['issue']) ? $_GET['issue'] : null;\n $service = $this->serviceFactory->getService(ServiceFactory::SITE_SERVICE);\n $home = $service->getHomeInfo($user_id, $issue, new SiteVoBuilder());\n $create_thread_form = new CreateThreadForm();\n $selected = $home->getHomeSelected();\n return $this->render('home', ['home' => $home,\n 'feed_selected' => $selected,\n 'change_email_form' => new ResendChangeEmailForm(),\n 'create_thread_form' => $create_thread_form]);\n\t}", "public function homePage()\n {\n return $this->render(\"homePage.html.twig\");\n }", "public function route_home() {\n\t\techo '<h1>It wurks!</h1>';\n\t}", "public function index() \n\t{\n\t\tredirect('home');\n\t}", "public function Home()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'home');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Home')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/homepage');\n }", "public function home()\n {\n global $user;\n\n // Example data to use in the home page.\n $context['user'] = $user;\n $context['allPosts'] = Post::tenMostRecent();\n $context['allComments'] = Comment::tenMostRecent();\n $context['allImages'] = Image::tenMostRecent();\n return render('views/pages/home.php', $context);\n }", "public function home()\n {\n $params = [\n 'name' => 'xEiBi'\n ];\n\n return $this->render('home', $params);\n }", "public function home()\r\n {\r\n\r\n $view = new Template();\r\n echo $view->render('views/home.html');\r\n }", "public function home()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$data['username']\t\t\t= $this->session->userdata('username');\n\t\t\t\t$this->load->view('admin/home', $data);\n\t\t\t}", "private function home() {\n // busca as categorias do bd\n $categorias = $this->model->visualizarCategorias();\n // seta as categorias para a view\n $this->view->setCategorias($categorias);\n // passa o arquivo home\n $file = $this->templates . 'home.php';\n \n // retorna o conteudo da tela home para o usuario\n $this->telaUser = $this->view->retornaTela($file);\n }", "public function home($data){\r\n if(!$this->isLogged()){\r\n header(\"Location:\".url(\"admin/login\"));\r\n }\r\n echo $this->view->render(\"home.php\",[\r\n \"title\"=> \"Admin Home | \". SITE,\r\n ]);\r\n }", "public function index() {\n\n\t\t$data['content'] = 'Homepage';\n\t\t$this->flexi->title('Homepage')\n\t\t\t\t\t->make('home', $data);\n\n\t}", "public function home()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(4);\n echo $this->getRender()->render('homeView.twig', [\n 'resultat' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function goHome()\n {\n $this->redirect(url($this->getHomeUrl()));\n }", "public function homeAction()\n {\n return $this->redirect($this->generateUrl('system_tracking_homepage'), 301);\n }", "public function home()\n\t{\n\t\treturn view('pages.home');\n\t}", "function home()\n\t{\n\t\t$data['active_page'] = 'home';\n\t\t$data['cart_items_count'] = $this->m_cart->get_cart_count();\n\t\t$data['settings'] = $this->m_settings->get_all();\n\t\t$this->load->view('frontend/templates/header',$data);\n\t\t$this->load->view('frontend/templates/main_home_top_bg');\n\t\t$this->load->view('frontend/pages/boss/home');\n\t\t$this->load->view('frontend/templates/footer', $data);\n\n\t}", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n if (session()->get('logged_in')) {\n \techo render(HOME_PAGE, ['title' => 'Accueil']);\n }\n // Otherwise, the login page is displayed\n else $this->login();\n }", "public function index()\n {\n// $pageData = $this->_pageService->getPage(PageConstant::HOME_PAGE);\n return $this->renderView($this->getView('home.welcome'), [], 'Home');\n }", "public function homePage()\n {\n return cq()->homePage();\n }", "public function home()\n\t{\n\t\t$this->load->view('homepage_view');\n\t}", "public function home()\n\t{\n\t\t$this->sidebar_template = 'news';\n\t\t$this->news = R::dispense('news', 5);\n\t\t$this->render();\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function home()\n\t{\n\t\t$header = $this->loaded_module(0);\n\t\t$footer = $this->loaded_module(1);\n\t\t\n\t\t$data = $this->settings();\n\t\t\n\t\t$product = $this->loaded_module(7);\n\t\t$data[\"product_special\"] = $product->special_product_list(8);\n\t\t$data[\"latest_product\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product2\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product3\"] = $product->latest_product_list(6);\n\t\t\n\t\t$banner = $this->loaded_module_admin(7)->get_active_banner();\n\t\t$data[\"banner\"] = $banner;\n\t\t\n\t\t$header->header_view();\n\t\t$this->load->view(\"Home_v\", $data);\n\t\t$footer->footer_view();\n\t}", "public function home()\n {\n $lastUpdates = ArticleManager::findLastUpdates();\n\n $this->renderView('home.twig',\n [\n 'articleList' => $this->articleList,\n 'lastUpdates' => $lastUpdates, \n ]\n );\n }", "function home(){\n if(!is_null(Session::get('id_usuario'))){\n header(\"Location: \".URL.\"tarea\");\n\n }\n $this->view->show();\n }", "public function index()\n\t{\n\t\tif (ENVIRONMENT=='development')\n\t\t\t$this->render('home');\n\t\telse\n\t\t\tredirect();\n\t}", "public function index()\n\t{\n\t\tif (ENVIRONMENT=='development')\n\t\t\t$this->render('home');\n\t\telse\n\t\t\tredirect();\n\t}", "public function actionProvHome()\n {\n return $this->render('prov/prov-home');\n }", "public function home()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (!isset ($_GET['id'])) {\n show_view('views/pages/home.php', [\n 'posts' => Posts::readAll(),\n 'bodyParts' => BodyPart::all(),\n 'difficulty' => Difficulty::all(),\n ]);\n } else {\n show_view('views/pages/home.php', [\n 'posts' => Posts::findByBodyPart($_GET['id']),\n 'bodyParts' => BodyPart::all(),\n 'difficulty' => Difficulty::all(),\n ]);\n }\n }\n }", "function Home()\n {\n $this->requestSessionInfo();\n\n // muestra solo 2\n $recent_artworks = $this->modelArtwork->GetFrontArtworks(2);\n $this->view->ShowHome($recent_artworks);\n }", "public function home()\n\t{\n\t\t$page = 'home';\n\t\treturn view('dashboard.home', compact('page'));\n\t}", "public function home()\n\t{\n\t\t//Se valida la existencia de los datos del usuario que inicio sesion dentro de la session\n\t\tif($this->session->userdata('id_usuario_prueba') != null){\n\t\t\t$data = [\n\t\t\t\t\"page\" => \"Home\"\n\t\t\t];\n\t\t\t$this->load->view('layout/layout_open');\n\t\t\t$this->load->view('layout/layout_menu', $data);\n\t\t\t$this->load->view('home');\n\t\t\t$this->load->view('layout/layout_close');\n\t\t}else{\n\t\t\theader(\"Location:\" . base_url());\n\t\t}\n\t}", "protected function goHomePage()\n {\n $this->_redirect($this->homeURL);\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "public function home()\n {\n return view(\"home\");\n }", "public function home()\n {\n return view('core::home.index');\n }", "public function index()\n\t{\n// $page = Page::whereTitle('home')->first();\n// if(! $page){\n// $page=nulls;\n// }\n\n\t\treturn view('admin.home.index');\n\n\n\t}", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function showHome()\n {\n //user authentication\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View(\"userHome\");\n $view->addData(\"userName\", $user->getNickName());\n echo $view->render();\n }", "public function indexAction() {\n $this->view->render('home/index'); //path from the view folder\n //we already have view because it's set up in the parent, render is from view\n }", "public function home()\n {\n $slug = $this->getHomeSlug();\n\n if ( ! $slug) {\n return abort(404, \"No wiki home page defined\");\n }\n\n return redirect()->to(cms_route('wiki.page', [ $slug ]));\n }", "public function home()\n {\n return view('home'); //Le paso la vista principal\n }", "public function home()\n\t{\n\t\treturn view('e_shop.landing');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function home () {\n\t\t//deteccion\n\t\tif(Agent::isMobile()){\n\t\t\treturn View::make(\"movil.home\");\n\t\t} else {\n\t\t\treturn View::make(\"desktop.pre\");\n\t\t}\n\t}", "public function userHome() {\n\n $this->page->getPage('userhome.tpl');\n }", "public function home()\n\t{\n\t\t$data = $this->Service->get_latest_blogs();\n\n\t\t// Get the only one latest blog among all the categories.\n\t\t$data['latest_blog'] = $this->Blogs_model->get_latest_blog();\n\n\t\t// load the view\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('blogs/home', $data);\n\t\t$this->load->view('templates/footer');\n\t}", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n //$this->layout = 'layout';\n $this->pageTitle=\"KushGhar-Home\";\n $this->render('index');\n }", "public function home(){\n $itemsHome = $this->itemsModel->listenerItems(); // Recupération des items de ma bdd ( par default les 8 permier items)\n include(\"home.php\"); // Chargement de la view (page home.php)\n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function home()\r\n\t{\r\n\t\tif( $this->is_logged_in() )\r\n\t\t{\r\n\t\t\treturn redirect('dashboard','refresh');\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t return redirect('login','refresh');\r\n\t\t}\r\n\t}", "public function index()\n\t{\n\t\t$data['logo'] = \"/img/ilih.png\";\n\t\t$data['users'] = $this->User->getAll();\n\n\t\t$this->parser->parse('home', $data);\n\t}", "public function home()\n\t{\n\t\treturn View::make('newhome');\n\t}", "public static function index()\n {\n self::create_view(\"home.view\", [\n \"user\" => Session::retrieve_object(\"user\")\n ]);\n\n exit;\n }", "public function home()\n\t{\n\t\t\n\t\t$data = $this->data;\n\t\t$this->load->view('admin/index.php',$data);\n\t}", "public function index() {\n\t\t\t$this->render('home.twig.html', ['flash' => $this->session->getFlash(), 'token' => $this->session->getToken()]);\n\t\t}", "public function showHome()\n {\n if(!isset($_GET['people']))\n {\n $arr=$this->model->getList();\n include 'view_home.php';\n } else\n {\n $val = $this->model->getPerson($_GET['people']);\n include 'view2.php';\n }\n }", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index()\n {\n return view('web.defaults.home');\n }", "public function homePageAction(Application $app){\n \n $spectacles = $app['dao.spectacle']->LastNineArticles();\n $archives= $app['dao.spectacle']->ArchiveShow();\n $presses = $app['dao.press']->findAll();\n return $app['twig']->render('index.html.twig', array('spectacles'=>$spectacles,\n 'archives'=>$archives,\n 'presses'=>$presses));\n }", "public function home() {\n\t\treturn View::make('home', array('pageTitle' => 'Home'));\n\t}", "public function index()\n {\n return View(\"pages.home\");\n }", "public function actionIndex() \n\t{\n\t\t$metaTitle = 'Homepage';\n\t\t\n\t\t$categories = array();\n\t\t$categories = Category::getCategoriesList();\n\t\t\n\t\t$latestProducts = array();\n\t\t$latestProducts = Product::getLatestProducts(4);\n\t\t\n\t\t// products for slider of recommended\n\t\t$sliderProducts = array();\n\t\t$sliderProducts = Product::getRecommendedProducts();\n\t\t\n\t\trequire_once(ROOT.'/views/site/index.php');\n\t\t\n\t\treturn true;\n\t}", "public function homePage()\n\t{\n $data[\"base_url\"] = $this->config->item(\"base_url\");\n $data['header'] = $this->load->view('user/header', $data, TRUE);\n\t\t$data['footer'] = $this->load->view('user/footer', $data, TRUE);\n\t\t$this->load->view('user/home',$data,true);\n }", "public function homepage()\n {\n return view('statics.home');\n }", "public function showHome()\n {\n return view('content.index.index.home');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function home()\n {\n return view('page.home');\n }", "public function home()\n {\n return view('admin.home');\n }", "public function index()\n\t{\n\t\tif ( $this->auth->check() )\n\t\t{\t\t\n\t\t\t// MUESTRA LA PAGINA\n\t\t\t$this->show_page();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect ( $this->_base_url );\n\t\t}\n\t}", "public function home() {\n return view('admin.home');\n }", "public function getHome()\n\t{\n\t\tif(Session::get('admin') == 'admin')\n\t\t\treturn Redirect::route('admin-home-get');\n\t\t\n\t\tif(Session::get('member') == 'member')\n\t\t\treturn Redirect::route('member-home-get');\n\n\t\tif(Session::get('employee') == 'employee')\n\t\t\treturn Redirect::route('employee-home-get');\n\n\t\treturn View::make('errors/404');\n\t}", "public function home()\n\t{\n\t\tSession::put('lang','EN');\n\t\treturn $this->homeblade();\n\t}" ]
[ "0.87153625", "0.8310088", "0.82810503", "0.8278076", "0.8214171", "0.81164247", "0.80845374", "0.8044981", "0.80166644", "0.8002096", "0.7999078", "0.79849523", "0.79761887", "0.795694", "0.79460955", "0.7902253", "0.7888324", "0.788606", "0.7880821", "0.7861734", "0.7838802", "0.7838412", "0.78327864", "0.7826531", "0.7816538", "0.7779734", "0.7769118", "0.77506584", "0.77426744", "0.7737106", "0.7725228", "0.77189624", "0.7703055", "0.7694349", "0.7686936", "0.7667964", "0.7663247", "0.76619303", "0.76535124", "0.7640195", "0.7637233", "0.76297516", "0.7624652", "0.76221615", "0.76194006", "0.7612479", "0.7588557", "0.75729644", "0.7565794", "0.75597113", "0.7553198", "0.75471556", "0.75423056", "0.75377196", "0.75377196", "0.75364745", "0.75325185", "0.7531952", "0.75315803", "0.75257677", "0.7525042", "0.750439", "0.74993926", "0.7496873", "0.7479717", "0.74702317", "0.74631333", "0.7445817", "0.7433147", "0.7414255", "0.74088806", "0.7404012", "0.74007213", "0.73968834", "0.73915917", "0.7391174", "0.73776376", "0.737426", "0.7364511", "0.7354475", "0.73542154", "0.7347136", "0.73423463", "0.73422736", "0.73305213", "0.7312517", "0.7306927", "0.730441", "0.7297422", "0.7294075", "0.7289855", "0.7287005", "0.7283341", "0.72723496", "0.7264403", "0.7262247", "0.72569174", "0.7256079", "0.7255837", "0.72454935", "0.7241475" ]
0.0
-1