query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Adds the order offer types into the database | public function createStoreOfferTypes($offer_types,$store_id) {
##
## PARAMETERS
## @offer_types The offer type array
## @store_id The storeID
$key = 0;
$types_added = array();
## Add active types
foreach($offer_types as $type) {
$data = array(
'store_id' => $store_id,
'type' => $type,
'order_num' => $key,
'status' => 1
);
$format = array(
'%d',
'%s',
'%d',
'%d'
);
$this->wpdb->insert($this->wpdb->prefix.'topspin_stores_offer_type',$data,$format);
$key++;
$types_added[] = $type;
}
## Add inactive types
$types_list = $this->getOfferTypes();
foreach($types_list as $type) {
if(!in_array($type['type'],$types_added)) {
$data = array(
'store_id' => $store_id,
'type' => $type['type'],
'order_num' => $key,
'status' => 0
);
$format = array(
'%d',
'%s',
'%d',
'%d'
);
$this->wpdb->insert($this->wpdb->prefix.'topspin_stores_offer_type',$data,$format);
$key++;
$types_added[] = $type;
}
}
} | [
"public function testOrderTypesAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"protected static function updateOfferTypes()\n {\n foreach (\\XLite\\Core\\Database::getRepo('XLite\\Module\\QSL\\SpecialOffersBase\\Model\\OfferType')->findAll() as $type) {\n $enabled = $type->hasAllRequiredClasses();\n $type->setEnabled($enabled);\n if (!$enabled) {\n foreach ($type->getSpecialOffers() as $offer) {\n $offer->setEnabled(false);\n }\n }\n }\n\n }",
"protected function setUpTypes()\n {\n foreach (array_keys($this->usedTypes) as $typeName) {\n if (!isset(static::$addedTypes[$typeName]) && !Type::hasType($typeName)) {\n Type::addType($typeName, static::$types[$typeName]);\n\n $type = Type::getType($typeName);\n\n // Since doctrineTypeComments may already be initialized check if added type requires comment\n $platform = $this->getPlatform();\n if ($type->requiresSQLCommentHint($platform) && !$platform->isCommentedDoctrineType($type)) {\n $this->getPlatform()->markDoctrineTypeCommented(Type::getType($typeName));\n }\n\n static::$addedTypes[$typeName] = true;\n }\n }\n }",
"public function Addoffer()\n {\n $price = $this->request->post('price');\n $money_type = $this->request->post('price-type');\n $duration_type = $this->request->post('duration_type');\n $duration_num = $this->request->post('duration_num');\n\n $this->load->model('Offers')->insertOffer($price, $money_type, $duration_type, $duration_num);\n \n return $this->showOffers();\n \n }",
"function order_types($products_active = null) {\n\t\tif(!$products_active) {\n\t\t\tparent::collection(ORDER_TYPES_SQL_LOAD, array('order_type_id'), \"order_type\", \"order_type_id\");\n\t\t} else {\n\t\t\tparent::collection(ORDER_TYPES_PRODUCTS_ACTIVE_SQL_LOAD, array('name'), \"order_type\", \"order_type_id\");\n\t\t}\n\t}",
"public function build_product_types() {\n $this->accept_product_types = apply_filters( 'mje_checkout_product_types', array( 'mjob_order', 'mje_claims' ) );\n }",
"public function getOrderTypes()\n {\n return [$this->insertEmailOrderTable];\n }",
"public function setOrderTypes(array $order_types);",
"public function install_pt_fieldtypes()\n {\n // Run all the time, make sure these tables are updated.\n $field_types = array('matrix', 'playa', 'assets');\n\n require_once PATH_THIRD .'publisher/libraries/Publisher/Publisher_fieldtype.php';\n\n foreach ($field_types as $field_type)\n {\n $class_name = 'Publisher_'. $field_type;\n\n // Initialize the fieldtype class, and set necessary properties\n require_once PATH_THIRD .'publisher/libraries/Publisher/fieldtypes/'. $class_name .'.php';\n ee()->$class_name = new $class_name();\n ee()->$class_name->install();\n }\n\n ee()->session->set_flashdata('message_success', lang('publisher_install_pt_success'));\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('settings'));\n }",
"public function saveTrainingTypes()\n\t{\n\t\tglobal $ilDB;\n\n\t\t$id = $this->getId();\n\t\tif($id)\n\t\t{\n\t\t\t$ilDB->manipulate(\"DELETE FROM adn_ta_provider_ttype\".\n\t\t\t\t\" WHERE ta_provider_id = \".$ilDB->quote($id, \"integer\"));\n\n\t\t\tforeach($this->training_types as $type => $date)\n\t\t\t{\n\t\t\t\t$fields = array(\"ta_provider_id\" => array(\"integer\", $id),\n\t\t\t\t\t\"training_type\" => array(\"text\", $type),\n\t\t\t\t\t\"approval_date\" => array(\"timestamp\", $date->get(IL_CAL_DATETIME, \"\", ilTimeZone::UTC)));\n\n\t\t\t\t$ilDB->insert(\"adn_ta_provider_ttype\", $fields);\n\t\t\t}\n\t\t}\n\t}",
"public function teams_extend_table_save_order() {\r\n\t\t$db = new DB_Handling_Core();\r\n\t\t$sql_query = 'CREATE TABLE IF NOT EXISTS team_player_orders(\r\n\t\t\tteam_player_id INT(9) NOT NULL,\r\n\t\t\tteam_player_name VARCHAR(255),\r\n\t\t\tteam_code VARCHAR(255),\r\n\t\t\tproduct_selected_id VARCHAR(255),\r\n\t\t\tproduct_selected_qty INT(9)\r\n\t\t\t)';\r\n\t\t$db->teams_extend_create_table( $sql_query );\r\n\t}",
"function wc_register_order_type($type, $args = array())\n {\n }",
"private function createUserTypes()\n {\n $user_types = UserType::getTypes();\n\n foreach ($user_types as $id => $name) {\n $model = UserType::findOne($id);\n\n if ($model == null) {\n $model = new UserType();\n $model->id = $id;\n }\n $model->name = $name;\n\n if ($model->save()) {\n echo \"The user type '\" . $model->name .\"' was created successfully.\\n\";\n }\n }\n }",
"public function addOrderProducts() {\n \n }",
"private static function addToDatabase()\n {\n self::$order->address_id = self::$address->id;\n self::$order->user_id = self::$user->id;\n self::$order->order_date = Carbon::now()->format('Y-m-d h:i:s');\n self::$order->save();\n }",
"protected function addOrderToDB()\n\t{\n\t\t# Set the Database instance to a variable.\n\t\t$db=DB::get_instance();\n\n\t\t# For debugging\n\t\t$this->script=__FILE__;\n\n\t\t# Put order info in the DataBase (orders table.)\n\t\ttry\n\t\t{\n\t\t\t$db->query('INSERT INTO `'.DBPREFIX.'orders` (`user_id`, `txnid`, `payer_id`, `txn_type`, `item_number`, `payer_email`, `address`, `city`, `state`, `country`, `country_code`, `zipcode`, `residence`, `item_name`, `quantity`, `option_name1`, `option_selection1`, `option_name2`, `option_selection2`, `payment_currency`, `settle_currency`, `exchange_rate`, `shipping`, `payment_gross`, `payment_fee`, `settle_amount`, `memo`, `payment_date`, `pending_reason`, `reason_code`, `creation_date`) VALUES ('.\n\t\t\t\t\t$db->quote($db->escape($this->id)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->txn_id)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->payer_id)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->txn_type)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->item_number)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->payer_email)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->address)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->city)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->state)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->country)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->country_code)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->zipcode)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->residence)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->item_name)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->quantity)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->option_name1)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->option_selection1)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->option_name2)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->option_selection2)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->payment_currency)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->settle_currency)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->exchange_rate)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->shipping)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->payment_gross)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->payment_fee)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->settle_amount)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->memo)).',' .\n\t\t\t\t\t$db->quote($db->escape($this->payment_date)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->pending_reason)).', '.\n\t\t\t\t\t$db->quote($db->escape($this->reason_code)).', '.\n\t\t\t\t\t$db->quote($db->escape(YEAR_MM_DD)).')');\n\t\t}\n\t\tcatch(ezDB_Error $ez)\n\t\t{\n\t\t\t# The orders table was not updated! This error will not stop the script.\n\t\t\t$this->error.=\"Transaction not entered into \\\"orders\\\" in the Database! \\n<br />Error occured: \".$ez->error.', code: '.$ez->errno.'<br />Last query: '.$ez->last_query;\n\t\t\t# What is the subject of the error email send to the admin?\n\t\t\t$this->error_subject=\"Check IPN_log\".$this->log_subj.\", there was an error.\";\n\t\t\t$this->makeLog();\n\t\t\tthrow new Exception($this->error_subject.' -> '.$this->error, E_RECOVERABLE_ERROR);\n\t\t\tdie();\n\t\t}\n\t}",
"public function insert (ExpenseTypeVO $expenseTypeVO);",
"private function setPrizeTypes()\n {\n $prizeTypes = $this->prizeTypeRepository->readTypes();\n\n foreach( $prizeTypes as $prizeType )\n {\n $this->prizeTypes[$prizeType->getId()] = $prizeType->getType();\n }\n }",
"private function initTypeExtensions()\n {\n $this->typeExtensions = array();\n\n foreach ($this->loadTypeExtensions() as $extension) {\n if (!$extension instanceof TableTypeExtensionInterface) {\n throw new UnexpectedTypeException($extension, 'Swoopaholic\\Component\\Table\\TableTypeExtensionInterface');\n }\n\n $type = $extension->getExtendedType();\n\n $this->typeExtensions[$type][] = $extension;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collOperationScenariiParentssRelatedByOpsNumero collection This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearOperationScenariiParentssRelatedByOpsNumero()
{
$this->collOperationScenariiParentssRelatedByOpsNumero = null; // important to set this to null since that means it is uninitialized
$this->collOperationScenariiParentssRelatedByOpsNumeroPartial = null;
return $this;
} | [
"public function clearOperationScenariiParentssRelatedByOpsParentNumero()\n {\n $this->collOperationScenariiParentssRelatedByOpsParentNumero = null; // important to set this to null since that means it is uninitialized\n $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial = null;\n\n return $this;\n }",
"public function setOperationScenariiParentssRelatedByOpsNumero(PropelCollection $operationScenariiParentssRelatedByOpsNumero, PropelPDO $con = null)\n {\n $operationScenariiParentssRelatedByOpsNumeroToDelete = $this->getOperationScenariiParentssRelatedByOpsNumero(new Criteria(), $con)->diff($operationScenariiParentssRelatedByOpsNumero);\n\n\n //since at least one column in the foreign key is at the same time a PK\n //we can not just set a PK to NULL in the lines below. We have to store\n //a backup of all values, so we are able to manipulate these items based on the onDelete value later.\n $this->operationScenariiParentssRelatedByOpsNumeroScheduledForDeletion = clone $operationScenariiParentssRelatedByOpsNumeroToDelete;\n\n foreach ($operationScenariiParentssRelatedByOpsNumeroToDelete as $operationScenariiParentsRelatedByOpsNumeroRemoved) {\n $operationScenariiParentsRelatedByOpsNumeroRemoved->setOperationScenariiRelatedByOpsNumero(null);\n }\n\n $this->collOperationScenariiParentssRelatedByOpsNumero = null;\n foreach ($operationScenariiParentssRelatedByOpsNumero as $operationScenariiParentsRelatedByOpsNumero) {\n $this->addOperationScenariiParentsRelatedByOpsNumero($operationScenariiParentsRelatedByOpsNumero);\n }\n\n $this->collOperationScenariiParentssRelatedByOpsNumero = $operationScenariiParentssRelatedByOpsNumero;\n $this->collOperationScenariiParentssRelatedByOpsNumeroPartial = false;\n\n return $this;\n }",
"public function setOperationScenariiParentssRelatedByOpsParentNumero(PropelCollection $operationScenariiParentssRelatedByOpsParentNumero, PropelPDO $con = null)\n {\n $operationScenariiParentssRelatedByOpsParentNumeroToDelete = $this->getOperationScenariiParentssRelatedByOpsParentNumero(new Criteria(), $con)->diff($operationScenariiParentssRelatedByOpsParentNumero);\n\n\n //since at least one column in the foreign key is at the same time a PK\n //we can not just set a PK to NULL in the lines below. We have to store\n //a backup of all values, so we are able to manipulate these items based on the onDelete value later.\n $this->operationScenariiParentssRelatedByOpsParentNumeroScheduledForDeletion = clone $operationScenariiParentssRelatedByOpsParentNumeroToDelete;\n\n foreach ($operationScenariiParentssRelatedByOpsParentNumeroToDelete as $operationScenariiParentsRelatedByOpsParentNumeroRemoved) {\n $operationScenariiParentsRelatedByOpsParentNumeroRemoved->setOperationScenariiRelatedByOpsParentNumero(null);\n }\n\n $this->collOperationScenariiParentssRelatedByOpsParentNumero = null;\n foreach ($operationScenariiParentssRelatedByOpsParentNumero as $operationScenariiParentsRelatedByOpsParentNumero) {\n $this->addOperationScenariiParentsRelatedByOpsParentNumero($operationScenariiParentsRelatedByOpsParentNumero);\n }\n\n $this->collOperationScenariiParentssRelatedByOpsParentNumero = $operationScenariiParentssRelatedByOpsParentNumero;\n $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial = false;\n\n return $this;\n }",
"public function clearOperationScenariis()\n {\n $this->collOperationScenariis = null; // important to set this to null since that means it is uninitialized\n $this->collOperationScenariisPartial = null;\n\n return $this;\n }",
"public function getOperationScenariiParentssRelatedByOpsNumero($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collOperationScenariiParentssRelatedByOpsNumeroPartial && !$this->isNew();\n if (null === $this->collOperationScenariiParentssRelatedByOpsNumero || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collOperationScenariiParentssRelatedByOpsNumero) {\n // return empty collection\n $this->initOperationScenariiParentssRelatedByOpsNumero();\n } else {\n $collOperationScenariiParentssRelatedByOpsNumero = OperationScenariiParentsQuery::create(null, $criteria)\n ->filterByOperationScenariiRelatedByOpsNumero($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collOperationScenariiParentssRelatedByOpsNumeroPartial && count($collOperationScenariiParentssRelatedByOpsNumero)) {\n $this->initOperationScenariiParentssRelatedByOpsNumero(false);\n\n foreach ($collOperationScenariiParentssRelatedByOpsNumero as $obj) {\n if (false == $this->collOperationScenariiParentssRelatedByOpsNumero->contains($obj)) {\n $this->collOperationScenariiParentssRelatedByOpsNumero->append($obj);\n }\n }\n\n $this->collOperationScenariiParentssRelatedByOpsNumeroPartial = true;\n }\n\n $collOperationScenariiParentssRelatedByOpsNumero->getInternalIterator()->rewind();\n\n return $collOperationScenariiParentssRelatedByOpsNumero;\n }\n\n if ($partial && $this->collOperationScenariiParentssRelatedByOpsNumero) {\n foreach ($this->collOperationScenariiParentssRelatedByOpsNumero as $obj) {\n if ($obj->isNew()) {\n $collOperationScenariiParentssRelatedByOpsNumero[] = $obj;\n }\n }\n }\n\n $this->collOperationScenariiParentssRelatedByOpsNumero = $collOperationScenariiParentssRelatedByOpsNumero;\n $this->collOperationScenariiParentssRelatedByOpsNumeroPartial = false;\n }\n }\n\n return $this->collOperationScenariiParentssRelatedByOpsNumero;\n }",
"public function clearOperationssRelatedByOpDcId()\n {\n $this->collOperationssRelatedByOpDcId = null; // important to set this to null since that means it is uninitialized\n $this->collOperationssRelatedByOpDcIdPartial = null;\n\n return $this;\n }",
"public function getOperationScenariiParentssRelatedByOpsParentNumero($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial && !$this->isNew();\n if (null === $this->collOperationScenariiParentssRelatedByOpsParentNumero || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collOperationScenariiParentssRelatedByOpsParentNumero) {\n // return empty collection\n $this->initOperationScenariiParentssRelatedByOpsParentNumero();\n } else {\n $collOperationScenariiParentssRelatedByOpsParentNumero = OperationScenariiParentsQuery::create(null, $criteria)\n ->filterByOperationScenariiRelatedByOpsParentNumero($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial && count($collOperationScenariiParentssRelatedByOpsParentNumero)) {\n $this->initOperationScenariiParentssRelatedByOpsParentNumero(false);\n\n foreach ($collOperationScenariiParentssRelatedByOpsParentNumero as $obj) {\n if (false == $this->collOperationScenariiParentssRelatedByOpsParentNumero->contains($obj)) {\n $this->collOperationScenariiParentssRelatedByOpsParentNumero->append($obj);\n }\n }\n\n $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial = true;\n }\n\n $collOperationScenariiParentssRelatedByOpsParentNumero->getInternalIterator()->rewind();\n\n return $collOperationScenariiParentssRelatedByOpsParentNumero;\n }\n\n if ($partial && $this->collOperationScenariiParentssRelatedByOpsParentNumero) {\n foreach ($this->collOperationScenariiParentssRelatedByOpsParentNumero as $obj) {\n if ($obj->isNew()) {\n $collOperationScenariiParentssRelatedByOpsParentNumero[] = $obj;\n }\n }\n }\n\n $this->collOperationScenariiParentssRelatedByOpsParentNumero = $collOperationScenariiParentssRelatedByOpsParentNumero;\n $this->collOperationScenariiParentssRelatedByOpsParentNumeroPartial = false;\n }\n }\n\n return $this->collOperationScenariiParentssRelatedByOpsParentNumero;\n }",
"public function clearNotaPedidosRelatedBySolicitaId()\n\t{\n\t\t$this->collNotaPedidosRelatedBySolicitaId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearMembrosRelatedByInstituicaoId()\n\t{\n\t\t$this->collMembrosRelatedByInstituicaoId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearNotaPedidosRelatedByControlaId()\n\t{\n\t\t$this->collNotaPedidosRelatedByControlaId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearAnotacaoProcessos()\n\t{\n\t\t$this->collAnotacaoProcessos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearMROSocietes()\n {\n $this->collMROSocietes = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearC006tEvidenciasRelatedByCoCustodio()\n\t{\n\t\t$this->collC006tEvidenciasRelatedByCoCustodio = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearPermissaosRelatedByCoUsuarioAlteracao()\n\t{\n\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearNoticias()\n\t{\n\t\t$this->collNoticias = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearNotaPedidosRelatedByAdministraId()\n\t{\n\t\t$this->collNotaPedidosRelatedByAdministraId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCasos()\n\t{\n\t\t$this->collCasos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearNotificacionsRelatedById_emisor()\n\t{\n\t\t$this->collNotificacionsRelatedById_emisor = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearHbfTurnossRelatedByIdAsociado()\n {\n $this->collHbfTurnossRelatedByIdAsociado = null; // important to set this to NULL since that means it is uninitialized\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajax action for customer name autocompletion | public function executeAjaxCustomerAutocomplete(sfWebRequest $request)
{
$this->getResponse()->setContentType('application/json');
$q = $request->getParameter('q');
$items = Doctrine::getTable('Customer')->simpleRetrieveForSelect($request->getParameter('q'),
$request->getParameter('limit'));
return $this->renderText(json_encode($items));
} | [
"function ajax_autoComplete()\r\n\t\t{\r\n\t\t\tif (trim($this->data['County']['name']) == '')\r\n\t\t\t{\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$matches = $this->County->find('all', array(\r\n\t\t\t\t'contain' => array(),\r\n\t\t\t\t'fields' => array('id', 'odhs_county_number', 'name'),\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'name like' => strtoupper($this->data['County']['name']) . '%',\r\n\t\t\t\t\t'is_active' => 1\r\n\t\t\t\t),\r\n\t\t\t\t'index' => 'C',\r\n\t\t\t\t'order' => array('name')\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$this->set('output', array(\r\n\t\t\t\t'data' => $matches, \r\n\t\t\t\t'id_field' => 'County.id',\r\n\t\t\t\t'id_prefix' => '',\r\n\t\t\t\t'value_fields' => array('County.name'),\r\n\t\t\t\t'informal_fields' => array('County.odhs_county_number'),\r\n\t\t\t\t'informal_format' => ' (<span class=\"CountyCode\">%s</span>)'\r\n\t\t\t));\r\n\t\t}",
"public function get_autocomplete()\n {\n $data['result'] = $this->json_response($this->json_status['error']);\n \n if ($this->is_ajax()) {\n $term = $this->input->get('term', TRUE);\n $user_id = $this->input->get('user_id', TRUE);\n \n $this->object_model->db->like(array(\n 'name' => $term\n ));\n \n if ($user_id)\n $this->object_model->db->where(array(\n 'user_id' => $user_id\n ));\n \n $clients = $this->object_model->get(false, \"id, name as label, name as value\");\n \n if (! $clients) {\n $clients[] = array(\n 'id' => 0,\n 'value' => lang(\"no_record_found\")\n );\n }\n \n $data['result'] = json_encode($clients);\n }\n \n $this->template('/ajax', $data, TRUE);\n }",
"function autoCompleteProductNames()\n {\n \t//pr($this->Firm->find('all'));die;\n \t//$this->set('firms', $this->Firm->find('all'));\n\t\t\t$this->set('productnames', $this->Productname->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t'Productname.isactive' => 1,\n\t\t\t'Productname.product_name LIKE' => '%'.$this->data['Productname']['product_id'].'%'\n\t\t\t),\n\t\t\t'fields' => array('product_code','id','product_name')\n\t\t\t)));\n\t\t\t\n\t\t\t$this->layout = 'ajax';\n }",
"function ajax_autoComplete()\r\n\t\t{\r\n\t\t\tif (!isset($this->data['Physician']['search']))\r\n\t\t\t{\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$value = $this->data['Physician']['search'];\r\n\t\t\t\r\n\t\t\t$single = $this->Physician->find('first', array(\r\n\t\t\t\t'contain' => array(),\r\n\t\t\t\t'fields' => array('id', 'name', 'address_1', 'phone_number'),\r\n\t\t\t\t'conditions' => array('physician_number' => $value),\r\n\t\t\t\t'order' => array('name')\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\tif ($single === false)\r\n\t\t\t{\r\n\t\t\t\t$matches = $this->Physician->find('all', array(\r\n\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t'fields' => array('id', 'name', 'address_1', 'phone_number'),\r\n\t\t\t\t\t'conditions' => array('name like' => $value . '%'),\r\n\t\t\t\t\t'order' => array('name')\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$matches[0] = $single;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->set('output', array(\r\n\t\t\t\t'data' => $matches,\r\n\t\t\t\t'id_field' => 'Physician.id', \r\n\t\t\t\t'id_prefix' => '',\r\n\t\t\t\t'value_fields' => array('Physician.name'),\r\n\t\t\t\t'informal_fields' => array('Physician.address_1', 'Physician.phone_number'),\r\n\t\t\t\t'informal_format' => ' | %s | %s'\r\n\t\t\t));\r\n\t\t}",
"function getCustomer(){\n\t\t$key\t=\t$this->input->get('term');\n\t\t$suggest=\"\";\n\t\tif(!empty($key) && strlen($key) > 2){\n\t\t\t$key\t= str_replace(\"%20\",\" \",$key);\n\t\t\t$key\t= trim($key);\n\t\t}\n\t\t$suggest\t= customerList($key);\n\t\techo json_encode($suggest);\n\t}",
"public function autocompleteAction() {\n $filterParams['name'] = $this->_getParam('name_auto', NULL);\n $filters = $this->getFilters($filterParams);\n\n $directiveRepo = $this->_entityManager->getRepository('Model\\Pastor');\n $directives = $directiveRepo->findByCriteria($filters);\n\n $data = array();\n foreach ($directives as $directive) {\n $data[] = $directive->getFirstName();\n }\n\n $this->stdResponse->items = $data;\n $this->_helper->json($this->stdResponse);\n }",
"function wp_ajax_autocomplete_user()\n {\n }",
"public function autocompleteAction() {\n\t\t$filterParams['name'] = $this->_getParam('name_auto', NULL);\n\t\t$filters = $this->getFilters($filterParams);\n\n\t\t$directiveRepo = $this->_entityManager->getRepository('Model\\Directive');\n\t\t$directives = $directiveRepo->findByCriteria($filters);\n\n\t\t$data = array();\n\t\tforeach ($directives as $directive) {\n\t\t\t$data[] = $directive->getFirstName();\n\t\t}\n\n\t\t$this->stdResponse->items = $data;\n\t\t$this->_helper->json($this->stdResponse);\n\t}",
"function uet_json_search_customers() {\n\tob_start();\n\n\tcheck_ajax_referer( 'search-customers', 'security' );\n\n\t$term = wc_clean( stripslashes( $_GET['term'] ) );\n\n\tif ( empty( $term ) ) {\n\t\tdie();\n\t}\n\n\t$found_customers = array();\n\n\tadd_action( 'pre_user_query', array( __CLASS__, 'uet_json_search_customer_name' ) );\n\n\t$customers_query = new WP_User_Query( apply_filters( 'uet_json_search_customers_query', array(\n\t\t'fields' => 'all',\n\t\t'orderby' => 'display_name',\n\t\t'search' => '*' . $term . '*',\n\t\t'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' )\n\t) ) );\n\n\tremove_action( 'pre_user_query', array( __CLASS__, 'uet_json_search_customer_name' ) );\n\n\t$customers = $customers_query->get_results();\n\n\tif ( $customers ) {\n\t\tforeach ( $customers as $customer ) {\n\t\t\t$found_customers[ $customer->ID ] = $customer->display_name . ' (#' . $customer->ID . ' – ' . sanitize_email( $customer->user_email ) . ')';\n\t\t}\n\t}\n\n\twp_send_json( $found_customers );\n\n}",
"public function get_autocomplete()\n {\n $data['result'] = $this->json_response($this->json_status['error']);\n \n if ($this->is_ajax()) {\n $term = $this->input->get('term', TRUE);\n $user_id = $this->input->get('user_id', TRUE);\n \n $this->object_model->db->like(array(\n 'name' => $term\n ));\n \n if ($user_id)\n $this->object_model->db->where(array(\n 'user_id' => $user_id\n ));\n \n $items = $this->object_model->get(false, \"id, name as label, name as value, rate, description\");\n \n if (! $items) {\n $items[] = array(\n 'id' => 0,\n 'value' => lang(\"no_record_found\")\n );\n }\n \n $data['result'] = json_encode($items);\n }\n \n $this->template('/ajax', $data, TRUE);\n }",
"function ajax_name()\r\n\t\t{\r\n\t\t\t$match = $this->Physician->field('name', array('physician_number' => $this->params['form']['physician_number']));\r\n\t\t\t$this->set('output', $match !== false ? $match : '');\r\n\t\t}",
"public function autocomplete_callback();",
"public function autoCompleteUserBox(){\r\n \r\n $this->autoRender = false;\r\n $this->layout = 'ajax';\r\n \r\n $term = $this->request->query('term');\r\n \r\n $data = $this->User->find('all', array(\r\n 'conditions' => array(\r\n 'or' =>array(\r\n array('User.email LIKE' => \"%$term%\"),\r\n array('Profile.last_name LIKE' => \"%$term%\"),\r\n array('Profile.first_name LIKE' => \"%$term%\"))),\r\n 'fields' => array('User.id', 'User.email'), \r\n 'contain' => array('Profile.last_name', 'Profile.first_name')));\r\n $jsonData = array();\r\n $i = 0;\r\n foreach ($data as $key => $value) {\r\n $jsonData[$i]['id'] = $value['User']['id'];\r\n $jsonData[$i]['desc'] = $value['User']['email'] . \" - \" . strtoupper($value['Profile']['first_name']) . \" \" . strtoupper($value['Profile']['last_name']);\r\n $i++;\r\n }\r\n echo json_encode($jsonData );\r\n\r\n }",
"function ori_regform_ajax_callback_autocomplete() {\n //return $callback_name;\n //var_dump($callback_name);\n // тип поля autocomplete\n $field = $_POST['field'];\n // код страны по которой ищем\n $country = check_plain($_POST['country']);\n\n $arg = $_POST;\n\n if (!empty($field)) {\n $result = OriRegform::init($country)->getSelect($field, $arg);\n\n return drupal_json(\n array('result' => $result,\n 'count' => count($result))\n );\n }\n\n }",
"function ajax_show_customer_results(){\n\t\t$keyword = isset($_POST['keyword']) ? $_POST['keyword'] : '';\n\t\t$customers = db_select('customers', '*', \"WHERE Name LIKE '$keyword%' ORDER BY Name ASC LIMIT 100\");\n\t\tinclude 'view/customers/search.php';\n\t}",
"public function cloud_autocomplete() {\n if (!empty($_REQUEST['term'])) {\n $search_for = sanitize_text_field($_REQUEST['term']);\n \n $params = array(\n 'orb_cloud_lib_data' => array(\n 'cmd' => 'item.list',\n 'query' => $search_for,\n )\n );\n\n $req_res = $this->call($this->api_url, $params);\n wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());\n }\n }",
"public function media_credit_author_names_ajax() {\n if ( ! isset( $_POST['term'] ) ) {\n die('0'); // standard response for failure\n }\n\n if ( ! current_user_can( 'edit_posts' ) ) {\n die('-1'); // standard response for permissions\n }\n\n if ( isset( $_POST['term'] ) ) {\n if ($authors = self::get_editable_authors_by_name( wp_get_current_user()->ID, $_POST['term'], $_POST['limit'] ) ) {\n foreach ( $authors as $author )\n $results[] = (object) array(\"id\"=>$author->ID, \"label\"=>$author->display_name, \"value\"=>$author->display_name);\n echo json_encode($results);\n }\n echo '';\n }\n\n die(0);\n }",
"function ajax_autoComplete()\r\n\t\t{\r\n\t\t\tif (!isset($this->data['Diagnosis']['search']))\r\n\t\t\t{\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$value = strtoupper($this->data['Diagnosis']['search']);\r\n\t\t\t\r\n\t\t\t$matches = $this->Diagnosis->find('all', array(\r\n\t\t\t\t'contain' => array(),\r\n\t\t\t\t'fields' => array('id', 'description', 'code'),\r\n\t\t\t\t'conditions' => array('code like' => $value . '%'),\r\n\t\t\t\t'index' => 'A'\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\tif (count($matches) == 0)\r\n\t\t\t{\r\n\t\t\t\t$matches = $this->Diagnosis->find('all', array(\r\n\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t'fields' => array('id', 'description', 'code'),\r\n\t\t\t\t\t'conditions' => array('description like' => $value . '%'),\r\n\t\t\t\t\t'order' => array('description'),\r\n\t\t\t\t\t'index' => 'B'\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->set('output', array(\r\n\t\t\t\t'data' => $matches,\r\n\t\t\t\t'id_field' => 'Diagnosis.id', \r\n\t\t\t\t'id_prefix' => '',\r\n\t\t\t\t'value_fields' => array('Diagnosis.description'),\r\n\t\t\t\t'informal_fields' => array('Diagnosis.code'),\r\n\t\t\t\t'informal_format' => '| %s'\r\n\t\t\t));\r\n\t\t}",
"public function actionRetrieveCustomersByTermForAutocomplete( $term ) {\n $companies = ServiceFactory::createCompanyService()->getCompaniesBySubstring( $term );\n $result = array( );\n foreach( $companies as $company ) {\n $idx = count( $result );\n $result[$idx]['id'] = $company->id;\n $result[$idx]['value'] = $company->name;\n }\n echo CJSON::encode( $result );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getter for the return parameter senderAccountNumber | public function getSenderAccountNumber()
{
return $this->senderAccountNumber;
} | [
"public function getSenderAccountNumber()\n {\n \n if (isset($this->xml->SenderAccount) === true) {\n return $this->xml->SenderAccount->Number->__toString();\n }\n \n return null;\n }",
"public function getSenderNumber()\n\t{\n\t\treturn $this->senderNumber;\n\t}",
"private function getSenderNumber(): string\n {\n return $this->pluginData->twilioSmsNumber;\n }",
"public function getSenderAccountOwner()\n {\n return $this->senderAccountOwner;\n }",
"public function getSenderBankNumber()\n {\n return $this->senderBankNumber;\n }",
"public function getSenderBankNumber()\n {\n return $this->_getField(self::$SENDER_BANK_NUMBER);\n }",
"public function getAccountNumber()\n {\n return $this->accountNumber;\n }",
"public function getFromaccount()\n {\n return $this->fromaccount;\n }",
"public function getAccountNumber()\n {\n return $this->account_number;\n }",
"public function getAccountNumber()\n\t{\n\t\treturn $this->accountNumber;\n\t}",
"public function getAccountNumber();",
"public function getPaymentAccountNumber(): string {\n return $this->paymentAccountNumber;\n }",
"public function getFromAccountName() {\n\t\treturn $this->from_account_name;\n\t}",
"public function getSenderId()\n {\n return $this->sender_id;\n }",
"public function getSenderUuid()\n {\n return $this->sender_uuid;\n }",
"public function getSenderUsername()\n {\n return $this->senderUsername;\n }",
"public function getSenderTokenId() \n {\n return $this->_fields['SenderTokenId']['FieldValue'];\n }",
"public function getSenderId()\n {\n return $this->senderId;\n }",
"public function getSenderID()\n {\n return $this->senderID;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ $params = array('oAssetAccessGrantReq' => array('ASSET_ID' => $this>retrieve_Form_Data['ASSET_ID'], 'KIVOTOS_ID' => $this>retrieve_Form_Data("KIVOTOS_ID"), 'CLIENT_ID' => self::$oUser>retrieve_Form_Data("CLIENT_ID"), 'USER_ID' => self::$oUser>retrieve_Form_Data("USER_ID"), 'IPADDRESS' => self::$oUser>retrieve_Form_Data("IPADDRESS"), 'PHPSESSION' => self::$oUser>retrieve_Form_Data("PHPSESSION") ) ); $methodName = 'assetAccessGrantReq'; $server>wsdl>addSimpleType( 'oStringResponse', '', 'simpleType', 'scalar', array('RESPONSETEXT' => array('name' => 'RESPONSETEXT','type' => 'xsd:string')) ); | function saveNewAsset($soapRequest){
$SERVICE_RESPONSE = '';
//
// INSTANTIATE WEB SERVICE MANAGER
if(!isset($oSERVICE_MGR)){
$oSERVICE_MGR = new webservice_manager($_SESSION['oCRNRSTN_ENV']);
}
//
// PROCESS SOAP REQUEST AND RETURN RESULT (SOAP)
$SERVICE_RESPONSE = $oSERVICE_MGR->buildResponse('saveNewAsset',$soapRequest);
return $SERVICE_RESPONSE;
} | [
"function sendRequest($report_type, $params )\n{ \n global $soap_client, $debug;//\n //var_dump(getSecurityHeader());return;\n //$soap_client = new nusoap_client( '../wsdl/adobe_analytics_service-1.4.wsdl', true );\n $response = $soap_client->call(\n $report_type,\n $params,\n 'http://www.omniture.com', //namespace\n '', //Soap Action\n getSecurityHeader()\n );\n\n if($debug) echo \"\\n=== REQUEST ===\\n\" . $soap_client->request . \"\\n\";\n\n if($debug) echo \"\\n=== RESPONSE ===\\n\" . $soap_client->response . \"\\n\";\n\n /* Check the request response for issues */\n if($err = $soap_client->getError())\n throw new Exception(\"sendRequest(): SOAP ERROR: $err\", 0);\n\n return($response);\n\n}",
"public function CreateAccessCodeSOAP($request) {\n \n //Convert TokenCustomerID from string to float, if TokenCustomerID is provided in the SOAP request\n if(isset($request['Customer']->TokenCustomerID))\n $request['Customer']->TokenCustomerID = (float)$request['Customer']->TokenCustomerID;\n\n try {\n $client = new SoapClient($this->APIConfig[\"PaymentService.Soap\"], array(\n 'trace' => true,\n 'exceptions' => true,\n 'login' => $this->APIConfig['Payment.Username'],\n 'password' => $this->APIConfig['Payment.Password'],\n ));\n $result = $client->CreateAccessCode(array('request' => $request));\n //echo(htmlspecialchars($client->__getLastRequest()));\n } catch (Exception $e) {\n $lblError = $e->getMessage();\n }\n\n if (isset($lblError)) {\n echo \"<h2>CreateAccessCode SOAP Error: $lblError</h2><pre>\";\n die();\n }\n else\n return $result->CreateAccessCodeResult;\n }",
"function wsf_serivce_invoke_function($operation_node, $function_name, $class_name,\n $class_args, $soap_body_node, $header_node, $classmap, $mtom_on,\n $cid2cont_type, $cid2attachments) {\n\n require_once('wsf_wsdl_consts.php');\n require_once('wsf_wsdl_util.php');\n require_once('wsf_wsdl_deserialization.php');\n\n $sig_node = NULL;\n $binding_details_node = NULL;\n\tif($operation_node) {\n\t\tforeach($operation_node->childNodes as $operation_child) {\n\t\t\tif($operation_child->tagName == WSF_SIGNATURE) {\n\t\t\t\t$sig_node = $operation_child;\n\t\t\t}\n if($operation_child->tagName == WSF_BINDINDG_DETAILS) {\n $binding_details_node = $operation_child;\n }\n\t\t}\n\t}\n\n $is_doc = TRUE; //currently we only support doc-lit style parsing..\n $is_wrapper = FALSE;\n $params_node = NULL;\n $is_direct_list = FALSE;\n\n if($sig_node) {\n $params_node = $sig_node->firstChild;\n if($params_node && $params_node->localName == WSF_PARAMS) {\n if($params_node->hasAttributes()) {\n /* Wrapper element of the request operation */\n $sig_attrs = $params_node->attributes;\n\n if($sig_attrs->getNamedItem(WSF_WRAPPER_ELEMENT)) {\n $ele_name = $sig_attrs->getNamedItem(WSF_WRAPPER_ELEMENT)->value;\n }\n if($sig_attrs->getNamedItem(WSF_WRAPPER_ELEMENT_NS)) {\n $ele_ns = $sig_attrs->getNamedItem(WSF_WRAPPER_ELEMENT_NS)->value;\n }\n\n $is_wrapper = TRUE;\n }\n else{\n /* No wrapper element in the request */\n $ele_ns = NULL;\n $ele_name = NULL;\n\n /* check for the only param target-namespace */\n $only_param = $params_node->firstChild;\n $sig_attrs = $only_param->attributes;\n \n if($sig_attrs->getNamedItem(WSF_TARGETNAMESPACE)) {\n $ele_ns = $sig_attrs->getNamedItem(WSF_TARGETNAMESPACE)->value;\n }\n if($sig_attrs->getNamedItem(WSF_NAME)) {\n $ele_name = $sig_attrs->getNamedItem(WSF_NAME)->value;\n }\n if($sig_attrs->getNamedItem(WSF_LIST)) {\n $is_direct_list = $sig_attrs->getNamedItem(WSF_LIST)->value;\n }\n }\n }\n }\n\n\tif(!$soap_body_node) {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"soap_body not found\");\n\t}\n\n // parsing input headers\n $header_params = array();\n $output_headers = array();\n if($header_node) {\n $header_first_child = $header_node->firstChild;\n $output_index = 0;\n\n if($binding_details_node) {\n $binding_details_childs = $binding_details_node->childNodes;\n\n foreach($binding_details_childs as $binding_details_child) {\n if($binding_details_child->nodeType == XML_ELEMENT_NODE &&\n $binding_details_child->nodeName == WSF_SOAPHEADER &&\n $binding_details_child->attributes->getNamedItem(WSF_HEADER_FOR_ATTRIBUTE)) {\n\n if($binding_details_child->attributes->getNamedItem(WSF_HEADER_FOR_ATTRIBUTE)->value == WSF_WSDL_INPUT) {\n\n //so this is the next input element..\n $sig_attrs = $binding_details_child->attributes;\n\n if($sig_attrs->getNamedItem(WSF_TYPE)) {\n $ele_name = $sig_attrs->getNamedItem(WSF_TYPE)->value;\n }\n if($sig_attrs->getNamedItem(WSF_TYPE_NAMESPACE)) {\n $ele_ns = $sig_attrs->getNamedItem(WSF_TYPE_NAMESPACE)->value;\n }\n\n // for the starting sig we have to go for the header node name we want\n\n //go to the next header\n if($header_first_child) {\n $header_child = $header_first_child;\n while($header_child && ($header_child->nodeType == XML_TEXT_NODE ||\n !($header_child->localName == $ele_name && $header_child->namespaceURI == $ele_ns))) {\n $header_child = $header_child->nextSibling;\n }\n }\n\n if($header_child) {\n $header_sig = $binding_details_child->firstChild;\n if($classmap != NULL && !empty($classmap)) {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"starting to parse header $ele_name as a classmap\");\n $new_param = wsf_parse_payload_for_class_map($header_child, $header_sig, $ele_name, $classmap,\n $cid2cont_type, $cid2attachments);\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"parsed_pram \".print_r($new_param, TRUE).\" as a classmap\");\n }\n else\n {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"starting to parse header $ele_name as an array\");\n $new_param = wsf_parse_payload_for_array($header_child, $header_sig,\n $cid2cont_type, $cid2attachments);\n }\n $header_params[] = $new_param;\n }\n else {\n //if header child doesn't exist better check whether it is an requeired header\n if($sig_attrs && $sig_attrs->getNamedItem(WSF_REQUIRED) && $sig_attrs->getNamedItem(WSF_REQUIRED)->value == \"true\") {\n //throwing faults saying it is required\n throw new WSFault(\"Sender\", \"Requried header {$ele_name}|{$ele_ns} missing\");\n }\n }\n\n }\n else if($binding_details_child->attributes->getNamedItem(WSF_HEADER_FOR_ATTRIBUTE)->value == WSF_WSDL_OUTPUT){\n $output_headers[$output_index] = array(); //to retrive later\n $header_params[] = &$output_headers[$output_index]; //to feed to the user operation\n \n $output_index ++;\n }\n }\n }\n }\n }\n\n //parsing the pyalod\n $op_param_values = array();\n if($classmap != NULL && !empty($classmap)) {\n if($soap_body_node)\n {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"starting to parse payload as a classmap\");\n $op_param_values = wsf_parse_payload_for_class_map($soap_body_node, $params_node, $ele_name, $classmap,\n $cid2cont_type, $cid2attachments);\n }\n $arg_array = array_merge(array($op_param_values), $header_params); \n }\n else\n {\n if($soap_body_node)\n {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, \"starting to parse payload as an array\");\n $op_param_values = wsf_parse_payload_for_array($soap_body_node, $params_node,\n $cid2cont_type, $cid2attachments);\n if(!is_array($op_param_values) || $is_direct_list) {\n // this can happens when returning simple types\n $op_param_values = array($op_param_values);\n }\n }\n $arg_array = array_merge($op_param_values, $header_params); \n }\n\n ws_log_write(__FILE__, __LINE__, WSF_LOG_DEBUG, print_r($arg_array, TRUE));\n\t\n\n if($class_name != NULL) {\n // First call the constructor\n $class = new ReflectionClass($class_name);\n\n if($class) {\n if($class_args && is_array($class_args)) {\n $class_inst = $class->newInstanceArgs($class_args);\n }\n else {\n $class_inst = $class->newInstanceArgs(array());\n }\n \n // Then the user method\n $method = $class->getMethod($function_name);\n if(($classmap != NULL && !empty($classmap)) || $is_direct_list) {\n // for direct lists we follow same api as classmap\n\t\t\t\t\n $response_value = $method->invokeArgs($class_inst, $arg_array);\n }\n\t\t\telse {\n $response_value = $method->invokeArgs($class_inst, $arg_array);\n }\n }\n else {\n ws_log_write(__FILE__, __LINE__, WSF_LOG_ERROR, \"class : $class_name doesn't exists\");\n }\n }\n else\n {\n if(($classmap != NULL && !empty($classmap)) || $is_direct_list) {\n\t\t\t// for direct lists we follow same api as classmap\n\t\t\t$response_value = call_user_func_array($function_name, $arg_array);\n }\n\t\telse {\n $response_value = call_user_func_array($function_name, $arg_array);\n }\n }\n\n $attachment_map = array();\n\n $response_payload_string = wsf_wsdl_create_response_payload($response_value, $sig_node, $mtom_on,\n $attachment_map, $classmap);\n $output_header_string =\n wsf_wsdl_create_response_headers($binding_details_node, $output_headers, $mtom_on,\n $attachment_map, $classmap);\n\n\n\treturn array(WSF_RESPONSE_PAYLOAD => $response_payload_string, \n WSF_OUTPUT_HEADERS => $output_header_string,\n WSF_ATTACHMENT_MAP => $attachment_map);\n}",
"function dsf_get_address_doctor_soap($house_number, $street_name, $locality, $region, $post_code, $country, $customer_id, $password, $origin, $withhn, $countrytype, $lineseperator, $preferlang, $capital, $formatwithorg, $parseinput, $removediacretic){\n\t\n\t$soap_request = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";\n\t\t\t\t$soap_request .= \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\"\\n\";\n\t\t\t\t$soap_request .= \"xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\"\\n\";\n\t\t\t\t$soap_request .= \"xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\";\n\t\t\t\t$soap_request .= \"<soap:Body>\\n\";\n\t\t\t\t\t$soap_request .= \"<Validate xmlns=\\\"http://validator2.AddressDoctor.com/addInteractive/Interactive\\\">\\n\";\n\t\t\t\t\t$soap_request .= \"<addInteractiveRequest>\\n\";\n\t\t\t\t\t\t$soap_request .= \"<Authentication>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<CustomerID>\" . $customer_id . \"</CustomerID>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<DepartmentID>0</DepartmentID>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Password>\" . $password . \"</Password>\\n\";\n\t\t\t\t\t\t$soap_request .= \"</Authentication>\\n\";\n\t\t\t\t\t\t$soap_request .= \"<CampaignID>myCampaignID</CampaignID>\\n\";\n\t\t\t\t\t\t$soap_request .= \"<JobToken></JobToken>\\n\";\n\t\t\t\t\t\t$soap_request .= \"<Parameters>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<CountryOfOrigin>\" . $origin . \"</CountryOfOrigin>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<StreetWithHNo>\" . $withhn . \"</StreetWithHNo>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<CountryType>\" . $countrytype . \"</CountryType>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<LineSeparator>\" . $lineseperator . \"</LineSeparator>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<PreferredLanguage>\" . $preferlang . \"</PreferredLanguage>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Capitalization>\" . $capital . \"</Capitalization>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<FormattedAddressWithOrganization>\" . $formatwithorg . \"</FormattedAddressWithOrganization>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<ParsedInput>\" . $parseinput . \"</ParsedInput>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<RemoveDiacritics>\" . $removediacretic . \"</RemoveDiacritics>\\n\";\n\t\t\t\t\t\t$soap_request .= \"</Parameters>\\n\";\n\t\t\t\t\t\t$soap_request .= \"<Address>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<RecordID>998887</RecordID>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Organization>AddressDoctor GmbH</Organization>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Department>Spectrum</Department>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Contact>Varta</Contact>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Building></Building>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Street>\" . utf8_encode($street_name) . \"</Street>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<HouseNumber>\" . $house_number . \"</HouseNumber>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<POBox></POBox>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Locality>\" . $locality . \"</Locality>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<PostalCode>\" . $post_code . \"</PostalCode>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Province>\" . $region . \"</Province>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Country>\" . $country . \"</Country>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<Residue></Residue>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<CountrySpecificLocalityLine></CountrySpecificLocalityLine>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<DeliveryAddressLines></DeliveryAddressLines>\\n\";\n\t\t\t\t\t\t\t\t$soap_request .= \"<FormattedAddress></FormattedAddress>\\n\";\n\t\t\t\t\t\t$soap_request .= \"</Address>\\n\";\n\t\t\t\t\t\t$soap_request .= \"</addInteractiveRequest>\\n\";\n\t\t\t\t\t$soap_request .= \"</Validate>\\n\";\n\t\t\t\t$soap_request .= \"</soap:Body>\\n\";\n\t\t\t\t$soap_request .= \"</soap:Envelope>\\n\";\n\t\n\t\treturn $soap_request;\n\t\n}",
"function callPhSOAPAPI($aParams,\n $rootUrl = \"http://localhost:9090/PhElectricityAPI\",\n $soapUser = \"username\",\n $soapPassword = \"password\") {\n\n $soapUrl = $rootUrl . '/' . $aParams['Service']; // asmx URL of WSDL\n // xml post structure\n $xml_post_string = '<soapenv:Envelope'\n . ' xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"'\n . ' xmlns:cpy=\"http://cpy.ws.phsoft.com/\">';\n $xml_post_string .= '<soapenv:Header/>';\n $xml_post_string .= '<soapenv:Body>';\n if (isset($aParams['params']) && is_array($aParams['params']) && count($aParams['params']) > 0) {\n $xml_post_string .= '<' . $aParams['Operation'] . '>';\n foreach ($aParams['params'] as $key => $value) {\n $xml_post_string .= '<' . $key . '>' . $value . '</' . $key . '>';\n }\n $xml_post_string .= '</' . $aParams['Operation'] . '>';\n } else {\n $xml_post_string .= '<' . $aParams['Operation'] . '/>';\n }\n $xml_post_string .= '</soapenv:Body>';\n $xml_post_string .= '</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: \" . $soapUrl,\n \"Content-length: \" . strlen($xml_post_string),\n \"hapikey: 56A6A8851DAF44B388D0C7BA43BB7EB5\",\n \"husername: Nart\",\n \"hpassword: PNhaSrotfHtaOyntehGaomd165\",\n \"hcopy: \" . $aParams['header']['Copy'],\n \"htoken: \" . $aParams['header']['Token']\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_URL, $soapUrl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $soapUser . \":\" . $soapPassword);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $vResponse = curl_exec($ch);\n curl_close($ch);\n\n $vResponse = str_replace(\"</soap:Body>\", \"\", str_replace(\"<soap:Body>\", \"\", $vResponse));\n $vResponse = substr($vResponse, strpos($vResponse, '<return>') + 8);\n $vResponse = substr($vResponse, 0, strpos($vResponse, '</return>'));\n\n return $vResponse;\n }",
"public function generateXMLRequestString()\n {\n $enabledMetadataTypes = array();\n if ($this->enableSocialTags) {\n $enabledMetadataTypes[] = 'GenericRelations';\n }\n if ($this->enableGenericRelations) {\n $enabledMetadataTypes[] = 'SocialTags';\n }\n\n $xml = '<c:params xmlns:c=\"http://s.opencalais.com/1/pred/\" ';\n $xml .= 'xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">';\n $xml .= '<c:processingDirectives ';\n $xml .= 'c:contentType=\"' . $this->contentType . '\" ';\n $xml .= 'c:enableMetadataType=\"' . implode(',', $enabledMetadataTypes) . '\" ';\n $xml .= 'c:outputFormat=\"' . $this->outputFormat . '\" ';\n $xml .= 'c:docRDFaccessible=\"' . ($this->docRDFaccessible ? 'true' : 'false') . '\" ';\n $xml .= '></c:processingDirectives>';\n $xml .= '<c:userDirectives ';\n $xml .= 'c:allowDistribution=\"' . ($this->allowDistribution ? 'true' : 'false') . '\" ';\n $xml .= 'c:allowSearch=\"' . ($this->allowSearch ? 'true' : 'false') . '\" ';\n $xml .= '></c:userDirectives>';\n $xml .= '<c:externalMetadata></c:externalMetadata>';\n $xml .= '</c:params>';\n\n return $xml;\n }",
"public function allocateAssets() {\n try {\n $serviceToCall = \"InvestmentWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <inv01>\n <q1>A</q1>\n <q2>A</q2>\n <q3>A</q3>\n <q4>A</q4>\n <q5>A</q5>\n <q6>A</q6>\n <q7>A</q7>\n <q8>A</q8>\n <q9>A</q9>\n <q10>A</q10>\n </inv01>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <inv01 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </inv01>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"inv01Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"inv01Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"inv01Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"function _commerce_ups_xml_access_request() {\n $access = variable_get('commerce_ups_access_key', '');\n $user = variable_get('commerce_ups_user_id', '');\n $password = variable_get('commerce_ups_password', '');\n return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<AccessRequest xml:lang=\\\"en-US\\\">\n <AccessLicenseNumber>$access</AccessLicenseNumber>\n <UserId>$user</UserId>\n <Password>$password</Password>\n</AccessRequest>\n\";\n}",
"public function GetXML() {\n $xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?><getAuthorization>';\n $xml .= \"<Version>$this->version</Version>\";\n $xml .= \"<Processor>$this->processor</Processor>\";\n $xml .= \"<MerchantID>$this->merchantID</MerchantID>\";\n if (!IsNullOrEmptyString($this->terminalID))\n $xml .= \"<TerminalID>$this->terminalID</TerminalID>\";\n $xml .= \"<TransType>$this->transType</TransType>\";\n $xml .= \"<TrAmount>$this->trAmount</TrAmount>\";\n if ($this->transType == '4' || $this->transType == 4)\n $xml .= \"<NewAmount>$this->newAmount</NewAmount>\";\n $xml .= \"<TrCurrency>$this->trCurrency</TrCurrency>\";\n $xml .= \"<DateAndTime>$this->dateAndTime</DateAndTime>\";\n if (!IsNullOrEmptyString($this->PAN))\n $xml .= \"<PAN>$this->PAN</PAN>\";\n if (!IsNullOrEmptyString($this->expDate))\n $xml .= \"<ExpDate>$this->expDate</ExpDate>\";\n if (!IsNullOrEmptyString($this->track1))\n $xml .= \"<Track1>$this->track1</Track1>\";\n if (!IsNullOrEmptyString($this->track2))\n $xml .= \"<Track2>$this->track2</Track2>\";\n $xml .= \"<RRN>$this->RRN</RRN>\";\n if (!IsNullOrEmptyString($this->authCode))\n $xml .= \"<AuthCode>$this->authCode</AuthCode>\";\n if (!IsNullOrEmptyString($this->CVC2))\n $xml .= \"<CVC2>$this->CVC2</CVC2>\";\n if (!IsNullOrEmptyString($this->securityLevelInd))\n $xml .= \"<SecurityLevelInd>$this->securityLevelInd</SecurityLevelInd>\";\n if (!IsNullOrEmptyString($this->UCAF))\n $xml .= \"<UCAF>$this->UCAF</UCAF>\";\n if (!IsNullOrEmptyString($this->CAVV))\n $xml .= \"<CAVV>$this->CAVV</CAVV>\";\n if (!IsNullOrEmptyString($this->XID))\n $xml .= \"<XID>$this->XID</XID>\";\n if (!IsNullOrEmptyString($this->merchantName))\n $xml .= \"<MerchantName>$this->merchantName</MerchantName>\";\n if (!IsNullOrEmptyString($this->merchantCity))\n $xml .= \"<MerchantCity>$this->merchantCity</MerchantCity>\";\n if (!IsNullOrEmptyString($this->merchantCountry))\n $xml .= \"<MerchantCountry>$this->merchantCountry</MerchantCountry>\";\n $xml .= \"</getAuthorization>\";\n return $xml;\n }",
"abstract protected function buildRequestType();",
"function UD_GetAssetResults($userid,$assetid,$summarylevel=true) {\r\n\tglobal $CFG;\r\n\r\n\tif (!isolsaconfigurationset()) {\r\n\t\t$response = new olsaresponse(false,get_string('skillsoft_olsasettingsmissing','skillsoft'),NULL);\r\n\t} else {\r\n\r\n\t\t//Set local OLSA Variables\r\n\t\t$endpoint = $CFG->skillsoft_olsaendpoint;\r\n\t\t$customerId = $CFG->skillsoft_olsacustomerid;\r\n\t\t$sharedsecret = $CFG->skillsoft_olsasharedsecret;\r\n\r\n\r\n\t\t//Specify the WSDL using the EndPoint\r\n\t\t$wsdlurl = $endpoint.'?WSDL';\r\n\r\n\t\t//Specify the SOAP Client Options\r\n\t\t$options = array(\r\n\t\t\t\"trace\" => 0,\r\n\t\t\t\"exceptions\" => 0,\r\n\t\t\t\"soap_version\" => SOAP_1_2,\r\n\t\t\t\"cache_wsdl\" => WSDL_CACHE_BOTH,\r\n\t\t\t\"encoding\"=> \"UTF-8\"\r\n\t\t\t);\r\n\r\n\t\t\t//Create a new instance of the OLSA Soap Client\r\n\t\t\t$client = new olsa_soapclient($wsdlurl,$options);\r\n\r\n\t\t\t//Create the USERNAMETOKEN\r\n\t\t\t$client->__setUsernameToken($customerId,$sharedsecret);\r\n\r\n\t\t\t//Create the Request\r\n\t\t\tif (empty($assetid)) {\r\n\t\t\t\t$GetAssetResultsRequest = array(\r\n\t\t\t\t\t\"customerId\" => $customerId,\r\n\t\t\t\t\t\"userName\" => $userid,\r\n\t\t\t\t\t\"summaryLevel\" => $summarylevel,\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\t$GetAssetResultsRequest = array(\r\n\t\t\t\t\t\"customerId\" => $customerId,\r\n\t\t\t\t\t\"userName\" => $userid,\r\n\t\t\t\t\t\"assetId\" => $assetid,\r\n\t\t\t\t\t\"summaryLevel\" => $summarylevel,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t//Call the WebService and stored result in $result\r\n\t\t\t$result=$client->__soapCall('UD_GetAssetResults',array('parameters'=>$GetAssetResultsRequest));\r\n\r\n\t\t\tif (is_soap_fault($result)) {\r\n\r\n\t\t\t\tif (!stripos($result->getmessage(),'security token could not be authenticated or authorized') == false) {\r\n\t\t\t\t\t//Authentication Failure\r\n\t\t\t\t\t$response = new olsaresponse(false,get_string('skillsoft_olsassoapauthentication','skillsoft'),NULL);\r\n\t\t\t\t} elseif (!stripos($result->getmessage(), 'The specified course could not be found') == false){\r\n\t\t\t\t\t//Asset ID is invalid\r\n\t\t\t\t\t$response = new olsaresponse(false,get_string('skillsoft_olsassoapinvalidassetid','skillsoft',$assetid),NULL);\r\n\t\t\t\t} elseif (!stripos($result->getmessage(), 'does not exist, or is not in Source Users Scope') == false){\r\n\t\t\t\t\t//User ID is invalid\r\n\t\t\t\t\t$response = new olsaresponse(false,get_string('skillsoft_olsassoapinvaliduserid','skillsoft',$userid),NULL);\r\n\t\t\t\t} elseif (!stripos($result->getmessage(), 'are no results for') == false){\r\n\t\t\t\t\t//No results repond as OK with NULL object\r\n\t\t\t\t\t$response = new olsaresponse(true,'',NULL);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//General SOAP Fault\r\n\t\t\t\t\t//print_error('olsassoapfault','skillsoft','',$result->getmessage());\r\n\t\t\t\t\t$response = new olsaresponse(false,get_string('skillsoft_olsassoapfault','skillsoft',$result->getmessage()),NULL);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$results = $result->RESULTS;\r\n\t\t\t\t$response = new olsaresponse(true,'',$results);\r\n\t\t\t}\r\n\t}\r\n\treturn $response;\r\n}",
"function invokeCreateInboundShipmentPlan(FBAInboundServiceMWS_Interface $service, $request) \n {\n try {\n $response = $service->createInboundShipmentPlan($request);\n echo '<pre>'; print_r($response); echo '</pre>';\n\n echo (\"Service Response\\n\");\n echo (\"=============================================================================\\n\");\n\n echo(\" CreateInboundShipmentPlanResponse\\n\");\n if ($response->isSetCreateInboundShipmentPlanResult()) { \n echo(\" CreateInboundShipmentPlanResult\\n\");\n $createInboundShipmentPlanResult = $response->getCreateInboundShipmentPlanResult();\n if ($createInboundShipmentPlanResult->isSetInboundShipmentPlans()) { \n echo(\" InboundShipmentPlans\\n\");\n $inboundShipmentPlans = $createInboundShipmentPlanResult->getInboundShipmentPlans();\n $memberList = $inboundShipmentPlans->getmember();\n foreach ($memberList as $member) {\n echo(\" member\\n\");\n if ($member->isSetShipmentId()) \n {\n echo(\" ShipmentId\\n\");\n echo(\" \" . $member->getShipmentId() . \"\\n\");\n }\n if ($member->isSetDestinationFulfillmentCenterId()) \n {\n echo(\" DestinationFulfillmentCenterId\\n\");\n echo(\" \" . $member->getDestinationFulfillmentCenterId() . \"\\n\");\n }\n if ($member->isSetShipToAddress()) { \n echo(\" ShipToAddress\\n\");\n $shipToAddress = $member->getShipToAddress();\n if ($shipToAddress->isSetName()) \n {\n echo(\" Name\\n\");\n echo(\" \" . $shipToAddress->getName() . \"\\n\");\n }\n if ($shipToAddress->isSetAddressLine1()) \n {\n echo(\" AddressLine1\\n\");\n echo(\" \" . $shipToAddress->getAddressLine1() . \"\\n\");\n }\n if ($shipToAddress->isSetAddressLine2()) \n {\n echo(\" AddressLine2\\n\");\n echo(\" \" . $shipToAddress->getAddressLine2() . \"\\n\");\n }\n if ($shipToAddress->isSetDistrictOrCounty()) \n {\n echo(\" DistrictOrCounty\\n\");\n echo(\" \" . $shipToAddress->getDistrictOrCounty() . \"\\n\");\n }\n if ($shipToAddress->isSetCity()) \n {\n echo(\" City\\n\");\n echo(\" \" . $shipToAddress->getCity() . \"\\n\");\n }\n if ($shipToAddress->isSetStateOrProvinceCode()) \n {\n echo(\" StateOrProvinceCode\\n\");\n echo(\" \" . $shipToAddress->getStateOrProvinceCode() . \"\\n\");\n }\n if ($shipToAddress->isSetCountryCode()) \n {\n echo(\" CountryCode\\n\");\n echo(\" \" . $shipToAddress->getCountryCode() . \"\\n\");\n }\n if ($shipToAddress->isSetPostalCode()) \n {\n echo(\" PostalCode\\n\");\n echo(\" \" . $shipToAddress->getPostalCode() . \"\\n\");\n }\n } \n if ($member->isSetLabelPrepType()) \n {\n echo(\" LabelPrepType\\n\");\n echo(\" \" . $member->getLabelPrepType() . \"\\n\");\n }\n if ($member->isSetItems()) { \n echo(\" Items\\n\");\n $items = $member->getItems();\n $member1List = $items->getmember();\n foreach ($member1List as $member1) {\n echo(\" member\\n\");\n if ($member1->isSetSellerSKU()) \n {\n echo(\" SellerSKU\\n\");\n echo(\" \" . $member1->getSellerSKU() . \"\\n\");\n }\n if ($member1->isSetFulfillmentNetworkSKU()) \n {\n echo(\" FulfillmentNetworkSKU\\n\");\n echo(\" \" . $member1->getFulfillmentNetworkSKU() . \"\\n\");\n }\n if ($member1->isSetQuantity()) \n {\n echo(\" Quantity\\n\");\n echo(\" \" . $member1->getQuantity() . \"\\n\");\n }\n }\n } \n }\n } \n } \n if ($response->isSetResponseMetadata()) { \n echo(\" ResponseMetadata\\n\");\n $responseMetadata = $response->getResponseMetadata();\n if ($responseMetadata->isSetRequestId()) \n {\n echo(\" RequestId\\n\");\n echo(\" \" . $responseMetadata->getRequestId() . \"\\n\");\n }\n } \n\n } catch (FBAInboundServiceMWS_Exception $ex) {\n echo(\"Caught Exception: \" . $ex->getMessage() . \"\\n\");\n echo(\"Response Status Code: \" . $ex->getStatusCode() . \"\\n\");\n echo(\"Error Code: \" . $ex->getErrorCode() . \"\\n\");\n echo(\"Error Type: \" . $ex->getErrorType() . \"\\n\");\n echo(\"Request ID: \" . $ex->getRequestId() . \"\\n\");\n echo(\"XML: \" . $ex->getXML() . \"\\n\");\n }\n }",
"public function DocTypeDataSaveAPI($request,$params){\n $client=$this->getGuzzleHttpInstance(); //Guzzle Client object\n $url=env(\"VALIDATEME_BE_ENDPOINT\").\"/doctype\";\n $headers = [\n 'Content-Type' => 'application/json',\n 'authorization' => 'Basic '.env(\"VALIDATEME_BE_API_AUTH_KEY\"),\n ];\n $data=[\n 'json' => $params,\n 'headers' => $headers,\n 'http_errors' => false\n ];\n $response = $client->request('POST',$url, $data);\n $finalResponse=$this->HeaderStatusCode($response->getStatusCode(),json_decode($response->getBody()->getContents(),true));\n return $finalResponse;\n }",
"function Create_ListSessionsRequest_Object($endDate, $folderId, $pagination,$remoteRecorderId, $sortBy, $sortIncreasing, $startDate,$states)\n{\n\n //Create empty object to store member data\n $listSessionsRequest = new stdClass();\n\n $listSessionsRequest->EndDate = new SoapVar($endDate, XSD_STRING, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->FolderId = new SoapVar($folderId, XSD_STRING, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->Pagination = new SoapVar($pagination,SOAP_ENC_OBJECT, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->RemoteRecorderId = new SoapVar($remoteRecorderId, XSD_STRING, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->SortBy = new SoapVar($sortBy, XSD_STRING, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->SortIncreasing = new SoapVar($sortIncreasing, XSD_BOOLEAN, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->StartDate = new SoapVar($startDate, XSD_STRING, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n $listSessionsRequest->States = new SoapVar($states, SOAP_ENC_OBJECT, null, null, null, PanoptoSessionManagementSoapClient::OBJECT_MEMBER_NAMESPACE);\n return $listSessionsRequest;\n}",
"public function testTeamsIdDynamicDatasNkDataSourceSoapGet()\n {\n\n }",
"private function toSoapCreate() {\n\t$returnVal = new thObject();\n\t$returnVal->Id = $this->getId();\n\t$returnVal->Type = $this->getType();\n\n\t$returnVal->any = '';\n\tfor ($i = 0; $i < $this->dom->childNodes->item(0)->childNodes->length; $i++) {\n\t $returnVal->any .= $this->dom->saveXML($this->dom->childNodes->item(0)->childNodes->item($i));\n\t}\n\n\treturn $returnVal;\n }",
"public function responseAction()/*{{{*/\n {\n $post = Mage::app()->getRequest()->getParams();\n #echo '<pre>'.print_r($post, 1).'</pre>';\n\n Mage::log(\"Heidelpay - responseAction: post\");\n Mage::log($post);\n $returnvalue = '';\n if (isset($post['PROCESSING_RESULT'])) $returnvalue = $post['PROCESSING_RESULT'];\n if ($returnvalue){\n $shortid = $orderId = $uniqueid = $authType = $statusCode = $processReturn = $frontendCancel = $payCode = $custId = '';\n $accBrand = $accExpMonth = $accExpYear = $accHolder = $accNumber = $accBank = $actPM = '';\n $conAccCountry = $conAccHolder = $conAccNumber = $conAccBank = $conAccBic = $conAccIban = $presAmount = $presCurrency = $pm = '';\n if (isset($post['IDENTIFICATION_SHORTID']))\t\t\t\t\t$shortid\t\t\t\t= $post['IDENTIFICATION_SHORTID'];\n if (isset($post['IDENTIFICATION_TRANSACTIONID'])) \t\t$orderId\t\t\t\t= $post['IDENTIFICATION_TRANSACTIONID'];\n if (isset($post['IDENTIFICATION_UNIQUEID']))\t\t\t\t$uniqueid\t\t\t\t= $post['IDENTIFICATION_UNIQUEID'];\n if (isset($post['AUTHENTICATION_TYPE']))\t\t\t\t\t$authType\t\t\t\t= $post['AUTHENTICATION_TYPE'];\n if (isset($post['PROCESSING_STATUS_CODE']))\t\t\t$statusCode\t\t\t= $post['PROCESSING_STATUS_CODE'];\n if (isset($post['PROCESSING_RETURN'])) \t\t$processReturn\t\t= $post['PROCESSING_RETURN'];\n if (isset($post['FRONTEND_REQUEST_CANCELLED'])) $frontendCancel\t= $post['FRONTEND_REQUEST_CANCELLED'];\n if (isset($post['PAYMENT_CODE']))\t\t\t\t\t\t\t\t$payCode\t\t\t\t= $post['PAYMENT_CODE'];\n if (isset($post['ACCOUNT_BRAND']))\t\t\t\t\t\t\t\t$accBrand\t\t\t= $post['ACCOUNT_BRAND'];\n if (isset($post['ACCOUNT_EXPIRY_MONTH']))\t\t\t\t$accExpMonth\t\t= $post['ACCOUNT_EXPIRY_MONTH'];\n if (isset($post['ACCOUNT_EXPIRY_YEAR']))\t\t\t\t\t$accExpYear\t\t= $post['ACCOUNT_EXPIRY_YEAR'];\n if (isset($post['ACCOUNT_HOLDER']))\t\t\t\t\t\t\t$accHolder\t\t\t= $post['ACCOUNT_HOLDER'];\n if (isset($post['ACCOUNT_NUMBER']))\t\t\t\t\t\t\t$accNumber\t\t\t= $post['ACCOUNT_NUMBER'];\n if (isset($post['ACCOUNT_BANK']))\t\t\t\t\t\t\t\t$accBank\t\t\t\t= $post['ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_COUNTRY']))\t$conAccCountry\t= $post['CONNECTOR_ACCOUNT_COUNTRY'];\n if (isset($post['CONNECTOR_ACCOUNT_HOLDER']))\t\t$conAccHolder\t\t= $post['CONNECTOR_ACCOUNT_HOLDER'];\n if (isset($post['CONNECTOR_ACCOUNT_NUMBER']))\t$conAccNumber\t= $post['CONNECTOR_ACCOUNT_NUMBER'];\n if (isset($post['CONNECTOR_ACCOUNT_BANK']))\t\t\t$conAccBank\t\t= $post['CONNECTOR_ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_BIC']))\t\t\t\t$conAccBic\t\t\t= $post['CONNECTOR_ACCOUNT_BIC'];\n if (isset($post['CONNECTOR_ACCOUNT_IBAN']))\t\t\t$conAccIban\t\t\t= $post['CONNECTOR_ACCOUNT_IBAN'];\n if (isset($post['PRESENTATION_AMOUNT']))\t\t\t\t\t$presAmount\t\t\t= $post['PRESENTATION_AMOUNT'];\n if (isset($post['PRESENTATION_CURRENCY']))\t\t\t\t$presCurrency\t\t= $post['PRESENTATION_CURRENCY'];\n if (isset($post['CRITERION_PAYMETHOD']))\t\t\t\t\t$pm\t\t\t\t\t\t= $post['CRITERION_PAYMETHOD'];\n if (isset($post['actPM'])) \t\t\t\t\t\t$actPM\t\t\t\t\t= $post['actPM']; \n\n $invoiceMailComment = 'Short ID: '.$shortid; \n\n // PNO Meldung Special Hack bei PROCESSING.RETURN.CODE=100.400.110\n $returnCode = '';\n if (isset($post['PROCESSING_RETURN_CODE'])) $returnCode = $post['PROCESSING_RETURN_CODE'];\n if (strpos($returnCode, '100.400.110') !== false){\n $processReturn = $this->_getHelper('heidelpay')->__('HP_PNO_ERROR');\n }\n\n // Order ID extrahieren\n if (strpos($orderId, '-') !== false){\n $parts = explode('-', $orderId);\n $orderId = $parts[0];\n $custId = $parts[1];\n }\n\n // Order Object\n $order = $this->getOrder();\n if (!empty($orderId)){\n $order->loadByIncrementId($orderId);\n // Payment Object # Change 25.05.2012\n if ($order->getPayment() !== false){\n \t$payment = $order->getPayment()->getMethodInstance();\n } else {\n \t$payment = $this->getHPPayment();\n }\n #echo '<pre>'.print_r($payment, 1).'</pre>';\n }\n\n if ($payCode == 'IV.PA' && $post['ACCOUNT_BRAND'] == 'BILLSAFE'){\n\t $repl = array(\n '{AMOUNT}' => $post['CRITERION_BILLSAFE_AMOUNT'], \n '{CURRENCY}' => $post['CRITERION_BILLSAFE_CURRENCY'], \n '{ACC_OWNER}' => $post['CRITERION_BILLSAFE_RECIPIENT'], \n '{ACC_BANKNAME}' => $post['CRITERION_BILLSAFE_BANKNAME'], \n '{ACC_NUMBER}' => $post['CRITERION_BILLSAFE_ACCOUNTNUMBER'], \n '{ACC_BANKCODE}' => $post['CRITERION_BILLSAFE_BANKCODE'],\n '{ACC_BIC}' => $post['CRITERION_BILLSAFE_BIC'], \n '{ACC_IBAN}' => $post['CRITERION_BILLSAFE_IBAN'], \n '{SHORTID}' => $post['CRITERION_BILLSAFE_REFERENCE'],\n '{LEGALNOTE}' => $post['CRITERION_BILLSAFE_LEGALNOTE'],\n '{NOTE}' \t\t=> $post['CRITERION_BILLSAFE_NOTE'],\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_BILLSAFE', $this->_getHelper('heidelpay')->__('HP_SUCCESS_BILLSAFE'));\n\n $bsData = strtr(HP_SUCCESS_BILLSAFE, $repl);\n $bsData.= ' '.$post['CRITERION_BILLSAFE_LEGALNOTE'].' ';\n //$bsData.= substr($post['CRITERION_BILLSAFE_NOTE'], 0, strlen($post['CRITERION_BILLSAFE_NOTE'])-11).' '.date('d.m.Y', mktime(0,0,0,date('m'),date('d')+$post['CRITERION_BILLSAFE_PERIOD'],date('Y'))).'.';\n $bsData.= preg_replace('/{DAYS}/', $post['CRITERION_BILLSAFE_PERIOD'], $this->_getHelper('heidelpay')->__('HP_LEGALNOTE_BILLSAFE'));\n $bsData = nl2br(htmlentities($bsData));\n $invoiceMailComment = $bsData;\n $order->setCustomerNote($bsData);\n $order->save();\n }\n\n $params = '';\n $prePaidData = '';\n // Vorkasse Sonderkrams\n if ($payCode == 'PP.PA'){\n $params.= '&pcode='.$payCode.'&';\n foreach($this->importantPPFields AS $k => $v){\n if (isset($post[$v])) $params.= $v.'='.$post[$v].'&';\n }\n $repl = array(\n '{AMOUNT}' => $presAmount, \n '{CURRENCY}' => $presCurrency, \n '{ACC_COUNTRY}' => $conAccCountry, \n '{ACC_OWNER}' => $conAccHolder, \n '{ACC_NUMBER}' => $conAccNumber, \n '{ACC_BANKCODE}' => $conAccBank,\n '{ACC_BIC}' => $conAccBic, \n '{ACC_IBAN}' => $conAccIban, \n '{SHORTID}' => $shortid,\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_PREPAID', $this->_getHelper('heidelpay')->__('HP_SUCCESS_PREPAID'));\n\n $prePaidData = strtr(HP_SUCCESS_PREPAID, $repl);\n $invoiceMailComment = $prePaidData;\n }\n\n // Wenn die OT Zahlung nicht erfolgreich war, dann gespeicherte Kontodaten l�schen\n if (!strstr($returnvalue,\"ACK\") && strpos($payCode, 'OT') !== false){\n \tif ($custId != \"\"){\n \t\t$customer = Mage::getModel('customer/customer')->load($custId);\n \t\tif ($customer->getEmail() != \"\"){\n \t\t\tMage::log(\"Heidelpay - responseAction: customer->save() \" . $custId . \", \" . $customer->getEmail());\n \t\t\t$customer->setHeidelpayLastBlz($accBank);\n \t\t\t$customer->setHeidelpayLastKto($accNumber);\n \t\t\t$customer->setHeidelpayLastHolder($accHolder);\n \t\t\t$customer->save();\n \t\t}\n \t}\n }\n\n #echo '<pre>'.print_r($order, 1).'</pre>'; exit();\n if (strstr($returnvalue,\"ACK\")) {\n if (strpos($payCode, 'RG') !== false){\n # Register\n } else {\n if (!empty($orderId)){\n // fill order\n\t\t\tif ($order->canInvoice()) {\n\t\t\t\ttry {\n\t\t\t\t\t$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n\t\t\t\t\tif (!$invoice->getTotalQty()) {\n\t\t\t\t\t\tMage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));\n\t\t\t\t\t}\n\t\t\t\t\t$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n\t\t\t\t\t$invoice->register();\n\t\t\t\t\t$transactionSave = Mage::getModel('core/resource_transaction')\n\t\t\t\t\t\t->addObject($invoice)\n\t\t\t\t\t\t->addObject($invoice->getOrder())\n\t\t\t\t\t\t->save();\n\t\t\t\t\tif ($this->_invoiceOrderEmail) $invoice->sendEmail(true, $invoiceMailComment); // Rechnung versenden\n\t\t\t\t}\n\t\t\t\tcatch (Mage_Core_Exception $e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n \tMage::log(\"Heidelpay - responseAction: order->setState \" .$payment->getPaymentState());\n $order->setState($payment->getPaymentState());\n $order->addStatusToHistory($payment->getPaymentState(), 'Short ID: '.$shortid.' '.$invoiceMailComment, $order->getCustomerNoteNotify());\n if (strpos($payCode, 'PA') !== false){ # Nur bei PA speichern.\n // TransID f�r PIXI speichern\n $order->getPayment()->setLastTransId($uniqueid);\n }\n // $order->getPayment()->registerCaptureNotification($presAmount);\n $order->setCustomerNote($invoiceMailComment); // Kommentar auch in EMail\n $order->save();\n }\n }\n if ($statusCode == '90' && $authType == '3DSecure'){\n #print $base.\"/index.php/default/Heidelpay/payment/afterThreeDSecure/\"; \n echo Mage::getUrl('heidelpay/payment/afterThreeDSecure/', array('_secure' => true));\n } else {\n if (strpos($payCode, 'RG') !== false){\n #echo '<pre>Custid: '.print_r($custId, 1).'</pre>';\n if ($custId > 0){\n $customer = Mage::getModel('customer/customer')->load($custId);\n #echo '<pre>'.print_r($customer, 1).'</pre>';\n if (strpos($payCode, 'OT') !== false){\n $customer->setHeidelpayLastBlz($accBank);\n $customer->setHeidelpayLastKto($accNumber);\n $customer->setHeidelpayLastHolder($accHolder);\n }\n if (strpos($payCode, 'CC') !== false){\n if (strpos($actPM, 'XC') !== false){\n $customer->setHeidelpayXcardUniqueId($uniqueid);\n $customer->setHeidelpayXcardPaymentType($payCode);\n $customer->setHeidelpayXcard($accNumber);\n $customer->setHeidelpayXcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayXcardBrand($accBrand);\n $customer->setHeidelpayXcardHolder($accHolder);\n } else {\n $customer->setHeidelpayCcardUniqueId($uniqueid);\n $customer->setHeidelpayCcardPaymentType($payCode);\n $customer->setHeidelpayCcard($accNumber);\n $customer->setHeidelpayCcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayCcardBrand($accBrand);\n $customer->setHeidelpayCcardHolder($accHolder);\n }\n }\n if (strpos($payCode, 'DC') !== false){\n $customer->setHeidelpayDcardUniqueId($uniqueid);\n $customer->setHeidelpayDcardPaymentType($payCode);\n $customer->setHeidelpayDcard($accNumber);\n $customer->setHeidelpayDcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayDcardBrand($accBrand);\n $customer->setHeidelpayDcardHolder($accHolder);\n }\n $customer->save();\n }\n echo Mage::getUrl('heidelpay/payment/afterRegister/', array('_secure' => true)).'?uniqueId='.$uniqueid;\n } else {\n echo Mage::getUrl('heidelpay/payment/success/', array('_secure' => true)).'?uniqueId='.$uniqueid.$params;\n }\n }\n } else if ($frontendCancel == 'true'){\n if (!empty($orderId)){\n $order->setState($payment->getCancelState());\n $order->addStatusToHistory($payment->getCancelState(), 'Cancelled by User', $order->getCustomerNoteNotify());\n $order->save();\n }\n // Bei CC und DC nur bei DIRECT die CANCEL Methode nutzen.\n //if (!empty($orderId) && (strpos($payCode, 'CC') !== false || strpos($payCode, 'DC') !== false) && $payment->getConfigData('bookingmode') == 'DIRECT'){\n if ((strpos($payCode, 'CC') !== false || strpos($payCode, 'XC') !== false || strpos($payCode, 'DC') !== false)){\n print Mage::getUrl('heidelpay/payment/cancel/', array('_secure' => true, 'error' => 'Cancelled by User')).\"?pc=\".$payCode;\n } else {\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n }\n } else {\n if (!empty($orderId)){\n $order->setState($payment->getErrorState());\n $order->addStatusToHistory($payment->getErrorState(), utf8_encode($processReturn), $order->getCustomerNoteNotify());\n $order->save();\n }\n if ($processReturn == 'Canceled by user'){\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n } else {\n if(strpos($payCode, 'CC')!==false || strpos($payCode, 'XC')!==false || strpos($payCode, 'DC')!==false){\n \t$isIframe = 1;\n \tMage::log(\"Heidelpay - responseAction: \".$payCode.\" Zahlung mit Fehlercode \" . $processReturn .\", \" . $this->getSession()->getData('hp_iframe_opened'));\n } else {\n \t$isIframe = 0;\n }\n print Mage::getUrl('heidelpay/payment/error/', array('_secure' => true)).'?error='.urlencode($processReturn).\"&isiframe=\".$isIframe.\"&pc=\".$payCode;\n }\n }\n } else {\n echo 'FAIL';\n }\n }",
"function RPC_GetLicenseInfo(&$respParam)\r\n{\r\n\t$retval = LM_GetLicenseInfo($respParam);\r\n\treturn $retval; \r\n\t\r\n}",
"private function _postService () {\n $missing=$postDataArray=Array();\n $requiredParams=$this->Request_Params['Required'];\n foreach ($requiredParams AS $k => $v) :\n if ($k != 'code_url') :\n if (strlen($v) == 0) :\n $missing[]=$k;\n else :\n $postDataArray[$k] = urlencode($v);\n endif;\n elseif ($k == 'code_url') :\n if (is_array($v) AND sizeof($v) > 0) :\n foreach ($v AS $code_url) :\n $postDataArray['code_url'][] = $code_url;\n endforeach;\n else : $missing[] = 'code_url';\n endif;\n endif;\n endforeach;\n if (sizeof($missing) > 0) :\n $err = \"Required fields missing: '\" . implode(\"', '\", $missing) .\"'\";\n throw new CC_Service_Exception($err);\n else :\n $optionalParams=$this->Request_Params['Optional'];\n foreach($optionalParams AS $k => $v) :\n if (is_string($v) AND strlen($v) > 0) :\n $postDataArray[$k] = urlencode($v);\n endif;\n endforeach;\n return HttpRequest::sendPostDataArray(self::CC_POST_URL, $postDataArray);\n endif;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the specified work order in storage. | public function update(SaveWorkOrderRequest $request, WorkOrder $workOrder)
{
DB::transaction(function () use ($request, $workOrder) {
$workOrder->fill($request->input())->save();
// sync work order containers
$excluded = collect($request->input('containers', []))->filter(function ($container) {
return !empty($container['id']);
});
$workOrder->workOrderContainers()->whereNotIn('id', $excluded->pluck('id'))->delete();
foreach ($request->input('containers', []) as $container) {
$workOrder->workOrderContainers()->updateOrCreate(
['id' => data_get($container, 'id')],
$container
);
}
// sync work order goods
$excluded = collect($request->input('goods', []))->filter(function ($item) {
return !empty($item['id']);
});
$workOrder->workOrderGoods()->whereNotIn('id', $excluded->pluck('id'))->delete();
foreach ($request->input('goods', []) as $item) {
$workOrder->workOrderGoods()->updateOrCreate(
['id' => data_get($item, 'id')],
$item
);
}
});
if (data_get($workOrder->getChanges(), 'user_id')) {
event(new JobAssignedEvent($workOrder));
}
return response()->json([
"status" => "success",
'data' => $workOrder->load(['workOrderContainers', 'workOrderGoods']),
"message" => __("Work order :number successfully updated", [
'number' => $workOrder->job_number
])
]);
} | [
"public function testUpdateAnOrder()\n {\n }",
"abstract public function updateOrder(ShopgateOrder $order);",
"private function updateOrder() {\n\n $this->order->name = $_POST['name'];\n $this->order->address_line_1 = $_POST['address_line_1'];\n $this->order->address_line_2 = $_POST['address_line_2'];\n $this->order->postal_code = $_POST['postal_code'];\n $this->order->state = $_POST['state'];\n $this->order->amount = $_POST['amount'];\n $this->order->region_id = $_POST['region_id'];\n $this->order->reference_number = $_POST['reference_number'];\n $this->order->shipped = $_POST['shipped'] == 'on';\n\n $this->order->save();\n\n foreach ($this->orderProducts as $orderProduct) {\n foreach ($_POST['quantities'] as $orderProductId => $quantity) {\n\n if ($orderProduct->id == $orderProductId) {\n $orderProduct->quantity = $quantity;\n\n $orderProduct->save();\n }\n }\n }\n }",
"public function testUpdateOrderUsingPut()\n {\n }",
"public function it_updates_a_order()\n {\n Http::fake();\n\n (new Shopify('shop', 'token'))->orders(123)->put($order = [\n 'key1' => 'value1'\n ]);\n\n $order['id'] = 123;\n\n Http::assertSent(function (Request $request) use ($order) {\n return $request->url() == 'https://shop.myshopify.com/admin/orders/123.json'\n && $request->method() == 'PUT'\n && $request->data() == compact('order');\n });\n }",
"public function testUpdateFulfillmentOrder()\n {\n }",
"public function testUpdateOrderTrackUsingPut()\n {\n }",
"public function testUpdateOrder()\n\t{\n\t\tprint 'Run test for #updateOrder...';\n\t\t$api = new DefaultApi();\n\t\t$response = $this->provideApiKey($api, function ($api, $apiKey) {\n\t\t\treturn $api->updateOrder(\n\t\t\t\t(new UpdateOrderRequest())\n\t\t\t\t\t->setApiKey($apiKey)\n\t\t\t\t\t->setFolders(array(0))\n\t\t\t);\n\t\t});\n\t\tprint($response);\n\t\t$this->assertEquals('ok', $response->getStatus());\n\t\t$this->assertStringMatchesFormat('Order Updated', $response->getMsg());\n\t\t$this->assertNotEmpty($response->getCode());\n\t\tprint('');\n\t}",
"public function updateOrderAction() {\n //CHECK POST\n if ($this->getRequest()->isPost()) {\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n $values = $_POST;\n try {\n foreach ($values['order'] as $key => $value) {\n $tab = Engine_Api::_()->getItem('seaocore_tab', (int) $value);\n if (!empty($tab)) {\n $tab->order = $key + 1;\n $tab->save();\n }\n }\n $db->commit();\n $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }",
"public function update_order($data)\n\t{\n\t\t$this->EE->cartthrob->cart->update_order($data);\n\t}",
"public function updated(Order $order)\n {\n //\n }",
"public function updated(RequestOrder $requestOrder)\n {\n //\n }",
"public function updated(BatchOrder $batchOrder)\n {\n //\n }",
"public function updated(Order $Order)\n {\n //code...\n }",
"public function testUpdateOrdersAsync()\n {\n }",
"public function orderUpdate()\n {\n\n /**\n * @var Amazon_MCF_Helper_Data $helper\n */\n $helper = Mage::helper('amazon_mcf');\n\n $stores = Mage::app()->getStores(true);\n /**\n *\n *\n * @var Amazon_MCF_Model_Service_Outbound $service\n */\n $service = Mage::getSingleton('amazon_mcf/service_outbound');\n\n\n foreach ($stores as $store) {\n if (!$helper->isEnabled($store)) {\n continue;\n }\n\n /**\n * @var \\Mage_Sales_Model_Resource_Order_Collection $ordersToProcess\n */\n $ordersToProcess = Mage::getResourceModel(\n 'sales/order_collection'\n );\n $ordersToProcess\n ->addFieldToFilter('store_id', $store->getId())\n ->addFieldToFilter(\n 'state', array(\n 'in' => array(\n Mage_Sales_Model_Order::STATE_NEW,\n Mage_Sales_Model_Order::STATE_PROCESSING,\n ),\n )\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status', array(\n 'in' => array(\n Amazon_MCF_Helper_Data::ORDER_STATUS_RECEIVED,\n Amazon_MCF_Helper_Data::ORDER_STATUS_PLANNING,\n Amazon_MCF_Helper_Data::ORDER_STATUS_PROCESSING,\n ),\n )\n );\n\n if ($ordersToProcess->count()) {\n $helper->logOrder(\n 'Beginning Order Update for '\n . $ordersToProcess->count() . ' orders.'\n );\n }\n\n foreach ($ordersToProcess as $order) {\n\n $helper->logOrder(\n 'Updating order #' . $order->getIncrementId()\n );\n /**\n * @var \\FBAOutboundServiceMWS_Model_GetFulfillmentOrderResponse $result\n */\n $result = $service->getFulfillmentOrder($order);\n\n if (!empty($result)) {\n $fulfillmentOrderResult = $result\n ->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING\n // / CANCELLED / COMPLETE / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $helper->logOrder(\n 'Status of order #'\n . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if (in_array(\n $amazonStatus, array(\n 'COMPLETE',\n 'COMPLETE_PARTIALLED',\n )\n )\n ) {\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n } elseif (in_array(\n $amazonStatus, array(\n 'CANCELLED',\n 'UNFULFILLABLE',\n 'INVALID',\n )\n )\n ) {\n $this->cancelFBAShipment(\n $order, $fulfillmentOrderResult, strtolower($amazonStatus)\n );\n\n break;\n }\n }\n }\n }\n }",
"protected function updateOrders()\n {\n $connection = $this->resource->getConnection('core_write');\n $bind = [self::SENT_TO_ERP_ORDER_TABLE_FLAG => 1];\n $where = ['entity_id IN(?)' => $this->orderIds];\n $connection->update($connection->getTableName('sales_order'), $bind, $where);\n }",
"public function updateOrderAction() {\n //CHECK POST\n if ($this->getRequest()->isPost()) {\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n $values = $_POST;\n try {\n foreach ($values['order'] as $key => $value) {\n $tab = Engine_Api::_()->getItem('seaocore_tab', (int) $value);\n if (!empty($tab)) {\n $tab->order = $key + 1;\n $tab->save();\n }\n }\n $db->commit();\n $this->_helper->redirector->gotoRoute(array('action' => 'widget'));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }",
"private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid('', $this->connector->accountURL, $this->orderURL);\n $post = $this->connector->post($this->orderURL, $sign);\n if($post['status'] === 200)\n {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if(array_key_exists('certificate', $post['body'])) $this->certificateURL = $post['body']['certificate'];\n $this->updateAuthorizations();\n }\n else\n {\n if($this->log instanceof \\Psr\\Log\\LoggerInterface)\n {\n $this->log->info('Cannot update data for order \\'' . $this->basename . '\\'.');\n }\n elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('Cannot update data for order \\'' . $this->basename . '\\'.', 'function updateOrderData');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adiciona um elemento no inicio da lista | public function addFirst($mixed) {
$this->head = new Nodo($mixed, $this->head);
if($this->isEmpty()) { // verifica se a lista esta vazia
// se estiver, o fim da lista recebe o mesmo elemento, pois como possui
// apenas um elemento o fim e o inicio são o mesmo
$this->tail = $this->head;
}
$this->iSize++;// incrementa-se o tamanho da lista
} | [
"function adiElemento($elemento) {\n\t\t$this->elementos[] = $elemento;\n\t}",
"function addElement($id){\r\n $this->list[] = $id;\r\n $this->list = array_unique($this->list);\r\n }",
"public function testAddingZeroElement(){\n\t\t$this->object->addElement(0);\n\t}",
"public function addFirst($element);",
"public function Push(ENota $_contenuto){\n\t\t$this->contenuto[]=$_contenuto;\n\t}",
"public function add($element);",
"public function addEmptyItemAndGetKey()\n {\n $this->ksort();\n $count = $this->count();\n if ($count > 0) {\n // @extensionScannerIgnoreLine\n $iterator = $this->getIterator();\n $iterator->seek($count - 1);\n $index = $iterator->key() + 1;\n } else {\n $index = 1;\n }\n $this[$index] = new self();\n\n return $index;\n }",
"function add(FormElement $obj){\n $this->elements[] = $obj;\n }",
"function agregarJuego($coleccionJuegos, $puntos, $indicePalabra)\n{\n $coleccionJuegos[count($coleccionJuegos)] = [\"puntos\" => $puntos, \"indicePalabra\" => $indicePalabra];\n return $coleccionJuegos;\n}",
"public function create_and_add_element($element)\n {\n // add to the collection\n $this->add_element($element);\n }",
"public function addElement(Adress $adress){\n //si l'instance ne se trouve pas dans le tableau....\n if(!in_array($adress, $this->collectionAdress)){\n $this->collectionAdress[] = $adress; //on le met dans le tableau\n }\n }",
"function newItemBefore()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$new_li =& $this->dom->create_element(\"ListItem\");\n\t\t$new_li =& $li->insert_before($new_li, $li);\n\t}",
"public static function nuevoArticulo() {\n\n $cod = $_SESSION['cod'];\n $_SESSION['productos'][$cod] ++;\n// $p = new Producto($_SESSION['cod']);\n//\n// self::agregarProductos($p->getCod(), $p->getPvp());\n }",
"private function addtoul($o,$p){\n\t\t$this->addel(new mfcms_ul($o));//Add the subul(if not exist)\n\t\tforeach($this->ullist as $key => $value){\n\t\t\tif($value->gethtml() == $o){//Add the item\n\t\t\t\t$value->addel($p);\n\t\t\t}\n\t\t}\n\t}",
"private function insereListaApresentacao() {\n // Apaga caso já exista\n $listas = ListaCompra::where('consumidor_id', 3)->get();\n\n if($listas->count() > 0) {\n foreach($listas as $lista) {\n $compras = Compra::where('lista_compra_id', $lista->id)->get();\n\n foreach ($compras as $compra)\n $compra->delete();\n\n $lista->delete();\n }\n }\n\n // Insere lista\n $listaID = ListaCompra::create(\n [\n 'data_lista' => date('Y-m-d', strtotime('now')),\n 'consumidor_id' => 3,\n 'recomendada' => 1,\n 'confirmada' => 0\n ]\n )->id;\n\n // Insere 9 compras na lista\n $compras = [];\n $compras[] = ['quantidade' => 2, 'produtoID' => 2, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 3, 'produtoID' => 3, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 4, 'produtoID' => 4, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 2, 'produtoID' => 5, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 1, 'produtoID' => 6, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 8, 'produtoID' => 7, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 9, 'produtoID' => 8, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 5, 'produtoID' => 9, 'listaID' => $listaID];\n $compras[] = ['quantidade' => 7, 'produtoID' => 10, 'listaID' => $listaID];\n\n foreach($compras as $compra) {\n Compra::create(\n [\n 'quantidade' => $compra['quantidade'],\n 'produto_id' => $compra['produtoID'],\n 'lista_compra_id' => $compra['listaID']\n ]\n )->save();\n }\n }",
"public function addNuevoAlimento()\n {\n $this->modeloAlimentos->insertNuevoAlimento($_POST);\n\n redireccionar('/Alimentos');\n }",
"public function addToStart(Domino $domino): void\n {\n array_unshift($this->elements, $domino);\n }",
"function addElement(PageElement $element) {\n\t\t$this->elements[] = $element;\n\t}",
"function evt__agregar()\n\t{\n if($this->s__pantalla=='pant_seleccion'){\n $this->set_pantalla('pant_edicion');\n }\n //si estoy en la pantalla cargo_seleccion y presiono agregar entonces\n if($this->s__pantalla=='pant_cargo_seleccion'){\n $this->dep('datos')->tabla('designacion')->resetear();\n $this->set_pantalla('pant_cargo');\n } \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get distance between start vertex and given end vertex | public function getDistance(Vertex $endVertex)
{
return (float)\count($this->getEdgesTo($endVertex));
} | [
"public function getDistanceFromStart() : float;",
"abstract public function getVertexFromTo(Vertex $endVertex);",
"public function distance(Position $start, Position $end, $precision = 2);",
"function calculateLengthByCoordinates($startCoordinate, $endCoordinate)\n {\n return $endCoordinate - $startCoordinate;\n }",
"abstract public function getVertexToFrom(Vertex $startVertex);",
"public function distance($vertex = null){\n if(func_num_args() == 1){\n return $this->vertices->get($vertex)->potential();\n }else{\n return $this->vertices->last()->potential();\n }\n }",
"public function distanceTo(Vec4 $right) : float {}",
"public function getLength(){\n\t\treturn sqrt(pow($this->start->x - $this->end->x, 2) +\n\t\t\tpow($this->start->y - $this->end->y, 2) +\n\t\t\tpow($this->start->z - $this->end->z, 2));\n\t}",
"function dist ($x1, $y1, $x2, $y2){ \n return sqrt(($x1-$x2)*($x1-$x2) + ($y1-$y2)*($y1-$y2));}",
"public function getDistance($start_latitude,$start_longitude,$end_latitude,$end_longitude)\n {\n $api_key = env('API_KEY');\n\n $origins = $start_latitude.\",\".$start_longitude;\n\n $destinations = $end_latitude.\",\".$end_longitude;\n\n $url = \"https://maps.googleapis.com/maps/api/distancematrix/json?origins=\" . $origins . \"&destinations=\" . $destinations . \"&language=en-EN&key=\".$api_key;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n $response_a = json_decode($response, true);\n\n\n if (isset($response_a['rows'][0]['elements'][0]['distance']['text'])) {\n $distance = $response_a['rows'][0]['elements'][0]['distance']['text'];\n }else{\n $distance = 0;\n }\n\n Log::info(\"Distance retrieved : \".$distance);\n\n\n return $distance;\n }",
"static function distance(&$from, &$to)\r\n {\r\n $x = $to[0] - $from[0];\r\n $y = $to[1] - $from[1];\r\n return sqrt($x*$x + $y*$y);\r\n }",
"function distance2point(&$vertex){\r\n\t\t$distance = infinity; // start very far away\r\n\t\t// loop all vertices of polygon\r\n\t\t$va =& $this->first; \t// first vertex of first segment to check\r\n\t\t$vb =& $va->Next();\t\t// second vertex of segment\r\n\t\tdo{\r\n\t\t\t// get the distance of given vertex to current line segment\r\n\t\t\t$dist = $this->dist_line2point($va->X(),$va->Y(),$vb->X(),$vb->Y(),$vertex->X(),$vertex->Y());\r\n\t\t\t// save it if it is shortest distance so far\r\n\t\t\t$distance = ($dist<$distance)?$dist:$distance;\r\n\t\t\t// set next line segments' vertices\r\n\t\t\t$va =& $va->Next();\r\n\t\t\t$vb =& $va->Next();\r\n\t\t}while ($vb->id() != $this->first->id());\r\n\t\t// return distance if it was resolved, otherwise return null\r\n\t\treturn ($distance<infinity)?$distance:NULL;\t // if in geomode, distance is in meters\r\n\t}",
"public function distance(): float;",
"public function getDistance()\n {\n return round(\n sqrt(\n pow($this->transit->from_lat - $this->transit->to_lat, 2)\n + pow($this->transit->from_lng - $this->transit->to_lng, 2)\n ),\n 2\n );\n }",
"public function dijkstra($start,$end){\n\n\n //The current shortest path with its parent(s) and weight\n $shortestPath = array();\n\n //All other paths\n $failPaths = array();\n\n //Sets the weight to \"infinity\" since currently the shortest path is 0\n //This allows the first path that is calculated be the shortest\n //Else it would stay at 0 and no path would be shorter\n foreach(array_keys($this->mapArray) as $value) $failPaths[$value] = 999;\n $failPaths[$start] = 0;\n\n\n //start calculations\n while(!empty($failPaths))\n {\n //the current minimum weight\n $minimum = array_search(min($failPaths), $failPaths);\n\n //If the minimum is at the ending intersection break\n if($minimum == $end) break;\n\n //\n foreach($this->mapArray[$minimum] as $key=>$value) if(!empty($failPaths[$key]) && $failPaths[$minimum] + $value < $failPaths[$key])\n {\n $failPaths[$key] = $failPaths[$minimum] + $value;\n $shortestPath[$key] = array($minimum, $failPaths[$key]);\n }\n unset($failPaths[$minimum]);\n }\n\n\n\n //list the shortest path\n $directions = array();\n //Current position in array\n $position = $end;\n\n\n //Retrack from the ending intersection\n //Currently not exiting this while loop\n while($position != $start)\n {\n $directions[] = $position;\n $position = $shortestPath[$position][0];\n }\n\n\n //Reverse array so it's in order from start to ending intersection\n $directions[] = $start;\n $directions = array_reverse($directions);\n\n //set class variable directions to final in order direction array\n $this->directionsArray = $directions;\n $this->lengthOfShortestPath = ($shortestPath[$end][1]);\n\n }",
"public function getVertexDegree(VertexInterface $vertex): int;",
"function GetDistPointLine($x,$y,$a,$b,$c)\n{\n\treturn abs(($a * $x) + ($b * $y) + $c) / sqrt(($a * $a) + ($b * $b));\n}",
"public function getEdgesBetween($start, $end)\n {\n list($dist, $prev) = $this->dijkstra($this->graph->getNodes()[$start]);\n \n $edges = array();\n $nextId = $prev[$end];\n \n $edges[] = $this->graph->findEdgeInOutList($end, $prev[$end]);\n \n while ($nextId != $start) {\n $edges[] = $this->graph->findEdgeInOutList($nextId, $prev[$nextId]);\n $nextId = $prev[$nextId];\n }\n \n return $edges;\n }",
"function distance(EBox $b2): float {\n if (!$this->min || !$b2->min)\n throw new \\Exception(\"Erreur de EBox::distance() avec une des EBox indéterminée\");\n return max(\n abs($b2->min[0] - $this->min[0]),\n abs($b2->min[1] - $this->min[1]),\n abs($b2->max[0] - $this->max[0]),\n abs($b2->max[1] - $this->max[1])\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the credit memo store currency code. | public function getStoreCurrencyCode(); | [
"public function getStoreCurrencyCode()\n {\n return $this->_storeManager->getStore()->getCurrentCurrency()->getCode();\n }",
"public function getCurrentCode()\n {\n return $this->getCoreHelper()->getCurrentStore()->getCurrentCurrencyCode();\n }",
"public function getStoreCurrencyCode()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $storeManager = $objectManager->get('\\Magento\\Store\\Model\\StoreManagerInterface');\n $store = $storeManager->getStore();\n return $store->getBaseCurrencyCode();\n }",
"public function getCurrentCurrencyCode()\n {\n return $this->_storeManager->getStore()->getCurrentCurrencyCode();\n }",
"public function getCurrencyCode()\n {\n return isset($this->CurrencyCode) ? $this->CurrencyCode : null;\n }",
"public function getCurrencyCode() \n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }",
"public function getCurrencyCode()\n {\n return strtoupper(Mage::app()->getStore()->getCurrentCurrencyCode());\n }",
"public function getCode()\n {\n return $this->currencyCode;\n }",
"public static function getCurrentCurrencyCode()\n {\n return Shopware()->Shop()->getCurrency()->getCurrency();\n }",
"public function getCurrencyCode(){\n\t\treturn $this->_data->itemAt('geoplugin_currencyCode');\n\t}",
"public function getCurrencyCode() : string\n {\n return $this->currencyCode;\n }",
"public function getCurrentCurrencyCode()\n {\n return $this->_priceCurrency->getCurrency()->getCurrencyCode();\n }",
"static function fetchLocaleCurrencyCode()\n {\n $locale = eZLocale::instance();\n $currencyCode = $locale->currencyShortName();\n return $currencyCode;\n }",
"public function fetchCurrencySymbol()\n {\n $storeCurrency = $this->storeSetting\n ->where('name', 'currency_symbol')\n ->select('value')\n ->first();\n\n if (empty($storeCurrency)) {\n return '';\n }\n\n return $storeCurrency->value;\n }",
"protected function GetCurrency()\n\t\t{\n\t\t\t$order = current($this->orderData['orders']);\n\t\t\treturn $order['ordcurrencyid'];\n\t\t}",
"public function getCurrencyCode();",
"public function getBaseCurrencyCode()\n {\n return $this->_storeManager->getStore()->getBaseCurrencyCode();\n }",
"public function getBaseCurrencyCode()\n {\n if ($this->baseCurrencyCode === null) {\n $this->baseCurrencyCode = strtoupper(\n $this->getStore()->getBaseCurrencyCode()\n );\n }\n\n return $this->baseCurrencyCode;\n }",
"public function getCurrencyCode()\n\t{\n\t\t$column = self::COL_CURRENCY_CODE;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setQttbconfheadgetdef() Set the value of [qttbconfshowmarg] column. | public function setQttbconfshowmarg($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->qttbconfshowmarg !== $v) {
$this->qttbconfshowmarg = $v;
$this->modifiedColumns[ConfigQtTableMap::COL_QTTBCONFSHOWMARG] = true;
}
return $this;
} | [
"public function setIntbconfheadgetdef($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->intbconfheadgetdef !== $v) {\n $this->intbconfheadgetdef = $v;\n $this->modifiedColumns[ConfigInTableMap::COL_INTBCONFHEADGETDEF] = true;\n }\n\n return $this;\n }",
"public function getIntbconfheadgetdef()\n {\n return $this->intbconfheadgetdef;\n }",
"public function setQttbconfdefack($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->qttbconfdefack !== $v) {\n $this->qttbconfdefack = $v;\n $this->modifiedColumns[ConfigQtTableMap::COL_QTTBCONFDEFACK] = true;\n }\n\n return $this;\n }",
"public function getQttbconfdefpick()\n {\n return $this->qttbconfdefpick;\n }",
"public function setQttbconfmarkupmargin($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->qttbconfmarkupmargin !== $v) {\n $this->qttbconfmarkupmargin = $v;\n $this->modifiedColumns[ConfigQtTableMap::COL_QTTBCONFMARKUPMARGIN] = true;\n }\n\n return $this;\n }",
"public function getAptbconfdeftermcode()\n {\n return $this->aptbconfdeftermcode;\n }",
"public function setIntbconfordrqtydef($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbconfordrqtydef !== $v) {\n $this->intbconfordrqtydef = $v;\n $this->modifiedColumns[ConfigInTableMap::COL_INTBCONFORDRQTYDEF] = true;\n }\n\n return $this;\n }",
"public function setIntbconfitemgetdef($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->intbconfitemgetdef !== $v) {\n $this->intbconfitemgetdef = $v;\n $this->modifiedColumns[ConfigInTableMap::COL_INTBCONFITEMGETDEF] = true;\n }\n\n return $this;\n }",
"public function setQttbconfdefpack($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->qttbconfdefpack !== $v) {\n $this->qttbconfdefpack = $v;\n $this->modifiedColumns[ConfigQtTableMap::COL_QTTBCONFDEFPACK] = true;\n }\n\n return $this;\n }",
"public function getIntbconfordrqtydef()\n {\n return $this->intbconfordrqtydef;\n }",
"public function setIntbconfusewhsedef($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbconfusewhsedef !== $v) {\n $this->intbconfusewhsedef = $v;\n $this->modifiedColumns[ConfigInTableMap::COL_INTBCONFUSEWHSEDEF] = true;\n }\n\n return $this;\n }",
"public function setOetbconfqtytoshipdef($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oetbconfqtytoshipdef !== $v) {\n $this->oetbconfqtytoshipdef = $v;\n $this->modifiedColumns[ConfigSalesOrderTableMap::COL_OETBCONFQTYTOSHIPDEF] = true;\n }\n\n return $this;\n }",
"public function setQttbconfdefinvc($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->qttbconfdefinvc !== $v) {\n $this->qttbconfdefinvc = $v;\n $this->modifiedColumns[ConfigQtTableMap::COL_QTTBCONFDEFINVC] = true;\n }\n\n return $this;\n }",
"public function getIntbconfuompurdef()\n {\n return $this->intbconfuompurdef;\n }",
"public function getOetbconfqtytoshipdef()\n {\n return $this->oetbconfqtytoshipdef;\n }",
"public function setCctbconfminmarghold($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cctbconfminmarghold !== $v) {\n $this->cctbconfminmarghold = $v;\n $this->modifiedColumns[ConfigCcTableMap::COL_CCTBCONFMINMARGHOLD] = true;\n }\n\n return $this;\n }",
"public function getAptbconfvendcols()\n {\n return $this->aptbconfvendcols;\n }",
"public function setIntbconfdefack($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbconfdefack !== $v) {\n $this->intbconfdefack = $v;\n $this->modifiedColumns[ConfigInTableMap::COL_INTBCONFDEFACK] = true;\n }\n\n return $this;\n }",
"function set_def_conf($sect,$name,$def,$const=null,$handl = null) {\n\t\tif (!isset($this->ini_cfg[$sect][$name])){\n\t\t\tswitch($handl){\n\t\t\tcase 'error':\n\t\t\t\terror_log(\"Fatal: Config entry $sect/$name not found in config!\");\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t\tcase 'no-set':\n\t\t\t\tbreak;\n\t\t\tcase null:\n\t\t\tdefault:\n\t\t\t\tif (defined('DEBUG_CONF') && constant('DEBUG_CONF'))\n\t\t\t\t\terror_log(\"Warning: conf entry $sect/$name not in config, using default.\");\n\t\t\t\t$this->ini_cfg[$sect][$name] = $def;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// second pass\n\t\tif (isset($this->ini_cfg[$sect][$name])) {\n\t\t\tif($const !=null){\n\t\t\tdefine($const,$this->ini_cfg[$sect][$name]);\n\t\t\t//echo \"define('$const',\\$this->config[$sect][$name]);<br>\\n\";\n\t\t\t}\n\t\t\treturn $this->ini_cfg[$sect][$name];\n\t\t}\n\t\telse {\n\t\t\tif($const !=null){\n\t\t\tdefine($const,null);\n\t\t\t//echo \"define('$const',null);<br>\\n\";\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the settings for graph submission plugin | public function save_settings(stdClass $data) {
// save_settings is called when the assignment settings page is submitted
// either for a new assignment or when editing an existing one
// for settings specific to a single instance of the assignment,
// use the assign_plugin::set_config function to save key/value pairs
// as shown below against the assignment instance for this plugin.
//$this->set_config('maxfilesubmissions', $data->assignsubmission_graph_maxfiles);
//$this->set_config('maxsubmissionsizebytes', $data->assignsubmission_graph_maxsizebytes);
return true;
} | [
"public function save()\n {\n $this->settings->savePostSettings();\n }",
"public function saveSettings()\n {\n file_put_contents($this->profile, json_encode($this->settings));\n }",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"function save_serialized_settings() {\n\t\t\t//Return -> Single Site | If network settings page | Networkwide Settings Disabled\n\t\t\tif ( ! is_multisite() || is_network_admin() || ! $this->settings['networkwide'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$c_settings = $this->get_serialised_settings();\n\t\t\t$this->update_setting( WP_SMUSH_PREFIX . 'last_settings', $c_settings );\n\t\t}",
"public function saveSettings()\n {\n $this->getStore()->save($this->data);\n }",
"public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}",
"public function save() {\n\n\t\tTQB_Post_meta::update_quiz_progress_settings_meta( $this->_quiz_id, $this->_quiz_style_settings );\n\t\tTQB_Post_meta::update_quiz_progress_general_settings( $this->_quiz_id, $this->_general_settings );\n\t}",
"public static function save_settings() {\r\n\r\n\t\t\t// Only admins can save settings.\r\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tself::save_integration_option();\r\n\t\t\tself::save_branding_option();\r\n\r\n\t\t\t// Let extensions hook into saving.\r\n\t\t\tdo_action( 'uael_admin_settings_save' );\r\n\t\t}",
"public function save_settings()\n {\n //check if visitor has administrator privilleges\n if($this->pluginaizer->session->is_admin()){\n $this->vars['plugin_config'] = $this->pluginaizer->plugin_config();\n if(isset($_POST['server']) && $_POST['server'] != 'all'){\n foreach($_POST AS $key => $val){\n if($key != 'server'){\n $this->vars['plugin_config'][$_POST['server']][$key] = $val;\n }\n }\n } else{\n foreach($_POST AS $key => $val){\n if($key != 'server'){\n $this->vars['plugin_config'][$key] = $val;\n }\n }\n }\n if($this->pluginaizer->save_config($this->vars['plugin_config'])){\n echo $this->pluginaizer->jsone(['success' => 'Plugin configuration successfully saved']);\n } else{\n echo $this->pluginaizer->jsone(['error' => $this->pluginaizer->error]);\n }\n }\n }",
"public function save_settings() {\n\t\tif ( ! is_admin() || ! isset( $_POST['permalink_structure'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$permalinks = (array) get_option( 'mylisting_permalinks', [] );\n\t\t$permalinks['job_base'] = sanitize_text_field( $_POST['wpjm_job_base_slug'] );\n\t\t$permalinks['category_base'] = sanitize_text_field( $_POST['wpjm_job_category_slug'] );\n\t\t$permalinks['region_base'] = sanitize_text_field( $_POST['ml_region_slug'] );\n\t\t$permalinks['tag_base'] = sanitize_text_field( $_POST['ml_tag_slug'] );\n\n\t\tupdate_option( 'mylisting_permalinks', $permalinks );\n\t}",
"function save() {\n\t\t\t//Log::debug( \"SUH saving settings: \" . print_r( self::$cache, true ) );\n\t\t\tupdate_site_option( self::SETTINGS_KEY, self::$cache );\n\t\t}",
"public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }",
"function saveSettings() {\n\n $noticesync = $this->boolean('noticesync');\n\n $original = clone($this->flink);\n\n $this->flink->set_flags($noticesync, false, false, false);\n\n $result = $this->flink->update($original);\n\n // DB_DataObject returns false if it can't find anything\n if ($result === false) {\n // TRANS: Notice in case saving of preferences fail.\n $this->showForm(_m('There was a problem saving your preferences.'));\n } else {\n // TRANS: Confirmation that settings have been saved into the system.\n $this->showForm(_m('Preferences saved.'), true);\n }\n }",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"public function save_settings()\n {\n $this->setup_ft();\n\n return $this->call_ft(__FUNCTION__, $this->settings());\n }",
"public function save($settings){\n\t\tfile_put_contents($this->file, json_encode($settings));\n\t}",
"function save_settings()\n\t{\n\t\tglobal $DB, $REGX;\n\t\t\n\t\t// Initialise the settings array.\n\t\t$this->settings = array(\n\t\t\t'update_check'\t=> isset($_POST['update_check']) ? $_POST['update_check'] : ''\n\t\t\t);\n\t\t\n\t\t// Serialise the settings, and save them to the database.\n\t\t$sql = \"UPDATE exp_extensions SET settings = '\" . addslashes(serialize($this->settings)) . \"' WHERE class = '\" . get_class($this) . \"'\";\n\t\t$DB->query($sql);\n\t}",
"function saveSettings() {\n\t\t$this->validate();\n\t\t$this->setupTemplate(true);\n\n\t\timport('classes.notification.form.NotificationSettingsForm');\n\n\t\t$notificationSettingsForm = new NotificationSettingsForm();\n\t\t$notificationSettingsForm->readInputData();\n\n\t\tif ($notificationSettingsForm->validate()) {\n\t\t\t$notificationSettingsForm->execute();\n\t\t\tPKPRequest::redirect(NotificationHandler::getContextDepthArray(), 'notification', 'settings');\n\t\t} else {\n\t\t\t$notificationSettingsForm->display();\n\t\t}\n\t}",
"function settings_page_save() {\n\t\t// Check for permission\n\t\tif ( !current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t\t}\n\n\t\tif ( ! isset( $_POST['cp_seo_internal_link_settings'] ) ) {\n\t return;\n\t }\n\n\t $plugin_enabled = isset($_POST['plugin_enabled']) ? $_POST['plugin_enabled'] : 0;\n\t $show_in_excerpt = isset($_POST['show_in_excerpt']) ? $_POST['show_in_excerpt'] : 0;\n\n\t // Create option array to save\n\t $options = [\n\t \t'plugin_enabled' => $plugin_enabled,\n\t \t'show_in_excerpt' => $show_in_excerpt\n\t ];\n\n\t // Update options\n\t update_option( 'cp_seo_internal_link_settings', $options );\n\n\t // Update Settings\n\t $this->set_settings( $this->settings, $options );\n\n\t return [\n\t \t'status' => 'success',\n\t \t'message' => __( 'Settings saved' )\n\t ];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DESCRIPTION : It retrieves the Socioeconomic details of a Profile whose ID is specified METHOD : GET | function getProfileSocioeconomicDetails($aged_id = null){
global $pdo;
// Check if the method is GET
if (REQUEST_METHOD == 'GET'){
// Check if the parameter of the URI is set. If the parameter is not set, it generates a 400 error.
if(isset($aged_id)) {
$query = "SELECT * FROM c4a_i_schema.profile_socioeconomic_details WHERE aged_id = $aged_id ";
$query_results = $pdo->query($query);
// Check if the query has been correctly performed.
// If the variable is true it returns the data in JSON format
if (!$query_results) {
generate500("Error performing the query");
} else {
//if the query has retrieved at least a result
if($query_results->rowCount() > 0) {
//it fetches each single row and encode in JSON format the results
while ($row = $query_results->fetch(PDO::FETCH_ASSOC)) {
$sjes = new Jecho($row);
$sjes->message = "Profile retrieved";
echo $sjes->encode("Profile");
} // end if to set results into JSON
} else {
generate404("There is no profile with the specified id. aged_id = ".$aged_id);
}
} // end if/else for the check of results
} else {
generate400("The aged_id is not specified");
} //end if/else for verify if aged_id is set
} else {
generate400("The method is not a GET");
} //end if/else to verify that the method is a GET
} | [
"function get_service_profile($profileId) {\r\n $ret = $this->restGet(\"/api/profile/\" . $profileId);\r\n return $ret;\r\n }",
"public function physicianProfile_get(){\n\t\t$getProfile = $this->PM->getPK('physicianprofile',$this->get('id'));\n\t\t\n\t\t$this->response(array(\n\t\t\t'status' => 'TRUE',\n\t\t\t'profile' => json_encode($getProfile),\n\t\t));\n\t}",
"private function getProfile()\n {\n if ($this->http->headers->has('JWT_TOKEN')) {\n $this->options['headers'] = [\n 'Content-type' => 'application/json',\n 'Authorization' => $this->http->headers->get('JWT_TOKEN')\n ];\n\n $get_profile = $this->client->request('GET', '/employee/my-profile', $this->options);\n if ($get_profile->getStatusCode() === 200) {\n $get_profile = \\GuzzleHttp\\json_decode($get_profile->getBody());\n $this->output($get_profile);\n }\n }\n $this->output([\n 'status' => false\n ]);\n }",
"public function getProfile();",
"public function getProfile()\n {\n }",
"public function ApiGetIndividual() {\r\n /* The API call will return an object with the following properties:\r\n * scoutid will match existing\r\n * firstname should match existing\r\n * lastname should match existing\r\n * photo_guid used somehow to construct the URL of a photo for this scout. Not used at present.\r\n * email1, 2, 3 & 4 appear to be always the empty string.\r\n * phone1, 2, 3 & 4 appear to be always the empty string.\r\n * address & address2 appear to be always the empty string\r\n * dob date of birth in form 'YYYY-MM-YY'. Not used at present.\r\n * started date joined scouting movement, in form 'YYYY-MM-DD'. Not used at present.\r\n * joining_in_yrs seems to be zero even for people who have been a member for several years (and\r\n * have the joining in badges showing in OSM).\r\n * parents, notes, medical, religion, school, ethnicity, subs, custom1, custom2, custom3, custom4,\r\n * custom5, custom6, custom7, custom8, custom9 all appear to be always the empty string.\r\n * created_date date and time this record was created, in the form 'YYYY-MM-DD HH:MI:SS'.\r\n * last_accessed date and time this record was last access, in the form 'YYYY-MM-DD HH:MI:SS'. It\r\n * is not quite clear what constitutes 'access'. Not used at present.\r\n * patrolid the id of the patrol in which this scout is a member. Patrols\r\n * are specific to a section, except ids '-2' and '-3' which are\r\n * is the leaders and young leaders patrols in all sections.\r\n * patrolleader small integer indicating role in patrol: 0=>member, 1=>second; 2=>sixer. Not used\r\n * at present.\r\n * startedsection date joined this section, in form 'YYYY-MM-DD'.\r\n * enddate date left this section, in form 'YYYY-MM-DD', or null if this isn't yet known.\r\n * age narrative string such as '10 years and 5 months'. This is the age at the time of the\r\n * query, not at the time of any event or term.\r\n * age_simple as age, but in shorter form such as '10 / 05'.\r\n * sectionid the id of the section to which this record relates. Should be the same as the id of\r\n * the related section object.\r\n * active meaning not quite certain. A value of true may indicate the scout is still (at the\r\n * time of enquiry) a member is this section, or perhaps in any section.\r\n * meetings a number which may be a count of total meetings attended. This property is absent if\r\n * the enquiry did not include a term.\r\n */\r\n if (!$this->apiGotIndividual) {\r\n $this->apiGotIndividual = true;\r\n $apiData = $this->osm->PostAPI( \"ext/members/contact/?action=getIndividual&context=members\" .\r\n \"§ionid={$this->section->id}&scoutid={$this->id}&termid=0\" );\r\n if ($apiData->ok) {\r\n $apiData = $apiData->data;\r\n assert( $this->id == $apiData->scoutid );\r\n $this->dob = date_create( $apiData->dob );\r\n $this->firstName = $apiData->firstname;\r\n $this->lastName = $apiData->lastname;\r\n $this->patrol = $this->section->Patrol( $apiData->patrolid );\r\n $this->patrolLevel = intval( $apiData->patrolleader );\r\n $this->dateJoinedMovement = date_create( $apiData->started );\r\n $this->dateStartedSection = date_create( $apiData->startedsection );\r\n $this->dateLeftSection = $apiData->enddate === null ? null :\r\n date_create( $apiData->enddate );\r\n } }\r\n }",
"function get_SecurityProfileList(){\ninclude 'soapconnection.php';\n$d = array($client->Profile_GetList($appIDrequest));\n$b = $d[0]->Profile_GetListResult->inProfile;\n\nreturn $b;\n}",
"public function testGetProfile()\n\t{\n\t\tprint 'Run test for #getProfile...';\n\t\t$api = new DefaultApi();\n\t\t$response = $this->provideApiKey($api, function ($api, $apiKey) {\n\t\t\treturn $api->getProfile(\n\t\t\t\t(new GetProfileRequest())\n\t\t\t\t\t->setApiKey($apiKey)\n\t\t\t);\n\t\t});\n\t\tprint($response);\n\t\t$this->assertEquals('ok', $response->getStatus());\n\t\t$this->assertNotEmpty($response->getCode());\n\t\t$this->assertNotNull($response->getProfile());\n\t\t$this->assertNotNull($response->getApp());\n\t\t$this->assertNotNull($response->getShareUrl());\n\t\t$this->assertNotNull($response->getRateUrl());\n\t\t$this->assertEquals(0, $response->getCredits());\n\t\t$this->assertEquals(0, $response->getCreditsTrans());\n\t\tprint('');\n\t}",
"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 }",
"function findProfile($id) {\n AppLogger::info(\"Entering profileService.findProfile\");\n $servername = Database::$dbservername;\n $username = Database::$dbusername;\n $password = Database::$dbpassword;\n $dbname = Database::$dbname;\n \n //Get connection to the database\n $db = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n // Create a new instance of the userDataService to call the findProfilebyId method\n AppLogger::info(\"Leaving profileService to call findProfileById() at userDataService\");\n $uds = new userDataService($db);\n return $uds->findProfileById($id);\n \n \n //Close connection to the database\n AppLogger::info(\"Exiting profileService with the users profile\");\n $db = null;\n }",
"public function get_profile($which=''){\r\n\t\tif(!$this->check_api_key())\r\n\t\t\treturn \"Please add your access key use this function: set_access_key('Set Your Access Key')\";\r\n\r\n\t\tif(empty($which))\r\n\t\t\treturn \"please set id or symbol<br>example:<br>\r\n\t\t\t1) $forex->get_profile('1,2,3');<br>\r\n\t\t\t2) $forex->get_profile('CHF/USD,USD/JPY');<br>\r\n\t\t\t3) $forex->get_profile('CHF,USD,JPY,GBP,NZD');<br>\r\n\t\t\t<a href='https://fcsapi.com/document/forex-api#profile' target='_blank'>Goto more info</a>\";\r\n\r\n\t\t$symbol_id = $this->check_symbol_id($which);\r\n\t\t$link = \"https://fcsapi.com/api/forex/profile?$symbol_id=$which&access_key=\".$this->api_key.\"&output=\".$this->output;\r\n\r\n\t\treturn file_get_contents($link);\r\n\t}",
"public function getProfileDetails()\n {\n // check if the respective cookies exist or not\n if (check_jwt_cookie($this->auth[\"service_name\"], $this->auth[\"cookie_name\"])) {\n // check if the user_id is provided\n if (empty($_POST['user_id'])) {\n json_output(BAD_DATA, array(\n \"code\" => BAD_DATA,\n \"message\" => \"user_id missing from input params\"\n ));\n return;\n }\n $user_id = $_POST['user_id'];\n $user_details = $this->UserModel->getUserDetails($user_id);\n if (isset($user_details)) {\n json_output(SUCCESS, array(\n \"code\" => SUCCESS,\n \"message\" => \"User profile details fetched\",\n \"data\" => [\n \"user_id\" => $user_details->id,\n \"email\" => $user_details->email,\n \"first_name\" => $user_details->firstname,\n \"last_name\" => $user_details->lastname,\n \"phone_number\" => $user_details->phonenumber,\n \"gender\" => $user_details->gender,\n ]));\n return;\n }\n } else {\n json_output(UNAUTHORIZED, array(\n \"code\" => UNAUTHORIZED,\n \"message\" => \"Invalid cookies\"\n ));\n }\n return;\n }",
"public function getProfile() {\n return $this->request(\n \"GET\",\n \"/users/{$this->user_id}/profile\",\n \"Profile\"\n )\n ->first();\n }",
"public static function GetProfile($user_id){\n // then it's visible or it must be user's own profile if it's private.\n }",
"public function getUserProfile()\n {\n $this->resetParams();\n return $this->sendRequest(\"users/profile\",\"GET\");\n }",
"public function student_profile($id)\n\t{\n\t\t$this->template->set('title', 'Student Profile');\n\t\t$data['info'] = $this->mdl_student->get_student_profile($id);\n\t\t//$data['fee_dues'] = $this->mdl_student->get_due_fee_amount($id);\n\t\t$data['academicFeeList'] = $this->mdl_accountant->accoutant_due_fee_academic($id);\n\t\t// var_dump($data['academicFeeList']);\n\t\t// die();\n\t\t$data['library_info'] = $this->mdl_accountant->student_book_info($id);\n\t\t// var_dump($data['library_info']);\n\t\t// die();\n\t\t$data['hostel_dues'] = $this->mdl_accountant->student_hostel_due_info($id);\n\t\t// var_dump($data['hostel_dues']);\n\t\t// die();\n\t\t//$data['hostel_room'] = $this->mdl_student->get_due_hostel_room($id);\n\t\t$data['hostel_mess'] = $this->mdl_accountant->student_hostel_messinfo($id);\n\t\t$data['fee_types'] = $this->mdl_accountant->aplicable_fee($id);\n\t\t//$data['academicFee'] = $this->mdl_accountant->academic_fee($id);\n\t\t$this->template->load('template', 'contents', 'accountants/student_profile',$data);\n\t}",
"public static function getProfileById($id) {\n\t\t$bro = Roster::getBrother($id);\n\t\t$pub_prof_url = $bro->linkedin;\n\t\tif($pub_prof_url == null) {\n\t\t\treturn null;\n\t\t}\n\t\t$pub_prof_url = urlencode($pub_prof_url);\n\t\t$url = \"http://api.linkedin.com/v1/people/url=$pub_prof_url\";\n\t\t$url .= \":(first-name,last-name,headline,location:(name),industry,picture-urls::(original))\";\n\n\t\t$oauth = new OAuth(static::$api_key, static::$secret_key);\n\t\t$oauth->setToken(static::$oauth_token, static::$oauth_key);\n\n\t\t$params = array();\n\t\t$headers = array();\n\t\t$method = OAUTH_HTTP_METHOD_GET;\n\t\t \n\t\t// By default, the LinkedIn API responses are in XML format. \n\t\t// If you prefer JSON, simply specify the format in your call\n\t\t// $url = \"http://api.linkedin.com/v1/people/~?format=json\";\n\n\t\t// Make call to LinkedIn to retrieve your own profile\n\t\t$oauth->fetch($url, $params, $method, $headers);\n\t\t \n\t\t$xmlString = $oauth->getLastResponse();\n\t\t$simpleXML = simplexml_load_string($xmlString);\n\t\t$results = array($simpleXML);\n\t\t$results = $results[0];\n\t\tLinkedin::updateProfile($id, $results);\n\t\treturn $results;\n\t}",
"public function ProfileOverview() {\n return ApiClient::Request('account/profileoverview');\n }",
"function get_csgo_stats($profile){\r\n $apiKey = \"446D9274E9EAB369BE07A6C776A082D5\";\r\n return call_api(\"http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key={$apiKey}&steamid={$profile}\")->playerstats->stats;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parsing time interval from input source. | public function parseTimeDuration(InputSource $source)
{
throw new IllegalParserStateTransitionException();
} | [
"public function validate_interval($interval)\n {\n $interval = preg_replace('/\\s+/', ' ', $interval);\n $interval_parts = explode(\" \", $interval);\n\n if(empty($interval_parts[0]) || empty($interval_parts[1])) {\n throw new Exception('Parsing error: date formatting');\n }\n\n $start_time = strtotime($interval_parts[0]);\n $end_time = strtotime($interval_parts[1]);\n\n //validate method\n if($this->is_valid_start_time($start_time) == false) {\n throw new Exception('Invalid start time');\n }\n\n if($this->is_valid_end_time($end_time) == false) {\n throw new Exception('Invalid end time');\n }\n\n return [$start_time, $end_time];\n\n }",
"public function parseTime() {}",
"public function parse($source);",
"function local_tcapi_parse_duration($str)\n{\n $result = array();\n preg_match('/^(?:P)([^T]*)(?:T)?(.*)?$/', trim($str), $sections);\n if(!empty($sections[1]))\n {\n preg_match_all('/(\\d+)([YMWD])/', $sections[1], $parts, PREG_SET_ORDER);\n $units = array('Y' => 'years', 'M' => 'months', 'W' => 'weeks', 'D' => 'days');\n foreach($parts as $part)\n {\n \t$part[1] = '00'.$part[1]; \n \t$value = (strpos($part[1], '.')) ? substr($part[1], (strpos($part[1], '.')-2), strlen($part[1])) : substr($part[1], -2, 2);\n $result[$units[$part[2]]] = $value;\n }\n }\n if(!empty($sections[2]))\n {\n preg_match_all('/(\\d*\\.?\\d+|\\d+)([HMS])/', $sections[2], $parts, PREG_SET_ORDER);\n $units = array('H' => 'hours', 'M' => 'minutes', 'S' => 'seconds');\n foreach($parts as $part)\n {\n \t$part[1] = '00'.$part[1]; \n \t$value = (strpos($part[1], '.')) ? substr($part[1], (strpos($part[1], '.')-2), strlen($part[1])) : substr($part[1], -2, 2);\n \t $result[$units[$part[2]]] = $value;\n }\n }\n return $result;\n}",
"public static function parse($s) \r\n {\r\n if(is_null($s))\r\n {\r\n throw new ArgumentNullException(\"s is null.\");\r\n }\r\n\r\n $matches = array(\r\n 'D.H:m:s' => \"/^([0-9]*).(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])$/\",\r\n 'D.H:m:s.t' => \"/^([0-9]*).(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9]).([0-9]*)$/\",\r\n 'D' => \"/^\\d+$/\",\r\n 'H:m' => \"/^(2[0-3]|[0-1][0-9]):([0-5][0-9])$/\",\r\n 'H:m:s' => \"/^(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])$/\" \r\n );\r\n $result = array();\r\n if(preg_match($matches['D.H:m:s'], $s, $result))\r\n return new TimeSpan($result[1], $result[2], $result[3], $result[4]);\r\n if(preg_match($matches['D.H:m:s.t'], $s, $result))\r\n return new TimeSpan($result[1], $result[2], $result[3], $result[4], $result[5]);\r\n if(preg_match($matches['D'], $s, $result))\r\n return new TimeSpan ($result[0], 0, 0, 0, 0);\r\n if(preg_match($matches['H:m'], $s, $result))\r\n return new TimeSpan(0, $result[1], $result[2]);\r\n if(preg_match($matches['H:m:s'], $s, $result))\r\n return new TimeSpan(0, $result[1], $result[2], $result[3]);\r\n\r\n throw new FormatException(\"s has an invalid format.\");\r\n }",
"function t_parse($input){\n\tglobal $tx, $fl, $ln, $t_parse, $t_getformat;\n\t//pass input directly back to output\n\tif(is_null($input))return array($input,'null');\n\tif(!strlen($input))return array($input,'blank');\n\t\n\tif(preg_match('/^[0-9]{14}$/',$input)){\n\t\t//timestamp (MySQL)\n\t\t$yr=substr($input,0,2);\n\t\t$YR=substr($input,0,4);\n\t\t$readable=$YR.'-'.substr($input,4,2).'-'.substr($input,6,2).' '.substr($input,8,2).':'.substr($input,10,2).':'.substr($input,12,2);\n\t\tif(strtotime($readable)==-1 || strtotime($readable)===false){\n\t\t\t//we have to do further operations\n\t\t\tmail($developerEmail,'date read error',get_globals(),$fromHdrBugs);\n\t\t\treturn array(false,'error-timestamp');\n\t\t}else{\n\t\t\treturn array(strtotime($readable),'timestamp');\n\t\t}\n\t}else if(is_int($input)){\n\t\t//presume a unix timestamp\n\t\treturn array($input,'unix');\n\t}else if(preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*$/',$input)){\n\t\tif(!preg_match('/[1-9]/',$input)){\n\t\t\t//zero datetime - we are going to assume that THIS would never happen in good coding: 0000-00-00 14:30:00 (2:30 elapsed time)\n\t\t\treturn array('','blank-datetime');\n\t\t}else if(strtotime($input)==-1 || strtotime($input)===false){\n\t\t\t//we have to do further operations\n\t\t\treturn array(false,'error-datetime');\n\t\t}else{\n\t\t\treturn array(strtotime($input),'datetime');\n\t\t}\n\t}else if(preg_match('/^[0-9]{2}:[0-9]{2}:[0-9]{2}$/',$input)){\n\t\tif(strtotime($input)==-1 || strtotime($input)===false){\n\t\t\t//we have to do further operations\n\t\t\treturn array(false,'error-datetime');\n\t\t}else{\n\t\t\treturn array(strtotime($input),'datetime');\n\t\t}\n\t}else{\n\t\tif(strtotime($input)==-1 || strtotime($input)===false){\n\t\t\t//we have to do further operations\n\t\t\treturn array(false,'error-human');\n\t\t}else{\n\t\t\treturn array(strtotime($input),'human');\n\t\t}\n\t}\n}",
"public function testParseDuration()\n {\n // set up base date and time, and fixed durations from there\n $base = gmmktime(0, 0, 0, 1, 1, 2000);\n $second = gmmktime(0, 0, 1, 1, 1, 2000); // +1 sec\n $minute = gmmktime(0, 1, 0, 1, 1, 2000); // +1 min\n $hour = gmmktime(1, 0, 0, 1, 1, 2000); // +1 hour\n $day = gmmktime(0, 0, 0, 1, 2, 2000); // +1 day\n $week = gmmktime(0, 0, 0, 1, 8, 2000); // +1 week\n $month = gmmktime(0, 0, 0, 2, 1, 2000); // +1 month\n $year = gmmktime(0, 0, 0, 1, 1, 2001); // +1 year\n\n // corner cases\n $manymonths = gmmktime(0, 0, 0, 3, 1, 2001); // +14 months = +1 year +2 months\n $negmonths = gmmktime(0, 0, 0, 10, 1, 1999); // -3 months = -1 year +9 months\n\n // test valid duration with timestamp and zeroes\n $this->assertEquals($base + (60 * 60) + 60 + 1, Time::parseDuration('P0Y0M0DT1H1M1S', $base));\n\n // test seconds\n $this->assertEquals($second, Time::parseDuration('PT1S', $base), \"Failure checking for 1 second duration.\");\n\n // test minutes\n $this->assertEquals($minute, Time::parseDuration('PT1M', $base), \"Failure checking for 1 minute duration.\");\n\n // test hours\n $this->assertEquals($hour, Time::parseDuration('PT1H', $base), \"Failure checking for 1 hour duration.\");\n\n // test days\n $this->assertEquals($day, Time::parseDuration('P1D', $base), \"Failure checking for 1 day duration.\");\n\n // test weeks\n $this->assertEquals($week, Time::parseDuration('P1W', $base), \"Failure checking for 1 week duration.\");\n\n // test month\n $this->assertEquals($month, Time::parseDuration('P1M', $base), \"Failure checking for 1 month duration.\");\n\n // test year\n $this->assertEquals($year, Time::parseDuration('P1Y', $base), \"Failure checking for 1 year duration.\");\n\n // test months > 12\n $this->assertEquals(\n $manymonths,\n Time::parseDuration('P14M', $base),\n \"Failure checking for 14 months duration (1 year and 2 months).\"\n );\n\n // test negative months\n $this->assertEquals(\n $negmonths,\n Time::parseDuration('-P3M', $base),\n \"Failure checking for -3 months duration (-1 year + 9 months).\"\n );\n\n // test from current time\n $now = time();\n $this->assertGreaterThanOrEqual(\n $now + 60,\n Time::parseDuration('PT1M'),\n \"Failure testing for 1 minute over current time.\"\n );\n\n // test invalid input parameters\n try {\n // invalid duration\n Time::parseDuration(0);\n $this->fail(\"Did not fail with invalid duration parameter.\");\n } catch (\\InvalidArgumentException $e) {\n $this->assertEquals('Invalid input parameters', $e->getMessage());\n }\n try {\n // invalid timestamp\n Time::parseDuration('', array());\n $this->fail(\"Did not fail with invalid timestamp parameter.\");\n } catch (\\InvalidArgumentException $e) {\n $this->assertEquals('Invalid input parameters', $e->getMessage());\n }\n\n // test invalid durations\n try {\n // invalid string\n Time::parseDuration('abcdefg');\n $this->fail(\"Did not fail with invalid ISO 8601 duration.\");\n } catch (\\InvalidArgumentException $e) {\n $this->assertStringStartsWith('Invalid ISO 8601 duration: ', $e->getMessage());\n }\n try {\n // missing T delimiter\n Time::parseDuration('P1S');\n $this->fail(\"Did not fail with duration missing T delimiter.\");\n } catch (\\InvalidArgumentException $e) {\n $this->assertStringStartsWith('Invalid ISO 8601 duration: ', $e->getMessage());\n }\n }",
"public function parse(InputSource $source);",
"public function providerTestFormatInterval() {\n $data = [\n // Checks for basic seconds.\n [1, 1, '1 sec'],\n [1, 2, '1 sec'],\n [2, 1, '2 sec'],\n [2, 2, '2 sec'],\n // Checks for minutes with seconds.\n [61, 1, '1 min'],\n [61, 2, '1 min 1 sec'],\n [62, 2, '1 min 2 sec'],\n [121, 1, '2 min'],\n [121, 2, '2 min 1 sec'],\n // Check for hours with minutes and seconds.\n [3601, 1, '1 hour'],\n [3601, 2, '1 hour'],\n // Check for higher units.\n [86401, 1, '1 day'],\n [604800, 1, '1 week'],\n [2592000 * 2, 1, '2 months'],\n [31536000 * 2, 1, '2 years'],\n // Check for a complicated one with months weeks and days.\n [2592000 * 2 + 604800 * 3 + 86400 * 4, 3, '2 months 3 weeks 4 days'],\n // Check for the langcode.\n [61, 1, '1 min', 'xxx-lolspeak'],\n // Check with an unspecified granularity.\n [61, NULL, '1 min 1 sec'],\n ];\n\n return $data;\n }",
"public function testParseDuration()\n {\n $duration = 'PT1393462294S';\n $timestamp = 1393876825;\n\n $parsedDuration = Utils::parseDuration($duration, $timestamp);\n $this->assertEquals(2787339119, $parsedDuration);\n\n $parsedDuration2 = Utils::parseDuration($duration);\n\n $this->assertTrue($parsedDuration2 > $parsedDuration);\n\n $invalidDuration = 'PT1Y';\n try {\n $parsedDuration3 = Utils::parseDuration($invalidDuration);\n $this->fail('Exception was not raised');\n } catch (Exception $e) {\n $this->assertContains('Invalid ISO 8601 duration', $e->getMessage());\n }\n\n $newDuration = 'P1Y1M';\n $parsedDuration4 = Utils::parseDuration($newDuration, $timestamp);\n $this->assertEquals(1428091225, $parsedDuration4);\n\n $negDuration = '-P14M';\n $parsedDuration5 = Utils::parseDuration($negDuration, $timestamp);\n $this->assertEquals(1357243225, $parsedDuration5);\n }",
"function amr_parsePeriod($text,$tzobj) {\n $periodParts = explode('/', $text);\n if (!($start = amr_parseDateTime($periodParts[0], $tzobj))) return (false);\n if ($duration = amr_parseDuration($periodParts[1])) return array('start' => $start, 'duration' => $duration);\n\t\telse {\n\t\t\tif (!($end = amr_parseDateTime($periodParts[1], $tzobj))) return (false);\n\t\t\telse {\n\t\t\t\treturn array('start' => $start, 'end' => $end);\n\t\t\t}\n\t\t}\n }",
"private function parse_schedule(){\n\n }",
"public static function parseTimexTimeDurationType(string $input): string\r\n {\r\n if(strlen($input) < 2)\r\n throw new InvalidTimexTimeDurationException(\"The given Timex3 Time duration format must be greater than 2 characters\");\r\n\r\n if(strtoupper(substr($input, 0, 2)) !== \"PT\")\r\n throw new InvalidTimexTimeDurationException(\"The given input '$input' not a valid Timex Time duration\");\r\n\r\n if(strtoupper(substr($input, 0, 4)) == \"PT0.\") // Milliseconds ends in S, so this check is required.\r\n {\r\n return TimexTimeDuration::Milliseconds;\r\n }\r\n else\r\n {\r\n switch(strtoupper(substr($input, strlen($input) -1, 1)))\r\n {\r\n case TimexTimeDuration::Hour:\r\n return TimexTimeDuration::Hour;\r\n\r\n case TimexTimeDuration::Minute:\r\n return TimexTimeDuration::Minute;\r\n\r\n case TimexTimeDuration::Second:\r\n return TimexTimeDuration::Second;\r\n }\r\n }\r\n\r\n throw new TimexDurationParseException(\"The given input '$input' cannot be parsed as a Timex3 Time duration format\");\r\n }",
"function check_times($poll, $url)\r\n {\r\n // initialize counter\r\n $time = 0;\r\n \r\n // create time strings\r\n foreach($poll['keys']['OPTION'] as $key => $value)\r\n {\r\n // update counters\r\n $time++;\r\n \r\n // break once out of dates\r\n if($poll['text'][$value]['level'] != TIME_LEVEL)\r\n {\r\n // correct counter (valid event not found)\r\n $time--;\r\n break;\r\n }\r\n \r\n // set start and end values the same if single time\r\n if(isset($poll['text'][$value]['attributes']['DATETIME']))\r\n {\r\n $start_year = substr($poll['text'][$value]['attributes']['DATETIME'], 0, 4);\r\n $start_month = substr($poll['text'][$value]['attributes']['DATETIME'], 5, 2);\r\n $start_day = substr($poll['text'][$value]['attributes']['DATETIME'], 8, 2);\r\n $start_hours = substr($poll['text'][$value]['attributes']['DATETIME'], 11, -6);\r\n $start_minutes = substr($poll['text'][$value]['attributes']['DATETIME'], 14, -3);\r\n \r\n // reformat times to unix time\r\n $doodle['start'][$time] = $doodle['end'][$time] = mktime($start_hours, $start_minutes, 0, $start_month, $start_day, $start_year);\r\n }\r\n \r\n // set start AND end time if a range is set\r\n else if (isset($poll['text'][$value]['attributes']['STARTDATETIME']))\r\n { \r\n // set start and end values\r\n $start_year = substr($poll['text'][$value]['attributes']['STARTDATETIME'], 0, 4);\r\n $start_month = substr($poll['text'][$value]['attributes']['STARTDATETIME'], 5, 2);\r\n $start_day = substr($poll['text'][$value]['attributes']['STARTDATETIME'], 8, 2);\r\n $start_hours = substr($poll['text'][$value]['attributes']['STARTDATETIME'], 11, -6);\r\n $start_minutes = substr($poll['text'][$value]['attributes']['STARTDATETIME'], 14, -3);\r\n \r\n $end_year = substr($poll['text'][$value]['attributes']['ENDDATETIME'], 0, 4);\r\n $end_month = substr($poll['text'][$value]['attributes']['ENDDATETIME'], 5, 2);\r\n $end_day = substr($poll['text'][$value]['attributes']['ENDDATETIME'], 8, 2);\r\n $end_hours = substr($poll['text'][$value]['attributes']['ENDDATETIME'], 11, -6);\r\n $end_minutes = substr($poll['text'][$value]['attributes']['ENDDATETIME'], 14, -3); \r\n \r\n // reformat times to unix time\r\n $doodle['start'][$time] = mktime($start_hours, $start_minutes, 0, $start_month, $start_day, $start_year);\r\n $doodle['end'][$time] = mktime($end_hours, $end_minutes, 0, $end_month, $end_day, $end_year);\r\n }\r\n \r\n else\r\n apologize(\"Sorry, an error occurred. Please try again.\");\r\n }\r\n \r\n // require index.php to get calendar information\r\n require_once(\"index.php\");\r\n }",
"function parse_time($timestr){\n\tglobal $TIME_PATTERN;\n\t$timestr = trim($timestr);\n\tif(!preg_match(\"/^\\\\s*\".$TIME_PATTERN.\"\\\\s*$/\",$timestr)) return FALSE;\n\t$parsed = strtotime($timestr);\n\tif($parsed===FALSE) return FALSE;\n\t$cal = new Calendar($parsed);\n\treturn array( \"hour\"=>(int)$cal->get_hour(), \"minute\"=>(int)$cal->get_minute(), \n\t\t\t\"second\"=>(int)$cal->get_second() );\n}",
"public function testParseReturnsSelfIfIntervalIsValid()\n {\n $expected = (new Interval())\n ->setIsLowerInclusive(true)\n ->setLower(1)\n ->setUpper(2)\n ->setIsUpperInclusive(false);\n \n $actual = (new Interval())->parse('[1, 2)');\n \n $this->assertEquals($expected, $actual);\n \n return;\n }",
"function parse_duration($durstr){\n\tglobal $DURATION_PATTERN;\n\t$matches = array();\n\tif(!preg_match(\"/^\\\\s*\".$DURATION_PATTERN.\"\\\\s*$/\",trim($durstr),$matches)) return FALSE;\n\tif(sizeof($matches) == 1) return FALSE;\n\tif(sizeof($matches) <= 1+7){\n\t\t// words format\n\t\t$years = 0; if(sizeof($matches) > 1+0 && $matches[1+0] != \"\") $years = (int)$matches[1+0];\n\t\t$months = 0; if(sizeof($matches) > 1+1 && $matches[1+1] != \"\") $months = (int)$matches[1+1];\n\t\t$weeks = 0; if(sizeof($matches) > 1+2 && $matches[1+2] != \"\") $weeks = (int)$matches[1+2];\n\t\t$days = 0; if(sizeof($matches) > 1+3 && $matches[1+3] != \"\") $days = (int)$matches[1+3];\n\t\t$hours = 0; if(sizeof($matches) > 1+4 && $matches[1+4] != \"\") $hours = (int)$matches[1+4];\n\t\t$minutes = 0; if(sizeof($matches) > 1+5 && $matches[1+5] != \"\") $minutes = (int)$matches[1+5];\n\t\t$seconds = 0; if(sizeof($matches) > 1+6 && $matches[1+6] != \"\") $seconds = (int)$matches[1+6];\t\t\t\t\n\t\treturn approx_duration($years,$months,$weeks,$days,$hours,$minutes,$seconds);\t\t\t\t\n\t}elseif(sizeof($matches) <= 1+7+6){\n\t\t// iso datetime format\n\t\t$years = 0; if(sizeof($matches) > 1+7+0 && $matches[1+7+0] != \"\") $years = (int)$matches[1+7+0];\n\t\t$months = 0; if(sizeof($matches) > 1+7+1 && $matches[1+7+1] != \"\") $months = (int)$matches[1+7+1];\n\t\t$days = 0; if(sizeof($matches) > 1+7+2 && $matches[1+7+2] != \"\") $days = (int)$matches[1+7+2];\n\t\t$hours = 0; if(sizeof($matches) > 1+7+3 && $matches[1+7+3] != \"\") $hours = (int)$matches[1+7+3];\n\t\t$minutes = 0; if(sizeof($matches) > 1+7+4 && $matches[1+7+4] != \"\") $minutes = (int)$matches[1+7+4];\n\t\t$seconds = 0; if(sizeof($matches) > 1+7+5 && $matches[1+7+5] != \"\") $seconds = (int)$matches[1+7+5];\n\t\treturn approx_duration($years,$months,0,$days,$hours,$minutes,$seconds);\n\t}else{\n\t\t// iso time only format\n\t\t$hours = 0; if(sizeof($matches) > 1+7+6+0 && $matches[1+7+6+0] != \"\") $hours = (int)$matches[1+7+6+0];\n\t\t$minutes = 0; if(sizeof($matches) > 1+7+6+1 && $matches[1+7+6+1] != \"\") $minutes = (int)$matches[1+7+6+1];\n\t\t$seconds = 0; if(sizeof($matches) > 1+7+6+2 && $matches[1+7+6+2] != \"\") $seconds = (int)$matches[1+7+6+2];\n\t\treturn approx_duration(0,0,0,0,$hours,$minutes,$seconds);\n\t}\n}",
"public function testParseThrowsExceptionIfIntervalIsNotValid()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n (new Interval())->parse('foo');\n \n return;\n }",
"private function parse() {\n $data = getdate($this->timestamp);\n \n if($data) {\n $this->year = (integer) $data['year'];\n $this->month = (integer) $data['mon'];\n $this->day = (integer) $data['mday'];\n $this->hour = (integer) $data['hours'];\n $this->minute = (integer) $data['minutes'];\n $this->second = (integer) $data['seconds'];\n } // if\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of Mandatory. | public function setMandatory($Mandatory)
{
$this->Mandatory = $Mandatory;
} | [
"public function setMandatory($value)\n {\n return $this->set(self::MANDATORY, $value);\n }",
"public function setIsMandatory(?bool $value): void {\n $this->getBackingStore()->set('isMandatory', $value);\n }",
"public function setMandatory($var)\n {\n GPBUtil::checkBool($var);\n $this->mandatory = $var;\n\n return $this;\n }",
"public function setMandatory($mandatory)\n {\n $this->mandatory = $mandatory;\n return $this;\n }",
"public function setSerialNumberRequired($value) {\r\n $this->_data[\"SerialNumberRequired\"] = filter_var($value, FILTER_VALIDATE_BOOLEAN);\r\n return $this;\r\n }",
"public function setSystemMandatory(bool $systemMandatory)\n\t{\n\t\t$this->systemMandatory=$systemMandatory; \n\t\t$this->keyModified['system_mandatory'] = 1; \n\n\t}",
"public function isMandatory()\n\t{\n\t\treturn true;\n\t}",
"public function setOptional()\n\t{\n\t\t$this->required = FALSE;\n\t}",
"public function required()\n {\n $this->required = true;\n }",
"public function setRequired($required) {\n $this->required = !empty($required);\n }",
"public function setRequired($required = true)\n\t\t{\n\t\t\t$this->required = $required;\n\t\t}",
"public function setRequired(bool $required): void\n {\n $this->required = $required;\n }",
"protected function setRequired($required)\n {\n $this->required = (bool) $required;\n }",
"public function optional()\n {\n $this->required = false;\n }",
"public function isMandatory()\n {\n return $this->mandatory === true;\n }",
"public function parseRequired(): void\n {\n $this->required = true;\n }",
"public function isMandatory(): bool\n\t{\n\t\treturn ($this->visibility[FieldTable::VISIBILITY_MANDATORY] ?? false);\n\t}",
"public function getMandatory()\n\t{\n\t\treturn $this->mandatory; \n\n\t}",
"public function setMandatoryParent($value)\n {\n return $this->set(self::MANDATORY_PARENT, $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the requestedEnrollmentProfileAssignmentDateTime The time enrollment profile was assigned to the device | public function getRequestedEnrollmentProfileAssignmentDateTime()
{
if (array_key_exists("requestedEnrollmentProfileAssignmentDateTime", $this->_propDict)) {
if (is_a($this->_propDict["requestedEnrollmentProfileAssignmentDateTime"], "\DateTime") || is_null($this->_propDict["requestedEnrollmentProfileAssignmentDateTime"])) {
return $this->_propDict["requestedEnrollmentProfileAssignmentDateTime"];
} else {
$this->_propDict["requestedEnrollmentProfileAssignmentDateTime"] = new \DateTime($this->_propDict["requestedEnrollmentProfileAssignmentDateTime"]);
return $this->_propDict["requestedEnrollmentProfileAssignmentDateTime"];
}
}
return null;
} | [
"public function getAssignTime()\n {\n return $this->assignTime;\n }",
"public function getEnrollmentStartDateTime()\n {\n if (array_key_exists(\"enrollmentStartDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"enrollmentStartDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"enrollmentStartDateTime\"])) {\n return $this->_propDict[\"enrollmentStartDateTime\"];\n } else {\n $this->_propDict[\"enrollmentStartDateTime\"] = new \\DateTime($this->_propDict[\"enrollmentStartDateTime\"]);\n return $this->_propDict[\"enrollmentStartDateTime\"];\n }\n }\n return null;\n }",
"public function getExchangeLicenseAssignDate()\n {\n if (array_key_exists(\"exchangeLicenseAssignDate\", $this->_propDict)) {\n if (is_a($this->_propDict[\"exchangeLicenseAssignDate\"], \"\\DateTime\") || is_null($this->_propDict[\"exchangeLicenseAssignDate\"])) {\n return $this->_propDict[\"exchangeLicenseAssignDate\"];\n } else {\n $this->_propDict[\"exchangeLicenseAssignDate\"] = new \\DateTime($this->_propDict[\"exchangeLicenseAssignDate\"]);\n return $this->_propDict[\"exchangeLicenseAssignDate\"];\n }\n }\n return null;\n }",
"public function getRequestedEnrollmentProfileId()\n {\n if (array_key_exists(\"requestedEnrollmentProfileId\", $this->_propDict)) {\n return $this->_propDict[\"requestedEnrollmentProfileId\"];\n } else {\n return null;\n }\n }",
"public function getEasActivationDateTime()\n {\n if (array_key_exists(\"easActivationDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"easActivationDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"easActivationDateTime\"])) {\n return $this->_propDict[\"easActivationDateTime\"];\n } else {\n $this->_propDict[\"easActivationDateTime\"] = new \\DateTime($this->_propDict[\"easActivationDateTime\"]);\n return $this->_propDict[\"easActivationDateTime\"];\n }\n }\n return null;\n }",
"public function getEnrollmentProfile()\n {\n if (array_key_exists(\"enrollmentProfile\", $this->_propDict)) {\n if (is_a($this->_propDict[\"enrollmentProfile\"], \"\\Beta\\Microsoft\\Graph\\Model\\AndroidDeviceOwnerEnrollmentProfileType\") || is_null($this->_propDict[\"enrollmentProfile\"])) {\n return $this->_propDict[\"enrollmentProfile\"];\n } else {\n $this->_propDict[\"enrollmentProfile\"] = new AndroidDeviceOwnerEnrollmentProfileType($this->_propDict[\"enrollmentProfile\"]);\n return $this->_propDict[\"enrollmentProfile\"];\n }\n }\n return null;\n }",
"public function getTakenDateTime()\n {\n if (array_key_exists(\"takenDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"takenDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"takenDateTime\"])) {\n return $this->_propDict[\"takenDateTime\"];\n } else {\n $this->_propDict[\"takenDateTime\"] = new \\DateTime($this->_propDict[\"takenDateTime\"]);\n return $this->_propDict[\"takenDateTime\"];\n }\n }\n return null;\n }",
"public function getPoliciesDatetime()\n {\n return $this->getValue('nb_user_policies_datetime');\n }",
"public function getTrainingDueDateTime()\n {\n if (array_key_exists(\"trainingDueDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"trainingDueDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"trainingDueDateTime\"])) {\n return $this->_propDict[\"trainingDueDateTime\"];\n } else {\n $this->_propDict[\"trainingDueDateTime\"] = new \\DateTime($this->_propDict[\"trainingDueDateTime\"]);\n return $this->_propDict[\"trainingDueDateTime\"];\n }\n }\n return null;\n }",
"public function getRegistrationDateTime()\n {\n if (array_key_exists(\"registrationDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"registrationDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"registrationDateTime\"])) {\n return $this->_propDict[\"registrationDateTime\"];\n } else {\n $this->_propDict[\"registrationDateTime\"] = new \\DateTime($this->_propDict[\"registrationDateTime\"]);\n return $this->_propDict[\"registrationDateTime\"];\n }\n }\n return null;\n }",
"public function getEvaluationDateTime()\n {\n if (array_key_exists(\"evaluationDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"evaluationDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"evaluationDateTime\"])) {\n return $this->_propDict[\"evaluationDateTime\"];\n } else {\n $this->_propDict[\"evaluationDateTime\"] = new \\DateTime($this->_propDict[\"evaluationDateTime\"]);\n return $this->_propDict[\"evaluationDateTime\"];\n }\n }\n return null;\n }",
"function getDateAssigned() {\n\t\treturn $this->getData('dateAssigned');\n\t}",
"public function getDApprovalRequestDate()\r\n {\r\n return $this->dApprovalRequestDate;\r\n }",
"public function getJoinedDateTime()\n {\n if (array_key_exists(\"joinedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"joinedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"joinedDateTime\"])) {\n return $this->_propDict[\"joinedDateTime\"];\n } else {\n $this->_propDict[\"joinedDateTime\"] = new \\DateTime($this->_propDict[\"joinedDateTime\"]);\n return $this->_propDict[\"joinedDateTime\"];\n }\n }\n return null;\n }",
"public function getAssignment() {\n\t\treturn ilTrainingProgrammeUserAssignment::getInstance($this->progress->getAssignmentId());\n\t}",
"public function getProfileCreateDate() {\n\t\treturn ($this->profileCreateDate);\n\t}",
"public function getDateTaken()\n {\n return ($dateTaken = $this->getAdapter()->getDateTaken())\n ? new \\DateTime($dateTaken)\n : null;\n }",
"public function getGrantDateTime()\n {\n if (array_key_exists(\"grantDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"grantDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"grantDateTime\"])) {\n return $this->_propDict[\"grantDateTime\"];\n } else {\n $this->_propDict[\"grantDateTime\"] = new \\DateTime($this->_propDict[\"grantDateTime\"]);\n return $this->_propDict[\"grantDateTime\"];\n }\n }\n return null;\n }",
"public function getAcquireDate()\n {\n return isset($this->acquire_date) ? $this->acquire_date : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the passed value is a valid url. | public function checkUrl($value) : bool
{
return filter_var($value, FILTER_VALIDATE_URL) !== false;
} | [
"function chkIsValidURL($value)\r\n\t\t{\r\n\t\t\t$is_ok = (preg_match(\"/^http.+\\..+$/i\", $value));\r\n\t\t\tif (!$is_ok)\r\n\t\t\t\treturn false;\r\n\t\t}",
"protected function url($value)\n {\n # Version 2\n $valid = true;\n if ($value != '')\n $valid = filter_var($value, FILTER_VALIDATE_URL);\n\n return $valid;\n }",
"public function isUrl()\n {\n return filter_var($this->_value, FILTER_VALIDATE_URL);\n }",
"public function validateUrlFormat()\r\n {\r\n return filter_var($this->url, FILTER_VALIDATE_URL);\r\n }",
"public function url(string $value): bool\n {\n return filter_var($value, FILTER_VALIDATE_URL) !== false;\n }",
"public function is_url($value)\n\t{\n\t\t if($this->is_empty($value)\n\t\t \t|| preg_match('/^/', $value))\n\t\t {\n\t\t\t return false;\n\t\t }\n\t\t return false;\n\t}",
"private function validateUrl($value)\n\t{\n\t\t$pattern = '/^{schemes}:\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(?::\\d{1,5})?(?:$|[?\\/#])/i';\n\t\t$validSchemes = ['http', 'https'];\n\t\t$pattern = str_replace('{schemes}', '(' . implode('|', $validSchemes) . ')', $pattern);\n\t\tif (!preg_match($pattern, $value)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function isUrl()\n {\n return \\Yana\\Data\\UrlValidator::validate($this->_getValue());\n }",
"protected function validateUrl($attribute, $value) {\n return (filter_var($value, FILTER_VALIDATE_URL) !== false);\n }",
"function is_a_url($value)\n {\n if (!is_string($value)) {\n return false;\n }\n\n if (preg_match('#^data:.+\\/.+;base64,#si', $value)) {\n return false;\n }\n\n // Ported from: https://github.com/segmentio/is-url/blob/master/index.js\n if (!preg_match('#^(?:\\w+:)?\\/\\/(.+)$#si', $value, $matches)) {\n return false;\n }\n\n $hostAndPath = $matches[1];\n if (!$hostAndPath) {\n return false;\n }\n\n if (preg_match('#^[^\\s\\.]+\\.\\S{2,}$#si', $hostAndPath)) {\n return true;\n }\n\n return false;\n }",
"private function validateUrl($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_URL) !== false;\n }",
"public function validateURL()\n {\n /* TODO: Implement */\n return true;\n }",
"public function checkUrl(): bool {\n if (filter_var($this->url, FILTER_VALIDATE_URL)) { \n return true;\n } else {\n throw new Exception('[Url] is not valid!');\n return false;\n }\n }",
"protected function checkIfUrlIsValid() {\n\n\t\t$isValid = TRUE;\n\n\t\tif (empty($this->url)) {\n\t\t\t$isValid = FALSE;\n\t\t}\n\n\t\tif (!\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::isValidUrl($this->url)) {\n\t\t\t$isValid = FALSE;\n\t\t}\n\n\t\tif (!$isValid) {\n\t\t\tthrow new \\Sto\\Mediaoembed\\Exception\\InvalidUrlException($this->url);\n\t\t}\n\t}",
"public function is_valid_url()\r\n {\r\n return (!empty($this->url) && PiplApi_Utils::piplapi_is_valid_url($this->url));\r\n }",
"private function url()\n {\n if (filter_var($data, FILTER_VALIDATE_URL)) {\n return true;\n }else {\n return $data . 'is not a valid url';\n }\n }",
"public function isValidUrl(String $input)\n {\n return filter_var($input, FILTER_VALIDATE_URL) ? true : false;\n }",
"public function isUrl()\n {\n return (false !== filter_var($this->pathname, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));\n }",
"function rest_is_valid_url( $url, $request = null, $key = null ) {\n\tif ( ! is_string( $url ) || empty( $url ) ) {\n\t\treturn false;\n\t}\n\treturn filter_var( $url, FILTER_VALIDATE_URL );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the raw content This content is not markdown parser (boolean) $sanitize, TRUE returns the content sanitized | public function contentRaw($sanitize=false)
{
$key = $this->key();
$filePath = PATH_PAGES.$key.DS.FILENAME;
$contentRaw = file_get_contents($filePath);
if ($sanitize) {
return Sanitize::html($contentRaw);
}
return $contentRaw;
} | [
"public function getSafeContent()\n {\n $content = $this->content;\n if ( empty( $content ) ) $content = $this->title;\n $content = strip_tags( $content );\n return $content;\n }",
"public function getRawContent()\n {\n if ($this->isStream)\n return stream_get_contents($this->content);\n\n return $this->content;\n }",
"public function content($fullContent=true, $noSanitize=true)\n\t{\n\t\t// This content is not sanitized.\n\t\t$content = $this->getValue('content');\n\n\t\tif(!$fullContent) {\n\t\t\treturn $this->contentBreak();\n\t\t}\n\n\t\tif($noSanitize) {\n\t\t\treturn $content;\n\t\t}\n\n\t\treturn Sanitize::html($content);\n\t}",
"function cmb2_html_content_sanitize( $content ) {\n return apply_filters( 'content_save_pre', $content );\n}",
"public function getRawContent(): string\n {\n return $this->rawContent;\n }",
"public function getRawContent()\n {\n return $this->rawContent;\n }",
"function getParsedContent(){\n\n\t\tif (!$this->contentHasBeenParsed){//it needs parsing\n\n\t\t\t//uppercase content type. If content type not specified, default to markdown.\n\t\t\t//(quick way to stop PHP errors when empty place-holding files are used.)\n\t\t\t$upper_content = isset($this->meta['CONTENT_TYPE']) ? strtoupper($this->meta['CONTENT_TYPE']) : 'MARKDOWN';\n\n\t\t\t//if it's a type that need parsing\n\t\t\tif (isset(self::$parsers[$upper_content])){\n\n\t\t\t\t$callback = self::$parsers[$upper_content];\n\t\t\t\t$this->parsedContent = $callback($this->content);\n\t\t\t\t$this->contentHasBeenParsed = true;\n\n\t\t\t} else {\n\n\t\t\t\t//content doesn't need parsing\n\t\t\t\t$this->parsedContent = $this->content;\n\t\t\t\t$this->contentHasBeenParsed = true;\n\n\t\t\t}//if-else\n\n\t\t}//if\n\n\t\treturn self::fixAbsoluteLinks($this->parsedContent);\n\n\t}",
"function check_body($input)\n{\n // Check BODY (sanitize only);\n if ((isset($input)) && (!empty($input))) {\n // we white list the allowed html tags\n return strip_tags($input, \"<div><br><br /><p><sub><img><sup><strong><b><em><u><a><s><font><span><ul><li><ol><blockquote><h1><h2><h3><h4><h5><h6><hr><table><tr><td><code><video><audio><pagebreak>\");\n }\n\n return '';\n}",
"protected function sanitize_markup() {\n\t\t$sanitization = new Sanitization();\n\t\t$sanitization->sanitize_document( $this->document );\n\t}",
"private function clean_content($data) \r\n\t{\r\n\t return strip_tags($data);\r\n\t}",
"function sanitize($input) {\r\n\treturn (strip_tags( $input ));\r\n}",
"function filter_distributor_content( $prepared_post, $request ) {\n\n\tif ( \\Distributor\\Utils\\is_using_gutenberg( get_post( $prepared_post->ID ) ) && isset( $request['distributor_raw_content'] ) ) {\n\t\tif ( \\Distributor\\Utils\\dt_use_block_editor_for_post_type( $prepared_post->post_type ) ) {\n\t\t\t$prepared_post->post_content = $request['distributor_raw_content'];\n\t\t}\n\t}\n\treturn $prepared_post;\n}",
"function getUnparsedContent() {\n return parent::getContent();\n }",
"public function getContentFiltered(){\n return apply_filters('the_content', $this->content);\n }",
"function maus_content_filter( $content ) {\n $content = html_entity_decode($content);\n // run your code on $content and\n return $content;\n}",
"function cleanContent($string) {\n global $DB;\n\n // Clean HTML\n $string = Html::clean(Html::entities_deep($string), false, 2);\n\n $br_marker = '==' . mt_rand() . '==';\n\n // Replace HTML line breaks to marker\n $string = preg_replace('/<br\\s*\\/?>/', $br_marker, $string);\n\n // Replace plain text line breaks to marker if content is not html\n // and rich text mode is enabled (otherwise remove them)\n $string = str_replace(\n [\"\\r\\n\", \"\\n\", \"\\r\"],\n $this->body_is_html ? ' ' : $br_marker,\n $string\n );\n\n // Wrap content for blacklisted items\n $itemstoclean = [];\n foreach ($DB->request('glpi_blacklistedmailcontents') as $data) {\n $toclean = trim($data['content']);\n if (!empty($toclean)) {\n $itemstoclean[] = str_replace([\"\\r\\n\", \"\\n\", \"\\r\"], $br_marker, $toclean);\n }\n }\n if (count($itemstoclean)) {\n $string = str_replace($itemstoclean, '', $string);\n }\n\n $string = str_replace($br_marker, \"<br />\", $string);\n\n // Double encoding for > and < char to avoid misinterpretations\n $string = str_replace(['<', '>'], ['&lt;', '&gt;'], $string);\n\n // Prevent XSS\n $string = Toolbox::clean_cross_side_scripting_deep($string);\n\n return $string;\n }",
"public function getRawContents(){\n\t\treturn $this->_raw_contents;\n\t}",
"public function getParsedContentAttribute()\n\t{\n\t\t$bridge = new TwigBridge(app());\n\t\t$loader = new Twig_Loader_String;\n\n\t\t$twig = $bridge->getTwig();\n\t\t$twig->setLoader($loader);\n\n\t\treturn $twig->loadTemplate($this->content)->render(array(\n\t\t\t'post' => $this\n\t\t));\n\t}",
"public function sanitize()\n {\n return $this->value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tells if the current participant is allowed to delete this thread | function canDeleteThread(ThreadInterface $thread)
{
return true;
} | [
"public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }",
"public function canRemove() {\n return $this->xpdo->hasPermission('discuss.thread_remove') &&\n ($this->isModerator() || $this->xpdo->discuss->user->isAdmin());\n }",
"public function canDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$topics = $this->getModel()->getList();\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$post = $this->getService('com://site/ninjaboard.model.posts')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->first_post_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $post->created_by != $user->id) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function canDelete()\n {\n return !$this->isAssigned();\n //nikto ho este neriesil\n }",
"public function canDelete() {\n return !$this->anySubmissions() && !$this->anyManualGrades() && !$this->anyTeams() && !($this->isVcs() && !$this->isTeamAssignment());\n }",
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function canDelete() {\n return !$this->anySubmissions() && !$this->anyManualGrades() && !$this->anyTeams();\n }",
"public function canDeleteRole() {\n\t}",
"public function canDelete()\n {\n if ($this->created_by == Yii::$app->user->id) {\n return true;\n }\n\n return false;\n }",
"public function isScheduledForDeletion();",
"public function isDeleteAllowed()\n {\n return $this->isAllowedAction('delete');\n }",
"function canDeleteItem() {\n\n if (!Session::haveAccessToEntity($this->getEntityID())) {\n return false;\n }\n\n // user can delete his ticket if no action on it\n if ($_SESSION[\"glpiactiveprofile\"][\"interface\"] == \"helpdesk\"\n && (!($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || $this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n || $this->numberOfFollowups() > 0\n || $this->numberOfTasks() > 0\n || $this->fields[\"date\"] != $this->fields[\"date_mod\"])) {\n return false;\n }\n\n return static::canDelete();\n }",
"function current_user_can_delete() {\n\t\treturn false;\n\t}",
"public function canDelete() {\n $query = 'SELECT * FROM ' . ROSTERSOFTEAMSOFSEASONS . ' WHERE playerID=' . $this->get_playerID();\n $result = mysql_query($query) or die(\"sp_clubs (Line \" . __LINE__ . \"): \" . mysql_errno() . \": \" . mysql_error());\n if ($result && mysql_num_rows($result) > 0) {\n return false;\n } else {\n return true;\n }\n }",
"public function canDelete(): bool\n {\n if (Auth::getLoggedInUserId() == $this->user_id || Auth::isAdmin()) {\n return true;\n }\n\n return false;\n }",
"public function canDelete() {\n $query = 'SELECT * FROM ' . TEAMSOFSEASONS . ' WHERE teamID=' . $this->get_teamID();\n $result = mysql_query($query) or die(\"sp_clubs (Line \" . __LINE__ . \"): \" . mysql_errno() . \": \" . mysql_error());\n if ($result && mysql_num_rows($result) > 0) {\n return false;\n } else {\n return true;\n }\n }",
"public function canDeletesubscriber()\n {\n return $this->canAdminister();\n }",
"function hasDeletePermission() {\n\t\tglobal $login;\n\t\treturn $login->isWebmaster();\n\t}",
"private function canDelete(): bool\n {\n return $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findGroupedByUser Get Id, Name map of calendars by user | static function getIdNameMapByUser(IUser $user, $min_state=STATE_VISIBLE) {
$calendars = self::getCalendarsByUser($user, $min_state);
$map = array();
if (is_foreachable($calendars)) {
$calendars->setCasting(array(
'id' => DBResult::CAST_INT
));
foreach ($calendars as $subobject) {
$calendar_id = array_var($subobject, 'id');
$calendar_name = array_var($subobject, 'name');
$created_by_id = array_var($subobject, 'created_by_id');
$share_can_add_events = array_var($subobject, 'share_can_add_events') ? true : false;
if ($user->getId() == $created_by_id || $share_can_add_events) {
$map[$calendar_id] = $calendar_name;
} // if
} // foreach;
} // if
return $map;
} | [
"static function findGroupedByUserId(User $user, $filter_can_add_events=false) {\n\t\t $order_by = 'created_by_id=' . $user->getId() . ' DESC, created_by_id ASC, position ASC';\n\n\t\t $calendars = self::getCalendarsByUser($user, STATE_VISIBLE, $order_by, $filter_can_add_events);\n\n\t\t $groups = array();\n\n\t\t if (is_foreachable($calendars)) {\n\t\t\t foreach ($calendars as $calendar) {\n\t\t\t\t\t$user_id = array_var($calendar, 'created_by_id');\n\t\t\t\t if (!isset($groups[$user_id])) {\n\t\t\t\t\t $groups[$user_id] = array();\n\t\t\t\t } // if\n\n\t\t\t\t $groups[$user_id][] = $calendar;\n\t\t\t } // foreach\n\t\t } // if\n\n\t\t return $groups;\n\t }",
"public function getUsersCalendars() {\n $userId = SPC_USERID;\n\t\t$role = SPC_USER_ROLE;\n\t\t$adminId = SPC_ADMINID;\n\n $db = new SpcDb();\n $activeUserCalendars = SpcCalendar::getActiveUserCals($adminId);\n\n\t\t//get this admin's users' spc_calendar_calendars\n\t\tif ($role == 'admin') {\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id AS user_id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.admin_id = $userId\n AND\n spc_users.role = 'user'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\t$users = array();\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$users[$row['username']][] = $row;\n\t\t\t}\n\n\t\t\techo Spc::jsonEncode(array('users' => $users));\n\n\t\t} else if ($role == 'super') {\n\t\t\t//get admins\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.role = 'admin'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\t$admins = array();\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$admins[$row['id']]['calendars'][] = $row;\n\t\t\t\t$admins[$row['id']]['username'] = $row['username'];\n\t\t\t}\n\n\t\t\t//add users\n\t\t\t$sql = \"SELECT\n\t\t\t\t\t\tspc_users.id AS user_id,\n\t\t\t\t\t\tspc_users.admin_id,\n\t\t\t\t\t\tspc_users.username,\n\t\t\t\t\t\tspc_calendar_calendars.id AS cal_id,\n\t\t\t\t\t\tspc_calendar_calendars.name AS cal_name,\n\t\t\t\t\t\tspc_calendar_calendars.color,\n\t\t\t\t\t\tspc_calendar_calendars.status\n\t\t\t\t\tFROM\n\t\t\t\t\t\tspc_users\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tspc_calendar_calendars ON spc_users.id = spc_calendar_calendars.user_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tspc_users.role = 'user'\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tspc_users.username, spc_calendar_calendars.name\";\n\n\t\t\t$rs = $db->query($sql);\n\n\t\t\twhile ($row = mysql_fetch_assoc($rs)) {\n\t\t\t\t$row['status'] = 'off';\n\t\t\t\tif (in_array($row['cal_id'], $activeUserCalendars)) {\n\t\t\t\t\t$row['status'] = 'on';\n\t\t\t\t}\n\n\t\t\t\t$admins[$row['admin_id']]['users'][$row['username']][] = $row;\n\t\t\t}\n\n\t\t\techo Spc::jsonEncode(array('admins' => $admins));\n\n\t\t} else {\n\t\t\techo Spc::jsonEncode(array('users' => '{}'));\n\t\t}\n }",
"public function getCalendars()\n {\n if(Auth::check()) {\n $id = Auth::user()->id;\n $user = GoogleUsers::find($id);\n\n //check to make sure the user access token is still valid\n $ch = curl_init('https://www.googleapis.com/calendar/v3/users/me/calendarList?access_token=' . $user->google_access_token);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $calendars = curl_exec($ch);\n $calendars = json_decode($calendars);\n\n //if the user access token is not valid - 401 \"Invalid Credentials\" refresh the access token\n if (isset($calendars->error->code)) {\n if ($calendars->error->code == '401') {\n $this->refreshToken($id);\n }\n }\n\n $ch = curl_init('https://www.googleapis.com/calendar/v3/users/me/calendarList?access_token=' . $user->google_access_token);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $calendars = curl_exec($ch);\n $calendars = json_decode($calendars);\n }\n\n $cal_ids = array();\n if ($calendars !== false) {\n foreach ($calendars->items as $calendar) {\n if ($calendar->accessRole == \"owner\") {\n array_push($cal_ids, array('id' => $calendar->id, 'user_id' => $id,'name' => $calendar->summary));\n }\n }\n }\n $response['calendars'] = $cal_ids;\n\n return json_encode($response);\n }",
"public function getGroupMemberSet($principal) {\n $principal = $this->getPrincipalByPath($principal);\n if (!$principal) throw new Sabre_DAV_Exception('Principal not found');\n \n $stmt = $this->pdo->prepare(\"SELECT uid, tx_cal_calendar FROM fe_users WHERE uid = ? AND deleted=0\");\r\n $stmt->execute(array($principal['id']));\n \n $calendarIds = '';\r\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\r\n \t$calendarIds = $row['tx_cal_calendar'];\n }\n \n $stmt = $this->pdo->prepare(\"SELECT * FROM tx_cal_calendar WHERE uid in (?)\");\r\n $stmt->execute(array($calendarIds));\n\n $result = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $result[] = $principal['uri'].'/'.$row['title'];\n\n }\n return $result;\n \n }",
"static function getCalendarsByUser(User $user, $min_state=STATE_VISIBLE, $order_by='position', $filter_by_can_add_events=false) {\n\t\t $table_calendars = TABLE_PREFIX . \"calendars\";\n\t\t $table_calendar_users = TABLE_PREFIX . \"calendar_users\";\n\n\t\t $shared_calendar_ids = DB::executeFirstColumn(\"SELECT calendar_id FROM $table_calendar_users WHERE user_id = ?\", $user->getId());\n\n\t\t // get share types by user\n\t\t $share_types = Calendars::getShareTypesByUser($user);\n\n\t\t if ($filter_by_can_add_events) {\n\t\t\t return DB::execute(\"SELECT * FROM $table_calendars WHERE (created_by_id = ? OR (share_type IN (?) AND share_can_add_events = ?) OR (share_type = ? AND id IN (?) AND share_can_add_events = ?)) AND state >= ? ORDER BY $order_by\", $user->getId(), $share_types, 1, Calendar::SHARE_WITH_SELECTED_USERS, $shared_calendar_ids, 1, $min_state);\n\t\t } else {\n\t\t\t return DB::execute(\"SELECT * FROM $table_calendars WHERE (created_by_id = ? OR share_type IN (?) OR (share_type = ? AND id IN (?))) AND state >= ? ORDER BY $order_by\", $user->getId(), $share_types, Calendar::SHARE_WITH_SELECTED_USERS, $shared_calendar_ids, $min_state);\n\t\t } // if\n\t }",
"function user_group_info($uid, $course_id, $as_id = NULL) {\n $gids = array();\n\n if ($uid != null) {\n $q = Database::get()->queryArray(\"SELECT group_members.group_id AS grp_id, `group`.name AS grp_name FROM group_members,`group`\n\t\t\tWHERE group_members.group_id = `group`.id\n\t\t\tAND `group`.course_id = ?d AND group_members.user_id = ?d\", $course_id, $uid);\n } else {\n if (!is_null($as_id) && Database::get()->querySingle(\"SELECT assign_to_specific FROM assignment WHERE id = ?d\", $as_id)->assign_to_specific) {\n $q = Database::get()->queryArray(\"SELECT `group`.name AS grp_name,`group`.id AS grp_id FROM `group`, assignment_to_specific WHERE `group`.id = assignment_to_specific.group_id AND `group`.course_id = ?d AND assignment_to_specific.assignment_id = ?d\", $course_id, $as_id);\n } else {\n $q = Database::get()->queryArray(\"SELECT name AS grp_name,id AS grp_id FROM `group` WHERE course_id = ?d\", $course_id);\n }\n }\n\n foreach ($q as $r) {\n $gids[$r->grp_id] = $r->grp_name;\n }\n return $gids;\n}",
"function getUserDayData($user, $day) {\n \t$objects_table = TABLE_PREFIX . 'project_objects';\n $assignments_table = TABLE_PREFIX . 'assignments';\n \n return Calendar::getDayData($day, db_prepare_string(\"$objects_table.id = $assignments_table.object_id AND $assignments_table.user_id = ?\", array($user->getId())), true);\n }",
"public function lookup_group($id);",
"function getCalendarObjects($calendarId);",
"public function getAccessibleCalendars() {\n\t\t$ids = array();\n\t\t$res = SQLQuery::create()->bypassSecurity()->select(\"UserCalendar\")->where(\"user\",PNApplication::$instance->user_management->user_id)->execute();\n\t\tforeach ($res as $r)\n\t\t\tarray_push($ids, $r[\"calendar\"]);\n\t\t$res = SQLQuery::create()->bypassSecurity()->select(\"CalendarRights\")->execute();\n\t\tforeach ($res as $r) {\n\t\t\tif (in_array($r[\"calendar\"], $ids)) continue;\n\t\t\tif (PNApplication::$instance->user_management->hasRight($r[\"right_name\"], $r[\"right_value\"]))\n\t\t\t\tarray_push($ids, $r[\"calendar\"]);\n\t\t}\n\t\treturn $ids;\n\t}",
"function get_group_name_and_creator($id){\n\t//sql command\n\t$sql = 'SELECT user_name, group_name FROM groups WHERE group_id = \\''. $id.'\\' ';\n\treturn array_shift(get_sql_results($sql));\n}",
"public function findByName($group_name);",
"public function GetGroupEvents()\n {\n $EventsDb = new Application_Model_DbTable_Calendar_Eventos();\n $UsusarioDb = new Application_Model_DbTable_Calendar_UsuariosEventos();\n \n $select = $EventsDb->select()\n ->setIntegrityCheck(false)\n ->from(array('a'=>$EventsDb->__get('_name')),array('id','start','end','allDay','title','description','origen'))\n ->joinLeft(array('c'=>$UsusarioDb->__get('_name')),'a.id=c.idevento',array('username'))\n ->where('c.OU_ID = ?',$this->userData->OU_ID);\n \n if(isset($this->params['start']))\n $select->where(\"UNIX_TIMESTAMP(STR_TO_DATE(start, '%Y-%m-%d %H:%i:%s')) >= ? \",$this->params['start']);\n \n if(isset($this->params['end']))\n $select->where(\"UNIX_TIMESTAMP(STR_TO_DATE(end, '%Y-%m-%d %H:%i:%s')) <= ? \",$this->params['end']);\n \n $Events = $EventsDb->fetchAll($select)->toArray();\n $Events = self::getEventoptions($Events);\n \n return json_encode($Events);\n }",
"function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,u.name,u.IdDepartamento,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}",
"protected function getUserCalendarList() {\r\n \r\n $url_parameters = [];\r\n $url_parameters['fields'] = 'items(id,summary,timeZone)';\r\n $url_parameters['minAccessRole'] = 'owner';\r\n $url_calendars = 'https://www.googleapis.com/calendar/v3/users/me/calendarList?' . http_build_query($url_parameters);\r\n \r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_calendars);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $_SESSION['accessToken']]);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n \r\n $data = json_decode(curl_exec($ch), true);\r\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n if ($http_code != 200) {\r\n throw new Exception('Error : Failed to get calendars list');\r\n }\r\n \r\n return $data;\r\n }",
"function getIdNameMap($user = null, $min_state = STATE_VISIBLE) {\n $project_id = $this->object->getId();\n $user_id = $user instanceof User ? $user->getId() : (integer) $user;\n\n return AngieApplication::cache()->getByObject($this->object, array('users', 'id_name_map', $user_id, $min_state), function() use ($project_id, $user, $min_state) {\n $users_table = TABLE_PREFIX . 'users';\n $project_users_table = TABLE_PREFIX . 'project_users';\n\n if($user instanceof User) {\n $rows = DB::execute(\"SELECT $users_table.id, $users_table.first_name, $users_table.last_name, $users_table.email FROM $users_table, $project_users_table WHERE $project_users_table.project_id = ? AND $users_table.id = $project_users_table.user_id AND $users_table.id IN (?)\", $project_id, $user->visibleUserIds(null, $min_state));\n } else {\n $rows = DB::execute(\"SELECT $users_table.id, $users_table.first_name, $users_table.last_name, $users_table.email FROM $users_table, $project_users_table WHERE $project_users_table.project_id = ? AND $users_table.id = $project_users_table.user_id AND $users_table.state >= ?\", $project_id, $min_state);\n } // if\n\n $result = array();\n\n if($rows) {\n foreach($rows as $row) {\n $result[(integer) $row['id']] = Users::getUserDisplayName($row);\n } // foreach\n } // if\n\n return $result;\n });\n }",
"public function get_group_users($group_id);",
"public function getUserGroups();",
"public function getEventsOnDate(Request $request, $id)\n {\n $str_date = $request -> input('year') . '-' . $request -> input('month') . '-' . $request -> input('day');\n\n $user = User::findOrFail($id);\n // User personal events\n $user_events = $user -> userEvents() -> where('date', $str_date) -> get();\n // User group events\n $group_events = $user -> groupEvents() -> join('groups', 'groups.id', '=', 'group_events.group_id') -> where('date', $str_date)\n -> select('group_events.*', 'groups.name as group_name') -> get();\n unset($user, $str_date);\n\n // merge results\n return array('user' => ResourceUserEvent::collection($user_events), 'group' => ResourceGroupEvent::collection($group_events));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces hooks with specified text | function replaceDefaultHook($str) {
global $default_hooks, $default_replace;
return (str_replace($default_hooks, $default_replace, $str));
} | [
"private function add_hooks() {\n\t\tadd_filter( 'slp_get_text_string' , array( $this , 'augment_text_string' ) , 10 , 2 );\n\t}",
"function ReplaceTarget($text){}",
"function replaceDefaultHook($str) // used in class.mail.php\r\n\r\n{\r\n\r\n\tglobal $default_hooks,$default_replace;\t\r\n\r\n\treturn (str_replace($default_hooks,$default_replace,$str));\r\n\r\n}",
"function replaceCustomText(&$text) {\n\t\treturn $text;\n\t}",
"static function insert_before ($file_name, $hook, $content) {\n\t\t$old_file_content = file_get_contents($file_name);\n\t\t$new_file_content = str_replace($hook, $content.$hook, $old_file_content);\n\n\t\tfile_put_contents($file_name, $new_file_content);\n\t}",
"function doNormalReplacements($text) {\n // known strings that do not exist in the translation file.\n $knownReplacements = array(\n '{ABJ404_STATUS_AUTO}' => ABJ404_STATUS_AUTO,\n '{ABJ404_STATUS_MANUAL}' => ABJ404_STATUS_MANUAL,\n '{ABJ404_STATUS_CAPTURED}' => ABJ404_STATUS_CAPTURED,\n '{ABJ404_STATUS_IGNORED}' => ABJ404_STATUS_IGNORED,\n '{ABJ404_TYPE_404_DISPLAYED}' => ABJ404_TYPE_404_DISPLAYED,\n '{ABJ404_TYPE_POST}' => ABJ404_TYPE_POST,\n '{ABJ404_TYPE_CAT}' => ABJ404_TYPE_CAT,\n '{ABJ404_TYPE_TAG}' => ABJ404_TYPE_TAG,\n '{ABJ404_TYPE_EXTERNAL}' => ABJ404_TYPE_EXTERNAL,\n '{ABJ404_TYPE_HOME}' => ABJ404_TYPE_HOME,\n );\n\n // replace known strings that do not exist in the translation file.\n $text = str_replace(array_keys($knownReplacements), array_values($knownReplacements), $text);\n \n // Find the strings to replace in the content.\n $re = '/\\{(.+?)\\}/x';\n preg_match_all($re, $text, $stringsToReplace, PREG_PATTERN_ORDER);\n\n // Iterate through each string to replace.\n foreach ($stringsToReplace[1] as $stringToReplace) {\n $text = str_replace('{' . $stringToReplace . '}', \n __($stringToReplace, '404-solution'), $text);\n }\n \n return $text;\n }",
"function replaceTags($text)\n {\n return preg_replace_callback(\"/<\\?php(.*?)\\?>/\",array(\"TemplateFiller\", \"evalTag\"),$text);\n }",
"abstract public function hook();",
"public function hook();",
"function hook_google_tag_snippets_alter(array &$snippets, Container $container) {\n // Do something to the script snippet.\n $snippets['script'] = str_replace('insertBefore', 'insertAfter', $snippets['script']);\n}",
"public function getReplacementText();",
"function affiliseo_taxonomy_images_change_insert_button_text($safe_text, $text) {\n return str_replace(\"Insert into Post\", \"Use this image\", $text);\n}",
"function replace_thickbox_text($translated_text, $text)\n {\n if ('Insert into Post' == $text) {\n $referer = strpos( wp_get_referer(), 'puawp_options' );\n if ($referer != '') {\n return ('Select For Pop Up Archive Upload');\n }\n }\n\n return $translated_text;\n }",
"public function replacePlaceHolders($text, array $data = [], BubbleableMetadata $bubbleable_metadata = NULL, array $options = []);",
"function goarch_change_insert_button_text($safe_text, $text)\n{\n return str_replace(\"Insert into Post\", \"Use this image\", $text);\n}",
"public function replaceToken($text, $data = [], $options = []);",
"function replaceKeyWordsInPopup ($page_id, $page_title, $popup_text){\r\n $popup_text = str_replace('TITLE',strip_tags($page_title),$popup_text);\r\n $popup_text = str_replace('BLOG',strip_tags($this->pagepost($page_id)),$popup_text);\r\n return $popup_text;\r\n }",
"private function replace($text, $data)\n {\n // Replace Data Tokens:\n \n foreach ($data as $key => $value) {\n \n if (is_scalar($value)) {\n $text = str_replace(\"{{$key}}\", $value, $text);\n }\n \n }\n \n // Replace Config Tokens:\n \n foreach ($this->config as $key => $value) {\n \n if (is_scalar($value)) {\n $text = str_replace(\"{{$key}}\", $value, $text);\n }\n \n }\n \n // Answer Text:\n \n return $text;\n }",
"function displayTextIfChanged($id, $tag, $text)\n{\n static $writeText = array();\n \n if (!isset($writeText[$id]) || $writeText[$id] != $text){\n $writeText[$id] = $text;\n echo str_replace(\"##\", $text, $tag);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Responds to a ckeditor_comment_type being updated. This hook is invoked after the ckeditor_comment_type has been updated in the database. | function hook_ckeditor_comment_type_update(CKEditorCommentType $ckeditor_comment_type) {
db_update('mytable')
->fields(array('extra' => print_r($ckeditor_comment_type, TRUE)))
->condition('id', entity_id('ckeditor_comment_type', $ckeditor_comment_type))
->execute();
} | [
"function hook_ckeditor_comment_type_presave(CKEditorCommentType $ckeditor_comment_type) {\n $ckeditor_comment_type->name = 'foo';\n}",
"public static function update_comment_type($comment_data)\n {\n }",
"function hook_micro_type_update($info) {\n if (!empty($info->old_type) && $info->old_type != $info->type) {\n $setting = variable_get('comment_' . $info->old_type, COMMENT_MICRO_OPEN);\n variable_del('comment_' . $info->old_type);\n variable_set('comment_' . $info->type, $setting);\n }\n}",
"public function testUpdateNotificationType()\n {\n }",
"function knbu_store_comment($comment) {\n\tglobal $wpdb;\n\tif ( !isset( $_POST['knbu_ktype'] ) ) return;\n\t$ktype = $_POST['knbu_ktype'];\n\tif (is_numeric($comment))\n\t\t$cid = $comment;\n\telse\n\t\t$cid = $comment['comment_post_ID'];\n\t\n\tupdate_comment_meta( $cid, 'kbtype', $ktype );\n}",
"public function fseo_tt_update_comment()\n {\n $id = $_POST['commentId'];\n $content = $_POST['commentContent'];\n $comment = get_comment($id, ARRAY_A);\n $comment['comment_content'] = $content;\n\n $res = wp_update_comment($comment);\n\n echo json_encode(['status' => $res ? 'success' : 'fail']);\n die();\n }",
"function hook_ckeditor_comment_presave(CKEditorComment $ckeditor_comment) {\n $ckeditor_comment->name = 'foo';\n}",
"public function onComEngageModelCommentsAfterUpdate($comment)\n\t{\n\t\tif ($this->user->guest)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$info = $this->getCommentInfo($comment);\n\n\t\t$container = $comment->getContainer();\n\n\t\t$container->platform->logUserAction($info, 'COM_ENGAGE_USERLOG_COMMENT_SAVE', 'com_engage');\n\t}",
"function hook_default_ckeditor_comment_type_alter(array &$defaults) {\n $defaults['main']->name = 'custom name';\n}",
"function convert_comments(){\n\t\t\t\tglobal $plugintable;\n\t\t\t\t$plugintable\t= \"pcontent\";\n\n\t\t\t\tif(!is_object($sqlcc)){ $sqlcc = new db; }\n\t\t\t\t$numc = $sqlcc -> db_Count(\"comments\", \"(*)\", \"WHERE comment_type = '1' \");\n\t\t\t\tif($numc > 0){\n\t\t\t\t\t$sqlcc -> db_Update(\"comments\", \"comment_type = '\".$plugintable.\"' WHERE comment_type = '1' \");\n\t\t\t\t}\n\t\t}",
"public function wp_editComment(/**\n * Fires after a comment has been successfully updated via XML-RPC.\n *\n * @since 3.4.0\n *\n * @param int $comment_ID ID of the updated comment.\n * @param array $args An array of arguments to update the comment.\n */\n$args) {}",
"public function onAfterCommentSave( &$comment )\n\t{\n\t}",
"function hook_ckeditor_comment_type_insert(CKEditorCommentType $ckeditor_comment_type) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('ckeditor_comment_type', $ckeditor_comment_type),\n 'extra' => print_r($ckeditor_comment_type, TRUE),\n ))\n ->execute();\n}",
"function setContent($comment, $type){\n\t\t$this->comment['comment_content'] = $comment;\n\t\t$this->comment['comment_type'] = $type;\n\t}",
"public function updatecomment()\n {\n $id_comment = $this->request->getParameter(\"id\");\n $comment = $this->comment->getComment($id_comment);\n $content = $comment['content'];\n $this->comment->changeCommentAdmin($content);\n }",
"public function getCommentType()\n {\n return $this->commentType;\n }",
"public function updatecomment()\n {\n $id_comment = $this->calculate->getCommentId();\n $comment = $this->comment->getComment($id_comment);\n $content = $comment['content'];\n $this->comment->changeComment($content);\n $this->message->commentUpdated();\n }",
"public function onBeforeSave()\n\t{\n\t\tif (empty($this->allow_comments))\n\t\t{\n\t\t\t$this->allow_comments = $this->Channel->deft_comments;\n\t\t}\n\t}",
"public function updatecomment()\n {\n $id_comment = $this->request->getParameter(\"id\");\n $comment = $this->comment->getComment($id_comment);\n $content = !empty($_POST['content']) ? trim($_POST['content']) : null;\n $this->comment->changeCommentAdmin($content);\n $this->message->commentUpdated($id_comment);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the metadata property, calls edit, and returns the calling object. $folder>setMetadataSet( $new_ms )>setMetadata( $new_m ); Asset | public function setMetadata( p\Metadata $m ) : Asset
{
$this->metadata = $m;
$this->edit();
$this->processMetadata();
return $this;
} | [
"public function getMetadataSet() : Asset\n {\n $service = $this->getService();\n //echo $this->metadataSetId . BR;\n \n return new MetadataSet( \n $service, \n $service->createId( MetadataSet::TYPE, \n $this->getProperty()->metadataSetId ) );\n }",
"public function setMetadataSet( MetadataSet $ms ) : Asset\n {\n if( $ms == NULL )\n {\n throw new e\\NullAssetException( c\\M::NULL_ASSET );\n }\n \n $this->getProperty()->metadataSetId = $ms->getId();\n $this->getProperty()->metadataSetPath = $ms->getPath();\n $this->edit();\n $this->processMetadata();\n \n return $this;\n }",
"public function setMetadata($metadata) {}",
"public function setMetadata($metadata) {\n }",
"protected function setFileMetadata(FileMetadata $newFileMetadata, array $resourceMetaData): void\n {\n foreach ($resourceMetaData as $metaDataEntry) {\n\n switch ($metaDataEntry->resource_type_field) {\n // 'source'\n case 76:\n /** @var \\RKW\\RkwResourcespace\\Domain\\Repository\\MediaSourcesRepository $mediaSourcesRepository */\n $mediaSourcesRepository = $this->objectManager->get(MediaSourcesRepository::class);\n $mediaSource = $mediaSourcesRepository->findOneByNameLike($metaDataEntry->value);\n if ($mediaSource) {\n // use existing\n $newFileMetadata->setTxCoreextendedSource($mediaSource);\n } else {\n // create & add new\n /** @var \\RKW\\RkwResourcespace\\Domain\\Model\\MediaSources $newMediaSource */\n $newMediaSource = $this->objectManager->get(MediaSources::class);\n $newMediaSource->setName($metaDataEntry->value);\n $mediaSourcesRepository->add($newMediaSource);\n // set new\n $newFileMetadata->setTxCoreextendedSource($newMediaSource);\n }\n break;\n // 'credit'\n case 10:\n $newFileMetadata->setTxCoreextendedPublisher(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n // 'title'\n case 8:\n $newFileMetadata->setTitle(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n // 'caption'\n case 18:\n $newFileMetadata->setCaption(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n // 'keywords'\n case 1:\n $newFileMetadata->setKeywords(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n // date\n case 12:\n $newFileMetadata->setContentCreationDate(strtotime($metaDataEntry->value));\n break;\n // text\n case 72:\n $newFileMetadata->setText(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n // additional text\n case 25:\n $newFileMetadata->setDescription(filter_var($metaDataEntry->value, FILTER_SANITIZE_STRING));\n break;\n }\n }\n }",
"protected function assignMetadata()\n\t{\n\t\t$this->metadata->metadatacreator = \"PhpYamdi version \".self::$version;\n\t}",
"public function testUpdateContentMetadataAccess()\n {\n }",
"protected function setMetadata(){\n\t\t$cacheKey = $this->generateCacheKey();\n\n\t\t//Try the cache first.\n\t\tif ( isset($this->cache) ){\n\t\t\t$this->metadata = $this->cache->get($cacheKey);\n\t\t}\n\n\t\t// Otherwise read out the metadata and create a cache\n\t\tif ( !isset($this->metadata) || !is_array($this->metadata) ){\n\t\t\t$this->extractMetadata();\n\n\t\t\t//Update cache.\n\t\t\tif ( isset($this->cache) ){\n\t\t\t\t$this->cache->set($cacheKey, $this->metadata, self::$cacheTime);\n\t\t\t}\n\t\t}\n\t}",
"public function testUpdateMetadata1()\n {\n }",
"public function testUpdateContentMetadata()\n {\n }",
"protected function _updateMetadata() {\n $this->_originalWidth = parent::getOriginalWidth();\n $this->_originalHeight = parent::getOriginalHeight();\n\n $storageModel = Mage::getSingleton('core/file_storage')->getStorageModel();\n $storageModel->updateMetadata($this->_getModel()->getBaseFile(), [\n 'width' => $this->_originalWidth,\n 'height' => $this->_originalHeight,\n ]);\n return $this;\n }",
"public function setMetadata($val) {\n $this->_metadata = $val;\n }",
"public function testUpdateMetadata3()\n {\n }",
"public function set_metadata ($metadata) {\n $this->metadata = $metadata;\n }",
"function edit($asset) {\n\n /* Construct the parameters in the same way that we\n * constructucted them for the folder, though creating\n * a page requires a bit more information\n */\n $params =\n\tarray (\n\t 'authentication' => array(\n\t 'username' => $this->username,\n\t 'password' => $this->password,\n\t ),\n\t 'asset' => $asset\n\t);\n //print_r($params);\n\n try {\n\t$this->success = false;\n\t$this->response = $this->client->edit($params);\n\n\tif ($this->response->editReturn->success == 'true') {\n\t $this->success = true;\n\t}\n\n } catch (Exception $e) {\n\t//print(\"Edit request failed to conform to the WSDL.\\n\");\n\t//print($client->__getLastResponse() . \"\\n\");\n }\n if ($this->success != true) {\n\t$this->response = $this->client->__getLastResponse() . \"\\n\";\n }\n }",
"public function testUpdateDocumentMetadata()\n {\n }",
"public function setMetadataToAdd($val)\n {\n $this->_propDict[\"metadataToAdd\"] = $val;\n return $this;\n }",
"public function setMetadata(EntityMetadata $metadata): void;",
"public function setMetadataMapping(\n ContentType $ct, string $name, string $value ) : Asset\n {\n if( $ct == NULL )\n throw new e\\NullAssetException( \n S_SPAN . c\\M::NULL_CONTENT_TYPE . E_SPAN );\n \n if( $name != self::TAGS && $name != self::CATEGORIES )\n throw new e\\UnacceptableValueException( \n S_SPAN . \"The name $name is not acceptable.\" . E_SPAN );\n \n $links = $this->getConnectorContentTypeLinks();\n \n foreach( $links as $link )\n {\n if( $link->getContentTypeId() == $ct->getId() )\n {\n $link->setMetadataMapping( $name, $value );\n return $this;\n }\n }\n \n throw new \\Exception( \n S_SPAN . \"The content does not exist in the connector.\" . E_SPAN );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides good data for adding aquifers | public function provideGoodCreateAquiferData () {
return [
[array(
'name' => 'Northern Aquifer',
'coordinates' => 'Way up north',
'status' => 'adequate',
'volume' => '1'
)],
[array(
'name' => 'Eastern Aquifer',
'coordinates' => 'Way to the east',
'status' => 'low',
'volume' => '2'
)],
[array(
'name' => 'Southern Aquifer',
'coordinates' => 'Way to the south',
'status' => 'full',
'volume' => '3'
)],
[array(
'name' => 'Western Aquifer',
'coordinates' => 'Way to the south',
'status' => 'critical',
'volume' => '4'
)],
];
} | [
"public function testCreateAquifer() {\n\n $aquiferData = array(\n 'name' => 'vastSea',\n 'coordinates' => '34.5531° N, 18.0480° E',\n 'status' => 'aqequate',\n 'volume' => 1000000000,\n );\n\n $aquiferManagerService = \\Drupal::service('aquifer.aquifer_manager_service');\n $response = $aquiferManagerService->updateAquifer($aquiferData);\n $node = $response->object;\n\n $this->assertEquals('created', $response->status);\n $this->assertEquals($aquiferData['coordinates'], $node->field_aquifer_coordinates->value);\n $this->assertEquals($aquiferData['status'], $node->field_aquifer_status->value);\n $this->assertEquals($aquiferData['volume'], $node->field_aquifer_volume->value);\n }",
"public function add_data();",
"public function __construct() {\n\t\t\t$offerings = array();\n\t\t}",
"protected function buildAudienceData() : array\n {\n // Data container\n $audience = [];\n\n // Add target channnels\n if (!empty($this->getChannels())) {\n $audience['tag'] = $this->getChannels();\n }\n\n // Add target aliases\n if (!empty($this->getAliases())) {\n foreach ($this->getAliases() as $alias) {\n $audience['alias'][] = $alias;\n }\n }\n\n // Add named user targets\n if (!empty($this->getNamedUsers())) {\n foreach ($this->getNamedUsers() as $namedUser) {\n $audience['named_user'][] = $namedUser;\n }\n }\n\n return $audience;\n }",
"public function getAcquirer(){\n return array(self::ACQUIRER_POSITIVI=> ComputopUtils::getLabelText('ACQUIRER_POSITIVI'),self::ACQUIRER_PARIBAS => ComputopUtils::getLabelText('ACQUIRER_PARIBAS'));\n }",
"public function addQA($data){\n\n\t\treturn $this->insert(['question'=>$data['q'], 'answer' => $data['a']]);\n\t}",
"public function provider_add_ma_da() : array\n {\n $question_id =& self::$_dummy_ids['question'];\n $q_question = self::$_dummy_values['question']['question'];\n $q_points = self::$_dummy_values['question']['points'];\n $q_topic =& self::$_dummy_values['question']['topic'];\n $q_type = self::$_dummy_values['question']['type'];\n $ma_answer = self::$_dummy_values['multiple_answer']['answer'];\n $ma_id =& self::$_dummy_ids['multiple_answer'];\n\n $data = [];\n\n $data['ma_add_new'] = [\n 2,\n [\n 'add_answer' => TRUE,\n 'name' => $q_question,\n 'points' => $q_points,\n 'nb_desired_answers' => 1,\n 'nbAnswer' => 1,\n 'reponses' => [['answer' => $ma_answer]],\n 'focus_topic' => &$q_topic,\n 'question_type' => $q_type\n ],\n 1\n ];\n\n $data['ma_add_old'] = [\n 2,\n [\n 'add_answer' => TRUE,\n 'name' => $q_question,\n 'points' => $q_points,\n 'nb_desired_answers' => 1,\n 'nbAnswer' => 1,\n 'reponses' => [[\n 'answer' => $ma_answer,\n 'id' => &$ma_id\n ]],\n 'focus_topic' => &$q_topic,\n 'question_type' => $q_type,\n 'id' => &$question_id\n ],\n 1\n ];\n\n $data['ma_delete_new'] = [\n 2,\n [\n 'del_answer0' => TRUE,\n 'name' => $q_question,\n 'points' => $q_points,\n 'nb_desired_answers' => 1,\n 'nbAnswer' => 1,\n 'reponses' => [['answer' => $ma_answer]],\n 'focus_topic' => &$q_topic,\n 'question_type' => $q_type\n ],\n -1\n ];\n\n $data['ma_delete_old'] = [\n 2,\n [\n 'del_answer0' => TRUE,\n 'name' => $q_question,\n 'points' => $q_points,\n 'nb_desired_answers' => 1,\n 'nbAnswer' => 1,\n 'reponses' => [[\n 'answer' => $ma_answer,\n 'id' => &$ma_id\n ]],\n 'focus_topic' => &$q_topic,\n 'question_type' => $q_type,\n 'id' => &$question_id\n ],\n -1\n ];\n\n $data['ma_delete_not_exist'] = [\n 2,\n [\n 'del_answer5' => TRUE,\n 'name' => $q_question,\n 'points' => $q_points,\n 'nb_desired_answers' => 1,\n 'nbAnswer' => 1,\n 'reponses' => [['answer' => $ma_answer]],\n 'focus_topic' => &$q_topic,\n 'question_type' => $q_type\n ],\n 0\n ];\n\n return $data;\n }",
"public function isAquarius();",
"protected function prepareAdditionalData() {}",
"public function setAtributes(){\n $this->atributes = array('Articulo', 'Tarifa', 'EstadoPedido','Empresa','Dateadd','Precio','Numeroarticulos');\n }",
"public function addAquarium(){\n\n return view('aquarium/add');\n }",
"private function add_additional_info() {\n global $DB;\n\n $answers = $DB->get_records('booking_answers', array('bookingid' => $this->id), 'id');\n $allresponses = array();\n $mainuserfields = user_picture::fields('u', NULL);\n $allresponses = get_users_by_capability($this->context, 'mod/booking:choose', $mainuserfields . ', u.id', 'u.lastname ASC, u.firstname ASC', '', '', '', '', true, true);\n\n foreach ($this->options as $option) {\n\n $count = $DB->get_record_sql('SELECT COUNT(*) AS count FROM {booking_answers} WHERE optionid = :optionid', array('optionid' => $option->id));\n $option->count = (int) $count->count;\n\n if (!$option->coursestarttime == 0) {\n $option->coursestarttimetext = userdate($option->coursestarttime, get_string('strftimedatetime'));\n } else {\n $option->coursestarttimetext = get_string(\"starttimenotset\", 'booking');\n }\n\n if (!$option->courseendtime == 0) {\n $option->courseendtimetext = userdate($option->courseendtime, get_string('strftimedatetime'), '', false);\n } else {\n $option->courseendtimetext = get_string(\"endtimenotset\", 'booking');\n }\n\n // we have to change $taken is different from booking_show_results\n $answerstocount = array();\n if ($answers) {\n foreach ($answers as $answer) {\n if ($answer->optionid == $option->id && isset($allresponses[$answer->userid])) {\n $answerstocount[] = $answer;\n }\n }\n }\n $taken = count($answerstocount);\n $totalavailable = $option->maxanswers + $option->maxoverbooking;\n if (!$option->limitanswers) {\n $option->status = \"available\";\n $option->taken = $taken;\n $option->availspaces = \"unlimited\";\n } else {\n if ($taken < $option->maxanswers) {\n $option->status = \"available\";\n $option->availspaces = $option->maxanswers - $taken;\n $option->taken = $taken;\n $option->availwaitspaces = $option->maxoverbooking;\n } elseif ($taken >= $option->maxanswers && $taken < $totalavailable) {\n $option->status = \"waitspaceavailable\";\n $option->availspaces = 0;\n $option->taken = $option->maxanswers;\n $option->availwaitspaces = $option->maxoverbooking - ($taken - $option->maxanswers);\n } elseif ($taken >= $totalavailable) {\n $option->status = \"full\";\n $option->availspaces = 0;\n $option->taken = $option->maxanswers;\n $option->availwaitspaces = 0;\n }\n }\n if (time() > $option->bookingclosingtime and $option->bookingclosingtime != 0) {\n $option->status = \"closed\";\n }\n if ($option->bookingclosingtime) {\n $option->bookingclosingtime = userdate($option->bookingclosingtime, get_string('strftimedate'), '', false);\n } else {\n $option->bookingclosingtime = false;\n }\n }\n }",
"public function buildPartA()\r\n {\r\n $this->product->add('jian zao A de a fanfa');\r\n\r\n }",
"function Submission_Author_Data()\n {\n return\n array\n (\n \"Title\",\"Name\",\"Institution\",\"Lattes\",\"Email\"\n );\n }",
"function plugin_register_erasers( $erasers = array() ) {\r\n\t\t\t$erasers[] = array(\r\n\t\t\t\t'eraser_friendly_name' => ultimatemember_plugin_name,\r\n\t\t\t\t'callback' => array( &$this, 'data_eraser' )\r\n\t\t\t);\r\n\t\t\treturn $erasers;\r\n\t\t}",
"public function organizeData()\n {\n $this->data = [\n 'date6'=>['value'=> $this->timeData['pay_time']],// 成交时间\n 'character_string1'=>['value'=> $this->checkDataLength($this->order->order_sn,32)],//订单号\n 'thing3'=>['value'=> $this->checkDataLength($this->member->nickname,20)],//购买者\n 'thing4'=>['value'=> $this->checkDataLength($this->goodsTitle,20)],// 购买商品\n 'number5'=>['value'=> $this->goodsNum],// 购买数量\n ];\n }",
"function process_add_aliquots() {\r\n\t\t\r\n\t\t\r\n\t\t// set data for easier access\r\n\t\t$process_data = $_SESSION['ctrapp_core']['datamart']['process'];\r\n\t\t\r\n\t\t// kick out to DATAMART if no BATCH data\r\n\t\tif ( !isset($process_data['AliquotMaster']) || !is_array($process_data['AliquotMaster']) || !count($process_data['AliquotMaster']) ) {\r\n\t\t\t$this->redirect( '/datamart/batch_sets/index/' );\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t// set MENU varible for echo on VIEW\r\n\t\t$this->set( 'ctrapp_menu', array() );\r\n\r\n \t$this->set( 'ctrapp_summary', array() );\r\n \t\t\t\r\n\t\t// set FORM variable, for HELPER call on VIEW\r\n\t\t$ctrapp_form = $this->Forms->getFormArray('orders');\r\n\t\t$this->set( 'ctrapp_form', $ctrapp_form );\r\n\t\t\r\n\t\t// set SIDEBAR variable, for HELPER call on VIEW\r\n\t\t// use PLUGIN_CONTROLLER_ACTION by default, but any ALIAS string that matches in the SIDEBARS datatable will do...\r\n\t\t$this->set( 'ctrapp_sidebar', $this->Sidebars->getColsArray( $this->params['plugin'].'_'.$this->params['controller'].'_'.$this->params['action'] ) );\r\n\t\t\r\n\t\t// Populate Study dropdown from study_summaries table\r\n\t\t$option_criteria = NULL;\r\n\t\t$fields = 'StudySummary.id, StudySummary.title';\r\n\t\t$order = 'StudySummary.title ASC';\r\n\t\t$study_summary_id_findall_result = $this->StudySummary->findAll( $option_criteria, $fields, $order );\r\n\t\t$study_summary_id_findall = array();\r\n\t\tforeach ( $study_summary_id_findall_result as $record ) {\r\n\t\t\t$study_summary_id_findall[ $record['StudySummary']['id'] ] = $record['StudySummary']['title'];\r\n\t\t}\r\n\t\t$this->set( 'study_summary_id_findall', $study_summary_id_findall );\t\t\r\n\t\t\r\n\t\t// get DATA for LISTALL form\r\n\t\t\r\n\t\t$criteria = 'Order.processing_status NOT IN (\"completed\") OR Order.processing_status IS NULL';\r\n\t\t$no_pagination_order = 'short_title ASC';\r\n\t\t\r\n\t\tlist( $order, $limit, $page ) = $this->Pagination->init( $criteria );\r\n\t\t$this->set( 'orders', $this->Order->findAll( $criteria, NULL, $no_pagination_order, $limit, $page, 0, 2 ) );\r\n\t\t\r\n\t}",
"function AddEventQuestDatas()\n {\n $event=$this->Event();\n \n if (empty($event[ \"ID\" ])) { return; }\n if (!method_exists($this,\"DatasObj\")) { return; }\n\n $this->DatasObj()->Sql_Table_Structure_Update();\n $this->ReadDBData\n (\n $this->DatasObj()->Sql_Select_Hashes\n (\n array\n (\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => 1,\n ),\n array(),\n array(\"SortOrder\",\"ID\")\n )\n );\n }",
"private function set_data() {\r\n $params = array();\r\n $coefs = array();\r\n foreach ($this->groups as $group) {\r\n foreach ($group['items'] as $item => $type) {\r\n if ($type) {\r\n $params[] = $item;\r\n } else {\r\n $coefs[] = $item;\r\n }\r\n }\r\n }\r\n $this->coefs = $coefs;\r\n $this->params = $params;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test issue prescription method | public function testIssuePrescription() {
$user = User::where('role_id', 1)->first();
$patient = $user->clinic->patients()->first();
$prescription = $patient->prescriptions()->where('issued', false)->first();
$drugs = [];
foreach ($prescription->prescriptionDrugs()->get() as $d) {
$drugs[] = ['id' => $d->id, 'issuedQuantity' => 20];
}
$this->actingAs($user)
->json('POST', 'API/issuePrescription', [
'prescription' => [
'id' => $prescription->id,
'payment' => 100,
'paymentRemarks' => 'None',
'prescription_drugs' => $drugs
]
])
->seeJson(['status' => 1]);
} | [
"public function test_createDisputeEvidenceText() {\r\n\r\n }",
"public function testPostConsignment()\n {\n }",
"public function testPostReplenishment()\n {\n }",
"public function testPurchasesEmailDocumentPost()\n {\n }",
"public function test_acceptDispute() {\r\n\r\n }",
"public function test_submitEvidence() {\r\n\r\n }",
"public function testExpenseReceiptPost()\n {\n }",
"public function testFailInvoice()\n {\n }",
"public function testCreditNoteCreateCreditNote()\n {\n }",
"public function testSubmission()\n {\n }",
"public function testBillingNotesEmailDocumentPost()\n {\n }",
"public function testInvoiceSubmit()\n {\n }",
"public function testStorePurchaseOrderNote()\n {\n }",
"public function testProcurementAdjustmentsPost()\n {\n\n }",
"public function testProcurementRmaActionsPost()\n {\n\n }",
"public function testManualSettle()\n {\n }",
"public function testTranslationReview()\n {\n }",
"public function testExecutePurchaseRtoken()\n {\n }",
"public function testGetReplenishments()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the max speed in mph | public function getMaxSpeedInMPH() {
return Converter::convertMetresPerSecondToMilesPerHour($this->getMaxSpeed());
} | [
"public function getMaxSpeed()\n {\n return $this->max_speed;\n }",
"public function getMaxSpeed()\n {\n return $this->maxSpeed;\n }",
"public function getMaxSpeed()\n {\n return $this->car->getMaxSpeed() * 0.9;\n }",
"public function getMaxSpeedInKPH() {\n return Converter::convertMetresPerSecondToKilometresPerHour($this->getMaxSpeed());\n }",
"public function getMaxSpeed() : int\n {\n return $this->get('max_speed', 'cars');\n }",
"public function getSpeed() {\n $speed = $GLOBALS['max_speed_mph']*(1-$this->getCarSize()/(2000*$this->distance));\n return $speed;\n if($this->getCarSize() == 0)\n return $GLOBALS['max_speed_mph'];\n $v = $this->getCarsPerHour();\n $d = $this->getCarSize() / $this->distance;\n $s = $v / $d;\n return $s > $GLOBALS['max_speed_mph'] ? $GLOBALS['max_speed_mph'] : $s;\n }",
"public function getMaxSpeed() {\n $max = 0;\n\n foreach ($this->laps as $lap) {\n if ($lap->getMaxSpeed() > $max) {\n $max = $lap->getMaxSpeed();\n }\n }\n\n return $max;\n }",
"public function maxSpeedTrackPoint()\n {\n $max_speed = 0;\n\t $max_speed_track_point = $this->track_points[0];\n\t foreach ($this->track_points as $track_point){\n\t if($track_point->speed > $max_speed) {\n\t $max_speed = $track_point->speed;\n\t $max_speed_track_point = $track_point;\n\t }\n\t }\n\t return $max_speed_track_point;\n }",
"function maxSpeed()\n {\n }",
"public function getMaxMph()\n\t{\n\t\treturn $this->attributes->acceleration;\n\t}",
"public function getMaxUnitsPerSecond()\n {\n return $this->max_units_per_second;\n }",
"public function getSpeed()\n {\n return $this->speed;\n }",
"public function getSpeed()\r\n {\r\n return $this->speed;\r\n }",
"public function getSpeed()\n\t{\n\t\treturn $this->speed;\n\t}",
"function getSpeed() { \n return $this->currentspeed;\n }",
"public function getMaxVelocity()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_MAX_VELOCITY, $payload);\n\n $payload = unpack('v1velocity', $data);\n\n return $payload['velocity'];\n }",
"public function getSpeed(){\n return $this->speed;\n }",
"public function getSpeedKmH()\n {\n return $this->speedKmH;\n }",
"public function getSpeed() {\n\t\treturn 1.1;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load first name value from wordpress field for profile edit | function users_acf_load_value_first_name( $value, $post_id, $field )
{
if(is_user_logged_in() ){
$current_user = wp_get_current_user();
return $current_user->first_name;
}
} | [
"function travomath_admin_profile_name_callback() {\n $firstName = esc_attr( get_option( 'first_name' ) );\n\t$lastName = esc_attr( get_option( 'last_name' ) );\n\techo '<input type=\"text\" name=\"first_name\" value=\"'.$firstName.'\" placeholder=\"First Name\" /> <input type=\"text\" name=\"last_name\" value=\"'.$lastName.'\" placeholder=\"Last Name\" />';\n}",
"function filterRPS_GF_populate_first_name($value)\n{\n global $user_ID;\n\n if (is_user_logged_in() && rps_is_paid_member($user_ID)) {\n $user = get_user_by('id', $user_ID);\n $value = $user->user_firstname;\n }\n\n return $value;\n}",
"function get_user_firstname($user_id) {\n\t\t\treturn get_user_meta( $user_id, 'first_name', true );\n\t}",
"public function getProfileFirstNameAttribute()\n {\n return data_get($this->profile, 'first_name');\n }",
"public function getFirstname() {\n return $this->getValue('firstname');\n }",
"function sh_custom_user_name_callback() {\n $userName = esc_attr( get_option( 'user_name' ) );\n echo '<input type=\"text\" name=\"user_name\" value=\"'.$userName.'\" placeholder=\"Full Name\" />';\n}",
"function getUserFirstName() {\n\t\tglobal $userInformation;\n\t\t\n\t\treturn $userInformation['first_name'];\n\t}",
"function filterRPS_GF_populate_last_name($value)\n{\n global $user_ID;\n\n if (is_user_logged_in() && rps_is_paid_member($user_ID)) {\n $user = get_user_by('id', $user_ID);\n $value = $user->user_lastname;\n }\n\n return $value;\n}",
"function getFirst_Name()\r\n\t{\r\n \t$user = $this->loadUser(Yii::app()->user->id);\r\n \tif($user!==null)\r\n \treturn $user->first_name;\r\n \t}",
"public function getFirstname() {\n $firstname = $this->userdetails['firstname'];\n return $firstname;\n }",
"public function assign_logged_in_user_name(){\r\n\r\n\t\t$user = wp_get_current_user();\r\n\t\t$name = $user->first_name;\t\t\r\n\t\treturn $name;\r\n\t}",
"function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}",
"public function getProfileFirstName() {\n\t\treturn($this->profileFirstName);\n\t}",
"function getFirstname()\n\t{\n\t\t$this->uid = $this->getUser();\n\t\t$ret = self::getAttribute($this->uid, 'givenname');\n\t\treturn $ret[0];\n\t}",
"function getFirst_Name(){\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->first_name;\n }",
"public function getProfileFirstName(): string {\n\t\treturn ($this->profileFirstName);\n\t}",
"function getEditorFirstName() {\n\t\treturn $this->getData('editorFirstName');\n\t}",
"public static function getFirstname() {\n $context = new tx_lib_context();\n $FE = $context->getFrontEnd();\n $userArr = $FE->fe_user->user;\n\n return (empty($userArr['firstname'])) ? 'anonymous' : $userArr['firstname'];\n }",
"public function getUser_firstname()\n {\n return $this->user_firstname;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the IndoorHistory model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = IndoorHistory::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected function findModel($id)\n {\n if (($model = AllocationHistory::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = LocationHistory::find()->where(['id' => $id])->with('package', 'site')->asArray()->one()) !== null) {\n return $model;\n } else {\n Yii::$app->response->format = 'json';\n Yii::$app->response->setStatusCode(404);\n Yii::$app->response->data = ['message' => 'Record not found'];\n Yii::$app->response->send();\n }\n }",
"protected function findModel($id_riwayat)\n {\n if (($model = Riwayat::findOne($id_riwayat)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = AeExtTickerTrade::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = MessageHistoryRecord::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n if (($model = ScoreHistory::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n\t\tif (($model = Homes::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = Timetable::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($id)\n {\n if (($model = HistoryBalance::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n \t$model = TravelLog::find()->where(['guid' => $id])->one();\n if ($model !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = EdmSendHistory::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PostHistory::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = OpeningHours::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Page::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = DesktopLog::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('yiiplus/desktop', '请求的页面不存在'));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of prezime | public function setPrezime($prezime)
{
$this->prezime = $prezime;
return $this;
} | [
"public function getPrezime()\n {\n return $this->prezime;\n }",
"public function set_preco( $preco ) : void {\n\n $this->preco = $preco;\n \n }",
"public function setPreu($preu)\n{\n$this->preu = $preu;\n\nreturn $this;\n}",
"public function testSetProratise() {\n\n $obj = new BonTravPrev();\n\n $obj->setProratise(true);\n $this->assertEquals(true, $obj->getProratise());\n }",
"public function testSetPrecompte() {\n\n $obj = new SalairesAttestation();\n\n $obj->setPrecompte(10.092018);\n $this->assertEquals(10.092018, $obj->getPrecompte());\n }",
"public function testSetHorairePrevu() {\n\n $obj = new Previsionnel();\n\n $obj->setHorairePrevu(10.092018);\n $this->assertEquals(10.092018, $obj->getHorairePrevu());\n }",
"public static function setPointValue()\n\t{\n\t\tself::$value = (include \"bootstrap/values.php\")[self::getConfiguration()[\"pointValue\"]];\n\t}",
"public function _setPrecio($Precio)\n\t {\n\t $this->Precio = $Precio;\n\t }",
"function setPreRingTime($exten,$follow_me_prering_time) {\n\t\t$this->FreePBX->astman->database_put('AMPUSER', \"$exten/followme/prering\", $follow_me_prering_time);\n\t}",
"public function testSetRrPris() {\n\n $obj = new PrepaPaie();\n\n $obj->setRrPris(10.092018);\n $this->assertEquals(10.092018, $obj->getRrPris());\n }",
"public function getPreu()\r\n {\r\n return $this->preu;\r\n }",
"public function setHorairePrevu(?float $horairePrevu): PrepaPaie {\n $this->horairePrevu = $horairePrevu;\n return $this;\n }",
"public function setPrioridade($pri) {\n $this->prioridade = $pri; \n }",
"public function setOpPrestCiestim($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_string($v)){\n $v = str_replace(\n array(' ',','),\n array('','.'),\n $v\n );\n }\n \n if(is_numeric($v)) {\n $v = (float) $v;\n }\n }\n if ($this->op_prest_ciestim !== $v) {\n $this->op_prest_ciestim = $v;\n $this->modifiedColumns[] = OperationPrestationsPeer::OP_PREST_CIESTIM;\n }\n\n\n return $this;\n }",
"abstract public function setPointValue($value);",
"public function testSetHMajoPris() {\n\n $obj = new PrepaPaie();\n\n $obj->setHMajoPris(10.092018);\n $this->assertEquals(10.092018, $obj->getHMajoPris());\n }",
"public function setRamSpikeTimeScore(?int $value): void {\n $this->getBackingStore()->set('ramSpikeTimeScore', $value);\n }",
"public function setVat($value);",
"public function setPretext($pretext)\n {\n $this->_pretext = $pretext;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the montant annuel5. | public function getMontantAnnuel5(): ?float {
return $this->montantAnnuel5;
} | [
"public function getMontantBPlaf5() {\n return $this->montantBPlaf5;\n }",
"public function getMontantSommeIsolPlaf5() {\n return $this->montantSommeIsolPlaf5;\n }",
"public function setMontantAnnuel5($montantAnnuel5) {\n $this->montantAnnuel5 = $montantAnnuel5;\n return $this;\n }",
"public function getMontantAnnuel() {\n return $this->montantAnnuel;\n }",
"public function getMontant()\n {\n return $this->montant;\n }",
"public function getMontant()\n {\n return $this->montant;\n }",
"public function getMontant()\n {\n return $this->montant;\n }",
"public function getAptmplusmonths5()\n {\n return $this->aptmplusmonths5;\n }",
"public function getMontantAmortissement() {\n return $this->montantAmortissement;\n }",
"public function getMontantAcompte() {\n return $this->montantAcompte;\n }",
"public function getArticleAttitude5()\n {\n return $this->article_attitude_5;\n }",
"public function getMontantAnnuel2() {\n return $this->montantAnnuel2;\n }",
"public function getArcusale24mo5()\n {\n return $this->arcusale24mo5;\n }",
"public function getMontant()\n {\n return $this->Montant;\n }",
"public function getMontantAutre31() {\n return $this->montantAutre31;\n }",
"public function getMontantAvantage() {\n return $this->montantAvantage;\n }",
"public function getMetNumInyeccionEstandar6()\n\t{\n\t\treturn $this->met_num_inyeccion_estandar_6;\n\t}",
"public function getMontant_vente()\n {\n return $this->montant_vente;\n }",
"public function getMttAnnee() {\n return $this->mttAnnee;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ checks if a passed webElement is a lookup or a normal dropdown | protected function _isLookup($element) {
//at the moment, determining by class="noselection" in hidden input seems best option
if(strpos($element->getAttribute('id'), '-ac') !== false) {
return true;
}
return false;
} | [
"public function isDropdown();",
"public function hasDropDown() {}",
"public function isDropdown() : bool\n {\n return $this->getFieldType() == c\\T::DROPDOWN;\n }",
"public function isDropdown()\n {\n return is_array($this->route);\n }",
"public function isDropDown()\n {\n return false;\n }",
"public function testCaseDropDown()\n {\n $this->open('http://www.achievers.com/resource/');\n\n $select = $this->getSelectOptions('id=resource_search_contenttype');\n //var_dump($select);\n $this->select('id=resource_search_contenttype', $select[2]);\n $this->pause(3000);\n\n //check heading if I am searching the right tag\n $this->assertSelectedLabel('id=resource_search_contenttype', $select[2]);\n\n //check if the search result tag contains 'Case Study'\n for($i = 1; $i <= 3; $i++)\n {\n if($this->isElementPresent('//*[@id=\"asset_list\"]/div/div[2]/div[' . $i . ']'))\n {\n $this->assertElementContainsText('//*[@id=\"asset_list\"]/div/div[2]/div[' . $i . ']', $select[2]);\n }\n else\n {\n break;\n }\n }\n\n //check url if type matches the current search\n $this->assertLocation('*Case*Study*');\n\n $this->close();\n }",
"public function hasDropDown()\n {\n return false;\n }",
"public function hasDropDown() {\n\t\treturn TRUE;\n\t}",
"public function should_exist_in_current_page_administration($element, $selectortype) {\n $nodes = array_map('trim', explode('>', $element));\n $nodetext = end($nodes);\n\n // Find administration menu.\n $rootxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true);\n $menuxpath = $rootxpath . '/p/../ul[1]';\n\n for ($i = 0; $i < (count($nodes) - 1); $i++) {\n $menuxpath .= \"/li/p/span[contains(text(), '{$nodes[$i]}')]/../../ul[1]\";\n }\n\n if ($selectortype == 'link') {\n $menuxpath .= \"/li/p[a[contains(text(), '{$nodetext}')]\";\n $menuxpath .= \"|a/span[contains(text(), '{$nodetext}')]]\";\n } else {\n $menuxpath .= \"/li/p/span[contains(text(), '{$nodes[$i]}')]\";\n }\n\n $exception = new ElementNotFoundException($this->getSession(), \"\\\"{$element}\\\" \\\"{$selectortype}\\\"\");\n $this->find('xpath', $menuxpath, $exception);\n }",
"function _webform_tree_dropdown_validate(&$element, &$form_state) {\n\n $wftdid = $element['wftdid']['#value'];\n\n\n // Set the proper return value. I.e. instead of returning all the values\n // that are used for making the hierarchical_select form element type work,\n // we pass a flat array of item ids. e.g. for the taxonomy module, this will\n // be an array of term ids. If a single item is selected, this will not be\n // an array.\n // If the form item is disabled, set the default value as the return value,\n // because otherwise nothing would be returned (disabled form items are not\n // submitted, as described in the HTML standard).\n if (isset($element['#disabled']) && $element['#disabled']) {\n $element['#return_value'] = $element['#default_value'];\n }\n /*echo '<pre>';\n print_r($form_state['node']);\n exit();*/\n \n $element['#value'] = $element['#return_value'];\n form_set_value($element, $element['#value'], $form_state);\n\n // We have to check again for errors. This line is taken litterally from\n // form.inc, so it works in an identical way.\n if ($element['#required'] &&\n (!count($element['#value']) || (is_string($element['#value']) && strlen(trim($element['#value'])) == 0))) {\n form_error($element, t('!name field is required.', array('!name' => $element['#title'])));\n _webform_tree_dropdown_form_set_error_class($element);\n }\n}",
"public function openDropdownOptions(): void\n {\n $select2link = $this->tc->wd->wait()->until(\n WebDriverExpectedCondition::presenceOfElementLocated(\n WebDriverBy::cssSelector($this->select2Selector . ' ' . ($this->isMultiple() ? 'input' : 'a'))\n )\n );\n\n // Click on element to open dropdown - to copy users behavior\n $select2link->click();\n }",
"public function testWhitepaperDropDown()\n {\n $this->open('http://www.achievers.com/resource/');\n\n $select = $this->getSelectOptions('id=resource_search_contenttype');\n //var_dump($select);\n $this->select('id=resource_search_contenttype', $select[5]);\n $this->pause(3000);\n\n //check heading if I am searching the right tag\n $this->assertSelectedLabel('id=resource_search_contenttype', $select[5]);\n\n //check if the search result tag contains 'Whitepaper'\n for($i = 1; $i <= 3; $i++)\n {\n if($this->isElementPresent('//*[@id=\"asset_list\"]/div/div[2]/div[' . $i . ']'))\n {\n $this->assertElementContainsText('//*[@id=\"asset_list\"]/div/div[2]/div[' . $i . ']', $select[5]);\n }\n else\n {\n break;\n }\n }\n\n //check url if type matches the current search\n $this->assertLocation('*Whitepaper*');\n\n $this->close();\n }",
"public function testFieldContainsTreeDropdownField()\n {\n $field = new DMSDocumentAddExistingField('Test', 'Test');\n $this->assertContainsOnlyInstancesOf('TreeDropdownField', $field->getChildren());\n $this->assertSame('PageSelector', $field->getChildren()->first()->getName());\n }",
"public static function validateWebformEntityReferenceSelectWidget(&$element, FormStateInterface $form_state, &$complete_form) {\n // Below prevents the below error.\n // Fatal error: Call to a member function uuid() on a non-object in\n // core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php.\n $value = (!empty($element['#value'])) ? $element['#value'] : NULL;\n $form_state->setValueForElement($element, $value);\n }",
"function open_select_must_be($val){\n\t\t\tif ($val=='obbligatorio')\n\t\t\t $testo=$this->testo;\n\t\t\t $testo=preg_replace(\"/<(.*?)>/\", \"\", $testo);\n\t\t\t $testo=preg_replace(\"/'/\", \"/\\/'/\", $testo);\n\t\t\t\t$this->controlli.=\"if (document.forms[0].\".$this->attributes['VAR'].\".value!='\".$val.\"') {alert ('\".$testo.\" must be \".$this->values[$val].\"'); return false}\\n\";\n\t\t}",
"public function validate_dropdown($str)\n\t{\n\t\tif ($str == 'Pilih')\n\t\t{\n\t\t\t$this->form_validation->set_message('validate_dropdown', 'Silahkan pilih %s terlebih dahulu');\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 test_action_logic_row_dropdown_field_values() {\n\t\tlist( $field_name, $meta_name, $new_field ) = $this->initialize_action_logic_variables( 'uc580i' );\n\n\t\t$dropdown = $this->get_action_logic_dropdown( $field_name, $meta_name, $new_field, 'Blue' );\n\n\t\t$opening_tag = '<select name=\"' . $field_name . '\">';\n\t\t$first_option = '<option value=\"\"></option>';\n\t\t$last_option = '<option value=\"Purple\">Purple</option>';\n\t\t$selected_option = '<option value=\"Blue\" selected=\\'selected\\'>Blue</option>';\n\t\t$closing_tag = '</select>';\n\t\t$option_number = 5;\n\n\t\t$this->assertContains( $opening_tag, $dropdown );\n\t\t$this->assertContains( $closing_tag, $dropdown );\n\t\t$this->assertContains( $first_option, $dropdown );\n\t\t$this->assertContains( $last_option, $dropdown );\n\t\t$this->assertContains( $selected_option, $dropdown );\n\t\t$this->assertSame( $option_number, substr_count( $dropdown, '<option' ) );\n\t}",
"function _custom_module_text_source_machine_exists($element, &$form_state) {\n $exists = FALSE;\n if ($element == '1234') {\n $exists = TRUE;\n }\n return $exists;\n}",
"public function isElementSelector()\n {\n return (!($this->isId) && !($this->isClass));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endLog() the implementing class must do any footer or related end of logging functions. | abstract protected function endLog(); | [
"function endLogging(){}",
"function end() {\n fclose($this->_log_handle);\n }",
"public function logEnd()\n {\n $this->end = microtime(true);\n }",
"function log_end() {\n\t\t$t = microtime(true) - $this->ts_start;\n\t\t$this->output_log_item( array(\"total_time\" => $t) );\n\n\t\t$this->current_section = null;\n\t}",
"abstract public function closeLog();",
"function closelog () {}",
"function closelog() {}",
"public function end()\n {\n }",
"public static function endLog()\n\t{\n\t\treturn self::$_aLogs;\n\t}",
"public function end($logging_key) {\n unset($this->queryLog[$logging_key]);\n }",
"public function logclose() \n\t\t{\n\t\t\tfclose($this->fp);\n\t\t}",
"public function onShutdown()\n {\n if ($this->logger instanceof Logger) {\n $this->logger->flushBuffer();\n }\n }",
"public function close()\n {\n parent::close();\n\n if ($this->opened) {\n closelog();\n $this->opened = false;\n }\n }",
"public function __destruct()\n {\n LogUtil::close();\n }",
"function logoutLog()\n{\n\t//execute audit, store logout log\n\texecuteAudit('logout');\n}",
"public function endOutput();",
"public function finish() {\n if (!$this->finished) {\n $this->logger->unCatchMessages($this);\n $this->end_time = microtime(TRUE);\n $this->finished = TRUE;\n $this->save();\n }\n }",
"public function clear_log();",
"public function flushLogs()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Feeds Table A table of configured feeds we will pull on each cron run or drush command. Each feed can be tied to a specific feed account above. | function tweet_feed_feeds_table() {
// Set up the right breadcrumbs
$breadcrumbs = array();
$breadcrumbs[] = l('Home', '<front>');
$breadcrumbs[] = l('Administration', 'admin');
$breadcrumbs[] = l('Configuration', 'admin/config');
$breadcrumbs[] = l('Web Services', 'admin/config/services');
$breadcrumbs[] = l('Tweet Feed Feeds', 'admin/config/services/tweet_feed/feeds');
drupal_set_breadcrumb($breadcrumbs);
$rows = array();
$header = array(
'feed_name' => array('data' => t('Feed name'), 'style' => 'text-align: center;'),
'feed_type' => array('data' => t('Type'), 'style' => 'text-align: center;'),
'feed_criteria' => array('data' => t('Feed Criteria'), 'style' => 'text-align: center;'),
'number_per_pull' => array('data' => t('# Per Pull'), 'style' => 'text-align: center;'),
'new_window' => array('data' => t('New Window'), 'style' => 'text-align: center;'),
'truncate' => array('data' => t('Truncate'), 'style' => 'text-align: center;'),
'edit' => array('data' => t('Edit'), 'style' => 'text-align: center;'),
'delete' => array('data' => t('Delete'), 'style' => 'text-align: center;'),
'import' => array('data' => t('Import'), 'style' => 'text-align: center;'),
);
$result = db_query('SELECT * FROM {tweet_feeds} ORDER BY feed_name ASC');
while ($data = $result->fetchObject()) {
switch ($data->query_type) {
case QUERY_SEARCH:
$query_type = 'Timeline Search';
$feed_criteria = $data->search_term;
break;
case QUERY_TIMELINE:
$query_type = 'User Timeline';
$feed_criteria = $data->timeline_id;
break;
case QUERY_LIST:
$query_type = 'User List';
$feed_criteria = $data->timeline_id . '/' . $data->list_name;
break;
default:
$query_type = t('Unknown');
$feed_criteria = t('Unknown');
}
$row = array();
$row[] = $data->feed_name;
$row[] = (array('data' => $query_type, 'align' => 'center'));
$row[] = (array('data' => $feed_criteria, 'align' => 'center'));
$row[] = (array('data' => $data->pull_count, 'align' => 'center'));
$row[] = (array('data' => $data->clear_prior, 'align' => 'center'));
$row[] = (array('data' => $data->new_window, 'align' => 'center'));
$row[] = (array('data' => l(t('Edit'), 'admin/config/services/tweet_feed/feeds/edit/' . $data->fid), 'align' => 'center'));
$row[] = (array('data' => l(t('Delete'), 'admin/config/services/tweet_feed/feeds/delete/' . $data->fid), 'align' => 'center'));
$row[] = (array('data' => l(t('Import'), 'admin/config/services/tweet_feed/feeds/run/' . $data->fid), 'align' => 'center'));
$rows[] = $row;
}
if (count($rows) == 0) {
$rows = array(
array(
'data' => array(array('align' => 'center', 'colspan' => 8, 'data' => t('THERE ARE CURRENTLY NO CONFIGURED TWITTER FEEDS.')))
),
);
}
$output = theme('table', array('header'=>$header, 'rows' => $rows));
return $output;
} | [
"public function generateFeedsAll()\n {\n $this->generateFeeds();\n }",
"public function feeds()\n {\n $sql =\n \"SELECT f.*, COUNT(m.id) > 0 AS active, COUNT(m.id) AS total_active, COUNT(m2.id) AS total_sent\n FROM {$this->tables['feed']} f\n LEFT JOIN {$this->tables['messagedata']} md ON f.url = md.data AND md.name = 'rss_feed'\n LEFT JOIN {$this->tables['message']} m ON md.id = m.id AND m.status NOT IN ('sent', 'prepared', 'suspended')\n LEFT JOIN {$this->tables['message']} m2 ON md.id = m2.id AND m2.status IN ('sent')\n GROUP BY f.id, f.url, f.etag, f.lastmodified\n ORDER BY active DESC, f.id\n \";\n\n return $this->dbCommand->queryAll($sql);\n }",
"public function actionListFeeds()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => ImportFeed::find(),\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 500,\n\t\t\t],\n ]);\n\n return $this->render('list_feeds', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getListFeeds()\n {\n $crumbs = [\n trans('admin/dashboard.dashboard') => 'cp',\n 'Manage ' . trans('admin/program.programs') => 'contentfeedmanagement',\n 'List ' . trans('admin/program.programs') => '',\n ];\n $viewmode = Input::get('view', 'desktop');\n $relfilter = Input::get('relfilter', 'nonassigned');\n $from = Input::get('from', 'none');\n $relid = Input::get('relid', 'none');\n $subtype = Input::get('subtype', 'all');\n $filters = Input::get('filters', 'all');\n $program_type = Input::get('program_type', 'all');\n\n $field = Input::get('field', 'relations.active_user_feed_rel');\n if ($viewmode == 'iframe') {\n $this->layout->breadcrumbs = '';\n $this->layout->pagetitle = '';\n $this->layout->pageicon = '';\n $this->layout->pagedescription = '';\n $this->layout->header = '';\n $this->layout->sidebar = '';\n $this->layout->content = view('admin.theme.promocode.__list')\n ->with('relfilter', $relfilter)\n ->with('from', $from)\n ->with('subtype', $subtype)\n ->with('field', $field)\n ->with('filters', $filters)\n ->with('program_type', $program_type)\n ->with('relid', $relid);\n $this->layout->footer = '';\n } else {\n $this->layout->breadcrumbs = Common::getBreadCrumbs($crumbs);\n $this->layout->pagetitle = 'Manage ' . trans('admin/program.programs');\n $this->layout->pageicon = 'fa fa-rss';\n $this->layout->pagedescription = 'Manage ' . trans('admin/program.programs');\n $this->layout->header = view('admin.theme.common.header');\n $this->layout->sidebar = view('admin.theme.common.sidebar')\n ->with('mainmenu', 'contentfeeds')\n ->with('submenu', 'listcontentfeeds');\n $this->layout->content = view('admin.theme.programs.listcontentfeed');\n $this->layout->footer = view('admin.theme.common.footer');\n }\n }",
"function refreshAllFeeds(){\n $conn = new Sgbd();\n $feeds = $conn->selectFromDB(\"all\", \"feeds\", array(\"*\"), array());\n foreach($feeds as $feed){\n self::refreshFeed($feed['id']);\n }\n }",
"public function getAllFeeds()\n {\n $response = array();\n $activitiesUrls = $this->_config->getActivitiesUrlsArray();\n foreach ($activitiesUrls as $snName => $url) {\n $response[$snName] = $this->_doRequest($url);\n }\n\n return $response;\n }",
"function fetchFeeds() {\n $feeds = array();\n $result = $this->db->query(\"SELECT * FROM feeds\");\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n array_push($feeds, $row);\n }\n return $feeds;\n }",
"public static function getAllFeeds()\n\t{\n\t\treturn static::getStore();\n\t}",
"public function ddl_feeds()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"SELECT feed_id, \r\n\t\t\t\t\t\t\tfeed_name,\r\n\t\t\t\t\t\t\tfeed_type \r\n\t\t\t\t\t\tFROM feeds\";\r\n\t\t\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\r\n\t\t\t\t$feeds = array();\r\n\t\t\t\t$arr_feed = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($result)) {\r\n\t\t\t\t\t\t$feeds['feed_id'] = $row[0];\r\n\t\t\t\t\t\t$feeds['feed_name'] = $row[1];\r\n\t\t\t\t\t\t$feeds['feed_type'] = $row[2];\r\n\t\t\t\t\t\t$arr_feed[] = $feeds;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $arr_feed;\r\n\t\t}",
"public function feeds()\n {\n $feeds = $this->source->getFeedList();\n\n return $this->apiResponse($feeds);\n }",
"public function userFeedsView()\n {\n return view( '_admin.user-feeds' )->with( [\n 'feeds' => Feed::where( 'user_id', vp_get_current_user_id() )->paginate( $this->settings->getSetting( 'posts_per_page' ) ),\n ] );\n }",
"public function index() {\n\t\t$feeds = $this->Feed->find(\n\t\t\t'all',\n\t\t\tarray(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'Feed.id',\n\t\t\t\t\t'Feed.name',\n\t\t\t\t\t'Feed.slug',\n\t\t\t\t\t'Feed.description',\n\t\t\t\t\t'Feed.plugin',\n\t\t\t\t\t'Feed.controller'\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Feed.active' => 1,\n\t\t\t\t\t//'Feed.group_id >= ' => $this->Auth->user('group_id')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->set(compact('feeds'));\n\t}",
"function drush_tweet_feed_tf_import_tweets() {\n $fid = drush_get_option('fid');\n $all = drush_get_option('all');\n $run = FALSE;\n \n // If we have not specified anything, present a list of available configured feeds to\n // update. Of course, if we only have one feed, then just roll with that\n if (empty($fid) && empty($all)) {\n // If we have one, then roll with it, if we have more, then present a list\n $result = db_query(\"SELECT fid, feed_name, query_type FROM {tweet_feeds}\n ORDER BY feed_name\");\n if ($result->rowCount() > 1) {\n $option = array();\n while ($fdata = $result->fetchObject()) {\n switch ($fdata->query_type) {\n case 1:\n $query_type = 'Search';\n break;\n case 2:\n $query_type = 'Timeline';\n break;\n case 3: \n $query_type = 'List';\n break;\n }\n $option[$fdata->fid] = $fdata->feed_name . ' (' . $query_type . ')';\n }\n \n $choice = drush_choice($option, dt('Which feed would you like to input?')); \n if ($choice && array_key_exists($choice, $option)) {\n tweet_feed_process_feed($choice);\n $run = TRUE;\n }\n else {\n tweet_feed_set_message('Unable to process feed. Illegal feed id specified.', 'fatal');\n $run = TRUE;\n \n }\n }\n else {\n $feed = $result->fetchObject();\n tweet_feed_process_feed($feed->fid);\n $run = TRUE;\n }\n }\n\n // If we're processing all, then pass null to the feeds processor \n if (!empty($all) && $run == FALSE) {\n tweet_feed_process_feeds(NULL);\n $run = TRUE;\n }\n \n if ($run == FALSE) { \n $fid = (!empty($fid)) ? $fid : NULL;\n tweet_feed_process_feed($fid);\n }\n}",
"public function feeds()\n {\n // require authentication\n // check_authentication();\n\n $where = array(\n 'sa.Status = 2'\n );\n\n if (get_post('latest')) {\n $where[] = 'sa.DateCompleted > \"' . date('Y-m-d H:i:s', get_post('latest')) . '\"';\n }\n\n if (get_post('department')) {\n $where[] = 'ss.DepartmentID = \"' . (int) get_post('department') . '\"';\n }\n\n if (get_post('locScope')) {\n $where[] = 'ss.LocationScopeID = \"' . (int) get_post('locScope') . '\"';\n }\n\n if (get_post('keyword')) {\n $keyword = $this->db->escape_like_str(get_post('keyword'));\n $where[] = '(ss.Name LIKE \"%'.$keyword.'%\" OR ss.Description LIKE \"%'.$keyword.'%\")'; \n }\n\n $raw_feeds = $this->mgovdb->getFeeds($where);\n\n $feeds = array();\n $providedCounts = array();\n\n foreach ($raw_feeds as $v) {\n\n $userData = user_account_details($v['ApplicantID'], 'id');\n\n $v['userFullname'] = user_full_name($userData, '');\n $v['userAddress'] = user_full_address($userData);\n $v['userAvatar'] = public_url('assets/profile/') . photo_filename($userData->Photo);\n if ($v['SubDepartmentID']) {\n $v['departmentName'] = lookup_db('Dept_ChildDepartment', 'Name', $v['SubDepartmentID']);\n } else {\n $v['departmentName'] = lookup_db('Dept_Departments', 'Name', $v['DepartmentID']);\n }\n $v['serviceDate'] = date('F d, Y', strtotime($v['DateCompleted']));\n $v['Logo'] = public_url('assets/logo/') . logo_filename($v['Logo']);\n $v['serviceQR'] = public_url('assets/qr/') . get_qr_file($v['ServiceCode'], 4);\n\n $providedCounts[$v['DepartmentID']] = get_department_service_provided($v['DepartmentID'], $providedCounts);\n $v['serviceProvided'] = number_format($providedCounts[$v['DepartmentID']]);\n $v['serviceProvider'] = get_service_providers($v['ServiceID'], true);\n\n $feeds[] = $v;\n\n }\n\n if (count($feeds)) {\n response_json(array(\n 'status' => true,\n 'timestamp' => time(),\n 'data' => $feeds\n ));\n } else {\n response_json(array(\n 'status' => false,\n 'message' => 'No new items found.'\n ));\n }\n\n }",
"private function update_feeds() {\n\t\t// Retrieve feeds\n\t\t$rows = $this->get_feeds();\n\t\tif($rows) {\n\t\t\t$time = time();\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$feed = $row['feed'];\n\t\t\t\t$checkdate = $row['date'];\n\t\t\t\t$query = urldecode($row['query']);\n\t\t\t\t$id = array_pop(explode('/', $feed));\n\t\t\t\t$rss = $this->make_feed($query, $id, $time, $checkdate);\n\t\t\t\t// Updated ?\n\t\t\t\tif($rss) {\n\t\t\t\t\t// Update the date\n\t\t\t\t\t$delete = \"DELETE FROM <\".BASENAME.\"/feeds> { <$rss> dc:date ?old . } \";\n\t\t\t\t\t$this->connector->query($delete);\n\t\t\t\t\t$date = date('c', $time);\n\t\t\t\t\t$insert = \"INSERT INTO <\".BASENAME.\"/feeds> { <$rss> dc:date \\\"$date\\\" . } \";\n\t\t\t\t\t$this->connector->query($insert);\n\t\t\t\t\t// Notify the PuSH hub server\n\t\t\t\t\t$this->push($rss);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function getFeeds($streamId)\n\t{\n\t\t$query = \"SELECT F.* FROM feed F, feed_stream FS WHERE FS.stream_id = {$streamId} AND F.feed_id = FS.feed_id\";\n\t\t\n\t\treturn Feed::processDBQuery( $query );\n\t}",
"public function getFeedsView()\n {\n $feedsView = array('all' => array('title' => 'All feeds', 'nbUnread' => 0, 'nbAll' => 0, 'feeds' => array()), 'folders' => array());\n \n foreach ($this->_data['feeds'] as $feedHash => $feed) {\n if (isset($feed['error'])) {\n $feed['error'] = $this->getError($feed['error']);\n }\n $feedsView['all']['nbUnread'] += $feed['nbUnread'];\n $feedsView['all']['nbAll'] += $feed['nbAll'];\n if (empty($feed['foldersHash'])) {\n $feedsView['all']['feeds'][$feedHash] = $feed;\n } else {\n foreach ($feed['foldersHash'] as $folderHash) {\n $folder = $this->getFolder($folderHash);\n if ($folder !== false) {\n if (!isset($feedsView['folders'][$folderHash]['title'])) {\n $feedsView['folders'][$folderHash]['title'] = $folder['title'];\n $feedsView['folders'][$folderHash]['isOpen'] = $folder['isOpen'];\n $feedsView['folders'][$folderHash]['nbUnread'] = 0;\n $feedsView['folders'][$folderHash]['nbAll'] = 0;\n }\n $feedsView['folders'][$folderHash]['feeds'][$feedHash] = $feed;\n $feedsView['folders'][$folderHash]['nbUnread'] += $feed['nbUnread'];\n $feedsView['folders'][$folderHash]['nbAll'] += $feed['nbAll'];\n }\n }\n }\n }\n\n return $feedsView;\n }",
"public function actionGetFacebookFeeds() {\n Yii::app()->user->SiteSessions;\n $feeds = array();\n $json_res = Yii::app()->curl\n ->setOption(CURLOPT_HTTPHEADER, array('Content-type: application/json'))\n ->post(\"https://www.facebook.com/feeds/page.php?id=175377742595349&format=json\", array());\n $json_arr = CJSON::decode($json_res);\n if (!empty($json_arr['entries'])) {\n $feeds = array_slice($json_arr['entries'], 0, 5);\n }\n\n $this->renderPartial(\"//site/_facebook_feeds\", array(\"feeds\" => $feeds));\n }",
"public static function getFeeds()\n\t{\n\t\t$rssUrl = Yii::app()->user->getState('rss_url');\n\t\t$rawFeed = file_get_contents($rssUrl);\n\t\tif($rawFeed!='') {\n\t\t\t// give an XML object to be iterate\n\t\t\t$xml = new SimpleXMLElement($rawFeed);\n\t\t\t$criteria = new CDbCriteria();\n\t\t\t$criteria->condition = 't.company_id=:company_id';\n\t\t\t$criteria->params = array(':company_id'=>Yii::app()->user->getState('globalId'));\n\t\t\t$rss_notification = RssNotification::model()->find($criteria);\n\t\t\t\n\t\t\t$post_pubDate = \"\";\n\t\t\t$post_url = \"\";\n\t\t\t$post_title = \"\";\n\t\t\t$data = '';\n\t\t\tforeach($xml->channel->item as $item)\n\t\t\t{\n\t\t\t\t$post_pubDate = $item->pubDate;\n\t\t\t\t$post_url = self::strip_cdata($item->link);\n\t\t\t\t$post_title = self::strip_cdata($item->title);\n\t\t\t\tif(strtotime($post_pubDate)>strtotime($rss_notification->last_post_pubDate)) {\n\t\t\t\t\t$data.= $post_pubDate;\n\t\t\t\t\t$data.= \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$info = new Info();\n\t\t\t\t\t$info->user_id = Yii::app()->user->getState('userId');\n\t\t\t\t\t$info->company_id = Yii::app()->user->getState('globalId');\n\t\t\t\t\t$info->access_level_id = 1;\n\t\t\t\t\t$info->info_type_id = 2;\n\t\t\t\t\t$info->title = $post_title; \n\t\t\t\t\t$info->content = $post_url;\n\t\t\t\t\t$info->date_create = date('Y-m-d H:i:s', strtotime($post_pubDate));\n\t\t\t\t\t$info->save();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the last post date time to now\n\t\t\tRssNotification::model ()->updateByPk ( $rss_notification->id, array (\n\t\t\t\t'last_post_pubDate' => date('Y-m-d H:i:s')\n\t\t\t) );\n\t\t\techo $data;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds and posts comments on task add if deferred post mode is off. | public function postCommentsOnTaskAdd(array $taskData): void
{
$addComments = $this->prepareCommentsOnTaskAdd($taskData);
$this->addComments($addComments);
if ($this->getDeferredPostMode())
{
return;
}
$this->postComments();
$this->clearComments();
} | [
"public function enableDeferredPostMode(): void\n\t{\n\t\t$this->deferredPostMode = true;\n\t}",
"function wp_update_comment_count($post_id, $do_deferred = \\false)\n {\n }",
"public function createpostcommentpost()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$taskCode = \"\";\n\t\t\t\t$this->LogAccess($taskCode);\n\t\t\t\t$_PostCommentRequestHelper = new PostCommentRequestHelper();\n\t\t\t\t$_PostComment = $_PostCommentRequestHelper->AssemblePostCommentEditControl();\n\t\t\t\t$_PostCommentBO = new PostCommentBO($this->_UserInfo);\n\t\t\t\t$_PostCommentValidator = new PostCommentValidator();\n\t\t\t\t$_PostCommentValidator->ValidatePostCommentEditControl($_PostComment, $this->_UserInfo);\n\t\t\t\tif (!$_PostComment->getIsValid())\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$VALERROR, \"\", $_PostComment->getErrors());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_PostComment->setCreateDate(new DateTime());\n\t\t\t\t\t$_PostCommentBO->InsertPostComment($_PostComment);\n\t\t\t\t\t$postComments = $_PostCommentBO->SelectByPostID($_PostComment->getPostID());\n\t\t\t\t\t$_AppUserBO = new AppUserBO($this->_UserInfo);\n\t\t\t\t\t$appUser = $_AppUserBO->SelectByAppUserID($_PostComment->getAppUserID());\n\t\t\t\t\t$output = PostCommentHelper::ProductCommentThreadControl($postComments, $appUser);\n\t\t\t\t\treturn $this->view->outputJson(Constants::$REFRESHCONTENT, $output, \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}",
"function updateCompletedTaskComments() {\n try {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n $comments_table = TABLE_PREFIX . 'comments';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating completed task comments @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT $comments_table.id, $comments_table.body FROM $comments_table, $project_objects_table WHERE $project_objects_table.type = $comments_table.parent_type AND $project_objects_table.id = $comments_table.parent_id AND $project_objects_table.type = 'Task' AND $project_objects_table.completed_on IS NOT NULL\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('TaskComment', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $comments_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Completed task comments updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update completed task comments @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }",
"function defensio_add_defensio_pending($comments) {\n global $user_ID, $post, $wpdb;\n\n $commenter = wp_get_current_commenter();\n $comment_author = $commenter['comment_author'];\n $comment_author_email = $commenter['comment_author_email']; \n $comment_author_url = esc_url($commenter['comment_author_url']);\n\n if ( $user_ID) {\n $comments = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND ( comment_approved = '0' OR 'comment_approved' = '\" . DefensioWP::DEFENSIO_PENDING_STATUS . \"' ) ) ) ORDER BY comment_date_gmt\", $post->ID, $user_ID));\n } else if ( empty($comment_author) ) {\n $comments = get_comments( array('post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC') );\n } else {\n $comments = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND ( comment_approved = '0' OR comment_approved = '\". DefensioWP::DEFENSIO_PENDING_STATUS .\"' ))) ORDER BY comment_date_gmt\", $post->ID, wp_specialchars_decode($comment_author,ENT_QUOTES), $comment_author_email));\n }\n\n return $comments;\n}",
"public function add_task_comment($data)\n {\n if ($data['content'] == '') {\n return false;\n }\n\n if (is_client_logged_in()) {\n $data['staffid'] = 0;\n $data['contact_id'] = get_contact_user_id();\n\n } else {\n $data['staffid'] = get_staff_user_id();\n $data['contact_id'] = 0;\n }\n\n if (isset($data['action'])) {\n unset($data['action']);\n }\n\n $data['dateadded'] = date('Y-m-d H:i:s');\n $data['content'] = $data['content'];\n if (is_client_logged_in()) {\n $data['content'] = _strip_tags($data['content']);\n }\n $this->db->insert('tblstafftaskcomments', $data);\n $insert_id = $this->db->insert_id();\n if ($insert_id) {\n $task = $this->get($data['taskid']);\n $description = 'not_task_new_comment';\n $additional_data = serialize(array($task->name));\n if ($task->rel_type == 'project') {\n $this->projects_model->log_activity($task->rel_id, 'project_activity_new_task_comment', $task->name, $task->visible_to_client);\n }\n $this->_send_task_responsible_users_notification($description, $data['taskid'], false, 'task-commented',$additional_data);\n return true;\n }\n return false;\n }",
"function tfuse_action_comments() {\n global $post;\n if (tfuse_page_options('disable_comments'))\n comments_template( '' );\n }",
"function wyz_business_post_comments_toggle() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\tglobal $current_user;\n\twp_get_current_user();\n\n\t$_post_id = intval( $_POST['post-id'] );\n\t$_user_id = $current_user->ID;\n\t$_comm_stat = $_POST['comm-stat'];\n\t$_post = get_post( $_post_id );\n\n\tif ( ! $_post || ( $_user_id != $_post->post_author && ! user_can( $_user_id, 'manage_options' ) ) ) {\n\t\twp_die( false );\n\t}\n\t\n\tif ( 'open' == $_comm_stat || 'closed' == $_comm_stat ) { \n\t\t$_post->comment_status = $_comm_stat;\n\t}\n\twp_update_post( $_post );\n\twp_die( true );\n}",
"public function createPostQueuedArticlesTask()\n {\n $tasksService = craft()->tasks;\n $task = $tasksService->getNextPendingTask('AppleNews_PostQueuedArticles');\n\n if (!$task) {\n $tasksService->createTask('AppleNews_PostQueuedArticles');\n }\n }",
"public function add_task_comment($data)\n {\n\n $data['staffid'] = get_staff_user_id();\n $data['dateadded'] = date('Y-m-d H:i:s');\n $data['content'] = nl2br($data['content']);\n $this->db->insert(TASK_COMMENTS_TABLE, $data);\n $insert_id = $this->db->insert_id();\n if ($insert_id) {\n $task = $this->get($data['taskid']);\n $description = get_staff_full_name(get_staff_user_id()) . ' commented on task <a href=\"' . admin_url('tasks/list_tasks/' . $task->id) . '\">' . substr($task->name, 0, 50) . '...</a>';\n $this->_send_task_responsible_users_notification($description, $data['taskid']);\n return true;\n }\n return false;\n }",
"function theme_queue_js(){\r\n if (!is_admin()){\r\n if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1))\r\n wp_enqueue_script( 'comment-reply' );\r\n }\r\n}",
"function newsroom_elated_post_info_comments($config) {\n $default_config = array(\n 'comments' => ''\n );\n\n $params = (shortcode_atts($default_config, $config));\n\n if ($params['comments'] == 'yes') {\n newsroom_elated_get_module_template_part('templates/parts/post-info/post-info-comments', 'blog', '', $params);\n }\n }",
"function bp_activity_action_post_comment() {\n\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );\n\n\t$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );\n\t$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );\n\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please do not leave the comment area blank.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n\t}\n\n\t$comment_id = bp_activity_new_comment( array(\n\t\t'content' => $content,\n\t\t'activity_id' => $activity_id,\n\t\t'parent_id' => false\n\t));\n\n\tif ( !empty( $comment_id ) )\n\t\tbp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );\n\n\tbp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );\n}",
"public function sync( $post ) {\n\t\t$posts = $this->get_posts( $post, array( 'posts_per_page' => -1 ) );\n\n\t\t$user_posts = $this->get_user_posts( $post );\n\t\t$user_tasks = $this->get_user_tasks( $post );\n\n\t\t$post_map = array_combine( array_map( function( $post ) {\n\t\t\treturn $post->ID;\n\t\t}, $posts ), $posts );\n\n\t\t$user_post_map = array_combine( array_map( function( $task ) {\n\t\t\treturn $task->comment_post_ID;\n\t\t}, $user_posts), $user_posts);\n\n\t\tforeach ( $user_tasks as $task ) {\n\t\t\tif ( ! isset( $user_post_map[ $task->comment_post_ID ]->tasks ) ) {\n\t\t\t\t$user_post_map[ $task->comment_post_ID ]->tasks = array();\n\t\t\t}\n\n\t\t\t$user_post_map[ $task->comment_post_ID ]->tasks[] = $task;\n\t\t}\n\n\t\t$post_vars = array();\n\n\t\tforeach ( $post_map as $series_post ) {\n\t\t\t$vars = array(\n\t\t\t\t'order' => $series_post->term_order,\n\t\t\t\t'title' => $series_post->post_title,\n\t\t\t\t'karma' => 'undefined',\n\t\t\t\t'tasks' => array(),\n\t\t\t\t'user_tasks' => array()\n\t\t\t);\n\n\t\t\tforeach ( $series_post->series_tasks as $task ) {\n\t\t\t\t$vars['tasks'][] = $task->task_content;\n\t\t\t}\n\n\t\t\tif ( isset( $user_post_map[ $series_post->ID ] ) ) {\n\t\t\t\t$vars['karma'] = $user_post_map[ $series_post->ID ]->comment_karma;\n\n\t\t\t\tforeach ( $user_post_map[ $series_post->ID ]->tasks as $task ) {\n\t\t\t\t\t$vars['user_tasks'][] = array(\n\t\t\t\t\t\t'order' => $task->comment_meta['_index'],\n\t\t\t\t\t\t'content' => $task->comment_content,\n\t\t\t\t\t\t'karma' => $task->comment_karma\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_vars[] = $vars;\n\t\t}\n\n\t\tvar_dump( $post_vars );\n\t}",
"public function post()\r\n\t{\r\n\t\t$user = JFactory::getUser();\r\n\t\t$autopublish = JFactory::getApplication()->getParams('com_comment')->get('autopublish', 0);\r\n\t\t$guestcomment = JFactory::getApplication()->getParams('com_comment')->get('guestcomment', 0);\r\n\t\t$input = JFactory::getApplication()->input;\r\n\t\t// if( $user->guest ){\r\n\t\t// \t$this->setRedirect('index.php', JText::_('you must login'));\r\n\t\t// \treturn;\r\n\t\t// }\r\n\r\n\t\t$model = $this->getModel('comment');\r\n\t\t\r\n\t\tif($guestcomment=='1'){\r\n\t\t\t$res = $model->postComment([\r\n\t\t\t\t'created_by' => $user->id,\r\n\t\t\t\t'guest_name' => $input->get('guestname', '', 'string'),\r\n\t\t\t\t'guest_email' => $input->get('guestemail', '', 'string'),\r\n\t\t\t\t'article_id' => $input->get('article_id', 0, 'int'),\r\n\t\t\t\t'comment' => $input->get('comment', '', 'string'),\r\n\t\t\t\t'published' => (int)$autopublish\r\n\t\t\t]);\r\n\t\t}else{\r\n\t\t\t$res = $model->postComment([\r\n\t\t\t\t'created_by' => $user->id,\r\n\t\t\t\t'article_id' => $input->get('article_id', 0, 'int'),\r\n\t\t\t\t'comment' => $input->get('comment', '', 'string'),\r\n\t\t\t\t'published' => (int)$autopublish\r\n\t\t\t]);\r\n\t\t}\r\n\t\tif($autopublish=='0'){\t\t\t\r\n\t\t\tJFactory::getApplication()->enqueueMessage(JText::_( 'COM_COMMENT_WAIT_TO_ACCEPT' ), 'warning');\r\n\t\t}else{\r\n\t\t\tJFactory::getApplication()->enqueueMessage(JText::_( 'COM_COMMENT_POST_COMMENT_SUCCESS' ), 'message');\r\n\t\t}\r\n\r\n\t\t$url = JRoute::_('index.php?option=com_content&view=article&id='.$input->get('article_id', 0, 'int').'&catid='.$this->input->get('catid', 0, 'int').'&Itemid='.$this->input->get('Itemid', 0, 'int'),false);\r\n\t\t\r\n\t\t$this->setRedirect($url);\r\n\t}",
"function cleanyeti_postfooter_postcomments() {\n global $postfootertabs;\n $postfootertabs .= '<dd><a href=\"#panel-entry-utility-6' . get_the_ID() . '\">' . __( 'Comments', 'cleanyeti' ) . '</a></dd>' . \"\\n\";\n $postcomments = '<div class=\"content\" id=\"panel-entry-utility-6' . get_the_ID() . '\">';\n\t if (comments_open()) {\n\t $postcommentnumber = get_comments_number();\n\n\t if ($postcommentnumber > '0') {\n\t \t$postcomments .= sprintf('<span class=\"comments-link\"><a href=\"%s\" title=\"%s\" rel=\"bookmark\">%s</a></span>',\n\t \t\t\t\t\t\tapply_filters('the_permalink', get_permalink()) . '#respond',\n\t \t\t\t\t\t\tsprintf( esc_attr__('Comment on %s', 'cleanyeti'), the_title_attribute( 'echo=0' ) ),\n\t\t\t\t\t\t\t\t\t/* translators: number of comments and trackbacks */\n\t \t\t\t\t\t\tsprintf( _n('%s Response', '%s Responses', $postcommentnumber, 'cleanyeti'), number_format_i18n( $postcommentnumber ) ) );\n\t\t\t\t} else {\n\t $postcomments .= sprintf('<span class=\"comments-link\"><a href=\"%s\" title=\"%s\" rel=\"bookmark\">%s</a></span>',\n\t \t\t\t\t\t\tapply_filters('the_permalink', get_permalink()) . '#respond',\n\t \t\t\t\t\t\tsprintf( esc_attr__('Comment on %s', 'cleanyeti'), the_title_attribute( 'echo=0' ) ),\n\t \t\t\t\t\t\t__('Leave a comment', 'cleanyeti'));\n\t }\n\t } else {\n\t $postcomments .= '<span class=\"comments-link comments-closed-link\">' . __('Comments closed', 'cleanyeti') .'</span>';\n\t }\n $postcomments .= '</div>';\n\t return apply_filters('cleanyeti_postfooter_postcomments',$postcomments);\n\t}",
"public function jobCommentPost()\n\t{\n\n\t}",
"protected function processDenotifycommentSubmission() {\n\t\t$apiObj = t3lib_div::makeInstance('toctoc_comments_api');\n\t\t/* @var $apiObj toctoc_comments_api */\n\t\tif (version_compare(TYPO3_version, '4.6', '<')) {\n\t\t\t$apiObj->initCaches();\n\t\t}\n\n\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_toctoc_comments_comments', 'uid=' . $this->commentid, array(\n\t\t\t\t'tx_commentsnotify_notify' => 0\n\t\t));\n\n\t\t// Clear cache\n\t\t$cacheidlist = strval($this->pid);\n\t\tif ($_SESSION['commentsPageOrigId']!=0) {\n\t\t\t$cacheidlist .= ', ' .$_SESSION['commentsPageOrigId'];\n\t\t}\n\n\t\t$pidListarr = t3lib_div::intExplode(',', $cacheidlist);\n\n\t\t$pidListarr=array_unique($pidListarr);\n\n\t\tif (version_compare(TYPO3_version, '6.0', '<')) {\n\t\t\tt3lib_div::requireOnce(PATH_t3lib . 'class.t3lib_tcemain.php');\n\t\t} else {\n\t\t\trequire_once \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath('core') . 'Classes/DataHandling/DataHandler.php';\n\t\t}\n\n\t\t$tce = t3lib_div::makeInstance('t3lib_TCEmain');\n\t\t// the $GLOBALS['TCA']-Patch for eID and FLUX\n\t\tif (!(isset($GLOBALS['TCA']))) {\n\t\t\t$GLOBALS['TCA'] = array();\n\t\t\t$GLOBALS['TCA']['tt_content'] = array();\n\t\t}\n\t\t/* @var $tce t3lib_TCEmain */\n\t\tforeach($pidListarr as $pid) {\n\t\t\tif ($pid != 0) {\n\t\t\t\t$tce->clear_cacheCmd($pid);\n\t\t\t}\n\n\t\t}\n\n\t\t$apiObj->setPluginCacheControlTstamp($this->pluginid);\n\t}",
"public function post_mod_comment()\n {\n require AJAX_DIR . '/post_mod_comment.php';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Track, Artist, and Featured Artists $dom simplesomethingDOM | function getTrackMetaData($dom) {
$output = getArtistAndTrackname($dom);
##TODO - need to get supporting artists (array)
$output['featuring'] = getFeaturedArtists($dom);
return $output;
} | [
"function getArtistAndTrackName($dom) {\n $artistTrack = $dom->find('h1.song_title',0);\n $artist = $artistTrack->find('a',0)->plaintext;\n $startBuffer = 8;\n $endBuffer = -11;\n $track = substr($artistTrack->plaintext, ($startBuffer + strlen($artist)) , $endBuffer);\n $output['track'] = $track;\n $output['artist'] = $artist;\n\n return $output;\n}",
"function getSongList($dom) {\n $trackURLs = array();\n $songs = $dom->find('ul.song_list ',0);\n #print $songs; \n #print_r($songs);\n foreach($songs->find('li a') as $track) {\n #print $track->href . \"\\n\";\n $trackURLs[] = $track->href;\n #print $track->href. \"\\n\";\n }\n return $trackURLs;\n}",
"function getAlbums($dom) {\n $albumURLs = array();\n $albumNames = array();\n $albums = $dom->find('ul.album_list',0);\n foreach($albums->find('li a') as $data){\n #print $data->href. \"\\n\";\n $albumURLs[] = $data->href;\n $albumNames[] = $data->plaintext;\n }\n return array(\"urls\"=>$albumURLs, \"names\"=>$albumNames);\n}",
"function get_artists()\n {\n $endpoint = 'artist';\n\n $api = new API_Thingy($this->credentials);\n return $api->get($endpoint);\n }",
"function GetArtists() {\r\n addLog(\"mpd->GetArtists()\");\r\n if ( is_null($resp = $this->SendCommand(MPD_CMD_TABLE, MPD_TBL_ARTIST))) return NULL;\r\n $arArray = array();\r\n $arLine = strtok($resp,\"\\n\");\r\n $arName = \"\";\r\n $arCounter = -1;\r\n while ( $arLine ) {\r\n list ( $element, $value ) = explode(\": \",$arLine);\r\n if ( $element == \"Artist\" ) {\r\n $arCounter++;\r\n $arName = $value;\r\n $arArray[$arCounter] = $arName;\r\n }\r\n $arLine = strtok(\"\\n\");\r\n }\r\n addLog(\"mpd->GetArtists()\");\r\n return $arArray;\r\n }",
"function GetArtists() {\n\t\tif ( $this->debugging ) echo \"mpd->GetArtists()\\n\";\n\t\tif ( is_null($resp = $this->SendCommand(MPD_CMD_TABLE, MPD_TBL_ARTIST)))\treturn NULL;\n $arArray = array();\n \n $arLine = strtok($resp,\"\\n\");\n $arName = \"\";\n $arCounter = -1;\n while ( $arLine ) {\n list ( $element, $value ) = explode(\": \",$arLine);\n if ( $element == \"Artist\" ) {\n \t$arCounter++;\n \t$arName = $value;\n \t$arArray[$arCounter] = $arName;\n }\n\n $arLine = strtok(\"\\n\");\n }\n\t\tif ( $this->debugging ) echo \"mpd->GetArtists()\\n\";\n return $arArray;\n }",
"public function getArtist();",
"function get_artists_with_everything()\n {\n $endpoint = 'artist?_recursive=true';\n\n $api = new API_Thingy($this->credentials);\n return $api->get($endpoint);\n }",
"public function get_tracks($artist_uri)\n {\n $response = $this->client->request('GET', '/' . $artist_uri . '/tracks');\n \n $body = $response->getBody();\n \n $dom = new DOMDocument;\n $dom->loadHTML($body);\n $xpath = new DomXPath( $dom );\n \n $arr_tracks_src = $xpath->query('//*[@id=\"app\"]/noscript[2]/article/section/article');\n $arr_tracks_out = [];\n \n foreach($arr_tracks_src as $track) {\n $datetimeSrc = $track->getElementsByTagName('time')[0]->nodeValue;\n $date = date_create_from_format('Y-m-d\\TH:i:s\\Z', $datetimeSrc);\n\n $genre = '';\n if($track->getElementsByTagName('meta')[1] != null) {\n $genre = $track->getElementsByTagName('meta')[1]->getAttribute('content');\n }\n\n $params = [\n ':title' => $track->getElementsByTagName('a')[0]->nodeValue,\n ':published' => $date->format('Y-m-j H:i:s'),\n ':genre' => $genre,\n ];\n\n array_push($arr_tracks_out, $params);\n }\n\n return $arr_tracks_out;\n }",
"function get_track_artists($track_key, $artist_type = 6, $is_html = true) {\n\t$names = \"\";\n\tif(open_db()) {\n\t\tif(!$is_html) {\t// Plain text output\n\t\t\t$names = $GLOBALS['db']->querySingle(\"SELECT group_concat(contributors.name, ', ') AS Artists FROM contributors, contributor_track WHERE (contributor_track.role = $artist_type) AND (contributors.id = contributor_track.contributor) AND (contributor_track.track = $track_key)\");\n\t\t\t$index = strrpos($names, ',');\n\t\t\tif($index === true) {\n\t\t\t\t$start = substr($names, 0, $index);\n\t\t\t\t$finish = substr($names, $index + 2);\n\t\t\t\t$names = $start . \" & \" . $finish;\n\t\t\t}\n\t\t} else {\t// HTML output\n\t\t\t$result = $GLOBALS['db']->query(\"SELECT \\\"<a href=\\\"\\\"MAL_artist_album_list.php?a=\\\" || contributors.id || \\\"\\\"\\\"> <span id=<\\\"\\\"artist\\\"\\\">\\\" || contributors.name || \\\"</span></a>\\\" AS Artists FROM contributors, contributor_track WHERE (contributor_track.role = 6) AND (contributors.id = contributor_track.contributor) AND (contributor_track.track = $track_key)\");\n\t\t\t$total = 0;\n\t\t\twhile($row = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$total++;\n\t\t\t}\n\t\t\t$count = 0;\n\t\t\twhile($row = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\tif($count > 0) {\n\t\t\t\t\tif($count == ($total - 1)) {\n\t\t\t\t\t\t$names .= \" & \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$names .= \", \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$names .= $row['Artists'];\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $names;\n}",
"public function getArtists(){\n return Artist::all();\n }",
"public static function artists()\n {\n return \"discogs:artists\";\n }",
"private function ext_artists() {\n\t\tglobal $db,$config,$helper;\t\t\t\n\t\t$name = $helper->fast(\"name\",\"3\",\"\");\n\t\t$data = '';\n\t\tif(strlen($name) >= 2 ) {\n\t\t\t$sql = $db->get(\"artist\",\"`art_name`,`art_key`\",\"`art_name` LIKE '%\".safe_quotes($name).\"%'\",30);\n\t\t\twhile($ht = $db->fetch($sql)) {\n\t\t\t\t$data .= ',\"'.un_quotes($ht['art_name']).'\"';\n\t\t\t}\t\t\t\t\n\t\t\t$data = substr($data,1);\n\t\t\techo \"var artist_list = [\".$data.\"];\";\n\t\t}\n\t\t\n\t}",
"private function get_data_from_document( $html ) {\n\t\t$xpath = $this->html_to_xpath( $html );\n\n\t\t$amp_story = $xpath->query( '//amp-story' );\n\n\t\tif ( ! $amp_story instanceof DOMNodeList || 0 === $amp_story->length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$title = $this->get_dom_attribute_content( $amp_story, 'title' );\n\t\t$poster = $this->get_dom_attribute_content( $amp_story, 'poster-portrait-src' );\n\n\t\treturn [\n\t\t\t'title' => $title ?: '',\n\t\t\t'poster' => $poster ?: '',\n\t\t];\n\t}",
"private function getSong()\n {\n $song = [];\n $song_area = $this->_parser->find('div[class*=\"theme-songs opnening\"]', 0);\n if ($song_area) {\n foreach ($song_area->find('span.theme-song') as $each_song) {\n $each_song = trim(preg_replace('/#\\d*:\\s/', '', $each_song->plaintext));\n $song['opening'][] = $each_song;\n }\n }\n\n $song_area = $this->_parser->find('div[class*=\"theme-songs ending\"]', 0);\n if ($song_area) {\n foreach ($song_area->find('span.theme-song') as $each_song) {\n $each_song = trim(preg_replace('/#\\d*:\\s/', '', $each_song->plaintext));\n $song['closing'][] = $each_song;\n }\n }\n\n return $song;\n }",
"function fetchSong($xml) {\n\t\t$lfm = getLastFMData((string)$xml->artist, (string)$xml->title);\n\t\tif ($lfm == NULL) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$artistID = (string)$lfm->track->artist->mbid;\n\t\tif ($artistID === \"\") {\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$song = createNewSong($xml, $lfm);\n\t\t$artist = createNewArtist($lfm);\n\t\t$album = createNewAlbum($lfm);\n\t\t$tags = createNewTags($lfm);\n\t\t\n\t\t$song->artist = $artist;\n\t\t$song->album = $album;\n\t\t$song->tags = $tags;\n\t\t\n\t\treturn $song;\n\t}",
"function display_artist_list(array $artists)\n {\n echo \"<ul class='artist_list'>\";\n foreach ($artists as $artist) {\n echo \"<li classname='artist_entry'>\";\n display_artist($artist);\n echo \"</li>\";\n }\n echo \"</ul>\";\n }",
"public function getArtistas() {\r\r\n $listado = $this->bd->get_results(\"SELECT DISTINCT artist_name FROM tb_tracks ORDER BY artist_name ASC\");\r\r\n return $listado;\r\r\n }",
"private function _fetchArtists()\n\t{\n\t\t$triples = $this->_store->query('SELECT ?uri ?name WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Band>. ?uri <http://xmlns.com/foaf/0.1/name> ?name }' ,'rows');\n\t\tif ($errs = $this->_store->getErrors()) {\n\t\t\tvar_dump($errs);\n\t\t}\n\t\treturn $triples;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the v10_1607 Windows 10 1607 or later. | public function setV10_1607($val)
{
$this->_propDict["v101607"] = $val;
return $this;
} | [
"public function getAllowWindows11Upgrade()\n {\n if (array_key_exists(\"allowWindows11Upgrade\", $this->_propDict)) {\n return $this->_propDict[\"allowWindows11Upgrade\"];\n } else {\n return null;\n }\n }",
"public function get_windows_10_support()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($this->get_server_max_protocol() == self::CONSTANT_SERVER_MAX_PROTOCOL_NT1)\n return TRUE;\n else\n return FALSE;\n }",
"public function setWindows10Devices($val)\n {\n $this->_propDict[\"windows10Devices\"] = $val;\n return $this;\n }",
"public function setMinimumSupportedWindowsRelease(?string $value): void {\n $this->getBackingStore()->set('minimumSupportedWindowsRelease', $value);\n }",
"public function getEnhanceWindowsCompatibility();",
"function setWindows($value)\n {\n $this->setCachedValue('Windows', $value);\n }",
"function GetToolkitMajorVersion(){}",
"public function setWindows($val)\n {\n $this->_propDict[\"windows\"] = intval($val);\n return $this;\n }",
"protected function upgrade_to_1_10_1() {\n\n\t\t$this->migrate_1_9_settings();\n\t}",
"public function setEnhanceWindowsCompatibility($enhance);",
"public function getV10_10()\n {\n if (array_key_exists(\"v1010\", $this->_propDict)) {\n return $this->_propDict[\"v1010\"];\n } else {\n return null;\n }\n }",
"public function testWindows8()\n {\n $this->assertSame(8, Platform::windows8()->getValue());\n }",
"public function setNativePlatformReviewSystem($value);",
"function wim_update_7023() {\n module_enable(['seckit']);\n module_disable(['hsts']);\n\n // Set configuration for seckit.\n _wim_set_default_seckit();\n}",
"function _unsupportedMla2000WarningOnUpgradeTo12_0x()\n {\n $log = Log::getInstance('Obtaining information about the installed administration tool for SQL Server');\n $mssqladmin = PleskComponent::CurrentWinMssqlWebAdmin();\n if ( $mssqladmin == 'mylittleadmin') {\n $warn = 'Starting from Plesk 12.0, MyLittleAdmin 2000 is no longer supported.';\n $log->warning($warn);\n $log->resultWarning();\n\n return;\n }\n $log->resultOk();\n }",
"protected function txtDeprecatedMajorVersion_Create() {\n\t\t\t$this->txtDeprecatedMajorVersion = new QIntegerTextBox($this);\n\t\t\t$this->txtDeprecatedMajorVersion->Name = QApplication::Translate('Deprecated Major Version');\n\t\t\t$this->txtDeprecatedMajorVersion->Text = $this->objFile->DeprecatedMajorVersion;\n\t\t}",
"function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {}",
"function HS_sysHWsetup()\n{\n\tHS_wrapper(\"sysHWsetup\");\n}",
"public function getV10_8()\n {\n if (array_key_exists(\"v108\", $this->_propDict)) {\n return $this->_propDict[\"v108\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test integer validation failed | public function testIntegerValidationFailed()
{
$validator = new Validator();
$value = 12.12;
$this->expectException(ValidationException::class);
$this->expectExceptionMessage('Validation failed');
$validator->addValidation($value, 'integer')
->validate();
} | [
"public function testValidateIntegerTen(): void\n {\n $this->assertFalse($this->validate(10));\n }",
"public function testIsValidReturnsFalseForInteger()\n {\n $this->assertFalse($this->validator->isValid(42));\n }",
"public function testIntegerRepresentations()\n {\n $rule = new Rule;\n $result = $rule->validate('foo', ['foo' => 1]);\n $this->assertFalse($result);\n\n $result = $rule->validate('foo', ['foo' => 0]);\n $this->assertFalse($result);\n }",
"public function testValidIntegerValue()\n {\n $this->assertTrue($this->int->execute(1234));\n }",
"public function test_integer_returns_true_when_not_optional_and_input_int() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( 1, $optional );\n\t\t$this->assertTrue( $result );\n\t}",
"private function _validateInteger()\r\n {\r\n if (isset($this->_integer)) {\r\n foreach ($this->_integer as $n) {\r\n \tif(!isset($this->_data[$n])) continue;\r\n if (!is_integer($this->_data[$n])) {\r\n $this->_errors->add('The ' . $this->_getNiceName($n) . ' must be a valid integer.');\r\n }\r\n }\r\n }\r\n }",
"public function test_integer_returns_true_when_optional_and_input_int() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( 1, $optional );\n\t\t$this->assertTrue( $result );\n\t}",
"public function testAssertIsIntCorrectType(): void\n {\n Validator::assertIsInt(__FUNCTION__, 666);\n // This assert won't be called if exception is thrown\n $this->assertTrue(true);\n }",
"public function testIntegerValidationDemonstration(): void\n {\n $validation = new InputGuard();\n\n $validation->int(1)\n ->errorMessage('This message will not be present on validation.');\n\n // A string that PHP can cast to an integer will be considered valid in non-strict mode.\n $validation->int('1')\n ->errorMessage('This message will not be present on validation.');\n\n $validation->int(5)\n ->min(PHP_INT_MIN)\n ->errorMessage('This message will not be present on validation.');\n\n $validation->int(5)\n ->between(0, 10)\n ->errorMessage('This message will not be present on validation.');\n\n // Nulls can be optionally allowed.\n $validation->int(null)\n ->nullable()\n ->errorMessage('This message will not be present on validation.');\n\n // Empty strings can be optionally allowed.\n $validation->int('')\n ->emptyString()\n ->errorMessage('This message will not be present on validation.');\n\n self::assertTrue($validation->success());\n self::assertSame([], $validation->pullErrorMessages());\n }",
"public static function validate_int($value)\n {\n }",
"public function testValidatorRejectsIntegersGreaterThanOne()\n {\n $this->assertRejects(2);\n }",
"public function testInteger() {\n $this->assertEquals(1292932, Sanitize::integer('129sdja2932'));\n $this->assertEquals(-1275452, Sanitize::integer('-12,754.52'));\n $this->assertEquals(18840, Sanitize::integer('+18#840'));\n }",
"public function functionCanBeInterpretedAsIntegerValidDataProvider() {}",
"public function functionCanBeInterpretedAsIntegerInvalidDataProvider() {}",
"public function testUnsigned(): void\n {\n $validator = new IntegerValidator(true);\n $result = $validator->validate(-9);\n\n $this->assertFalse($result->isValid());\n }",
"public function validateIntValue($value): void;",
"public function testValidateFirstParameterNotInteger()\n {\n $FB = new FizzBuzz();\n try {\n $FB->fizzbuzz(23.2, 18);\n $this->fail();\n } catch (FizzBuzzException $exc) {\n $this->assertEquals('The first parameter is not integer.', \n $exc->getMessage());\n }\n }",
"public function testGenerateLengthIsPositive()\n {\n $int = mt_rand(-20, -10);\n $bool = IntegerValidator::is_positive($int);\n $this->assertFalse($bool,true);\n }",
"public function testPositiveNumber() : void\n {\n $this->assertEquals(8, $this->validator->getNumber(6));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the RolePrivilegesMap model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = RolePrivilegesMap::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected function findModel($id)\n {\n if (($model = Privileges::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($idPesquisador)\n {\n if (($model = Pesquisador::findOne($idPesquisador)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n\t\t\t$model = Permissions::findOne($id);\n\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n\n }",
"function Shop_Shortcuts_GetObjectBySecureIdOr404($model, $secureId)\n{\n $myObject = new $model();\n $obj = $myObject->getOne(\"secureId='\" . $secureId . \"'\");\n if ($obj != null && $obj->id > 0) {\n return $obj;\n }\n throw new Pluf_HTTP_Error404(\"Object whit given secure id not found (\" . $model . \", \" . $secureId . \")\");\n}",
"protected function findModel($id)\n {\n if (($model = MenuItemRoles::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = Privilege::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Permiso::findOne(['name' => $id, 'type' => 2])) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('El permiso que estás intentando acceder no existe.');\n }",
"protected function findModel($id)\n {\n if (($model = AdminRole::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Rolehd::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = AuthRole::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"private function findRole($data)\n {\n /**\n * @var Mage_Admin_Model_Resource_Roles_Collection $modelCollection\n */\n $modelCollection = Mage::getModel('admin/roles')->getCollection();\n if (isset($data['mf_guid'])) {\n $modelCollection->getSelect()->where('mf_guid=?', $data['mf_guid']);\n }\n if (isset($data['role_name'])) {\n $modelCollection->getSelect()->orWhere('role_name=?', $data['role_name']);\n }\n $model = $modelCollection->getFirstItem();\n if ($model instanceof Mage_Admin_Model_Role && $model->getId() > 0) {\n return $model;\n }\n return null;\n\n }",
"protected function findOrFail($key)\n {\n return $this->model->where($this->model->getRouteKeyName(), $key)->firstOrFail();\n }",
"protected function findModel($id)\n {\n if (($model = Roles::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Role::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Roles::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"protected function findModel($id)\n {\n if (($model = AcRole::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = Role::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get feature product for index page | public function getproduct_feature()
{
$query = "SELECT * FROM tbl_product
WHERE type = '1'
order by created_ad desc LIMIT 3 ";
$result = $this->db->select($query);
return $result;
} | [
"public function getFeaturedProduct();",
"public function getProduct();",
"public function getProductFeature($prd_id, $feat_id) {\n \n }",
"public function action_get_product_relate()\n {\n $product_id = (int) Arr::get($_GET, 'product_id', 0);\n if($product_id)\n {\n $product_relate = DB::select('relate')\n ->from('ga_product_relate')\n ->where('product_id', '=', $product_id)\n ->where('relate_count', '>', 28)\n ->execute()->get('relate');\n echo $product_relate;\n }\n exit;\n }",
"function getFeaturedProducts(){\n\tglobal $objSmarty;\n\t$selQry=\"select * from product where feature='1' order by rand() limit 8\";\n\t$resultSet =$this->ExecuteQuery($selQry, \"select\");\n\t$num_rows=$this->ExecuteQuery($selQry,\"norows\");\n\tif($num_rows > 0){\n\t\t$objSmarty->assign(\"featuredProducts\",$resultSet);\n\t}else{\n\t\t$selectProducts=\"select * from product order by rand() limit 8\";\n\t\t$resultProducts =$this->ExecuteQuery($selectProducts, \"select\");\n\t\t$objSmarty->assign(\"featuredProducts\",$resultProducts);\n\t}\n}",
"private function getProducts($val_name, $feature_id, $params) {\n $product = new Application_Model_DbTable_ProductFeatures();\n $siteCurrency = Frontend_Utils::getSiteCurrency();\n if (!empty($val_name) && !empty($feature_id)) {\n\n//get feature to find out its type \n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_feature');\n $select->where('id =?', $feature_id);\n $feature = $product->fetchRow($select)->toArray();\n\n//by feature type set up table name\n $table = (($feature['type'] == 'varchar') ? 'shop_feature_values_varchar' : 'shop_feature_values_color');\n\n//find feature by name\n $select = $product->select()->setIntegrityCheck(FALSE)->from($table);\n $select->where('value =?', $val_name)->limit(1);\n $value = $product->fetchRow($select)->toArray();\n\n\n// find products by feature id and feature value id\n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_product');\n $select->join('shop_product_features', 'shop_product.id = shop_product_features.product_id', ['feature_id', 'feature_value_id', 'product_id']);\n\n//<--add filters from _get parameters \n if (!empty($params['price_max'])) {\n $price_max = Frontend_Utils::priceUA($params['price_max'], $siteCurrency);\n $select->where('shop_product.price <= ?', $price_max);\n }\n\n if (!empty($params['price_min'])) {\n $price_min = Frontend_Utils::priceUA($params['price_min'], $siteCurrency);\n $select->where('shop_product.price >= ?', $price_min);\n }\n\n if (!empty($params['category'])) {\n $categories = implode(',', $params['category']);\n $select->where('shop_product.category_id IN (' . $categories . ')');\n }\n//<--end\n\n\n $select->where('shop_product_features.feature_value_id = ?', $value['id']);\n $select->where('shop_product_features.feature_id = ?', $feature_id);\n $select->where('shop_product.status = ?', 1);\n \n//<-- add sorting filters\n if (isset($params['sort'])) {\n switch ($params['sort']) {\n case 'shop_product.name':\n $select->order('shop_product.name');\n break;\n case 'price_asc':\n $select->order('shop_product.price');\n break;\n case 'price_desc':\n $select->order('shop_product.price DESC');\n break;\n case 'rating':\n $select->order('shop_product.rating DESC');\n break;\n case 'date':\n $select->order('shop_product.create_datetime DESC');\n break;\n default:\n break;\n }\n }\n//<--end\n \n if ($result = $product->fetchAll($select)) {\n $category = new Application_Model_DbTable_Categoryes();\n $products = new Application_Model_DbTable_Products();\n\n $newResult = [];\n $result = $result->toArray();\n foreach ($result as $key => $value) {\n $newResult[$key] = $value;\n $newResult[$key]['category_name'] = $category->getCategoryById($value['category_id'])['name'];\n\n $select = $product->select()->setIntegrityCheck(FALSE)->from('shop_product_skus');\n $select->where('shop_product_skus.product_id = ?', $value['id']);\n $skus = $product->fetchAll($select)->toArray();\n foreach ($skus as $sku) {\n $newResult[$key]['skus'][$sku['id']] = $sku;\n }\n }\n return $newResult;\n }\n }\n return FALSE;\n }",
"public function getProduct() {\n $this->view->js = true;\n $product = $this->grabUrl();\n $this->view->product_name = $product['name'];\n $this->view->product_id = $product['id'];\n $this->view->auth = null;\n if (Sessions::get('js') == 'false') {\n $this->view->js = false;\n $this->view->product = $this->grab_product_noJS($this->view->product_id, $this->view->product_name);\n } else {\n $pageGen = rand();\n Sessions::set('pageGen', $pageGen);\n $this->view->auth = $pageGen;\n }\n return false;\n }",
"public function getProductAction(){\n $params = $this->dispatcher->getParams();\n $id = array_shift($params);\n $product = \\Multiple\\Models\\Product::findFirst(array(\n \"id =:id:\",\n \"bind\" => array(\n \"id\" => $id\n )\n ));\n $result = \\Helpers\\Model::toArray($product);\n \\Helpers\\Controller::jsonify($result);\n $this->view->disable();\n }",
"function get_features() {\n\t\t$sql = \"SELECT `products`.* FROM `products`,`products_features` WHERE `products`.`id` = `products_features`.`product_id` and `products`.`deleted` = 0 and `products`.`status` = 1 ORDER BY `products_features`.`order` ASC LIMIT 0,12\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}",
"public function getOneFeaturedProduct() {\r\n $featuredProducts = array(0);\r\n if ($this->getFeaturedProducts())\r\n $featuredProducts = $this->getFeaturedProducts()->getAllIds();\r\n $random = rand(0, count($featuredProducts) - 1);\r\n $randomId = $featuredProducts[$random];\r\n $featuredProduct = Mage::getModel('catalog/product')->load($randomId);\r\n return $featuredProduct;\r\n }",
"public function feature_indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('PasaRequirementBundle:Feature')->findAll();\n\n return array('entities' => $entities);\n }",
"public function api_featured_products()\n {\n $products = Product::where('category_id', '=',651)->inRandomOrder()->with('images')->take(10)->get();\n return response($products, 200);\n }",
"public function getCategoryFeaturedProduct()\n {\n $category = Mage::registry('current_category');\n $display_mode = ($category->getDisplayMode());\n if($display_mode=='PRODUCTS' || $display_mode=='PRODUCTS_AND_PAGE'){\n $id = Mage::registry('current_category')->getId();\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('category_id', $id)\n ->addFieldToFilter('is_featured',1)\n ->addFieldToFilter('featured_range',['in'=>[1,3]])\n ->addStoreFilter()\n ;\n\n $page_size = Mage::getStoreConfig('featured_options/general/max_slider')? Mage::getStoreConfig('featured_options/general/max_slider') : 10 ;\n $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds())\n ->setPageSize((int) $page_size );\n return $collection;\n }\n\n return;\n }",
"function getProductDetails(){\n return fetchProductDetails();\n }",
"public function readFeaturesByProduct($id){\n\t\treturn $query = \"SELECT DISTINCT speci_value FROM \" . self::$model .\" WHERE speci_type = 1 && product_id = \".$id;\n\t}",
"public function selectProductsFeatured()\n {\n $sql = \"SELECT * FROM \" . $this->getTableName(\"images\") . \" WHERE pro_id=? AND featured=\" . self::FEATURED_YES;\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"i\", $this->getProId());\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n return $this->fetch_assoc_all($result);\n }",
"public function getProductIndex($product_id)\n\t{\n\n if(!$product_id = intval($product_id))\n return null;\n \n return $this->dao->select('id,revision')->from(TABLE_WIKI_PAGE)\n ->where('product_id')->eq($product_id)\n ->andWhere('is_index')->eq('1')\n ->fetch();\n\t}",
"public function getProduct()\n {\n return $this->registry->registry('current_product');\n }",
"function fn_seo_extract_feature_brand($product_features)\n{\n foreach ($product_features as $feature_id => $feature_data) {\n if ($feature_data['feature_type'] === ProductFeatures::EXTENDED) {\n return $feature_data['variant'];\n }\n }\n\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
string to binary string (ab_to_base64) | public static function str_to_base64($ab) {
return self::base64urlencode($ab);
} | [
"function bin2base64($bin) {\n $arr = str_split($bin, 8);\n $str = '';\n foreach ( $arr as $binNumber ) {\n $str .= chr(bindec($binNumber));\n }\n return str_replace(\"=\", \"\", base64_encode($str));\n}",
"public static function toBase64($value) {}",
"function encodeToBase64($binaryString) {\n\treturn \\ParagonIE\\ConstantTime\\Encoding::base64Encode($binaryString);\n}",
"function hex2b64($str)\n\t{\n\t\t$raw = '';\n\t\tfor ($i=0; $i < strlen($str); $i+=2) {\n\t\t\t$raw .= chr(hexdec(substr($str, $i, 2)));\n\t\t}\n\t\treturn base64_encode($raw);\n\t}",
"protected function fromBase64ToBinString(string $data): string {\n // Left pad with 0s and truncate to max length of UUID in base 64.\n $data = \\substr(\\str_pad($data, 22, '0', \\STR_PAD_LEFT), 22);\n $base64 = \\array_flip(self::$base64);\n $result = '';\n $binary = '';\n // First convert to binary string.\n foreach (\\str_split($data) as $idx) {\n if (\\array_key_exists($idx, $base64)) {\n $binary .= $base64[$idx];\n } else {\n $mess = 'Invalid base 64 number given';\n throw new \\InvalidArgumentException($mess);\n }\n }\n // Drop 4 left padding 0s to make 128 bits long again;\n $binary = \\substr($binary, 4);\n // Finally convert into the binary string.\n foreach (\\str_split($binary, 8) as $value) {\n $result .= \\chr(\\bindec($value));\n }\n return $result;\n }",
"private function toBinary(string $string): string\n {\n return trim(array_reduce(str_split($string), fn ($carry, $char) => $carry .= ' ' . str_pad(decbin(ord($char)), 8, 0, STR_PAD_LEFT), ''));\n }",
"public function hex_to_base64($str)\n\t{\n\t\t$raw = '';\n\n\t\tfor ($i = 0; $i < strlen($str); $i += 2)\n\t\t{\n\t\t\t$raw .= chr(hexdec(substr($str, $i, 2)));\n\t\t}\n\n\t\treturn base64_encode($raw);\n\t}",
"function from_b64($str) {\n $str = preg_replace('/\\_/', '/', $str);\n $str = preg_replace('/\\./', '+', $str);\n $str = preg_replace('/\\-/', '=', $str);\n $str = base64_decode($str);\n return $str;\n}",
"public function toBinaryString() : string;",
"function task1($str)\n{\n $bytes = hex2bin($str);\n\n return base64_encode($bytes);\n}",
"public function toBin($str)\n {\n $str = (string)$str;\n// die($str);\n $l = strlen($str);\n $result = '';\n while ($l--) {\n $result = str_pad(decbin(ord($str[$l])), 8, \"0\", STR_PAD_LEFT) . $result;\n }\n return $result;\n }",
"public function encode_base64($string){\n\n //convert the string, no sanitising will be done because we can't predict the string data type\n $encoded = base64_encode($string);\n\n return $encoded;\n }",
"public static function baseEncode(string $string): string\n {\n return str_replace(['=', '+', '/'], '', base64_encode($string));\n }",
"public static function fromBase64(string $value): Binary\n {\n return new Binary($value, 'base64');\n }",
"public function toBase64(): string\r\n {\r\n return base64_encode($this->toTLV());\r\n }",
"function inertToB64($inert){\n $temp = str_replace('_', '/', $inert);\n $temp = str_replace('-', '+', $temp);\n return $temp;\n}",
"public static function rawToBase64(string $raw) : string\n {\n return base64_encode($raw);\n }",
"public static function base64_url_encode($string);",
"public function base64TxToBase64( $base64 )\n {\n return substr( $base64, 7 );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the document states. | function issuu_api_document_states() {
$states = &drupal_static(__FUNCTION__);
// Check if the array is not already initialized.
if (!isset($states)) {
$states = array(
'A' => t('Active'),
'F' => t('Failed'),
'P' => t('Processing'),
);
}
return $states;
} | [
"public function getStates();",
"public function get_states() {\n return $this->states;\n }",
"public function getDocument(State $state);",
"public function getStates()\n {\n return $this->states;\n }",
"public function getStates()\n {\n if ($this->states === null) {\n $this->states = fn_get_all_states(true, $this->lang_code);\n }\n\n return $this->states;\n }",
"public static function getStates()\n {\n\t\t if (is_null(self::$_states)) {\n self::$_states = array(\n self::STATE_OPEN => Mage::helper('sales')->__('Pending'),\n self::STATE_PAID => Mage::helper('sales')->__('Paid'),\n self::STATE_CANCELED => Mage::helper('sales')->__('Canceled'),\n );\n }\n\t\t \n\t\t// echo '<pre>';print_r( self::$_states);die;\n\t\t \n\t\t\t$invoiceStatus = Mage::getStoreConfig('editorder/opermission/edit_order_invoice_status'); \n\t\t\t$invoiceStatusArr = @unserialize($invoiceStatus);\t\t\n\t\t\tif($invoiceStatusArr) {\n\t\t\t\t$i = 4 ;\n\t\t\t\t foreach($invoiceStatusArr as $field) {\n\t\t\t\t \t \n\t\t\t\t\t$invoice_state = $field['feature'];\n\t\t\t\t\tself::$_states[$i] = $invoice_state ;\n\t\t\t\t\t//echo '<pre>';print_r( self::$_states);die;\n\t\t\t\t\t$i++ ;\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n \n return self::$_states;\n }",
"protected function _states ()\n {\n return array (Visible => 'Visible',\n Locked => 'Locked',\n Hidden => 'Hidden',\n Deleted => 'Deleted');\n }",
"public function getOrderStates() {\n return Mage::getSingleton(\"sales/order_config\")->getStates();\n }",
"public function allDocuments() {\n\t\treturn $this->_document;\n\t}",
"public static function all() {\n return static::$states;\n }",
"public function getDocuments()\n {\n return $this->documents;\n }",
"public function getStates() {\n $states = [];\n \n foreach($this->listeners as $listener) {\n $states = array_merge($states,$listener->getStates());\n }\n return $states;\n }",
"public function getStatesList();",
"public function getDocumentProperties()\n {\n return $this->getDocInfo();\n }",
"public function getDocumentInformation()\n {\n return $this->documentWriter->getDocumentInformation();\n }",
"public function getDocumentCounters()\n {\n return $this->document_counters;\n }",
"private function getDocumentStatistics() {\n $all_document_names = $document_pref = $document_non_pref = $live_document_pref\n = $live_document_non_pref = array();\n\n $all_documents = $this->em->getRepository(Document::class)->findAll();\n /** @var Document $document */\n foreach ($all_documents as $document) {\n $document_name = $document->getDoc_Id();\n $all_document_names[] = $document_name;\n $document_pref[] = $this->pc_repo->findDocumentPreferences($document_name);\n $document_non_pref[] = $this->pc_repo->findDocumentNonPreferences($document_name);\n }\n $no_pref_standalone = $this->pc_repo->findDocumentPreferences(\"none\")[0]['pref'];\n\n $all_websites = $this->em->getRepository(Website::class)->findAll();\n /** @var Document $document */\n foreach ($all_websites as $website) {\n $website_name = $website->getWebsiteName();\n $all_website_names[] = $website_name;\n $live_website_pref[] = $this->pc_repo->findDocumentPreferences($website_name, true);\n $live_website_non_pref[] = $this->pc_repo->findDocumentNonPreferences($website_name, true);\n }\n $no_pref_live = $this->pc_repo->findDocumentPreferences(\"none\", true)[0]['pref'];\n\n return array(\n 'all_documents' => $all_documents, 'all_document_names' => $all_document_names,\n 'all_websites' => $all_websites, 'all_website_names' => $all_website_names,\n 'document_pref' => $document_pref, 'document_non_pref' => $document_non_pref,\n 'live_website_pref' => $live_website_pref, 'live_website_non_pref' => $live_website_non_pref,\n 'no_pref_standalone' => $no_pref_standalone, 'no_pref_live' => $no_pref_live\n );\n }",
"function getStates(){\n\t\t\t global $db;\n\t\n\t\t\t $sqlQuery = $this->am_createSelectAllQuery($this->stateTblName,'1=1','state');\n\n\t\t\t $resultState = $db->execute($sqlQuery); \t\t\t\t\t \n\t\t\t return $resultState;\n\n\t\t}",
"public function get() {\n\t\t$documentStatus = $this->decorateDocumentStatus($this->storageBackend->get());\n\t\treturn $documentStatus;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format a node stripe legend. | function template_preprocess_calendar_stripe_legend(&$vars) {
if (empty($vars) || !$view = $vars['view_and_display_id']) {
return '';
}
list($view_name, $display_id) = explode(':', $view);
$view = Views::getView($view_name);
$view->setDisplay($display_id);
$row_options = $view->display_handler->getOption('row')['options'];
$legend_type = $row_options['colors']['legend'];
$display_options = $row_options['colors']['calendar_colors_' . $legend_type];
$options = [];
switch ($legend_type) {
case 'type':
$options = node_type_get_names();
break;
// @todo handle taxonomy legends
case 'taxonomy':
$vocabularies = (array) $row_options['colors']['calendar_colors_vocabulary'];
$term_colors = $row_options['colors']['calendar_colors_taxonomy'];
foreach ($vocabularies as $field_name => $vid) {
$vocab = \Drupal::entityTypeManager()->getStorage("taxonomy_term")->loadTree($vid);
foreach ($vocab as $key => $term) {
$options[$term->tid] = $term->name;
}
}
break;
}
$headers = [
['label' => t('Item')],
['label' => t('Key')]
];
$rows = [];
foreach ($options as $key => $label) {
$stripe = array_key_exists($key, $display_options) ? $display_options[$key] : CALENDAR_EMPTY_STRIPE;
if ($stripe != CALENDAR_EMPTY_STRIPE) {
$rows[] = [
'label' => $label,
'stripe' => $stripe,
];
}
}
if (!empty($rows)) {
$vars['headers'] = $headers;
$vars['rows'] = $rows;
}
} | [
"function uusm_calendar_stripe_legend() {\n if (empty($GLOBALS['calendar_stripes'])) {\n return '';\n }\n $header = '';/*array(\n array('class' => 'calendar-legend', 'data' => t('Item')),\n array('class' => 'calendar-legend', 'data' => t('Key'))\n );*/\n $rows = array();\n $output = ''; \n foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {\n if($stripe){\n $rows[] = array('<img src=\"../sites/all/themes/uusm/images/legend-block.png\" style=\"background-color:'. $stripe .';color:'. $stripe .'\" class=\"stripe\" title=\"Key: '. $label .'\" /> '.$label);\n }\n }\n if (!empty($rows)) {\n $output .= theme_item_list($items = $rows, $title = NULL, $type = 'ul', $attributes = array('class' => 'mini calendar-legend'));\n }\n return $output;\n}",
"public function getNodeFieldsetLegend()\n {\n return __('Node Properties');\n }",
"function print_legend()\r\n{\r\n\tglobal $gXpLang;\r\n\techo '<div style=\"text-align: center; margin: 5px 0;\">Link status colors: ';\r\n\techo '<span class=\"active\" style=\"border: 1px solid #fff; padding: 5px;\">'.$gXpLang['ACTIVE'].'</span> :: ';\r\n\techo '<span class=\"approval\" style=\"border: 1px solid #fff; padding: 5px;\">'.$gXpLang['APPROVAL_'].'</span> :: ';\r\n\techo '<span class=\"banned\" style=\"border: 1px solid #fff; padding: 5px;\">'.$gXpLang['BANNED'].'</span></div>';\r\n}",
"public function build_legend()\r\n {\r\n $result = '<div style=\"margin-top: 10px; float: right;\">';\r\n foreach ($this->legend as $key => $color)\r\n {\r\n $result .= '<span style=\"display:block; float: left; margin-right: 2px; width: 10px; height: 10px; border: 1px solid black; background-color: ' . $color . '\"> </span><span style=\"float:left; margin-right: 15px;\">' . $key . '</span>';\r\n }\r\n $result .= '</div>';\r\n return $result;\r\n }",
"function getColorLegendSVG($field, $cutoff, $y, $font_size=10) {\r\n\r\n\r\n\r\n\t//echo $field;\r\n\t$result = \"\";\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t// Field is LogFC\r\n\tif ($field == 'logFC') {\r\n\r\n\t\t// 'LogFC' Label\r\n\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t$result .= \"newText.setAttributeNS(null,'x',0); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t$result .= \"var textNode = document.createTextNode('Log2FC: ');\";\r\n\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\r\n\t\tif (!is_array($cutoff)) {\r\n\t\t\t$min = (-1) * ($cutoff + 1);\r\n\t\t\t$mid = 0;\r\n\t\t\t$max = $cutoff + 1;\r\n\t\t\t$color_gradient = '0';\r\n\t\t} else {\r\n\t\t\t$value_array = explode(',', $cutoff['value']);\r\n\t\t\t$min = floatval(trim($value_array[0]));\r\n\t\t\t$mid = floatval(trim($value_array[1]));\r\n\t\t\t$max = floatval(trim($value_array[2]));\r\n\t\t\t$color_style = $cutoff['color_style'];\r\n\t\t\t// Set Color\r\n\t\t\tif ($color_style == 0) {\r\n\t\t\t\t$color_gradient = '0';\r\n\t\t\t}\r\n\t\t\tif ($color_style == 1) {\r\n\t\t\t\t$color_gradient = '1';\r\n\t\t\t}\r\n\t\t\tif ($color_style == 2) {\r\n\t\t\t\t$color_gradient = '2';\r\n\t\t\t}\r\n\t\t\tif ($color_style == 3) {\r\n\t\t\t\t$color_gradient = '3';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t$result .= \"var myCircle = document.createElementNS(svgNS,'rect');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'id','mycircle');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'x',40);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'y',\" . intval($y - 10) . \");\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'width',40);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'height',13);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'fill','url(#gradient_\" . $color_gradient . \")');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'stroke','none');\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(myCircle);\";\r\n\r\n\t\t// Gradient Borders\r\n\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t$result .= \"newText.setAttributeNS(null,'x',90); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t$result .= \"var textNode = document.createTextNode('[\" . $min . \", \" . $mid . \", \" . $max . \"]');\";\r\n\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\r\n\t}\r\n\r\n\t// Field is P-Value or FDR\r\n\telse {\r\n\r\n\t\tif ($field == 'pvalue') {\r\n\t\t\t$field = 'pValue';\r\n\t\t} else {\r\n\t\t\t$field = 'FDR';\r\n\t\t}\r\n\r\n\t\t// Field\r\n\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t$result .= \"newText.setAttributeNS(null,'x',0); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t$result .= \"var textNode = document.createTextNode('\" . $field . \": ');\";\r\n\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\r\n\r\n\t\t// Three Colors\r\n\t\tif ($cutoff == 0) {\r\n\t\t\t$value = 0.01;\r\n\t\t\t$color = '6B8E23';\r\n\t\t}\r\n\t\t// Two Colors\r\n\t\telse if ($cutoff == 1) {\r\n\t\t\t$value = 0.01;\r\n\t\t\t$color = '00FF00';\r\n\t\t} else if ($cutoff == 2) {\r\n\t\t\t$value = 0.05;\r\n\t\t\t$color = '00FF00';\r\n\t\t} else {\r\n\t\t\t$value = $cutoff['value'];\r\n\t\t\t$color_style = $cutoff['color_style'];\r\n\t\t\tif ($color_style == 0) {\r\n\t\t\t\t$color = '00FF00';\r\n\t\t\t} else if ($color_style == 1) {\r\n\t\t\t\t$color = '6B8E23';\r\n\t\t\t} else if ($color_style == 2) {\r\n\t\t\t\t$color = '0000FF';\r\n\t\t\t} else {\r\n\t\t\t\t$color = 'FF0000';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Color 1\r\n\t\t$result .= \"var myCircle = document.createElementNS(svgNS,'rect');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'id','mycircle');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'x',40);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'y',\" . intval($y - 10) . \");\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'width',15);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'height',15);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'fill','#\" . $color . \"');\";\r\n\t\t//$result .= \"myCircle.setAttributeNS(null,'fill','url(#MyGradient)');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'stroke','none');\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(myCircle);\";\r\n\t\t// Label 1\r\n\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t$result .= \"newText.setAttributeNS(null,'x',58); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t$result .= \"var textNode = document.createTextNode('<\" . $value . \"');\";\r\n\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\r\n\t\tif ($cutoff == 0) {\r\n\t\t\t$color2 = '00FF00';\r\n\t\t\t$label2 = '0.01-0.05';\r\n\t\t} else {\r\n\t\t\t$color2 = 'FFFFFF';\r\n\t\t\t$label2 = '>=' . $value;\r\n\t\t}\r\n\r\n\t\t// Color 2\r\n\t\t$result .= \"var myCircle = document.createElementNS(svgNS,'rect');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'id','mycircle');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'x',85);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'y',\" . intval($y - 10) . \");\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'width',15);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'height',15);\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'fill','#\" . $color2 . \"');\";\r\n\t\t$result .= \"myCircle.setAttributeNS(null,'stroke','black');\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(myCircle);\";\r\n\t\t// Label 2\r\n\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t$result .= \"newText.setAttributeNS(null,'x',103); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t$result .= \"var textNode = document.createTextNode('\" . $label2 . \"');\";\r\n\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\r\n\r\n\t\tif ($cutoff == 0) {\r\n\t\t\t// Color 3\r\n\t\t\t$result .= \"var myCircle = document.createElementNS(svgNS,'rect');\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'id','mycircle');\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'x',150);\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'y',\" . intval($y - 10) . \");\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'width',15);\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'height',15);\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'fill','#FFFFFF');\";\r\n\t\t\t$result .= \"myCircle.setAttributeNS(null,'stroke','black');\";\r\n\t\t\t$result .= \"document.getElementById('info-box-0').appendChild(myCircle);\";\r\n\t\t\t// Label 2\r\n\t\t\t$result .= \"var newText = document.createElementNS(svgNS,'text');\";\r\n\t\t\t$result .= \"newText.setAttributeNS(null,'x',168); \";\r\n\t\t\t$result .= \"newText.setAttributeNS(null,'y',\" . $y . \"); \";\r\n\t\t\t$result .= \"newText.setAttributeNS(null,'font-size','\" . $font_size . \"px');\";\r\n\t\t\t$result .= \"var textNode = document.createTextNode('>0.05');\";\r\n\t\t\t$result .= \"newText.appendChild(textNode);\";\r\n\t\t\t$result .= \"document.getElementById('info-box-0').appendChild(newText);\";\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\r\n\r\n\treturn $result;\r\n}",
"public function get_chart_legend()\n {\n }",
"function Clegend(){\r\n \r\n print('</legend>');\r\n \r\n }",
"function CreateLegend()\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-sm-2 col-offset-6\\\"><p class=\\\"lead\\\">Bewertung:</p></div>\\n\";\n\t\techo \"\t<div class=\\\"col-sm-4\\\">\\n\";\n\t\techo \"\t\t<div class=\\\"row\\\">\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">++</p></div>\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">+</p></div>\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">o</p></div>\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">-</p></div>\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">--</p></div>\\n\";\n\t\techo \"\t\t\t<div class=\\\"col-2\\\"><p class=\\\"lead center\\\">N/A</p></div>\\n\";\n\t\techo \"\t\t</div>\\n\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"</div>\\n\";\n\t}",
"public function dibujarPieLegend() {\r\n $this->charObj->drawPieLegend($this->dimencion['width'] - $this->legend_dimencion['width'], 0, $this->charData->GetData(), $this->charData->GetDataDescription(), 250, 250, 250);\r\n }",
"abstract public function getLegendColor();",
"function of_set_legend() {\n global $of_legend_ar;\n $leg = \"\";\n foreach ($of_legend_ar as $key => $val) {\n $chk = $key + 1;\n if ($chk == count($of_legend_ar)) {\n $leg .= $val;\n } else {\n $leg .= \"$val - \";\n }\n }\n return $leg;\n}",
"function theme_legend($points, $values, $label) {\n $swatches = '';\n foreach ($points as $point) {\n if ($this->options['colors']['choropleth']['enable']) {\n $swatches .= theme('stylewriter_color_swatch', \n $point['color'], $point['dist'], $point['value_min'], $point['value_max'], $label);\n }\n else {\n $swatches .= theme('stylewriter_point_swatch', \n $point['color'], $point['dist'], $point['value_min'], $point['value_max'], $label);\n }\n }\n $first = current($points);\n $last = end($points);\n return theme('stylewriter_legend', \n $swatches, \n $values['min'], \n $values['max'], \n $label);\n }",
"function get_legend()\r\n {\r\n $html = array();\r\n $html[] = '<div class=\"content_object\" style=\"background-image: url(' . Theme :: get_common_image_path() . 'place_legend.png);\">';\r\n $html[] = '<div class=\"title\">' . Translation :: get('Legend', null, Utilities :: COMMON_LIBRARIES) . '</div>';\r\n $html[] = '<span class=\"compare_delete\">' . Translation :: get('CompareExample') . '</span>: ' . Translation :: get('CompareDeleteInfo') . '<br />';\r\n $html[] = '<span class=\"compare_add\">' . Translation :: get('CompareExample') . '</span>: ' . Translation :: get('CompareAddInfo') . '<br />';\r\n $html[] = '<span class=\"compare_change\">' . Translation :: get('CompareExample') . '</span>: ' . Translation :: get('CompareChangeInfo') . '<br />';\r\n $html[] = '<span class=\"compare_copy\">' . Translation :: get('CompareExample') . '</span>: ' . Translation :: get('CompareCopyInfo') . '<br />';\r\n $html[] = '</div>';\r\n\r\n return implode(\"\\n\", $html);\r\n }",
"function nodeTypeStripe(&$event) {\n $colors = isset($this->options['colors']['calendar_colors_type']) ? $this->options['colors']['calendar_colors_type'] : [];\n if (empty($colors)) {\n return;\n }\n\n $type_names = node_type_get_names();\n $bundle = $event->getBundle();\n $label = '';\n $stripeHex = '';\n if (array_key_exists($bundle, $type_names) || $colors[$bundle] == CALENDAR_EMPTY_STRIPE) {\n $label = $type_names[$bundle];\n }\n if (array_key_exists($bundle, $colors)) {\n $stripeHex = $colors[$bundle];\n }\n\n $event->addStripeLabel($label);\n $event->addStripeHex($stripeHex);\n }",
"protected function build_legend(){\r\n\t\t$return = '';\r\n\t\tif($this->info['legend'] == '1'){\r\n\t\t\t$return .= '<div id=\"legend\" ><h3>'.$this->user->lang('lang_ts3_legend').'</h3>';\r\n\t\t\tforeach ($this->info['sgroup'] as $var) {\r\n\t\t\t\t$return .= '<div class=\"tsleimg\"><img src=\"' . $this->server_path . 'portal/voice/modules/teamspeak3/tsimages/'.''.sanitize($var['p']).'\" alt=\"'.sanitize($var['n']).'\" /></div>';\r\n\t\t\t\t$return .= '<div class=\"tsle\">'.sanitize($var['n']).'</div>';\r\n\t\t\t\t$return .= '<div style=\"clear:both\"></div>';\r\n\t\t\t}\r\n\t\t\tforeach ($this->info['cgroup'] as $var) {\r\n\t\t\t\t$return .= '<div class=\"tsleimg\"><img src=\"' . $this->server_path . 'portal/voice/modules/teamspeak3/tsimages/'.''.sanitize($var['p']).'\" alt=\"'.sanitize($var['n']).'\" /></div>';\r\n\t\t\t\t$return .= '<div class=\"tsle\">'.sanitize($var['n']).'</div>';\r\n\t\t\t\t$return .= '<div style=\"clear:both\"></div>';\r\n\t\t\t}\r\n\t\t\t$return .= '</div>';\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"function wpbs_get_legend_item_icon($legend_item_id, $type, $color = array())\n{\n\n $output = '<div class=\"wpbs-legend-item-icon wpbs-legend-item-icon-' . esc_attr($legend_item_id) . '\" data-type=\"' . esc_attr($type) . '\">';\n\n for ($i = 0; $i <= 1; $i++) {\n\n $svg = '';\n if ($type == \"split\") {\n $svg = ($i == 0) ? '<svg height=\"100%\" width=\"100%\" viewBox=\"0 0 50 50\" preserveAspectRatio=\"none\"><polygon points=\"0,0 0,50 50,0\" /></svg>' : '<svg height=\"100%\" width=\"100%\" viewBox=\"0 0 50 50\" preserveAspectRatio=\"none\"><polygon points=\"0,50 50,50 50,0\" /></svg>';\n }\n\n $output .= '<div class=\"wpbs-legend-item-icon-color\" ' . (!empty($color[$i]) ? 'style=\"background-color: ' . esc_attr($color[$i]) . ';\"' : '') . '>' . $svg . '</div>';\n }\n\n $output .= '</div>';\n\n return $output;\n\n}",
"public function parseLegend()\n {\n // the legend will look like this:\n // 1 Fleischlos (vegetarisch) 6 Rind/Schweinefleisch 11 Sahne 16 geschwärzt\n // 2 Schweinefleisch 7 Schinken /geräuchert 12 Kartoffelstärke 17 jodiertes Salz\n // 3 Rindfleisch 8 Fisch 13 Farbstoffe 18 Geschmacksverstärker\n // 4 Geflügelfleisch 9 Wild 14 Gemüse-Bouillon 19 Pflanzeneiweiß\n // 5 Lammfleisch 10 Milch 15 Zucker 20 Mit Phosphat\n\n rewind($this->f);\n\n while (($line = fgets($this->f)) !== false) {\n // trim the line\n $line = trim($line);\n\n // skip the line if it's empty\n if ($line === '') {\n continue;\n }\n\n $matches = array();\n preg_match_all('~(\\d\\d?[a-züöäß\\/\\(\\)\\s\\-]+)~iu', $line, $matches);\n if (isset($matches[1])) {\n foreach ($matches[1] as $legendEntry) {\n $legendEntry = trim($legendEntry);\n $linematches = array();\n preg_match('~(\\d+)\\s+([a-zöäüß0-9\\s\\-/]+)~iu', $legendEntry, $linematches);\n if ($linematches) {\n // var_dump($matches);continue;\n // $item = array_map('Helper::trimStr', $item);\n $key = (int) trim($linematches[1]);\n // it picks up the postal code - there are not more than 30 legend entries -> removes the post code entry\n if ($key > 30) {\n continue;\n }\n $this->legend[$key] = trim($linematches[2]);\n }\n }\n }\n }\n\n // var_dump($legend);\n\n // write the legend for DEV inspection\n $f = fopen(realpath(__DIR__ . '/../data/legend.json'), 'w');\n if ($f) {\n fwrite($f, json_encode($this->legend, JSON_PRETTY_PRINT));\n echo 'written legend.json' . PHP_EOL;\n }\n fclose($f);\n\n return $this->legend;\n }",
"protected function _drawLegend()\r\n\t{\r\n\t\t$legendAreaOffsetX = $this->_memoryAreaWidth + $this->_contentAreaWidth;\r\n\t\t$offsetY = self::MARGIN_TOP;\r\n\t\t$i = 0;\r\n\t\tforeach ($this->_dataArray as $key => $value) {\r\n\t\t\timagerectangle($this->_im, $legendAreaOffsetX, $offsetY, ($legendAreaOffsetX + self::CHARACTER_SIZE),\r\n\t\t\t\t\t\t ($offsetY + self::CHARACTER_SIZE), $this->_colors[$i]);\r\n\t\t\timagefilltoborder($this->_im, ($legendAreaOffsetX + 1), ($offsetY + 1), $this->_colors[$i], $this->_colors[$i]);\r\n\t\t\t\r\n\t\t\timagettftext($this->_im, self::CHARACTER_SIZE, 0, $legendAreaOffsetX + ceil(self::CHARACTER_SIZE * 1.5),\r\n\t\t\t\t\t\t $offsetY + self::CHARACTER_SIZE, $this->_textColor, $this->_font, $value);\r\n\t\t\t\r\n\t\t\t$offsetY += ceil(self::CHARACTER_SIZE * 1.5);\r\n\t\t\t$i++;\r\n\t\t}\r\n\t}",
"protected function _drawLegend()\r\n\t{\r\n\t\t$legendAreaOffsetX = $this->circleAreaWidth + 10;\r\n\t\t$offsetY = self::MARGIN_TOP;\r\n\t\t$i = 0;\r\n\t\tforeach ($this->_dataArray as $key => $value) {\r\n\t\t\timagerectangle($this->_im, $legendAreaOffsetX, $offsetY, ($legendAreaOffsetX + self::CHARACTER_SIZE),\r\n\t\t\t\t\t\t ($offsetY + self::CHARACTER_SIZE), $this->_colors[$i]);\r\n\t\t\timagefilltoborder($this->_im, ($legendAreaOffsetX + 1), ($offsetY + 1), $this->_colors[$i], $this->_colors[$i]);\r\n\t\t\t\r\n\t\t\t$percentage = round($this->_dataArray[$key] / $this->_getSumValue($this->_dataArray) * 100, 1);\r\n\t\t\t$writeText = $percentage . '% ' . $key;\r\n\t\t\timagettftext($this->_im, self::CHARACTER_SIZE, 0, $legendAreaOffsetX + ceil(self::CHARACTER_SIZE * 1.5),\r\n\t\t\t\t\t\t $offsetY + self::CHARACTER_SIZE, $this->_textColor, $this->_font, $writeText);\r\n\t\t\t\r\n\t\t\t$offsetY += ceil(self::CHARACTER_SIZE * 1.5);\r\n\t\t\t$i++;\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: getParentPath Returns the cell for the specified cell path using the given root as the root of the path. Parameters: path Path whose parent path should be returned. | static function getParentPath($path)
{
if ($path != null && strlen($path) > 0)
{
$index = strrpos($path, mxCellPath::$PATH_SEPARATOR);
if ($index === false)
{
return "";
}
else
{
return substr($path, 0, $index);
}
}
return null;
} | [
"public function getParentPathOfPath($path);",
"static public function getParentPath($path) {\n\t\tif ($path === '/') {\n\t\t\t$parentPath = '';\n\t\t} elseif (strrpos($path, '/') === 0) {\n\t\t\t$parentPath = '/';\n\t\t} else {\n\t\t\t$parentPath = substr($path, 0, strrpos($path, '/'));\n\t\t}\n\n\t\treturn $parentPath;\n\t}",
"private function locate_parent_node($path)\n {\n }",
"static function getParentPath($path) {\n if ('$' === $path) {\n throw new \\InvalidArgumentException('Unable to find parent for: ' . $path);\n }\n\n $normalizedPath = self::normalizePath($path);\n preg_match(self::LAST_TOKEN_IN_PATH, $normalizedPath, $matches);\n $size = sizeof($matches);\n if ($size > 0) {\n return str_replace($matches[1], '', $normalizedPath);\n }\n\n throw new \\InvalidArgumentException('Unsupported JSON path: ' . $path . '!');\n }",
"public function getParentPath($parent_path = array())\n {\n $parent = $this->parent;\n \n if (!is_null($parent)) {\n array_push($parent_path, $parent->id);\n \n return $parent->getParentPath($parent_path);\n }\n else {\n // Parent is NULL, check if the $parent_path is empty.\n // If so, this comment is it's own parent (At the root)\n if (empty($parent_path))\n array_push($parent_path, $this->id);\n }\n \n return $parent_path;\n }",
"public function getParentPath()\n\t{\n\n\t\t$xpl = explode(\"/\", $this -> path);\n\t\tarray_pop($xpl);\n\t\treturn implode(\"/\", $xpl);\n\n\t}",
"function getParentPath(){\n\t\treturn (!$this->ParentID) ? '/' : f('SELECT Path FROM ' . $this->DB_WE->escape($this->Table) . ' WHERE ID=' . intval($this->ParentID), '', $this->DB_WE);\n\t}",
"public function getParentPath() {\n\t\treturn $this->parentPath;\n\t}",
"public function getParentPath() {\n static $path;\n if (!isset($path))\n $path = substr($this->getPath(), 0, strrpos($this->getPath(), '/'));\n return $path;\n }",
"public static function get_parent_language_path($language_path)\n {\n $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);\n $sql = \"SELECT dokeos_folder\n FROM \" . $tbl_admin_languages . \"\n WHERE id = (\n SELECT parent_id FROM \" . $tbl_admin_languages . \"\n WHERE dokeos_folder = '\" . Database::escape_string($language_path) . \"'\n )\n \";\n $result = Database::query($sql);\n if (Database::num_rows($result) == 0) {\n return null;\n }\n $row = Database::fetch_array($result);\n return $row['dokeos_folder'];\n }",
"public function getParentFolder()\n {\n return $this->getPath();\n }",
"function getPath() { /* {{{ */\n\t\tif (!isset($this->_parentID) || ($this->_parentID == \"\") || ($this->_parentID == 0) || ($this->_id == $this->_repo->rootFolderID)) {\n\t\t\treturn array($this);\n\t\t}\n\t\telse {\n\t\t\t$res = $this->getParent();\n\t\t\tif (!$res) return false;\n\n\t\t\t$path = $this->_parent->getPath();\n\t\t\tif (!$path) return false;\n\n\t\t\tarray_push($path, $this);\n\t\t\treturn $path;\n\t\t}\n\t}",
"public function &find(Path $path)\n {\n if (is_null($this->row)) {\n $f = new EmptyCell();\n return $f;\n }\n $first = $path->first();\n if ($first->getType() != PathNodeType::ARRAYTYPE) {\n $newPath = new Path(\"@@current\");\n $path = $newPath->add($path);\n }\n return DataStruct::search($this->row, $path);\n }",
"public function getParentFolder() {\n $explodedKey = explode(\"/\", $this->getKey());\n array_pop($explodedKey);\n return join(\"/\", $explodedKey);\n }",
"public function get_parent($node = 0) {\n $this->_init();\n if (isset($this->lookup[$node])) {\n return isset($this->lookup[$this->lookup[$node][$this->col_parent]]) ? $this->lookup[$this->lookup[$node][$this->col_parent]] : 0;\n }\n return false;\n }",
"public function getLexicalParent() : ?Path {\n\t\t// TODO unimplemented\n\t}",
"private function traitMetadataGetParentSection($path) {\n\t\t// get the list of array key sections\n\t\t$path_parts = explode($this->_trait_metadata_path_separator, $path);\n\t\t// get the last part of the path\n\t\t$section = array_pop($path_parts);\n\t\t// rebuild the parent path\n\t\t$parent_path = implode($this->_trait_metadata_path_separator, $path_parts);\n\t\ttry {\n\t\t\t// check to see if the metadata structure has the parent path section\n\t\t\t$parent_section = $this->traitArrayGetSectionFromPath($this->_trait_metadata, $parent_path);\n\t\t\tif(!is_array($parent_section) && !array_key_exists($section, $parent_section)) {\n\t\t\t// the section to unset doesn't exist\n\t\t\t\tthrow MetadataTraitException::withPathNotFound($parent_path, $section);\n\t\t\t}\n\t\t} catch (MetadataTraitException $ex) {\n\t\t// the parent path is not in the metadata structure\n\t\t\tthrow new MetadataTraitException($ex->getMessage(), $ex->getCode(), $ex);\n\t\t}\n\t\t// return details about the parent section and the specific section\n\t\treturn [\n\t\t\t\"path\"\t=> $parent_path,\n\t\t\t\"name\"\t=> $section,\n\t\t\t\"data\"\t=> &$parent_section\n\t\t];\n\t}",
"function getFullParentPath($fileId){\n\n $path = \"\";\n $parentID = 0;\n\n /* check if there is any entry */\n $checkQuery = \"\n SELECT COUNT(*)\n FROM `$SQL_DATABASE`.`$sqlTable_MiscSync`\n WHERE `ID_Sync` = '$fileId'\";\n $checkFetch = Xsy_Sql_FetchAll($checkQuery);\n $checkCount = $checkFetch[0]['COUNT(*)'];\n\n if($checkCount > 0 ){\n $query = \"\n SELECT `Int_Parent%Folder`\n FROM `$SQL_DATABASE`.`$sqlTable_MiscSync`\n WHERE `Id_Sync` = '$fileId'\";\n $fetch = Xsy_Sql_FetchAll($query);\n \n $parentID = $fetch[0]['Int_Parent%Folder`'];\n \n if($parentID == 0){\n return \"/\";\n }\n else{\n return getFullParentPath($parentID).findFolderNameById($parentID).\"/\";\n }\n\n }\n else{\n $path = NULL;\n }\n\n return $path;\n}",
"public static function getNodeFromPath(&$path);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get current API Id | public function getApiId(){
return $this->apiId;
} | [
"public function getApiId()\n {\n return $this->apiId;\n }",
"public function getApiId() \n {\n return $this->_api_id;\n }",
"public function getApi_id()\n {\n return $this->api_id;\n }",
"public function GetAPIID() {\n return $this->generateFingerPrint();\n }",
"public function getApiAuthId()\n {\n return $this->getConfig('auth_id');\n }",
"public function getApiLogId()\n {\n return $this->getData(self::KEY_API_LOG_ID);\n }",
"public function getPlayerApiId() {\n\t\treturn ($this->playerApiId);\n\t}",
"public function getApiLogId();",
"public function getApiSessionId()\n {\n if(empty($this->apiSessionId))\n {\n $this->authnicate();\n }\n return $this->apiSessionId;\n }",
"public function getTeamApiId() {\n\t\treturn ($this->teamApiId);\n\t}",
"public function getApiConfigId()\n {\n return $this->api_config_id;\n }",
"public function getProviderApiId()\n {\n return $this->provider_api_id;\n }",
"public function getCurrentId() {\n\t\treturn Sentry::getUser()->id;\n\t}",
"public function getApikey()\n {\n return ($this->instanceApikey) ? $this->instanceApikey : self::$apikey;\n }",
"public function getApiSpaceId()\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_LIVECHAT_API_SPACE_ID,\n $this->scopeInterface,\n (string) $this->websiteId\n );\n }",
"private function get_processing_api_id() : string {\n\t\t\treturn \"processing_api_{$this->get_currency_short_name()}\";\n\t\t}",
"public static function getUserID(){\n if(isset($_REQUEST['api_key']) && !empty($_REQUEST['api_key']))\n {\n $user=new User;\n $res=$user->getUserbyAPIKey($_REQUEST['api_key']);\n return $res['0']->id;\n }\n \n return (isset($_SESSION['login']) ? $_SESSION['login'] : \"1\") ;\n }",
"public function getCurrentId() {\n\t\treturn $this->current_user;\n\t}",
"private function get_custom_processing_api_id() : string {\n\t\t\treturn \"custom_api_{$this->get_currency_short_name()}\";\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The lower limit on years that the Calendar Engine can work with | function getMinYears()
{
return 0;
} | [
"function getMaxYears()\n {\n return 2037;\n }",
"public function getMaxAllowedYear() {\n\t\treturn $this->__maximumAllowedYear;\n\t}",
"public function get_max_year() {\n return 1429;\n }",
"function getMaxYears()\n {\n return $this->m_maxyears;\n }",
"function vital_gform_set_max_year($max_year) {\n $future_year = strtotime('+3 years');\n return date('Y', $future_year);\n}",
"public function getMaxYear()\n {\n return $this->getMinYear()+$this->getQuantityYears()-1;\n }",
"public function get_min_year() {\n return 1278;\n }",
"public function getMaxYear(){\n\t\treturn $this->_MaxYear;\n\t}",
"public function validYear() {\n\t\t$nowYear = date('Y');\n\t\treturn in_array($this->year, range($nowYear, $nowYear+20));\n\t}",
"public static\n\tfunction getMaxYear()\n\t{\n\n\t\t$params = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t$maxyear = $params->get(\"com_latestyear\", 2150);\n\t\t$maxyear = JEVHelper::getYearNumber($maxyear);\n\n\t\t//Just in case we got text here.\n\t\tif (!is_numeric($maxyear))\n\t\t{\n\t\t\t$maxyear = \"2150\";\n\t\t}\n\n\t\treturn $maxyear;\n\n\t}",
"public function setMaxAllowedYear($maxYear) {\n $this->maxYear = $maxYear;\n }",
"public function twoDigitYearMax($value=null) { }",
"function force_end_of_year() {\n \t\t\n \t\tglobal $zurich;\n \t\t\n \t\t$zurich->end_of_turn(1);\n \t}",
"public function getYearEnd(){return $this->_yearEnd;}",
"public function supportsYears()\n {\n return false;\n }",
"public function getMinYear(){\n\t\treturn $this->_MinYear;\n\t}",
"protected function getMinimumReportYear(){\n if( $this->getCurrentUser() != null && in_array('Admin', $this->getCurrentRoles()) ){\n return 2017;\n }\n else{\n return 2018;\n }\n }",
"public function getYearStart(){return $this->_yearStart;}",
"public function setMinAllowedYear($minYear) {\n\t\t$this->__minimumAllowedYear = $minYear;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get pay rate form element | function _acecrew_get_rates_form($payrateid = null) {
//select available variants
$query = "SELECT n.nid,
cpr.field_payrate_name_value as payrate_name,
cpr.field_payrate_perhour_value as perhour
FROM {node} n JOIN {content_type_crew_payrates} cpr ON n.nid = cpr.nid
WHERE n.type = '%s'
ORDER BY perhour ASC";
$query_result = db_query($query, 'crew_payrates');
//generate options
$options = array();
while ($row = db_fetch_object($query_result)) {
$options[$row->nid] = $row->payrate_name . ' (' . $row->perhour . 'GBP)';
}
//create select form element
$form['Crew Skills']['acecrew_payrate_id'] = array(
'#type' => 'select',
'#title' => t('Pay Rate'),
'#options' => $options,
'#required' => TRUE,
'#weight' => 99,
);
//set default(selected) value
if ($payrateid){
$form['Crew Skills']['acecrew_payrate_id']['#default_value'] = $payrateid;
}
return $form;
} | [
"public function getPayRate();",
"public function getRate(){\n return $this->rate;\n }",
"public function getFieldPriceRate()\n {\n return $this->fieldPriceRate;\n }",
"private function getRate() {\n if ($this->type == 'programming')\n return $this->project\n ->contract\n ->programming_hourly_rate;\n\n if ($this->type == 'sysadmin')\n return $this->project->contract->sysadmin_hourly_rate;\n\n if ($this->type == 'consulting')\n return $this->project->contract->consulting_hourly_rate;\n\n // TODO: Add in an exception here\n return null;\n }",
"public function getRate()\n {\n return $this->rate;\n }",
"public function getShippingRateInput();",
"public function getRate($currency);",
"function getCurrentPayrate() {\n\n\t\t//$obj_id = $this->guide_id;\n\n\t\t$current = $this->getGuidePayrates();\n\n\t\tif (count($current) == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $current[0]['rate'];\n\t\t}\n\n\t}",
"public function getRateValue(): float;",
"public function rate()\n {\n return $this->rate;\n }",
"public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }",
"function getPricingElement($name);",
"public function getFeeRate()\n {\n return $this->fee_rate;\n }",
"public function getRate() {\n\t\t$rate = $this->_get('in_rate');\n\t\tif($rate === null) {\n\t\t\t$cur = $this->get('in_currency');\n\t\t\tswitch($cur) {\n\t\t\t\tcase 'Mk' :\n\t\t\t\t\t$rate = 5.94573;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'GEO' :\n\t\t\t\t\t$rate = 1.5;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $rate;\n\t}",
"public function getRateAmount()\n\t{\n\t\treturn $this->rate_amount;\n\t}",
"function give_get_form_price( $form_id = 0 ) {\n\n\tif ( empty( $form_id ) ) {\n\t\treturn false;\n\t}\n\n\t$form = new Give_Donate_Form( $form_id );\n\n\treturn $form->__get( 'price' );\n}",
"public function getRateAmount()\n {\n return $this->rateAmount;\n }",
"public function rateAction()\n {\n $html = '';\n $paymentMethod = $this->getRequest()->getParam('paymentMethod');\n $calcValue = $this->getRequest()->getParam('calcValue');\n $ratePayShopId = $this->getRequest()->getParam('ratePayshopId');\n $amount = $this->getRequest()->getParam('amount');\n $ratePayCurrency = $this->getRequest()->getParam('ratePayCurrency');\n $isAdmin = $this->getRequest()->getParam('isAdmin');\n $quoteId = $this->getRequest()->getParam('quoteId');\n $this->loadLayout();\n\n try {\n if (preg_match('/^[0-9]+(\\.[0-9][0-9][0-9])?(,[0-9]{1,2})?$/', $calcValue)) {\n $calcValue = str_replace(\".\", \"\", $calcValue);\n $calcValue = str_replace(\",\", \".\", $calcValue);\n $calcValue = floor($calcValue * 100); //MAGE-363: Use cent instead of floating currency\n\n $client = Mage::getSingleton('payone_core/mapper_apiRequest_payment_genericpayment');\n $ratePayConfigModel = Mage::getSingleton('payone_core/payment_method_ratepay');\n $getConfig = $this->getConfig($ratePayConfigModel, $isAdmin, $quoteId);\n $result = $client->ratePayCalculationRequest($amount, $ratePayShopId, $ratePayCurrency, $calcValue, null, $getConfig, 'calculation-by-rate');\n\n if ($result instanceof Payone_Api_Response_Genericpayment_Ok) {\n $responseData = $result->getPayData()->toAssocArray();\n $initialRateChoice = $this->getRequest()->getParam('calcValue');\n $message = $this->__('lang_calculation_rate_ok');\n\n // if the calculated installment value is different from the choice, we notify the user\n if ($initialRateChoice != $responseData['rate']) {\n // if value is lower than choice AND number of months is at maximum (36)\n // then the choice was too low\n // otherwise, it just got adapted to the closest available installment value\n if (\n $initialRateChoice < $responseData['rate']\n && $responseData['number-of-rates'] == 36\n ) {\n $message = $this->__('lang_calculation_rate_too_low');\n } else {\n $message = $this->__('lang_calculation_rate_not_available');\n }\n }\n $responseData['calculation-result-message'] = $message;\n\n /** @var Payone_Core_Block_Checkout_RatePayInstallmentplan $reviewBlock */\n $reviewBlock = $this->getLayout()->getBlock('payone_ratepay.checkout.installmentplan');\n $reviewBlock->setData($responseData);\n $reviewBlock->setIsAdmin($isAdmin);\n $html = $reviewBlock->toHtml();\n\n //if admin order, some fields are added to store,\n //otherwise, data are stores into session\n if (!$isAdmin) {\n //set payone Session Data\n $this->setSessionData($responseData, $paymentMethod);\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n if($result instanceof Payone_Api_Response_Error) {\n $html = \"<div class='ratepay-result rateError'>\" . $this->__($result->getCustomermessage()) . \"</div>\";\n }\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n $html = \"<div class='ratepay-result rateError'>\" . $this->__('lang_error') . \":<br/>\" . $this->__('lang_wrong_value') . \"</div>\";\n }\n } catch (Exception $e) {\n $this->unsetSessionData($paymentMethod);\n Mage::getSingleton('checkout/session')->addError(\n $this->__('Unable to initialize Rate Pay Installement.')\n );\n Mage::logException($e);\n }\n \n $this->getResponse()\n ->clearHeaders()\n ->setHeader('Content-Type', 'text/html', true)\n ->setBody($html);\n return;\n }",
"function getBaseRate(){\n $baseRate = XMLOperation::invoke(function($f){\n return $f\n ->setFilePath(\"rateCurrencies\")\n ->findElements(\"//currencies/@base\");\n });\n\t\treturn $baseRate->item(0)->nodeValue;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the tincanlaunch_lrs object. | function tincanlaunch_build_lrs_settings(stdClass $tincanlaunch) {
// Data for tincanlaunch_lrs table.
$tincanlaunchlrs = new stdClass();
$tincanlaunchlrs->lrsendpoint = $tincanlaunch->tincanlaunchlrsendpoint;
$tincanlaunchlrs->lrsauthentication = $tincanlaunch->tincanlaunchlrsauthentication;
$tincanlaunchlrs->customacchp = $tincanlaunch->tincanlaunchcustomacchp;
$tincanlaunchlrs->useactoremail = $tincanlaunch->tincanlaunchuseactoremail;
$tincanlaunchlrs->lrsduration = $tincanlaunch->tincanlaunchlrsduration;
$tincanlaunchlrs->tincanlaunchid = $tincanlaunch->instance;
$tincanlaunchlrs->lrslogin = $tincanlaunch->tincanlaunchlrslogin;
$tincanlaunchlrs->lrspass = $tincanlaunch->tincanlaunchlrspass;
return $tincanlaunchlrs;
} | [
"public static function lti_launch() {\n global $wp;\n\n // allows deep links with an LTI launch urls like:\n // candela/api/lti/BLOGID?page_title=page_name\n // candela/api/lti/BLOGID?page_title=section_name%2Fpage_name\n if ( ! empty($wp->query_vars['page_title'] ) ) {\n switch_to_blog((int)$wp->query_vars['blog']);\n $page = $wp->query_vars['page_title'];\n if ( $page[0] == '/' ){\n $slash = '';\n } else {\n $slash = '/';\n }\n\n // todo make all the hide_* parameters copy over?\n // If it's a deep LTI link default to showing content_only\n wp_redirect( get_bloginfo('wpurl') . $slash . $page . \"?content_only\" );\n exit;\n }\n\n // allows deep links with an LTI launch urls like:\n // candela/api/lti/BLOGID?page_id=10\n if ( ! empty($wp->query_vars['page_id'] ) && is_numeric($wp->query_vars['page_id']) ) {\n switch_to_blog((int)$wp->query_vars['blog']);\n $url = get_bloginfo('wpurl') . \"?p=\" . $wp->query_vars['page_id'] . \"&content_only<i_context_id=\" . $wp->query_vars['context_id'];\n if (! empty($wp->query_vars['ext_post_message_navigation'] )){\n $url = $url . \"<i_nav\";\n }\n wp_redirect( $url );\n exit;\n }\n\n // allows deep links with an LTI custom parameter like:\n // custom_page_id=10\n if ( ! empty($wp->query_vars['custom_page_id'] ) && is_numeric($wp->query_vars['custom_page_id']) ) {\n switch_to_blog((int)$wp->query_vars['blog']);\n wp_redirect( get_bloginfo('wpurl') . \"?p=\" . $wp->query_vars['custom_page_id'] . \"&content_only<i_context_id=\" . $wp->query_vars['context_id'] );\n exit;\n }\n\n if ( ! empty($wp->query_vars['resource_link_id'] ) ) {\n $map = CandelaLTI::get_lti_map($wp->query_vars['resource_link_id']);\n if ( ! empty( $map->target_action ) ) {\n wp_redirect( $map->target_action );\n exit;\n }\n }\n // Currently just redirect to the blog/site homepage.\n if ( ! ( empty( $wp->query_vars['blog'] ) ) ){\n switch_to_blog((int)$wp->query_vars['blog']);\n wp_redirect( get_bloginfo('wpurl') . '/?content_only' );\n exit;\n }\n\n // redirect to primary site\n wp_redirect( get_site_url( 1 ) );\n exit;\n }",
"function tincan_launched_statement($registrationid) {\n global $tincanlaunch, $course, $CFG;\n $tincanlaunchsettings = tincanlaunch_settings($tincanlaunch->id);\n\n $version = $tincanlaunchsettings['tincanlaunchlrsversion'];\n $url = $tincanlaunchsettings['tincanlaunchlrsendpoint'];\n $basiclogin = $tincanlaunchsettings['tincanlaunchlrslogin'];\n $basicpass = $tincanlaunchsettings['tincanlaunchlrspass'];\n\n $tincanphputil = new \\TinCan\\Util();\n $statementid = $tincanphputil->getUUID();\n\n $lrs = new \\TinCan\\RemoteLRS($url, $version, $basiclogin, $basicpass);\n\n $parentdefinition = array();\n if (isset($course->summary) && $course->summary !== \"\") {\n $parentdefinition[\"description\"] = array(\n \"en-US\" => $course->summary\n );\n }\n\n if (isset($course->fullname) && $course->fullname !== \"\") {\n $parentdefinition[\"name\"] = array(\n \"en-US\" => $course->fullname\n );\n }\n\n $statement = new \\TinCan\\Statement(\n array(\n 'id' => $statementid,\n 'actor' => tincanlaunch_getactor($tincanlaunch->id),\n 'verb' => array(\n 'id' => 'http://adlnet.gov/expapi/verbs/launched',\n 'display' => array(\n 'en-US' => 'launched'\n )\n ),\n\n 'object' => array(\n 'id' => $tincanlaunch->tincanactivityid,\n 'objectType' => \"Activity\"\n ),\n\n \"context\" => array(\n \"registration\" => $registrationid,\n \"contextActivities\" => array(\n \"parent\" => array(\n array(\n \"id\" => $CFG->wwwroot . '/course/view.php?id=' . $course->id,\n \"objectType\" => \"Activity\",\n \"definition\" => $parentdefinition\n )\n ),\n \"grouping\" => array(\n array(\n \"id\" => $CFG->wwwroot,\n \"objectType\" => \"Activity\"\n )\n ),\n \"category\" => array(\n array(\n \"id\" => \"https://moodle.org\",\n \"objectType\" => \"Activity\",\n \"definition\" => array(\n \"type\" => \"http://id.tincanapi.com/activitytype/source\"\n )\n )\n )\n ),\n \"language\" => tincanlaunch_get_moodle_language()\n ),\n \"timestamp\" => date(DATE_ATOM)\n )\n );\n\n $response = $lrs->saveStatement($statement);\n return $response;\n}",
"function tincanlaunch_settings($instance) {\n global $DB, $tincanlaunchsettings;\n\n if (!is_null($tincanlaunchsettings)) {\n return $tincanlaunchsettings;\n }\n\n $expresult = array();\n $conditions = array('tincanlaunchid' => $instance);\n $fields = '*';\n $strictness = 'IGNORE_MISSING';\n $activitysettings = $DB->get_record('tincanlaunch_lrs', $conditions, $fields, $strictness);\n\n // If global settings are not used, retrieve activity settings.\n if (!use_global_lrs_settings($instance)) {\n $expresult['tincanlaunchlrsendpoint'] = $activitysettings->lrsendpoint;\n $expresult['tincanlaunchlrsauthentication'] = $activitysettings->lrsauthentication;\n $expresult['tincanlaunchlrslogin'] = $activitysettings->lrslogin;\n $expresult['tincanlaunchlrspass'] = $activitysettings->lrspass;\n $expresult['tincanlaunchcustomacchp'] = $activitysettings->customacchp;\n $expresult['tincanlaunchuseactoremail'] = $activitysettings->useactoremail;\n $expresult['tincanlaunchlrsduration'] = $activitysettings->lrsduration;\n } else { // Use global lrs settings.\n $result = $DB->get_records('config_plugins', array('plugin' => 'tincanlaunch'));\n foreach ($result as $value) {\n $expresult[$value->name] = $value->value;\n }\n }\n\n $expresult['tincanlaunchlrsversion'] = '1.0.0';\n\n $tincanlaunchsettings = $expresult;\n return $expresult;\n}",
"function tincanlaunch_add_instance($tincanlaunch, $mform=null) {\n global $DB;\n\n $tincanlaunch->timecreated = time();\n\n // Need the id of the newly created instance to return (and use if override defaults checkbox is checked).\n $tincanlaunch->id = $DB->insert_record('tincanlaunch', $tincanlaunch);\n\n $tincanlaunchlrs = tincanlaunch_build_lrs_settings($tincanlaunch);\n\n // Determine if override defaults checkbox is checked or we need to save watershed creds.\n if ($tincanlaunch->overridedefaults == '1' || $tincanlaunchlrs->lrsauthentication == '2') {\n $tincanlaunchlrs->tincanlaunchid = $tincanlaunch->id;\n\n // Insert data into tincanlaunch_lrs table.\n if (!$DB->insert_record('tincanlaunch_lrs', $tincanlaunchlrs)) {\n return false;\n }\n }\n\n // Process uploaded file.\n if (!empty($tincanlaunch->packagefile)) {\n tincanlaunch_process_new_package($tincanlaunch);\n }\n\n return $tincanlaunch->id;\n}",
"public function build()\n {\n\t $settings = Setting::find(1);\n\t\n\t if ($settings->mailgun_use) {\n\t $this->sendByMailGunAPI();\n\t } else {\n\t\t $options = [\n\t\t\t 'from_name' => empty($settings->from_name) ? config('mail.from.name') : $settings->from_name,\n\t\t\t 'from_email' => empty($settings->from_email) ? config('mail.from.address') : $settings->from_email,\n\t\t ];\n\t\t\n\t\t $this->from(['address' => $options['from_email'], 'name' => $options['from_name']])\n\t\t\t ->subject($this->subject)\n\t\t\t ->view($this->view)\n\t\t\t ->with(['data' => $this->data]);\n\n\t\t foreach($this->to as $receiver){\n\n\t\t\t $language = Language::whereShort(app()->getLocale())->first();\n\t\t \t$html = View::make($this->view, ['data' => $this->data])->render();\n\n\t\t\t LogEmail::create([\n\t\t\t\t 'language_id' => $language ? $language->id : 1,\n\t\t\t\t 'type' => null,\n\t\t\t\t 'from' => $options['from_email'],\n\t\t\t\t 'to' => $receiver['address'],\n\t\t\t\t 'subject' => $this->subject,\n\t\t\t\t 'message' => $html,\n\t\t\t\t 'mailgun_id' => null,\n\t\t\t\t 'mailgun_status' => null\n\t\t\t ]);\n\t\t }\n\t }\n }",
"function tincanlaunch_get_creds_learninglocker($basiclogin, $basicpass, $url, $expiry, $registrationuuid) {\n global $tincanlaunch;\n $actor = tincanlaunch_getactor($tincanlaunch->id);\n $data = array(\n 'scope' => array('all'),\n 'expiry' => $expiry->format(DATE_ATOM),\n 'historical' => false,\n 'actors' => array(\n \"objectType\" => 'Person',\n \"name\" => array($actor->getName())\n ),\n 'auth' => $actor,\n 'activity' => array(\n $tincanlaunch->tincanactivityid,\n ),\n 'registration' => $registrationuuid\n );\n\n if (null !== $actor->getMbox()) {\n $data['actors']['mbox'] = array($actor->getMbox());\n } else if (null !== $actor->getMbox_sha1sum()) {\n $data['actors']['mbox_sha1sum'] = array($actor->getMbox_sha1sum());\n } else if (null !== $actor->getOpenid()) {\n $data['actors']['openid'] = array($actor->getOpenid());\n } else if (null !== $actor->getAccount()) {\n $data['actors']['account'] = array($actor->getAccount());\n }\n\n $streamopt = array(\n 'ssl' => array(\n 'verify-peer' => false,\n ),\n 'http' => array(\n 'method' => 'POST',\n 'ignore_errors' => false,\n 'header' => array(\n 'Authorization: Basic ' . base64_encode(trim($basiclogin) . ':' . trim($basicpass)),\n 'Content-Type: application/json',\n 'Accept: application/json, */*; q=0.01',\n ),\n 'content' => tincanlaunch_myjson_encode($data),\n ),\n );\n\n $streamparams = array();\n\n $context = stream_context_create($streamopt);\n\n $stream = fopen(trim($url) . 'Basic/request' . '?' . http_build_query($streamparams, '', '&'), 'rb', false, $context);\n\n $returncode = explode(' ', $http_response_header[0]);\n $returncode = (int) $returncode[1];\n\n switch ($returncode) {\n case 200:\n $ret = stream_get_contents($stream);\n $meta = stream_get_meta_data($stream);\n\n if ($ret) {\n $ret = json_decode($ret, true);\n }\n break;\n default: // Error!\n $ret = null;\n $meta = $returncode;\n break;\n }\n\n return array(\n 'contents' => $ret,\n 'metadata' => $meta\n );\n}",
"function tincanlaunch_get_statements($url, $basiclogin, $basicpass, $version, $activityid, $agent, $verb, $since = null) {\n\n $lrs = new \\TinCan\\RemoteLRS($url, $version, $basiclogin, $basicpass);\n\n $statementsquery = array(\n \"agent\" => $agent,\n \"verb\" => new \\TinCan\\Verb(array(\"id\" => trim($verb))),\n \"activity\" => new \\TinCan\\Activity(array(\"id\" => trim($activityid))),\n \"related_activities\" => \"false\",\n \"format\" => \"ids\"\n );\n\n if (!is_null($since)) {\n $statementsquery[\"since\"] = $since;\n }\n\n // Get all the statements from the LRS.\n $statementsresponse = $lrs->queryStatements($statementsquery);\n\n if ($statementsresponse->success == false) {\n return $statementsresponse;\n }\n\n $allthestatements = $statementsresponse->content->getStatements();\n $morestatementsurl = $statementsresponse->content->getMore();\n while (!empty($morestatementsurl)) {\n $morestmtsresponse = $lrs->moreStatements($morestatementsurl);\n if ($morestmtsresponse->success == false) {\n return $morestmtsresponse;\n }\n $morestatements = $morestmtsresponse->content->getStatements();\n $morestatementsurl = $morestmtsresponse->content->getMore();\n // Note: due to the structure of the arrays, array_merge does not work as expected.\n foreach ($morestatements as $morestatement) {\n array_push($allthestatements, $morestatement);\n }\n }\n\n return new \\TinCan\\LRSResponse(\n $statementsresponse->success,\n $allthestatements,\n $statementsresponse->httpResponse\n );\n}",
"public function build() {\n\n $links_unchecked = $this->connection->query('SELECT COUNT(1) FROM {ocms_linkchecker_link} WHERE last_checked = :last_checked AND status = :status', array(':last_checked' => 0, ':status' => 1))->fetchField();\n if ($links_unchecked > 0) {\n $links_all = $this->connection->query('SELECT COUNT(1) FROM {ocms_linkchecker_link} WHERE status = :status', array(':status' => 1))->fetchField();\n drupal_set_message($this->translation->formatPlural($links_unchecked,\n 'There is 1 unchecked link of about @links_all links in the database. Please be patient until all links have been checked via cron.',\n 'There are @count unchecked links of about @links_all links in the database. Please be patient until all links have been checked via cron.',\n array('@links_all' => $links_all)), 'warning');\n }\n\n $query = $this->query;\n\n $header = array(\n array('data' => $this->t('URL'), 'field' => 'url', 'sort' => 'desc'),\n array('data' => $this->t('Response'), 'field' => 'code', 'sort' => 'desc'),\n array('data' => $this->t('Error'), 'field' => 'error'),\n array('data' => $this->t('Operations')),\n );\n\n $result = $query\n ->limit(50)\n ->orderByHeader($header)\n ->execute();\n\n // Evaluate permission once for performance reasons.\n $accessEditLinkSettings = $this->currentUser->hasPermission('edit link settings');\n $accessAdministerBlocks = $this->currentUser->hasPermission('administer blocks');\n $accessAdministerRedirects = $this->currentUser('administer redirects');\n\n $rows = array();\n foreach ($result as $link) {\n // Get the node, block and comment IDs that refer to this broken link and\n // that the current user has access to.\n $nids = $this->access->accessNodeIds($link, $this->currentUser);\n// $cids = _linkchecker_link_comment_ids($link, $this->currentUser);\n// $bids = _linkchecker_link_block_ids($link);\n\n // If the user does not have access to see this link anywhere, do not\n // display it, for reasons explained in _linkchecker_link_access(). We\n // still need to fill the table row, though, so as not to throw off the\n // number of items in the pager.\n// if (empty($nids) && empty($cids) && empty($bids)) {\n if (empty($nids)) {\n $rows[] = array(array('data' => $this->t('Permission restrictions deny you access to this broken link.'), 'colspan' => count($header)));\n continue;\n }\n\n $links = array();\n\n // Show links to link settings.\n if ($accessEditLinkSettings) {\n\t$url = Url::fromRoute('ocms_linkchecker.edit_link', array('linkId' => $link->lid), array('query' => $this->redirectDestination->getAsArray()));\n $links[] = Link::fromTextAndUrl($this->t('Edit link settings'), $url)->toString();\n }\n\n // Show link to nodes having this broken link.\n foreach ($nids as $nid) {\n $url = Url::fromUri('internal:/node/' . $nid . '/edit', array('query' => $this->redirectDestination->getAsArray()));\n $links[] = Link::fromTextAndUrl($this->t('Edit node @node', array('@node' => $nid)), $url)->toString();\n }\n\n // Show link to comments having this broken link.\n// $comment_types = linkchecker_scan_comment_types();\n// if (module_exists('comment') && !empty($comment_types)) {\n// foreach ($cids as $cid) {\n// $links[] = l(t('Edit comment @comment', array('@comment' => $cid)), 'comment/' . $cid . '/edit', array('query' => drupal_get_destination()));\n// }\n// }\n\n // Show link to blocks having this broken link.\n// if ($accessAdministerBlocks) {\n// foreach ($bids as $bid) {\n// $links[] = l(t('Edit block @block', array('@block' => $bid)), 'admin/structure/block/manage/block/' . $bid . '/configure', array('query' => drupal_get_destination()));\n// }\n// }\n\n // Show link to redirect this broken internal link.\n// if (module_exists('redirect') && $access_administer_redirects && _linkchecker_is_internal_url($link)) {\n// $links[] = l(t('Create redirection'), 'admin/config/search/redirect/add', array('query' => array('source' => $link->internal, drupal_get_destination())));\n// }\n\n $url = Url::fromUri($link->url);\n // Create table data for output.\n $rows[] = array(\n 'data' => array(\n Link::fromTextAndUrl(Html::escape($link->url), $url)->toString(),\n Html::escape($link->code),\n Html::escape($link->error),\n ['data' => ['#theme' => 'item_list', '#items' => $links]],\n ),\n );\n }\n\n $build['broken_links_table'] = array(\n '#type' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#empty' => $this->t('No broken links have been found.'),\n );\n $build['broken_links_pager'] = array('#type' => 'pager');\n\n // I think I may not need to set cache meta data\n // @todo: How do I want to cache this page?\n // Will I use cache tags, cache contexts, both of them?\n //$build['#cache']['tags'][] = 'node_list';\n return $build;\n }",
"public function getLticmProperties(){\n\t\t$learning_tool_interoperatibility_common_messaging_properties = array(\n\t\t\t'canvas.instructure.com' => array( // platform\n\t\t\t\t'properties' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'tool_id',\n\t\t\t\t\t\t'value' => 'lti.sso.test',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'privacy_level',\n\t\t\t\t\t\t'value' => 'public',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'domain',\n\t\t\t\t\t\t'value' => 'lti.sso.test',\n\t\t\t\t\t),\n\t\t\t\t),\n/*\n\t\t\t\t'options' => array(\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' => 'SISID',\n\t\t\t\t\t\t\t'value' => '$Canvas.user.sisSourceId',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t),\n\t\t\t\t),\n*/\n\t\t\t),\n\t\t\t'itslearning.com' => array( // platform\n\t\t\t\t'properties' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'tool_id',\n\t\t\t\t\t\t'value' => 'lti.sso.test',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'privacy_level',\n\t\t\t\t\t\t'value' => 'public',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'domain',\n\t\t\t\t\t\t'value' => 'lti.sso.test',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t'options' => array(\n\t\t\t\t\t'properties' => array(\n//\t\t\t\t\t\t// itslearning will always append the lis_person_sourcedid by default; do not need to request as a custom field\n//\t\t\t\t\t\tarray(\n//\t\t\t\t\t\t\t'name' => 'lis_person_sourcedid',\n//\t\t\t\t\t\t\t'value' => 'lis_person_sourcedid',\n//\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t),\n\t\t);\n\t\treturn $learning_tool_interoperatibility_common_messaging_properties;\n\t}",
"public function build()\r\n {\r\n if ( !Settings::i()->dtprofiler_enabled_logs ) {\r\n return \\null;\r\n }\r\n\r\n $sql = Db::i()->select( '*', 'core_log', \\null, 'id DESC', Settings::i()->dtprofiler_logs_amount );\r\n $logs = new ActiveRecordIterator( $sql, Log::class );\r\n $list = [];\r\n\r\n /* @var \\IPS\\Log $log */\r\n foreach ( $logs as $log ) {\r\n $url = Url::internal( 'app=toolbox&module=bt&controller=bt', 'front' )->setQueryString( [\r\n 'do' => 'log',\r\n 'id' => $log->id,\r\n ] );\r\n $data = DateTime::ts( $log->time );\r\n $name = 'Date: ' . $data;\r\n if ( $log->category !== \\null ) {\r\n $name .= '<br> Type: ' . $log->category;\r\n }\r\n\r\n if ( $log->url !== \\null ) {\r\n $name .= '<br> URL: ' . $log->url;\r\n }\r\n\r\n $name .= '<br>' . nl2br( htmlentities( $log->message ) );\r\n $list[] = Theme::i()->getTemplate( 'generic', 'toolbox', 'front' )->anchor( $name, $url, \\true );\r\n }\r\n\r\n return Theme::i()->getTemplate( 'generic', 'toolbox', 'front' )->button( 'Logs', 'logs', 'list of logs', $list, count( $list ), 'list', \\true, \\false );\r\n\r\n }",
"public function evaluate_lthr_list(){\n\t\t\t\t\t\t\n\t\t$this->db->join('tlhr_eval_ratings', 'tlhr_eval_ratings.tlhr_id = qpeteamleadtohr.tlhr_id');\n\t\t$this->db->join('tlhr_eval_factors', 'tlhr_eval_factors.tlhr_eval_fact_id = tlhr_eval_ratings.tlhr_eval_fact_id');\n\t\t$this->db->join('tlhr_categories', 'tlhr_categories.tlhr_cat_id = tlhr_eval_factors.tlhr_eval_cat');\n\t\t$this->db->join('user', 'user.User_id = qpeteamleadtohr.tlhr_name');\n\t\t$this->db->join('departments', 'departments.dept_id = qpeteamleadtohr.tlhr_department');\n\t\t$this->db->join('projects', 'projects.project_id = qpeteamleadtohr.tlhr_project');\n\t\t$this->db->join('designations', 'designations.designation_id = qpeteamleadtohr.tlhr_designation');\n\t\t\n\t\t$this->db->group_by(\"qpeteamleadtohr.tlhr_id\");\n\t\t$query = $this->db->get('qpeteamleadtohr');\n\n\t\treturn $query->result_array();\n\t}",
"static private function MakeRunList ()\n {\n\n self::$RunList = array();\n\n\n /// Add 'core' modules first\n foreach ( self::$ModuleList as $module )\n {\n if ( $module['type'] == 'core' )\n {\n self::AddModuleToRunList($module['name']);\n }\n }\n\n /// Add modules requested by current layout\n foreach ( explode(\" \", self::$Layout['modules']) as $module )\n {\n if ( !array_key_exists($module, self::$ModuleList) )\n {\n trigger_error(\"Module '{$module}' in layout '\".self::$Layout['name'].\"' not found in module list!\", E_USER_ERROR);\n }\n\n self::AddModuleToRunlist($module);\n }\n }",
"protected function build()\n {\n Debug::info(\"Controller: Build Call\");\n self::$template->addFilter('ui', '#{UI}(.*?){/UI}#is', (Issue::getUI() ? '$1' : ''), true);\n self::$template->set('CONTENT', self::$content);\n self::$template->set('TITLE', self::$title);\n self::$template->set('PAGE_DESCRIPTION', self::$pageDescription);\n self::$template->set('NOTICE', Issue::getNotice());\n self::$template->set('SUCCESS', Issue::getSuccess());\n self::$template->set('ERROR', Issue::getError());\n self::$template->set('INFO', Issue::getInfo());\n self::$template->render();\n }",
"public function __construct($success_trials, $clone_from_net = null) {\n\n\t\tif ( $clone_from_net ) {\n\t\t\t$this->net = $this->cloneNet($clone_from_net);\n\t\t}\n\t\telse {\n\t\t\t$this->net = $this->generateFlatNet(\n\t\t\t\t$success_trials /* <-- first row generated from array size in here */,\n\t\t\t\t[4,2,1]\n\t\t\t);\n\t\t}\n\t}",
"public function buildListings();",
"function build_lebenswelt_template(){\t\n\tglobal $lebenswelt_template;\n\n\t$lebenswelt_template = new LebensweltTemplate;\t\n}",
"private function buildRequest() {\n // call resource\n $this->call_resource = curl_init($this->buildRequestUrl());\n curl_setopt($this->call_resource, CURLOPT_RETURNTRANSFER, true);\n }",
"private function buildNotificationsBlock()\n {\n //====================================================================//\n // Execute Local SelfTest Function\n Splash::selfTest();\n //====================================================================//\n // Get Log\n $logs = Splash::log();\n //====================================================================//\n // If test was passed\n if (empty($logs->err)) {\n $this->blocksFactory()->addNotificationsBlock(array(\"success\" => \"Self-Test Passed!\"));\n }\n //====================================================================//\n // Add Error Notifications\n foreach ($logs->err as $message) {\n $this->blocksFactory()->addNotificationsBlock(array(\"error\" => $message));\n }\n //====================================================================//\n // Add Warning Notifications\n foreach ($logs->war as $message) {\n $this->blocksFactory()->addNotificationsBlock(array(\"warning\" => $message));\n }\n //====================================================================//\n // Add Success Notifications\n foreach ($logs->msg as $message) {\n $this->blocksFactory()->addNotificationsBlock(array(\"success\" => $message));\n }\n //====================================================================//\n // Add Debug Notifications\n foreach ($logs->deb as $message) {\n $this->blocksFactory()->addNotificationsBlock(array(\"info\" => $message));\n }\n }",
"function tadc_add_lti_properties(stdClass &$tadc)\n{\n // If we don't have get_course, we need to pull in $DB\n if(!TADC_USE_GET_COURSE)\n {\n global $DB;\n }\n $pluginSettings = get_config('tadc');\n\n $tadc->toolurl = tadc_generate_launch_url($pluginSettings->tadc_location, $pluginSettings->tenant_code);\n $tadc->instructorchoiceacceptgrades = false;\n $tadc->instructorchoicesendname = true;\n $tadc->instructorchoicesendemailaddr = true;\n $tadc->instructorchoiceallowroster = false;\n $tadc->launchcontainer = null;\n $tadc->servicesalt = uniqid('', true);\n $course = (TADC_USE_GET_COURSE ? get_course($tadc->course) : $DB->get_record('course', array('id' => $tadc->course), '*', MUST_EXIST));\n $customLTIParams = array('launch_identifier='.uniqid());\n $baseCourseCode = $course->{$pluginSettings->course_code_field};\n\n if(isset($pluginSettings->course_code_regex))\n {\n if(preg_match(\"/\".$pluginSettings->course_code_regex.\"/\", $baseCourseCode, $matches))\n {\n if(!empty($matches) && isset($matches[1]))\n {\n $baseCourseCode = $matches[1];\n }\n }\n }\n $customLTIParams[] = 'course_code='.$baseCourseCode;\n $customLTIParams[] = 'course_name='.$course->fullname;\n $customLTIParams[] = 'course_start='.date('Y-m-d', $course->startdate);\n $endDate = tadc_get_course_end($course);\n if(!empty($endDate))\n {\n $customLTIParams[] = 'course_end='.date('Y-m-d', $endDate);\n }\n $customLTIParams[] = 'source=' . TADC_SOURCE_URI;\n $customLTIParams[] = 'trackback=' . urlencode(new moodle_url('/mod/tadc/trackback.php', array('t'=>$tadc->id, 'api_key'=>$pluginSettings->api_key)));\n $tadc->resourcekey = $pluginSettings->api_key;\n $tadc->password = $pluginSettings->tadc_shared_secret;\n $tadc->instructorcustomparameters= implode(\"\\n\", $customLTIParams);\n $tadc->debuglaunch = false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
frees all slots unapppointed that are in the past | function scheduler_free_late_unused_slots($schedulerid){
global $CFG;
$now = time();
$sql = "
SELECT DISTINCT
s.id,s.id
FROM
{$CFG->prefix}scheduler_slots AS s
LEFT JOIN
{$CFG->prefix}scheduler_appointment AS a
ON
s.id = a.slotid
WHERE
a.studentid IS NULL AND
s.schedulerid = {$schedulerid} AND
starttime < {$now}
";
$to_delete = get_records_sql($sql);
if ($to_delete){
$ids = implode(',', array_keys($to_delete));
delete_records_select('scheduler_slots', " id IN ('$ids') ");
}
} | [
"public function clearBookableSlots() {\n self::$connection->straightQuery(\"TRUNCATE TABLE bookable_slot\");\n }",
"public function clearTimeslots()\n {\n $this->timeslots = [];\n self::$db->query('DELETE FROM '.$this->timeslot_table.' WHERE '.$this->id_field.'=$1', [$this->getID()]);\n $this->updateCacheObject();\n }",
"public function reset()\n {\n $this->slots = [];\n }",
"public function free_sst(){\r\n $this->SST = array();\r\n }",
"public function purgePeak(): void\n {\n $this->cache->forget($this->memoryTrackerPeakKey);\n }",
"private function allotSticky()\n {\n $slots = new Slots();\n foreach ($this->STICKY as $entity) {\n while ($entity['no_of_periods'] > 0) {\n $slot = $slots->getStickySlot($entity, $this->TNP);\n if ($slot[0] == null OR $slot[1] == null) {\n $this->COLLECTED [] = $entity;\n break;\n }\n\n //First period\n $entities = json_decode($slot[0]->entities);\n if (!is_array($entities)) {\n $entities = array();\n }\n array_push($entities, $entity);\n $slot[0]->entities = json_encode($entities);\n $slot[0]->left--;\n $slot[0]->save();\n $entity['no_of_periods']--;\n\n //Second Period\n $entities = json_decode($slot[1]->entities);\n if (!is_array($entities)) {\n $entities = array();\n }\n array_push($entities, $entity);\n $slot[1]->entities = json_encode($entities);\n $slot[1]->left--;\n $slot[1]->save();\n $entity['no_of_periods']--;\n }\n }\n unset($this->STICKY);\n unset($slots);\n unset($slot);\n unset($entity);\n unset($entities);\n }",
"public function clearSoAllocatedLotserials()\n {\n $this->collSoAllocatedLotserials = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function releaseSlot(): void;",
"public function clearStudentFrees()\n\t{\n\t\t$this->collStudentFrees = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"function decrease_capacity () {\n\t\t\n\t\tglobal $zurich;\n\t\t\n\t\t$key = get_param('close_res_number'); \n\t\tif(!$key) $key = $this->oldest();\n\t\tif ($key) {\n\t\t log_and_confirm(\"reduced capacity by closing a reservoir\", $this->id, 3);\n\t\t\tunset($this->reservoirs[$key]);\n\t\t\t}\n\t\telse {\n\t log_act(\"No reservoir to close!\", $this->id, 3);\n\t\t}\n\t}",
"function _clean() {\n\t\t$too_old = time() - $this->_max_age;\n\t\t\n\t\tforeach (array_keys($this->_values) as $key) {\n\t\t\tif ($key < $too_old) {\n\t\t\t\tunset($this->_values[$key]);\n\t\t\t}\n\t\t}\n\t}",
"function trimFreeSlot (freeSlot $slot, int $start, int $end) {\n $duration = $end - $start;\n $slotDuration = $slot->end - $slot->start;\n if ($slot->end - $slot->start <= $duration) {\n return;\n } else {\n // trim from bottom\n if ($slot->start < $start) {\n $slot->start += min(($slot->end - $slot->start) - $duration, $start - $slot->start);\n }\n // trim from top\n $slot->end -= ($slot->end - $slot->start) - $duration;\n }\n}",
"public function clearSlot(): void\n {\n app(LockerManager::class)->clearSlot($this);\n }",
"public function deleteOwnSlots()\n {\n foreach ($this->getsfPlopSlots() as $slot)\n $slot->delete();\n }",
"public function clearInvWhseLots()\n {\n $this->collInvWhseLots = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function purge()\n\t\t{\n\t\t\tfor($i = 0; $i < $this->numberOfVertices; ++$i) \n\t\t\t\tfor($j = 0; $j < $this->numberOfVertices; ++$j) \n\t\t\t\t\t$this->matrix->offsetSet(array($i, $j), NULL);\n\t\t\t\n\t\t\tparent::purge();\n\t\t}",
"public function adjustAllocationsToMatchQtyRemaining()\n {\n $toAdjust = $this->getQtyUnallocated();\n foreach ( $this->allocations as $alloc ) {\n if ( $toAdjust >= 0 ) {\n return;\n }\n $toAdjust -= $alloc->adjustQuantity($toAdjust);\n }\n assertion($toAdjust >= 0, \"alloc qty left to adjust: $toAdjust\");\n }",
"protected function release_reserved() {\n\t\t$expired = $this->datetime( -300 );\n\n\t\t$sql = $this->database->prepare(\n\t\t\t\"\n\t\t\t\tUPDATE {$this->jobs_table}\n\t\t\t\tSET attempts = attempts + 1, reserved_at = NULL\n\t\t\t\tWHERE reserved_at <= %s\",\n\t\t\t$expired\n\t\t);\n\n\t\t$this->database->query( $sql );\n\t}",
"protected function flushOldSlots(int $time): void\n {\n /** Don't flush if we are tracking the current time */\n if ($time === $this->lastEventTime)\n {\n return;\n }\n\n /** Check if we have not processed an event for the max measurement period and reset all counters */\n if (($time - $this->lastEventTime) >= $this->counter_length) {\n $this->initCounter();\n } else {\n /** We are a new time period */\n $lastIndex = $this->getIndexForTime($this->lastEventTime);\n $currentIndex = $this->getIndexForTime($time);\n if ($currentIndex >= $lastIndex)\n {\n for($i = $lastIndex+1; $i <= $currentIndex; $i++)\n {\n $this->counter[$i] = 0;\n }\n }\n else\n {\n for($i = 0; $i <= $currentIndex; $i++)\n {\n $this->counter[$i] = 0;\n }\n for($i = $lastIndex+1; $i < $this->counter_length; $i++)\n {\n $this->counter[$i] = 0;\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for searchProjects Searchprojects. | public function testSearchProjects()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
} | [
"public function testSearchProjects()\n {\n // create\n $project = $this->_getProjectData();\n $projectData = $this->_json->saveProject($project);\n $this->_projectsToDelete[] = $projectData['id'];\n \n // search & check\n $search = $this->_json->searchProjects($this->_getProjectFilter($projectData['title']), $this->_getPaging());\n $this->assertEquals($project['description'], $search['results'][0]['description']);\n $this->assertEquals(1, $search['totalcount']);\n }",
"public function testSearchProjects()\n {\n $this->specify('Search by non matching project title string', function () {\n $user = User::findOne(1003);\n $projects = $user->searchProjects('non matching');\n\n verify('Should be empty', $projects)->count(0);\n });\n\n $this->specify('Search by matching project title string', function () {\n $user = User::findOne(1003);\n $search = 'Lorem ipsum';\n $projects = $user->searchProjects($search);\n\n verify('Projects count should match', $projects)->count(2);\n foreach ($projects as $project) {\n verify('Should contains the search keyword', strtoupper($project->title))->contains(strtoupper($search));\n }\n });\n\n $this->specify('Search by matching project title string with specified limit', function () {\n $user = User::findOne(1003);\n $search = 'Lorem';\n $projects = $user->searchProjects($search, 1);\n\n verify('Projects count should match', $projects)->count(1);\n foreach ($projects as $project) {\n verify('Should contains the search keyword', strtoupper($project->title))->contains(strtoupper($search));\n }\n });\n\n $this->specify('Super user - search only within user\\'s projects (non matching title)', function () {\n $user = User::findOne(1006);\n $projects = $user->searchProjects('Lorem ipsum', 100, 0, true);\n\n verify('Should be empty', $projects)->count(0);\n });\n\n $this->specify('Super user - search only within user\\'s projects (matching title)', function () {\n $user = User::findOne(1006);\n $search = 'test title';\n $projects = $user->searchProjects($search, 100, 0, true);\n\n verify('Projects count should match', $projects)->count(1);\n foreach ($projects as $project) {\n verify('Should contains the search keyword', strtoupper($project->title))->contains(strtoupper($search));\n }\n });\n\n $this->specify('Super user - search within all projects', function () {\n $user = User::findOne(1006);\n $search = 'Lorem Ipsum';\n $projects = $user->searchProjects($search);\n\n verify('Projects count should match', $projects)->count(3);\n foreach ($projects as $project) {\n verify('Should contains the search keyword', strtoupper($project->title))->contains(strtoupper($search));\n }\n });\n }",
"public function testProjectsSearchGet()\n {\n $client = static::createClient();\n\n $path = '/projects/search';\n\n $crawler = $client->request('GET', $path);\n }",
"public function testsearchProjectReturnsResults() {\n // Assemble\n $searchParam = \"Bri\";\n\n $searchResults = \"Brielle Hayden\";\n \n //$this->mockedSearchController->shouldReceive('searchContacts')->once()->with(\"Greg\");\n $this->mockedProjectRepo\n ->shouldReceive('getProjectSearchInfo')\n ->once()\n ->with(Mockery::on(\n function($filter) use($searchParam)\n {\n $this->assertEquals($searchParam, $filter);\n \n return true;\n \n }))\n ->andReturn(\"Brielle Hayden\");\n \n // Act \n $response = $this->action(\"GET\", 'SearchAPIController@searchProjects', array(\"projects\" => \"Bri\"));\n\n\n \n // Assert \n $this->assertResponseStatus(200);\n $this->assertEquals($searchResults, $response->original);\n }",
"public function testListProjects()\n {\n $filter['id']=\"1\";\n $filter['project_name']=\"test50\";\n $filter['project_description']=\"test51\";\n $filter['date_start']='2019-01-01';\n $filter['date_end']='2030-01-01';\n $filter['owner_lastname']=\"Durand\";\n $filter['owner_firstname']=\"Jean\";\n $and=false;\n $res=$this->projectModel->listProjects($filter,$and);\n // $this->assertTrue(!is_null($res),true);\n// $this->assertTrue(count($res)>0,true);\n $this->assertNotEquals($res[0]['id'],false);\n }",
"public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }",
"public function testListProjects()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testListProject()\n {\n\n }",
"function Search_projects($keywords)\n\t{\n\t\tglobal $db;\n\t\t\n\t\t//if($options == 1)\n\t\t//{\n\t\t\t$sql_where = \" WHERE (project_title like '%\".$keywords.\"%' \"\n\t\t\t\t\t\t.\" OR project_description like '%\".$keywords.\"%')\";\n/*\t\t}\n\t\tif($options == 2)\n\t\t\t$sql_where = \" WHERE (project_title like '%\".$keywords.\"%') \";\n\t\tif($options == 3)\n\t\t\t$sql_where = \" WHERE (project_description like '%\".$keywords.\"%') \";\n*/\t\t\t\n\t\t\t\n\t\t$sql=\"SELECT count(*) as cnt FROM \".project_MASTER.\" AS PM \" \n\t\t\t.\" LEFT JOIN \".MEMBER_MASTER.\" AS MM ON PM.project_posted_by = MM.user_login_id \"\n\t\t\t. $sql_where\n\t\t\t.\" AND (project_status != 4 AND project_status != 6)\";\n \n\t\t$db->query($sql);\n\t\t$db->next_record();\n\t\t$_SESSION['total_record'] = $db->f(\"cnt\") ;\n\t\t$db->free();\n\n\t\t# Reset the start record if required\n\t\tif($_SESSION['user_page_size'] >= $_SESSION['total_record'])\n\t\t{\n\t\t\t$_SESSION['start_record'] = 0;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM \".project_MASTER.\" AS PM \" \n\t\t\t.\" LEFT JOIN \".MEMBER_MASTER.\" AS MM ON PM.project_posted_by = MM.user_login_id \"\n\t\t\t . $sql_where.\" AND (project_status != 4 AND project_status != 6) \"\n\t\t .\" ORDER BY premium_project DESC,project_post_time DESC\"\n\t\t\t .\" LIMIT \". $_SESSION['start_record']. \", \". $_SESSION['user_page_size'];\n\t\t$db->query($sql);\n\t}",
"public function testProjectGetByprojectID()\n {\n }",
"public function actionProjects() {\n $projects = new SimpleProjectSearchForm();\n $projects->unsetAttributes(); // clear any default values\n if (isset($_GET['SimpleProjectSearchForm']))\n $projects->attributes = $_GET['SimpleProjectSearchForm'];\n\n $this->renderPartial('_projects', array('projects' => $projects));\n }",
"public function listProjects() {\n $my = $this->request->query('my');\n $categoryId = $this->request->query('category');\n $q = $this->request->query('q');\n $this->loadModel('InvestProject');\n $this->loadModel('InvestCategory');\n $category = array();\n if ($categoryId) {\n $category = $this->InvestCategory->getOne($categoryId);\n }\n $userId = $my ? $this->currUserID : null;\n $result = $this->InvestProject->search($userId, $categoryId, $q);\n $this->set($result + $category + array('aSearch' => $q));\n\n $this->set(compact('group'));\n }",
"public function testGetProjects()\n {\n global $sonar_api_key;\n\n //Connect to sonarqube API\n $api = new HttpClient('https://sonarcloud.io/api/');\n $instance = new SonarqubeInstance($api, $sonar_api_key);\n\n $projects = $instance->getProjects();\n\n //test if paging if correctly handled (result count > 100 when testingith sonarcloud.io)\n $this->assertGreaterThan(100,count($projects));\n\n //test if at least a project is retuned with correct property keys\n $this->assertArrayHasKey('key', $projects[0]);\n $this->assertArrayHasKey('name', $projects[0]);\n }",
"public function testLoadProjectsForAdmins()\n {\n $this->user->expects($this->any())->method('isAdmin')\n ->willReturn(true);\n\n $criteria = Criteria::create();\n\n // Add limits.\n $criteria->setFirstResult(0)\n ->setMaxResults(20);\n\n $this->searchTest($criteria, 0, 20);\n }",
"public function testSpacesProjectsList()\n {\n }",
"public function testProjectsGet()\n {\n $client = static::createClient();\n\n $path = '/projects';\n\n $crawler = $client->request('GET', $path);\n }",
"public function testGetProject() {\n\t\t# Get the default project\n\t\t$t_response = $this->builder()->get( $this->getEndpoint( $this->getProjectId() ) )->send();\n\t\t$this->assertEquals( HTTP_STATUS_SUCCESS, $t_response->getStatusCode(),\n\t\t\t\"Project not found\"\n\t\t);\n\n\t\t# Get all projects\n\t\t$t_project = $this->createProject();\n\t\t$this->deleteProjectAfterRun( $t_project->id );\n\t\t$t_response = $this->builder()->get( $this->getEndpoint() )->send();\n\t\t$this->assertEquals( HTTP_STATUS_SUCCESS, $t_response->getStatusCode(),\n\t\t\t\"Failed to retrieve all projects\"\n\t\t);\n\t\t$t_projects = json_decode( $t_response->getBody() )->projects;\n\t\t$this->assertGreaterThanOrEqual(2, count( $t_projects ),\n\t\t\t\"Expected to retrieve at least 2 projects\"\n\t\t);\n\n\t\t# Non-existing project\n\t\t$t_project_id = 99999;\n\t\twhile( project_exists( $t_project_id ) ) {\n\t\t\t$t_project_id++;\n\t\t}\n\t\t$t_response = $this->builder()->get( $this->getEndpoint( $t_project_id ) )->send();\n\t\t$this->assertEquals( HTTP_STATUS_NOT_FOUND, $t_response->getStatusCode(),\n\t\t\t\"Found a non-existing project !\"\n\t\t);\n\t}",
"private function searchProjects($text, $phrase='', $ordering='') {\r\n $jinput = JFactory::getApplication()->input; \r\n $section = JText::_( 'JRESEARCH_PROJECT' );\r\n // Get the database object\r\n $db = JFactory::getDBO();\r\n\r\n if($this->limit <= 0)\r\n return array();\r\n\r\n switch ( $ordering ) {\r\n case 'alpha':\r\n $order = 'p.title ASC';\r\n break;\r\n case 'category':\r\n $order = 'r.name ASC';\r\n break;\r\n case 'popular':\r\n $order = 'p.hits DESC';\r\n break;\r\n case 'newest':\r\n $order = 'p.start_date DESC, p.created DESC';\r\n break;\r\n case 'oldest':\r\n $order = 'p.start_date ASC, p.created ASC';\r\n break;\r\n default:\r\n $order = 'p.title ASC';\r\n }\r\n\r\n $key = $db->Quote(strtolower($text), true);\t\t\r\n switch($phrase){\r\n case 'exact':\r\n $whereClause = \"p.published = 1 AND MATCH( p.title, p.description, p.keywords ) AGAINST ($key)\";\r\n break;\r\n case 'all':\r\n $allKey = $db->Quote(preg_replace('/(\\\\s+|^)/', \" +\", $text), true);\r\n $whereClause = \"p.published = 1 AND MATCH( p.title, p.description, p.keywords ) AGAINST ($allKey IN BOOLEAN MODE)\";\t\t\t\t\r\n break;\r\n case 'any':\r\n $whereClause = \"p.published = 1 AND MATCH( p.title, p.description, p.keywords ) AGAINST ($key IN BOOLEAN MODE)\";\r\n break;\r\n }\r\n\r\n $section = $db->Quote($section, false);\r\n $query = \"SELECT DISTINCT p.id AS id, '' AS metadesc, p.keywords AS metakey, p.title AS title, CONCAT_WS( '/', r.name, $section ) AS section, \r\n p.created AS created, '2' AS browsernav, SUBSTRING_INDEX(p.description, '<hr id=\\\"system-readmore\\\" />', 1) AS text FROM \r\n #__jresearch_project p LEFT JOIN #__jresearch_project_research_area pr ON p.id = pr.id_project \r\n LEFT JOIN #__jresearch_research_area r ON r.id = pr.id_research_area WHERE $whereClause ORDER BY $order\";\r\n\r\n $db->setQuery( $query, 0, $this->limit );\r\n $results = $db->loadObjectList();\r\n $itemId = $jinput->getInt('Itemid', 0);\r\n if(isset($results)){\r\n foreach($results as $key => $item){\r\n $results[$key]->href = \"index.php?option=com_jresearch&view=project&task=show&id=\".$results[$key]->id.'&Itemid='.$itemId;\r\n }\r\n }\r\n // We just reduce the limit\r\n $n = count($results);\r\n $this->limit -= $n;\r\n return $results;\r\n }",
"public function testIndexProjects()\n {\n $project = factory('App\\Project')->create();\n\n $response = $this->get('/project');\n $response->assertStatus(200);\n $response->assertSee($project->title);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Image / post thumbnail size Image size tested with: WP 5.2.1 task: Get the image sizes for an image id (in px). arguments: int $img_id string $thumbsize size of the image (add_image_size) If thumb size is not stated, use full size. returns: array image sizes [width], [height] | function mby_get_img_size(
$img_id,
$thumbsize = '' ) {
if( $thumbsize == '' ) $thumbsize = 'full';
$the_image = wp_get_attachment_image_src( $img_id, $thumbsize );
// wp_get_attachment_image_src returns an array with:
// [0] => url,
// [1] => width
// [2] => height
// [4] => is_intermediate
$img_sizes = array(
'width' => $the_image[1],
'height' => $the_image[2]
);
return $img_sizes;
} | [
"public function get_thumbnail_dimensions( $size ) {\n\t\tglobal $_wp_additional_image_sizes;\n\n\t\tswitch ( $size ) {\n\t\t\tcase 'thumbnail':\n\t\t\tcase 'medium':\n\t\t\tcase 'large':\n\t\t\t\t$width = get_option( $size . '_size_w' );\n\t\t\t\t$height = get_option( $size . '_size_h' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif ( empty( $_wp_additional_image_sizes[ $size ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$width = $_wp_additional_image_sizes[ $size ]['width'];\n\t\t\t\t$height = $_wp_additional_image_sizes[ $size ]['height'];\n\t\t}\n\n\t\t// Just to be safe.\n\t\t$width = (int) $width;\n\t\t$height = (int) $height;\n\n\t\treturn array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t);\n\t}",
"function acf_get_image_sizes() { }",
"function acf_get_image_sizes() {}",
"public function get_all_image_sizes($imgIds){\r\n\t \t\t$images = array();\r\n\t\t \tif(!empty($imgIds)){\r\n\t\t\t \tforeach($imgIds as $imgId):\r\n\t\t\t \t\tif($imgId == 'placeholder'){\r\n\t\t\t \t\t\t$images[] = array(\r\n\t\t\t \t\t\t\t'large' => array( wc_placeholder_img_src('large') ),\r\n\t\t\t \t\t\t\t'single' => array( wc_placeholder_img_src('shop_single') ),\r\n\t\t\t \t\t\t\t'thumb' => array( wc_placeholder_img_src('thumbnail') ),\r\n\t\t\t \t\t\t\t'alt' => '',\r\n\t\t\t \t\t\t\t'title' => ''\r\n\t\t\t \t\t\t);\r\n\t\t\t \t\t} else {\r\n\t\t\t\t \t\tif(!array_key_exists($imgId, $images)){\r\n if(!empty($imgId)):\r\n $attachment = $this->wp_get_attachment($imgId);\r\n $images[] = array(\r\n 'large' => wp_get_attachment_image_src($imgId, 'large'),\r\n 'single' => wp_get_attachment_image_src($imgId, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' )),\r\n 'thumb' => wp_get_attachment_image_src($imgId, 'thumbnail'),\r\n 'alt' => $attachment['alt'],\r\n 'title' => $attachment['title']\r\n );\r\n endif;\r\n\t\t\t\t \t\t}\r\n\t\t\t \t\t}\r\n\t\t\t \tendforeach;\r\n\t\t \t}\r\n\t\t \treturn $images;\r\n\t \t}",
"function air_helper_get_image_lazyload_dimensions( $image_id = 0, $sizes = [] ) {\n $image_id = intval( $image_id );\n\n if ( ! $image_id ) {\n return false;\n }\n\n // Bail if ID is not attachment\n if ( 'attachment' !== get_post_type( $image_id ) && apply_filters( 'air_helper_lazyload_do_post_type_check', true ) ) {\n return false;\n }\n\n // Default image sizes for use cases\n $default_sizes = [\n 'tiny' => 'tiny-lazyload-thumbnail',\n 'mobile' => 'large',\n 'big' => 'full',\n ];\n\n $sizes = wp_parse_args( $sizes, $default_sizes );\n\n // Get image data\n $dimensions = wp_get_attachment_image_src( $image_id, $sizes['big'] );\n\n if ( ! $dimensions ) {\n return false;\n }\n\n return [\n 'width' => $dimensions[1],\n 'height' => $dimensions[2],\n ];\n}",
"function affinity_mikado_get_image_dimensions($url) {\n\t\t$image_sizes = array();\n require_once(ABSPATH . 'wp-admin/includes/file.php');\n\n\t\t//is url passed?\n\t\tif ($url !== '') {\n\t\t\t//get image sizes from posts meta if attachment exists\n\t\t\t$image_sizes = affinity_mikado_get_attachment_meta_from_url($url, array('width', 'height'));\n\n\t\t\t//image does not exists in post table, we have to use PHP way of getting image size\n\t\t\tif (!count($image_sizes)) {\n\t\t\t\t//can we open file by url?\n\t\t\t\tif (ini_get('allow_url_fopen') == 1 && file_exists($url)) {\n\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($url);\n\t\t\t\t} else {\n\t\t\t\t\t//we can't open file directly, have to locate it with relative path.\n\t\t\t\t\t$image_obj = parse_url($url);\n $image_relative_path = rtrim(get_home_path(), '/') . $image_obj['path'];\n\n\t\t\t\t\tif (file_exists($image_relative_path)) {\n\t\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($image_relative_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we get width and height from some of above methods?\n\t\t\t\tif (isset($width) && isset($height)) {\n\t\t\t\t\t//set them to our image sizes array\n\t\t\t\t\t$image_sizes = array(\n\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t'height' => $height\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $image_sizes;\n\t}",
"public function get_thumbnail_sizes() {\n\t\tglobal $_wp_additional_image_sizes;\n\n\t\t$thumbnail_sizes = array();\n\n\t\tforeach ( get_intermediate_image_sizes() as $size ) {\n\t\t\t$thumbnail_sizes[ $size ]['label'] = $size;\n\t\t\tif ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {\n\t\t\t\t$thumbnail_sizes[ $size ]['width'] = (int) get_option( $size . '_size_w' );\n\t\t\t\t$thumbnail_sizes[ $size ]['height'] = (int) get_option( $size . '_size_h' );\n\t\t\t\t$thumbnail_sizes[ $size ]['crop'] = ( 'thumbnail' == $size ) ? (bool) get_option( 'thumbnail_crop' ) : false;\n\t\t\t} elseif ( ! empty( $_wp_additional_image_sizes ) && ! empty( $_wp_additional_image_sizes[ $size ] ) ) {\n\t\t\t\t$thumbnail_sizes[ $size ]['width'] = (int) $_wp_additional_image_sizes[ $size ]['width'];\n\t\t\t\t$thumbnail_sizes[ $size ]['height'] = (int) $_wp_additional_image_sizes[ $size ]['height'];\n\t\t\t\t$thumbnail_sizes[ $size ]['crop'] = (bool) $_wp_additional_image_sizes[ $size ]['crop'];\n\t\t\t}\n\t\t}\n\n\t\treturn $thumbnail_sizes;\n\t}",
"function getPhotoSizes($photo_id){ // No Secret Required\n\n\t\t/* Get Photo Size */\n\t\t$photoSizes = $this->askFlickr('photos.getSizes','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoSizes;\n\t}",
"public function getThumbnailSizes()\n {\n $config = Shopware()->Container()->get('shopware.plugin.cached_config_reader')->getByPluginName('EmzBiancoTheme');\n $thumbnail_sizes = array($config['thumbnail_size_small'],\n $config['thumbnail_size_middle'],\n $config['thumbnail_size_large']);\n\n return $thumbnail_sizes;\n }",
"function thb_get_slideshow_image_size( $id = null ) {\n\tif ( ! $id ) {\n\t\t$id = thb_get_page_ID();\n\t}\n\n\t$image_size = thb_get_post_meta( $id, 'slideshow_image_size' );\n\n\tif ( $image_size == '' ) {\n\t\t$image_size = 'large';\n\t}\n\n\treturn apply_filters( 'thb_slideshow_image_size', $image_size );\n}",
"public function vc_wpb_getimagesize($args, $attach_id, $params){\n if (!$this->enabled)\n return $args;\n \n $gs_host = ud_get_stateless_media()->get_gs_host();\n $meta_data = wp_get_attachment_metadata( $attach_id );\n preg_match(\"/src=[\\\"|'](.*?)[\\\"|']/\", $args['thumbnail'], $match);\n \n if(!empty($match[1]) && empty($meta_data['sizes'][$params['thumb_size']])){\n $dir = wp_upload_dir();\n $url = $match[1];\n $path = str_replace($gs_host, '', $url);\n $path = trim($path, '/');\n $absolute_path = $dir['basedir'] . '/' . $path;\n \n $size= getimagesize( $absolute_path );\n $filetype = wp_check_filetype($absolute_path);\n $size_info = array(\n 'file' => wp_basename( $absolute_path ),\n 'mime-type' => $filetype['type'],\n 'width' => $size[0],\n 'height' => $size[1],\n );\n $meta_data['sizes'][$params['thumb_size']] = $size_info; \n wp_update_attachment_metadata($attach_id, $meta_data );\n }\n return $args;\n }",
"function biagiotti_mikado_get_image_dimensions( $url ) {\n\t\t$image_sizes = array();\n\t\t\n\t\t//is url passed?\n\t\tif ( $url !== '' ) {\n\t\t\t//get image sizes from posts meta if attachment exists\n\t\t\t$image_sizes = biagiotti_mikado_get_attachment_meta_from_url( $url, array( 'width', 'height' ) );\n\t\t\t\n\t\t\t//image does not exists in post table, we have to use PHP way of getting image size\n\t\t\tif ( ! count( $image_sizes ) ) {\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\n\t\t\t\t//can we open file by url?\n\t\t\t\tif ( ini_get( 'allow_url_fopen' ) == 1 && file_exists( $url ) ) {\n\t\t\t\t\tlist( $width, $height, $type, $attr ) = getimagesize( $url );\n\t\t\t\t} else {\n\t\t\t\t\t//we can't open file directly, have to locate it with relative path.\n\t\t\t\t\t$image_obj = parse_url( $url );\n\t\t\t\t\t$image_relative_path = rtrim( get_home_path(), '/' ) . $image_obj['path'];\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists( $image_relative_path ) ) {\n\t\t\t\t\t\tlist( $width, $height, $type, $attr ) = getimagesize( $image_relative_path );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//did we get width and height from some of above methods?\n\t\t\t\tif ( isset( $width ) && isset( $height ) ) {\n\t\t\t\t\t//set them to our image sizes array\n\t\t\t\t\t$image_sizes = array(\n\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t'height' => $height\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $image_sizes;\n\t}",
"function zuhaus_mikado_get_image_dimensions( $url ) {\n\t\t$image_sizes = array();\n\t\t\n\t\t//is url passed?\n\t\tif ( $url !== '' ) {\n\t\t\t//get image sizes from posts meta if attachment exists\n\t\t\t$image_sizes = zuhaus_mikado_get_attachment_meta_from_url( $url, array( 'width', 'height' ) );\n\t\t\t\n\t\t\t//image does not exists in post table, we have to use PHP way of getting image size\n\t\t\tif ( ! count( $image_sizes ) ) {\n\t\t\t\t//can we open file by url?\n\t\t\t\tif ( ini_get( 'allow_url_fopen' ) == 1 && file_exists( $url ) ) {\n\t\t\t\t\tlist( $width, $height, $type, $attr ) = getimagesize( $url );\n\t\t\t\t} else {\n\t\t\t\t\t//we can't open file directly, have to locate it with relative path.\n\t\t\t\t\t$image_obj = parse_url( $url );\n\t\t\t\t\t$image_relative_path = $_SERVER['DOCUMENT_ROOT'] . $image_obj['path'];\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists( $image_relative_path ) ) {\n\t\t\t\t\t\tlist( $width, $height, $type, $attr ) = getimagesize( $image_relative_path );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//did we get width and height from some of above methods?\n\t\t\t\tif ( isset( $width ) && isset( $height ) ) {\n\t\t\t\t\t//set them to our image sizes array\n\t\t\t\t\t$image_sizes = array(\n\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t'height' => $height\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $image_sizes;\n\t}",
"function get_image_dimensions($image, $size = 'full')\n {\n $retval = NULL;\n // If an image id was provided, get the entity\n if (is_numeric($image)) {\n $image = $this->object->_image_mapper->find($image);\n }\n // Ensure we have a valid image\n if ($image) {\n $size = $this->normalize_image_size_name($size);\n if (!$size) {\n $size = 'full';\n }\n // Image dimensions are stored in the $image->meta_data\n // property for all implementations\n if (isset($image->meta_data) && isset($image->meta_data[$size])) {\n $retval = $image->meta_data[$size];\n } else {\n $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();\n $abspath = $this->object->get_image_abspath($image, $size, TRUE);\n if ($abspath) {\n $dims = @getimagesize($abspath);\n if ($dims) {\n $retval['width'] = $dims[0];\n $retval['height'] = $dims[1];\n }\n } elseif ($size == 'backup') {\n $retval = $this->object->get_image_dimensions($image, 'full');\n }\n if (!$retval && $dynthumbs && $dynthumbs->is_size_dynamic($size)) {\n $new_dims = $this->object->calculate_image_size_dimensions($image, $size);\n $retval = array('width' => $new_dims['real_width'], 'height' => $new_dims['real_height']);\n }\n }\n }\n return $retval;\n }",
"private function getThumbnailDimensions()\n {\n \t$dim = array();\n \t$dim['small']['width'] = 125;\n \t$dim['small']['height'] = 89;\n \n \t$dim['medium']['width'] = 250;\n \t$dim['medium']['height'] = 178;\n \n \t$dim['big']['width'] = 375;\n \t$dim['big']['height'] = 267;\n \n \treturn $dim;\n }",
"function get_image_widths_and_urls($id) {\n\t//Get all the possible image sizes\n\t$image_size_array = get_intermediate_image_sizes();\n\t//error_log('--------------------$image_size_array------------------------');\n\t//error_log( var_export($image_size_array, true) );\n\n\t$image_width_array = [];\n\t//$image_url_array = [];\n\t$widths_and_urls = [];\n\t$i = 0;\n\tforeach ( $image_size_array as $image_size_name ) {\n\t\t$image_info_array = wp_get_attachment_image_src($id, $image_size_name);\n\t\t$image_url = $image_info_array[0];\n\t\t$image_width = $image_info_array[1];\n\t\tif ( $image_width > 300 ) { //Don't want to include any images smaller than 300px, since they won't really ever be useful\n\t\t\t$image_width_array[] = $image_width;\n\t\t\t$widths_and_urls[$i] = [\n\t\t\t\t\"width\" => $image_width,\n\t\t\t\t\"url\" => $image_url,\n\t\t\t];\n\t\t\t//error_log('--------------------$image_info_array------------------------');\n\t\t\t//error_log( var_export($image_info_array, true) );\n\t\t\t$i++;\n\t\t}\n\t}\n\tarray_multisort ($image_width_array, SORT_ASC, SORT_NUMERIC, $widths_and_urls); //Sorts $widths_and_urls by the \"width\" key\n\t/*return [\n\t\t\"widths\" => $image_width_array,\n\t\t\"urls\" => $image_url_array,\n\t];*/\n\treturn $widths_and_urls;\n}",
"function auiu_get_image_sizes() {\n $image_sizes_orig = get_intermediate_image_sizes();\n $image_sizes_orig[] = 'full';\n $image_sizes = array();\n foreach ($image_sizes_orig as $size) {\n $image_sizes[$size] = $size;\n }\n return $image_sizes;\n}",
"function fa_get_custom_image_size( $image_id, $width, $height ){\n\t$image_id \t= absint( $image_id );\n\t$width \t\t= absint( $width );\n\t$height \t= absint( $height );\n\t// if width or height is 0, don't do anything\n\tif( $width == 0 || $height == 0 ){\n\t\treturn false;\n\t}\n\t// get the metadata from image\t\n\t$attachment_meta = get_post_meta( $image_id, '_wp_attachment_metadata', true );\n\tif( !$attachment_meta ){\n\t\treturn false;\n\t}\n\t// if width and height exceed the full image size, return the full image\n\tif( $width >= $attachment_meta['width'] && $height >= $attachment_meta['height'] ){\n\t\t$attachment = wp_get_attachment_image_src( $image_id, 'full' );\n\t\treturn $attachment[0];\n\t}\n\t\n\t// check if any of the registered sizes match the size we're looking for\n\tforeach( $attachment_meta['sizes'] as $size_name => $size_details ){\n\t\t// size matched, return it\n\t\tif( $width == $size_details['width'] && $height == $size_details['height'] ){\n\t\t\t$attachment = wp_get_attachment_image_src( $image_id, $size_name );\t\n\t\t\treturn $attachment[0];\t\t\n\t\t}\n\t}\n\t\n\t// get the upload dir details\n\t$wp_upload_dir = wp_upload_dir();\n\t// an extra meta field on image to store fa image sizes of resized images\n\t$fa_sizes = get_post_meta( $image_id, '_fa_attachment_metadata', true );\n\n\t// check sizes stored by FA\n\tif( $fa_sizes ){\n\t\tforeach( $fa_sizes as $details ){\n\t\t\tif( $width == $details['width'] && $height == $details['height'] ){\n\t\t\t\treturn $wp_upload_dir['baseurl'] . wp_normalize_path( $details['rel_path'] );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// create the new size if not found yet\n\t$image_path = path_join( $wp_upload_dir['basedir'] , $attachment_meta['file'] );\n\t// create the new image size\n\t$img_editor = wp_get_image_editor( $image_path );\n\t$img_editor->set_quality( 90 );\t\t\t\n\t$resized \t= $img_editor->resize( $width, $height, true );\n\t$new_file \t= $img_editor->generate_filename( null, null );\n\t$saved \t\t= $img_editor->save( $new_file );\n\t// relative file path\n\t$rel_path = str_replace( $wp_upload_dir['basedir'], '', $new_file );\n\t$new_file_url = $wp_upload_dir['baseurl'] . wp_normalize_path( $rel_path );\n\t\n\t// store the new size on image meta\n\t$fa_sizes = is_array( $fa_sizes ) ? $fa_sizes : array();\n\t$file_details = array(\n\t\t'basename' \t=> wp_basename( $new_file ),\n\t\t'rel_path' \t=> $rel_path,\n\t\t'width' \t=> $width,\n\t\t'height' \t=> $height\n\t);\n\t$fa_sizes[] = $file_details;\n\tupdate_post_meta( $image_id, '_fa_attachment_metadata', $fa_sizes);\n\treturn $new_file_url;\n}",
"public function getThumbnailData($size = 'thumbnail'){\n $attId = $this->getThumbnailId();\n if( ! $attId){\n return null;\n }\n $image = wp_get_attachment_image_src($attId, $size);\n list($url, $width, $height, $resized) = $image;\n\n return array(\n 'url' => $url,\n 'width' => $width,\n 'height' => $height,\n 'resized' => $resized,\n );\n //thumbnail, medium, large or full\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation apiFoldersGetWithHttpInfo Retrieves all folders paginating the response | public function apiFoldersGetWithHttpInfo($q = null, $limit = null, $offset = null, $order = null, $filterByParent = 'false', $parentId = null)
{
$returnType = '\Lacuna\Signer\Model\PaginatedSearchResponseFoldersFolderInfoModel';
$request = $this->apiFoldersGetRequest($q, $limit, $offset, $order, $filterByParent, $parentId);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if (!in_array($returnType, ['string','integer','bool'])) {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Lacuna\Signer\Model\PaginatedSearchResponseFoldersFolderInfoModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 422:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Lacuna\Signer\Model\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function apiFoldersIdGetWithHttpInfo($id)\n {\n $returnType = '\\Lacuna\\Signer\\Model\\FoldersFolderOrganizationModel';\n $request = $this->apiFoldersIdGetRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Lacuna\\Signer\\Model\\FoldersFolderOrganizationModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Lacuna\\Signer\\Model\\ErrorModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function allFoldersAsyncWithHttpInfo($fields = null)\n {\n $returnType = '\\Funeralzone\\LookerClient\\Model\\Folder[]';\n $request = $this->allFoldersRequest($fields);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getDocumentFolderFoldersAsyncWithHttpInfo($id, $limit = '100', $offset = '0', $embed = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\ModelDocumentFolder';\n $request = $this->getDocumentFolderFoldersRequest($id, $limit, $offset, $embed);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function foldersV2GetByIdWithHttpInfo($id)\n {\n $returnType = '\\Swagger\\Client\\Model\\FolderDTO';\n $request = $this->foldersV2GetByIdRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\FolderDTO',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function restNewslettersFoldersFolderIdGetWithHttpInfo($folder_id)\n {\n $request = $this->restNewslettersFoldersFolderIdGetRequest($folder_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Folder' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Folder', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Folder';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Folder',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function apiFoldersPostAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Lacuna\\Signer\\Model\\FoldersFolderInfoModel';\n $request = $this->apiFoldersPostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function apiFoldersIdGetAsyncWithHttpInfo($id)\n {\n $returnType = '\\Lacuna\\Signer\\Model\\FoldersFolderOrganizationModel';\n $request = $this->apiFoldersIdGetRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getDocumentFoldersWithHttpInfo($limit = '100', $offset = '0', $embed = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\ModelDocumentFolder';\n $request = $this->getDocumentFoldersRequest($limit, $offset, $embed);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ModelDocumentFolder',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function foldersV2FindByNameWithHttpInfo($name)\n {\n $returnType = '\\Swagger\\Client\\Model\\FolderDTO[]';\n $request = $this->foldersV2FindByNameRequest($name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\FolderDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function foldersV2FindInFolderByNameWithHttpInfo($id, $name)\n {\n $returnType = '\\Swagger\\Client\\Model\\FolderDTO[]';\n $request = $this->foldersV2FindInFolderByNameRequest($id, $name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\FolderDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function searchFoldersWithHttpInfo($fields = null, $page = null, $per_page = null, $limit = null, $offset = null, $sorts = null, $name = null, $id = null, $parent_id = null, $creator_id = null, $filter_or = null)\n {\n $returnType = '\\Funeralzone\\LookerClient\\Model\\Folder[]';\n $request = $this->searchFoldersRequest($fields, $page, $per_page, $limit, $offset, $sorts, $name, $id, $parent_id, $creator_id, $filter_or);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Folder[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function searchFoldersAsyncWithHttpInfo($fields = null, $page = null, $per_page = null, $limit = null, $offset = null, $sorts = null, $name = null, $id = null, $parent_id = null, $creator_id = null, $filter_or = null, $is_shared_root = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Folder[]';\n $request = $this->searchFoldersRequest($fields, $page, $per_page, $limit, $offset, $sorts, $name, $id, $parent_id, $creator_id, $filter_or, $is_shared_root);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getAllFolders();",
"public function createFolderWithHttpInfo($body = null)\n {\n $returnType = '\\Funeralzone\\LookerClient\\Model\\Folder';\n $request = $this->createFolderRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Folder',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\ValidationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function folderChildrenWithHttpInfo($folder_id, $fields = null, $page = null, $per_page = null, $limit = null, $offset = null, $sorts = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Folder[]';\n $request = $this->folderChildrenRequest($folder_id, $fields, $page, $per_page, $limit, $offset, $sorts);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Folder[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function designFoldersPostWithHttpInfo($data = null)\n {\n // parse inputs\n $resourcePath = \"/DesignFolders\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\DesignFolder',\n '/DesignFolders'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\DesignFolder', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\DesignFolder', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getFolders() {\n\t\treturn $this->_executeGetRequest('user/folders');\n\t}",
"function list_folders() {\n\n\t\t$parameters = array();\n\t\t$parameters['format'] = $this->format;\n\t\t$request = $this->oAuthRequest($this->host . \"folders/list\", 'POST', $parameters);\t\t\t\t\n\t\t$folders = $this->maybe_decode($request);\n\t\treturn $folders;\n\t\n\t}",
"public function getFolderInformation()\n {\n $url = \"{$this->getCmsUrl()}/v1/accounts/{$this->getAccountId()}/folders/{$this->getFolderId()}\";\n $header = [\n 'Content-type: application/json',\n \"Authorization: Bearer {$this->getAccessToken()}\",\n ];\n\n return $this->call('GET', $url, $header);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all versions from a board, for a given board Id. This only includes versions that the user has permission to view. Note, if the user does not have permission to view the board, no versions will be returned at all. Returned versions are ordered by the name of the project from which they belong and then by sequence defined by user. | public function versions($boardId, $parameters = [])
{
return $this->execute('get', "board/{$boardId}/version", $parameters);
} | [
"public function revisionOverview(BoardgameInterface $boardgame) {\n $account = $this->currentUser();\n $boardgame_storage = $this->entityTypeManager()->getStorage('boardgame');\n\n $langcode = $boardgame->language()->getId();\n $langname = $boardgame->language()->getName();\n $languages = $boardgame->getTranslationLanguages();\n $has_translations = (count($languages) > 1);\n $build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $boardgame->label()]) : $this->t('Revisions for %title', ['%title' => $boardgame->label()]);\n\n $header = [$this->t('Revision'), $this->t('Operations')];\n $revert_permission = (($account->hasPermission(\"revert all boardgame revisions\") || $account->hasPermission('administer boardgame entities')));\n $delete_permission = (($account->hasPermission(\"delete all boardgame revisions\") || $account->hasPermission('administer boardgame entities')));\n\n $rows = [];\n\n $vids = $boardgame_storage->revisionIds($boardgame);\n\n $latest_revision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\boardgames\\BoardgameInterface $revision */\n $revision = $boardgame_storage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $boardgame->getRevisionId()) {\n $link = $this->l($date, new Url('entity.boardgame.revision', [\n 'boardgame' => $boardgame->id(),\n 'boardgame_revision' => $vid,\n ]));\n }\n else {\n $link = $boardgame->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => $has_translations ?\n Url::fromRoute('entity.boardgame.translation_revert', [\n 'boardgame' => $boardgame->id(),\n 'boardgame_revision' => $vid,\n 'langcode' => $langcode,\n ]) :\n Url::fromRoute('entity.boardgame.revision_revert', [\n 'boardgame' => $boardgame->id(),\n 'boardgame_revision' => $vid,\n ]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.boardgame.revision_delete', [\n 'boardgame' => $boardgame->id(),\n 'boardgame_revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['boardgame_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }",
"public function listByBoardAction($boardId)\n {\n $this->view->disable();\n\n $parameters = $this->persistent->parameters;\n if (!is_array($parameters)) {\n $parameters = [];\n }\n $parameters['conditions'] = \"board_id = \" . $boardId;\n $parameters['order'] = \"sequence ASC\";\n \n $workflows = Workflow::find($parameters);\n \n $this->response->setJsonContent($workflows);\n $this->response->send(); \n }",
"public function getVersions();",
"public function getUserBoards($id) {\n return Board::find()\n ->join('INNER JOIN', 'board_user', 'board.id = board_user.board_id')\n ->where(['board_user.user_id' => $id])\n ->all();\n }",
"public function findAll($projectid) {\n\t\t$data = DB::getInstance()->query(\"SELECT * FROM version WHERE projectid='$projectid'\");\n\t\treturn $data->results();\n\t}",
"public function getAllRevisions()\n {\n // Retrieves username associated with an id. \n $this->ui_ids = array();\n\n /**\n * Retrieves list of previous versions of data dictionary.\n */\n $pid = $_GET[\"pid\"];\n $previous_versions = array();\n $sql = \"select p.pr_id, p.ts_approved, p.ui_id_requester, p.ui_id_approver,\n if(l.description = 'Approve production project modifications (automatic)',1,0) as automatic\n from redcap_metadata_prod_revisions p left join redcap_log_event l\n on p.project_id = l.project_id and p.ts_approved*1 = l.ts\n where p.project_id = $pid and p.ts_approved is not null order by p.pr_id\";\n\n if ($result = $this->query($sql))\n {\n // Cycle through results\n $rev_num = 0;\n $num_rows = $result->num_rows;\n while ($row = $result->fetch_object())\n {\n if ($rev_num == 0)\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Moved to Production\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved,\n );\n }\n else\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Production Revision #$rev_num\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved\n );\n }\n\n if ($rev_num == $num_rows - 1)\n {\n // Current revision will be mapped to timestamp and approver of last row\n $current_revision_ts_approved = $row->ts_approved;\n $current_revision_approver = $this->getUsernameFirstLast($row->ui_id_approver);\n $current_revision_requester = $this->getUsernameFirstLast($row->ui_id_requester);\n $current_revision_automatic = $row->automatic;\n }\n\n $rev_num++;\n }\n\n $result->close();\n \n // Sort by most recent version.\n $previous_versions = array_reverse($previous_versions);\n }\n\n // Shift timestamps, approvers, requesters, and automatic approval down by one,\n // as the correct info for each one is when the previous version was archived. \n $last_key = null;\n foreach($previous_versions as $key => $version)\n {\n if ($last_key !== null)\n {\n $previous_versions[$last_key][\"ts_approved\"] = $previous_versions[$key][\"ts_approved\"];\n $previous_versions[$last_key][\"requester\"] = $previous_versions[$key][\"requester\"];\n $previous_versions[$last_key][\"approver\"] = $previous_versions[$key][\"approver\"];\n $previous_versions[$last_key][\"automatic_approval\"] = $previous_versions[$key][\"automatic_approval\"];\n }\n $last_key = $key;\n }\n\n // Get correct production timestamp,\n // and the person who moved it to production\n if (!empty($previous_versions))\n {\n // Get correct production timestamp\n $sql = \"select production_time from redcap_projects where project_id = $pid\";\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $timestamp = $row->production_time;\n $previous_versions[sizeof($previous_versions)-1][\"ts_approved\"] = $timestamp;\n }\n $result->close();\n }\n\n if (!empty($timestamp))\n {\n // Retrieve person who moved to production, as it's stored separately. \n $sql = \"select u.ui_id from redcap_user_information u, redcap_log_event l\n where u.username = l.user and l.description = 'Move project to production status' and l.project_id = $pid \n and l.ts = '\" . str_replace(array(' ',':','-'), array('','',''), $timestamp) . \"' order by log_event_id desc limit 1\";\n\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $previous_versions[sizeof($previous_versions)-1][\"approver\"] = $this->getUsernameFirstLast($row->ui_id);\n }\n $result->close();\n }\n }\n }\n\n // Add current revision\n if (isset($current_revision_approver) && \n isset($current_revision_ts_approved) && \n isset($current_revision_automatic) && \n isset($current_revision_requester))\n {\n array_unshift($previous_versions, array(\n \"id\" => \"current\",\n \"label\" => \"Production Revision #$rev_num <b>(Current Revision)</b>\",\n \"requester\" => $current_revision_requester,\n \"approver\" => $current_revision_approver,\n \"automatic_approval\" => $current_revision_automatic,\n \"ts_approved\" => $current_revision_ts_approved\n ));\n }\n\n return $previous_versions;\n }",
"public function getVersions() {}",
"public function getById(string $boardId);",
"public function getVersionsList( $p_project_id ) {\n return $this->soap_client->mc_project_get_versions( $this->username, $this->password, $p_project_id );\n }",
"public function getVersions () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getversions'));\r\n\t}",
"public function getVersions() {\n DB_DAO::connectDatabase();\n $handler = DB_DAO::getDB()->prepare(\"SELECT version, id, isObsolete FROM version ORDER BY version DESC LIMIT 0,100\");\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n $data = array();\n $it = 0;\n while ($row = $handler->fetch(PDO::FETCH_ASSOC)) {\n $data[$it] = new Version($row['id'], $row['version'], $row['isObsolete']);\n $it++;\n }\n return $data;\n }",
"public function getVersions(): array\n {\n return $this->client->getGameVersions($this->game->getId());\n }",
"public function get_versions()\n {\n $sql = \"SELECT `name`, `version` FROM `versions`;\";\n $query = $this->db->query($sql);\n\n return $query->result();\n }",
"public function listVersions( $contentId )\n {\n $rows = $this->contentGateway->listVersions( $contentId );\n return $this->mapper->extractVersionListFromRows( $rows );\n }",
"public function getBoards()\n {\n $boardsItem = $this->cache->getItem('forumBoards');\n\n if (!$boardsItem->isHit()) {\n $tmpBoards = $this->connection->fetchAll('\n SELECT\n *,\n (SELECT forum_entries.date FROM forum_entries WHERE boardID = forum_board.id ORDER BY id DESC LIMIT 1) AS latestDate,\n (SELECT forum_thread.threadName FROM forum_thread WHERE forum_thread.id = (SELECT forum_entries.threadID FROM forum_entries WHERE boardID= forum_board.id ORDER BY id DESC LIMIT 1)) AS latestThreadName,\n (SELECT users.Username FROM users WHERE id = (SELECT forum_entries.userID FROM forum_entries WHERE boardID= forum_board.ID ORDER BY id DESC LIMIT 1)) AS latestUser,\n (SELECT users.Avatar FROM users WHERE id = (SELECT forum_entries.userID FROM forum_entries WHERE boardID= forum_board.ID ORDER BY id DESC LIMIT 1)) AS latestUserAvatar,\n (SELECT forum_entries.threadID FROM forum_entries WHERE boardID= forum_board.id ORDER BY id DESC LIMIT 1) AS latestLink\n FROM forum_board\n ');\n\n foreach ($tmpBoards as &$board2) {\n $board2['entries'] = $this->connection->fetchColumn('SELECT COUNT(*) FROM forum_entries WHERE boardID = ?', [$board2['id']]);\n $board2['threadCount'] = $this->connection->fetchColumn('SELECT COUNT(*) FROM forum_thread WHERE boardID = ?', [$board2['id']]);\n $board2['link'] = $this->rewriteManager->getRewriteByParams(['boardID' => $board2['id']])['link'];\n if (!empty($board2['latestLink'])) {\n $board2['latestLink'] = $this->rewriteManager->getRewriteByParams(['threadID' => $board2['latestLink']])['link'];\n }\n }\n $newArray = [];\n\n foreach ($tmpBoards as $board) {\n $newArray[$board['id']] = $board;\n }\n $tmpBoards = $newArray;\n unset($newArray);\n\n $boards = [];\n\n foreach ($tmpBoards as $tmpBoard) {\n if (empty($tmpBoard['boardSub'])) {\n $tmpBoard['subs'] = $this->getBoard($tmpBoards, $tmpBoard['id']);\n $boards[] = $tmpBoard;\n }\n }\n\n $boardsItem->set($boards);\n $this->cache->save($boardsItem);\n\n return $boards;\n }\n\n return $boardsItem->get();\n }",
"public function getAllLinearVersions();",
"public static function getAllVersion ( $file_id = 0 ) {\n\t\treturn self::where('file_id', $file_id)\n\t\t\t->orderBy('flag_current_version', 'desc')\n\t\t\t->orderBy('created_at', 'desc')\n\t\t\t->get();\n\t}",
"private static function getAllVersions($uid) {\n\t\t$view = new View('/' . $uid . '/');\n\t\t$dirs = [self::VERSIONS_ROOT];\n\t\t$versions = [];\n\n\t\twhile (!empty($dirs)) {\n\t\t\t$dir = \\array_pop($dirs);\n\t\t\t$files = $view->getDirectoryContent($dir);\n\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$fileData = $file->getData();\n\t\t\t\t$filePath = $dir . '/' . $fileData['name'];\n\t\t\t\tif ($file['type'] === 'dir') {\n\t\t\t\t\t\\array_push($dirs, $filePath);\n\t\t\t\t} else {\n\t\t\t\t\t$versionsBegin = \\strrpos($filePath, '.v');\n\t\t\t\t\t$relPathStart = \\strlen(self::VERSIONS_ROOT);\n\t\t\t\t\t$version = \\substr($filePath, $versionsBegin + 2);\n\t\t\t\t\t$relpath = \\substr($filePath, $relPathStart, $versionsBegin - $relPathStart);\n\t\t\t\t\t$key = $version . '#' . $relpath;\n\t\t\t\t\t$versions[$key] = ['path' => $relpath, 'timestamp' => $version];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// newest version first\n\t\t\\krsort($versions);\n\n\t\t$result = [];\n\n\t\tforeach ($versions as $key => $value) {\n\t\t\t$size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']);\n\t\t\t$filename = $value['path'];\n\n\t\t\t$result['all'][$key]['version'] = $value['timestamp'];\n\t\t\t$result['all'][$key]['path'] = $filename;\n\t\t\t$result['all'][$key]['size'] = $size;\n\n\t\t\t$result['by_file'][$filename][$key]['version'] = $value['timestamp'];\n\t\t\t$result['by_file'][$filename][$key]['path'] = $filename;\n\t\t\t$result['by_file'][$filename][$key]['size'] = $size;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getList() {\n\t\t$boards = $this->board->findAllForUser();\n\t\tLog::info('getList');\n\t\tLog::info($boards);\n\t\treturn $this->view('board.list', ['boardList' => $boards]);\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getVHostConfigAdvAsyncWithHttpInfo Retrieves the specified advanced VHost configuration | public function getVHostConfigAdvAsyncWithHttpInfo($server_name, $vhost_name)
{
$returnType = '\Swagger\Client\Model\VHostConfigAdv';
$request = $this->getVHostConfigAdvRequest($server_name, $vhost_name);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function getVHostConfigAdvWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\VHostConfigAdv';\n $request = $this->getVHostConfigAdvRequest($server_name, $vhost_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\VHostConfigAdv',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getDVRConfigAdvWithHttpInfo($serverName, $vhostName, $appName)\n {\n \n // verify the required parameter 'serverName' is set\n if ($serverName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $serverName when calling getDVRConfigAdv');\n }\n\n // verify the required parameter 'vhostName' is set\n if ($vhostName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $vhostName when calling getDVRConfigAdv');\n }\n\n // verify the required parameter 'appName' is set\n if ($appName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $appName when calling getDVRConfigAdv');\n }\n\n // parse inputs\n $resourcePath = \"/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/dvr/adv\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'text/xml', 'application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/xml','text/xml','application/json'));\n\n \n \n // path params\n if ($serverName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"serverName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($serverName),\n $resourcePath\n );\n }// path params\n if ($vhostName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"vhostName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($vhostName),\n $resourcePath\n );\n }// path params\n if ($appName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"appName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($appName),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n DVRConfigAdv::class\n );\n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array($this->apiClient->getSerializer()->deserialize($response, DVRConfigAdv::class, $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), DVRConfigAdv::class, $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getHostPortConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $portname)\n {\n $returnType = '\\Swagger\\Client\\Model\\HostPortConfigAdv';\n $request = $this->getHostPortConfigAdvRequest($server_name, $vhost_name, $portname);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getTranscoderTemplateConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $template_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\TranscoderTemplateConfigAdv';\n $request = $this->getTranscoderTemplateConfigAdvRequest($server_name, $vhost_name, $template_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getTranscoderAppConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $app_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\TranscoderAppConfigAdv';\n $request = $this->getTranscoderAppConfigAdvRequest($server_name, $vhost_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getVHostConfigAsyncWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\VHostConfig';\n $request = $this->getVHostConfigRequest($server_name, $vhost_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function postApplicationConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $app_name, $body)\n {\n $returnType = '';\n $request = $this->postApplicationConfigAdvRequest($server_name, $vhost_name, $app_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function getDVRConfigAdvRequest($server_name, $vhost_name, $app_name)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling getDVRConfigAdv'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling getDVRConfigAdv'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling getDVRConfigAdv'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/dvr/adv';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getStreamFileAppConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileAppConfigAdv';\n $request = $this->getStreamFileAppConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function postMediaCacheConfigAdvAsyncWithHttpInfo($server_name, $body)\n {\n $returnType = '';\n $request = $this->postMediaCacheConfigAdvRequest($server_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getTranscoderTemplateConfigAdvWithHttpInfo($server_name, $vhost_name, $template_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\TranscoderTemplateConfigAdv';\n $request = $this->getTranscoderTemplateConfigAdvRequest($server_name, $vhost_name, $template_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\TranscoderTemplateConfigAdv',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getStreamFileConfigAdvWithHttpInfo($server_name, $vhost_name, $streamfile_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileConfigAdv';\n $request = $this->getStreamFileConfigAdvRequest($server_name, $vhost_name, $streamfile_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\StreamFileConfigAdv',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getPublishersVhostConfigAsyncWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\PublishersVhostConfig';\n $request = $this->getPublishersVhostConfigRequest($server_name, $vhost_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getVHostTuneConfigAsyncWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\VHostTuneConfig';\n $request = $this->getVHostTuneConfigRequest($server_name, $vhost_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getTranscoderTemplateConfigAdvAsync($server_name, $vhost_name, $template_name)\n {\n return $this->getTranscoderTemplateConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $template_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function putVHostConfigAdvRequest($server_name, $vhost_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling putVHostConfigAdv'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling putVHostConfigAdv'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putVHostConfigAdv'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/adv';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getStreamFileAppConfigAdvWithHttpInfo($serverName, $vhostName, $streamfileName, $appName)\n {\n \n // verify the required parameter 'serverName' is set\n if ($serverName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $serverName when calling getStreamFileAppConfigAdv');\n }\n\n // verify the required parameter 'vhostName' is set\n if ($vhostName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $vhostName when calling getStreamFileAppConfigAdv');\n }\n\n // verify the required parameter 'streamfileName' is set\n if ($streamfileName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $streamfileName when calling getStreamFileAppConfigAdv');\n }\n\n // verify the required parameter 'appName' is set\n if ($appName === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $appName when calling getStreamFileAppConfigAdv');\n }\n\n // parse inputs\n $resourcePath = \"/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles/{streamfileName}/adv\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'text/xml', 'application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/xml','text/xml','application/json'));\n\n \n \n // path params\n if ($serverName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"serverName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($serverName),\n $resourcePath\n );\n }// path params\n if ($vhostName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"vhostName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($vhostName),\n $resourcePath\n );\n }// path params\n if ($streamfileName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"streamfileName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($streamfileName),\n $resourcePath\n );\n }// path params\n if ($appName !== null) {\n $resourcePath = str_replace(\n \"{\" . \"appName\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($appName),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n StreamFileAppConfigAdv::class\n );\n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array($this->apiClient->getSerializer()->deserialize($response, StreamFileAppConfigAdv::class, $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), StreamFileAppConfigAdv::class, $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function testAdConfigAsyncWithHttpInfo($body, $x_sds_auth_token = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TestActiveDirectoryConfigResponse';\n $request = $this->testAdConfigRequest($body, $x_sds_auth_token);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putDRMConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $app_name, $body)\n {\n $returnType = '';\n $request = $this->putDRMConfigAdvRequest($server_name, $vhost_name, $app_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the stone at a particular index of the goban | public function getStone($index)
{
return $this->board[$index];
} | [
"public function getIndividual($index) {\n return $this->people[$index];\n }",
"public function getSpineItem($index){\n\t\treturn $this->ebookData->spineData[$index];\n\t }",
"function getByIndex($index)\n {\n }",
"public function getStOneAt($offset)\n {\n return $this->get(self::STONE, $offset);\n }",
"public function getGene($index)\n {\n return $this->chromosome[$index];\n }",
"public function get(int $index);",
"function get_city_state( $index )\n{\n\tglobal $jne;\n\n\t$data = $jne->getData();\n\tif( $city = $data[$index] ) {\n\t\treturn JNE_normalize(sprintf('%s, %s', \n\t\t\t\t\ttrim($city['kecamatan']),\n\t\t\t\t\t$city['kota']\n\t\t\t\t));\t\n\t}\n\n\treturn $index;\n}",
"public function get_first_straw() {\n return $this->straws[0];\n }",
"public function sdnaIndex() { return $this->_m_sdnaIndex; }",
"public function get(int $index): mixed;",
"public function getStone()\n {\n return $this->stone;\n }",
"public function getIndex0(): int;",
"public function getSauces($index){\n if(isset($this->burgerArray[$index]->sauces)){\n return $this->burgerArray[$index]->sauces;\n }else{\n return array();\n }\n }",
"public function getGrant( $index ) {\n\t\treturn $this->grants[$index];\n\t}",
"function get($index)\n\t{\n\t\t$content = $this->read();\n\t\t$elm = $content['data'][$index];\n\t\t$elm['index'] = $index;\t\t\n\t\treturn $elm;\t\t\n\t}",
"public function get( ?string $index );",
"public function getSegment(int $index, $default = null): mixed\n\t{\n\t\treturn Arr::get($this->getSegments(), $index - 1, $default);\n\t}",
"public function get (int $index) : Object;",
"public function getNet($index)\r\n {\r\n return $this->net[$index];\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JOIN clause to the query using the Productomaterial relation | public function joinProductomaterial($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Productomaterial');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Productomaterial');
}
return $this;
} | [
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.quantity,p.stock_min,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image,pr.nombre AS proveedor\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" LEFT JOIN proveedores pr ON pr.id = p.proveedor_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; }",
"protected abstract function getJoinStatement();",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"protected function _joinProductNameTable()\n {\n if (!$this->_isProductNameJoined) {\n $entityTypeId = Mage::getResourceModel('catalog/config')\n ->getEntityTypeId();\n $attribute = Mage::getModel('catalog/entity_attribute')\n ->loadByCode($entityTypeId, 'name');\n\n $storeId = Mage::app()->getStore()->getId();\n\n $this->getSelect()\n ->join(\n array('product_name_table' => $attribute->getBackendTable()),\n 'product_name_table.entity_id=main_table.product_id' .\n ' AND product_name_table.store_id=' . $storeId .\n ' AND product_name_table.attribute_id=' . $attribute->getId().\n ' AND product_name_table.entity_type_id=' . $entityTypeId,\n array()\n );\n\n $this->_isProductNameJoined = true;\n }\n return $this;\n }",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.quantity,p.cost_price,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.active_product,p.name,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"public function joinFields()\n {\n\t\t$this->getSelect()\n\t\t ->join(\n array('mad' => $this->getTable('magebid/auction_detail')), \n 'mad.magebid_auction_detail_id = main_table.magebid_auction_detail_id')\t\n\t\t ->join(\n array('mat' => $this->getTable('magebid/auction_type')), \n 'mat.magebid_auction_type_id = main_table.magebid_auction_type_id');\t\t\t\t\t\n\t\t//echo $this->getSelect()->__toString();\n }",
"#[@arg]\n public function setJoin() {\n $this->criteria->setFetchmode(Fetchmode::join('Person'));\n }",
"private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }",
"private function _addJoinQuery($select, array $params = array())\r\n {\r\n if (isset($params['joinTables']) && count($params['joinTables']))\r\n $this->_joinTables = $params['joinTables'];\r\n\r\n /* If needs to add some data from other table, tests the joinTables\r\n * property. If not empty add tables and join clauses.\r\n */\r\n if (count($this->_joinTables) > 0)\r\n {\r\n // Loop on tables list(given by object class) to build the query\r\n foreach ($this->_joinTables as $key => $object)\r\n {\r\n if (is_array($object)){\r\n $objName = $object['obj'];\r\n $foreignKey = $object['foreignKey'];\r\n }\r\n else{\r\n $objName = $object;\r\n if($objName==\"ProductsInfoObject\"){\r\n $foreignKey = \"APBP_Productinfo\";\r\n }\r\n elseif($objName==\"BranchesObject\"){\r\n $foreignKey = \"APBP_Branch\";\r\n }\r\n else{\r\n $foreignKey = $params['foreignKey'];\r\n }\r\n }\r\n //Create an object and fetch data from object.\r\n $tmpObject = new $objName();\r\n $tmpDataTable = $tmpObject->getDataTableName();\r\n $tmpIndexTable = $tmpObject->getIndexTableName();\r\n $tmpColumnData = $tmpObject->getDataColumns();\r\n $tmpColumnIndex = $tmpObject->getIndexColumns();\r\n //Add data to tables list\r\n $tables[$tmpDataTable] = $tmpColumnData;\r\n $tables[$tmpIndexTable] = $tmpColumnIndex;\r\n //Get the primary key of the first data object to join table\r\n $tmpDataId = $tmpObject->getDataId();\r\n // If it's the first loop, join first table to the current table\r\n\r\n\r\n //LEFT JOIN `DocumentationsCategoryData` ON DCD_ID = DD_ID LEFT JOIN `DocumentationsCategoryIndex` ON DCD_ID = DCI_ID\r\n\r\n\r\n if ($key == 0)\r\n {\r\n $select->joinLeft($tmpDataTable, $tmpDataId . ' = ' . $foreignKey);\r\n //If there's an index table then it too and filter according language\r\n if (!empty($tmpIndexTable))\r\n {\r\n $tmpIndexId = $tmpObject->getIndexId();\r\n $select->joinLeft(\r\n $tmpIndexTable, $tmpDataId . ' = ' . $tmpIndexId);\r\n $select->where(\r\n $tmpIndexTable . '.' . $tmpObject->getIndexLanguageId() . ' = ?', $this->_defaultEditLanguage);\r\n }\r\n }\r\n elseif ($key > 0){\r\n // We have an other table to join to previous.\r\n $tmpDataId = $tmpObject->getDataId();\r\n\r\n $select->joinLeft(\r\n $tmpDataTable, $tmpDataId . ' = ' . $foreignKey);\r\n\r\n if (!empty($tmpIndexTable))\r\n {\r\n $tmpIndexId = $tmpObject->getIndexId();\r\n $select->joinLeft(\r\n $tmpIndexTable,\r\n $tmpDataId . ' = ' . $tmpIndexId);\r\n\r\n $select->where(\r\n $tmpIndexTable . '.' . $tmpObject->getIndexLanguageId() . ' = ?', $this->_defaultEditLanguage);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $select;\r\n }",
"public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', 'rm_resource');\n }",
"protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }",
"private function buildJoin()\n {\n if (empty($this->join)) {\n return;\n }\n\n foreach ($this->join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable)) {\n $joinStr = $this->buildPair(\"\", $joinTable);\n } else {\n $joinStr = $joinTable;\n }\n\n $this->query .= \" \".$joinType.\" JOIN \".$joinStr.\n (false !== stripos($joinCondition, 'using') ? \" \" : \" ON \")\n .$joinCondition;\n }\n }",
"protected function _buildJoin () {\r\n if (empty ($this->_join))\r\n return;\r\n\r\n foreach ($this->_join as $data) {\r\n list ($joinType, $joinTable, $joinCondition) = $data;\r\n\r\n if (is_object ($joinTable))\r\n $joinStr = $this->_buildPair (\"\", $joinTable);\r\n else\r\n $joinStr = $joinTable;\r\n\r\n $this->_query .= \" \" . $joinType. \" JOIN \" . $joinStr .\" on \" . $joinCondition;\r\n\r\n // Add join and query\r\n if (!empty($this->_joinAnd) && isset($this->_joinAnd[$joinStr])) {\r\n foreach($this->_joinAnd[$joinStr] as $join_and_cond) {\r\n list ($concat, $varName, $operator, $val) = $join_and_cond;\r\n $this->_query .= \" \" . $concat .\" \" . $varName;\r\n $this->conditionToSql($operator, $val);\r\n }\r\n }\r\n }\r\n }",
"public function joinCustomer()\n {\n $joinTable = $this->getTable('customer_grid_flat');\n $this->getSelect()->join($joinTable.' as cgf', 'main_table.seller_id = cgf.entity_id');\n }",
"function join($column,$filter,$foreign_column, $kind='inner', $filter_in_join=false)\n \t{\n \t\t$this->joins[]=new Join($column,$filter,$foreign_column,$kind, $filter_in_join);\n \t}",
"public function joinFoo()\n {\n $this->db->join($this->M_foo->table, \"{$this->M_foo->table}.{$this->M_foo->primaryKey} = {$this->table}.foo_id\");\n }",
"public function join()\n\t{\n\t\t// We do a left outer join here because we're not trying to limit the primary table's results\n\t\t// This function is primarily used when needing to sort by a field in the joined table\n\t\t$this->model->select($this->model->getQualifiedFieldName('*'))\n\t\t ->select($this->related->getQualifiedFieldName('*'))\n\t\t ->join($this->associativeTable,\n\t\t $this->model->getQualifiedFieldName($this->localKey),\n\t\t $this->associativeLocal,\n\t\t 'LEFT OUTER')\n\t\t ->join($this->related->getTableName(),\n\t\t $this->associativeRelated,\n\t\t $this->related->getQualifiedFieldName($this->relatedKey),\n\t\t 'LEFT OUTER');\n\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Forex Rate by prepaid_expense_id and allocation_date | public function getForexRateById($prepaid_expense_id, $allocation_date)
{
return $this->getAdapter()->fetchOne("SELECT `forex_rate` FROM `". $this->_name ."` WHERE `prepaid_expense_id` = $prepaid_expense_id and `allocation_date` = '$allocation_date'");
} | [
"public function getPrepaidAllocationById($prepaidExpenseId)\r\n\t{\r\n\t\treturn $this->getAdapter()->fetchAll(\"SELECT * ,DATE_FORMAT(apa.allocation_date, '%Y/%m/%d') AS allocation_date_format FROM `\". $this->_name .\"` as apa WHERE `prepaid_expense_id` = $prepaidExpenseId\");\r\n\t}",
"public function getFundDateEstimate();",
"function Fetch_Fund_Date(&$data)\n\t{\n\t\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t \t\tSELECT \n date_format(es.date_effective, '%m/%d/%Y') as due_date\n FROM \n event_schedule es,\n event_type et \n WHERE \n es.application_id = '{$data->application_id}' \n AND et.event_type_id = es.event_type_id \n AND et.company_id = {$data->company_id}\n\t\t\t\t AND es.date_effective < curdate()\n\t\t\t\t AND es.event_status = 'registered'\n AND et.name_short IN ( \t'payment_service_chg',\n\t\t\t\t\t\t\t\t\t\t\t'repayment_principal'\n\t\t\t\t\t\t\t\t\t\t ) \n ORDER BY\n es.date_effective desc\n LIMIT 1\t\n\t\t\t\";\t\t\n\t\t$tfund_date = array_pop($this->Get_LDB()->Get_Column($query));\n\t\t$data->fund_date = ($tfund_date) ? $tfund_date : $data->fund_date;\n\t}",
"public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}",
"public function get_rate($date)\n\t{\n\t\treturn $this->rate = $this->db->query_row(\n\t\t\tROMANIA_EXCHANGE_RATE_SQL_LOAD, \n\t\t\tarray(date(\"Y-m-d\", strtotime($date))));\n\t}",
"public function retrieve_dateWise_profit_report($start_date, $end_date)\n {\n $this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n $this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n $this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n $this->db->from('invoice a');\n $this->db->join('invoice_details b', 'b.invoice_id = a.invoice_id');\n\n $this->db->where('a.date >=', $start_date);\n $this->db->where('a.date <=', $end_date);\n\n $this->db->group_by('b.invoice_id');\n $this->db->order_by('a.invoice', 'desc');\n $query = $this->db->get();\n return $query->result_array();\n }",
"public function getRates($baseCurrency, \\DateTime $date);",
"public static function getTodayRate()\n {\n // return CurrenciesRateModel::whereDate('created_at', Carbon::now()->format('Y-m-d'))->first();\n return CurrenciesRateModel::orderBy('id', 'desc')->first();\n }",
"public function getRateDate();",
"public function getDateIncome(Request $request, Expense $expense) {\n $date = $request->report_date;\n $income_qry = Income::select(DB::raw('\"income\" as category'), 'name as mode_of_payment', 'amount as paid')\n ->whereRaw('DATE(date_of_income) = \"'.$date.'\"')\n ->unionAll(ReservationAdvance::select('category', 'mode_of_payment', 'paid')\n ->whereRaw('DATE(updated_at) = \"'.$date.'\"'));\n \n $result['income_list'] = $income_qry->get();\n //Works only with php 5.5 above\n $result['total_incomes'] = DB::table( DB::raw(\"({$income_qry->toSql()}) as sub\") )\n ->mergeBindings($income_qry->getQuery())\n ->select(DB::raw('sum(sub.paid) as amount'))\n ->first()->amount;\n \n $result['expense_list'] = $this->expenses->allExpenses($expense, $date, $date);\n //Works only with php 5.5 above\n $result['total_expenses'] = array_sum(array_column($result['expense_list']->toArray(), 'amount'));\n \n return json_encode($result);\n \n }",
"function getexpenyes() {\n $target = date('Y-m-d', strtotime(\"-1 days\"));\n $this->db->where('date', $target);\n $this->db->join('expense_category', 'expense_category.id = expense.cat_id')->order_by('list', 'ASC');\n $query = $this->db->get('expense');\n return $query->result();\n }",
"function it_finds_a_daily_rate_price_from_date_range_rate()\n {\n $dailyPrice = Price::fromString('10', Currency::fromString('EUR'));\n $equipment = new Equipment('Jack Hammer', new Rate(null, $dailyPrice, 1));\n\n $rentalQuery = new RentalQuery(\n $equipment,\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1)\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($dailyPrice);\n\n //////////\n $tempPrice = Price::fromString('8', Currency::fromString('EUR'));\n $equipment->addRate(\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-04'), new \\DateTime('2014-07-10')),\n $tempPrice,\n 1\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($tempPrice);\n\n }",
"private function Fetch_Fund_Date(&$data)\n\t{\n\t\t//$data->fund_date = $this->app->getScheduleBuilder()->getFundDate();\n\t\t$data->fund_action_date = !empty($data->date_fund_actual_ymd) ? $data->date_fund_actual_ymd : $data->date_fund_estimated_ymd;\n\t\t$data->fund_due_date = $this->pdc->Get_Business_Days_Forward($data->fund_action_date, 1);\n\t}",
"public function fetchRates();",
"public function getIncomeExpense(){\r\ndate_default_timezone_set(get_current_setting('timezone'));\t\r\n$date=date(\"Y-m-d\");\r\n//Current Day Income\r\n$income_query=$this->db->query(\"SELECT sum(amount) as amount FROM transaction \r\nWHERE type='Income' AND user_id='\".$this->session->userdata('user_id').\"' AND trans_date='\".$date.\"'\");\t\r\n$income_result=$income_query->row();\r\n//Current Day Expense\r\n$expense_query=$this->db->query(\"SELECT sum(amount) as amount FROM transaction \r\nWHERE type='Expense' AND user_id='\".$this->session->userdata('user_id').\"' AND trans_date='\".$date.\"'\");\t\r\n$expense_result=$expense_query->row();\r\n\r\n//Current Month Income\r\n$query1=$this->db->query(\"SELECT sum(amount) as amount FROM `transaction` \r\nWHERE type='Income' AND user_id='\".$this->session->userdata('user_id').\"' \r\nAnd trans_date between ADDDATE(LAST_DAY(SUBDATE('\".$date.\"',\r\nINTERVAL 1 MONTH)), 1) AND LAST_DAY('\".$date.\"')\");\t\r\n$curmonth_income_result=$query1->row();\r\n\r\n//Current Month Expense\r\n$query2=$this->db->query(\"SELECT sum(amount) as amount FROM `transaction` \r\nWHERE type='Expense' AND user_id='\".$this->session->userdata('user_id').\"' And trans_date \r\nbetween ADDDATE(LAST_DAY(SUBDATE('\".$date.\"',\r\nINTERVAL 1 MONTH)), 1) AND LAST_DAY('\".$date.\"')\");\t\r\n$curmonth_expense_result=$query2->row();\r\n\r\n\r\n$transaction=array(\r\n\"current_day_income\"=>isset($income_result->amount) ? $income_result->amount : 0,\r\n\"current_day_expense\"=> isset($expense_result->amount) ? $expense_result->amount : 0,\r\n\"current_month_income\"=> isset($curmonth_income_result->amount) ? $curmonth_income_result->amount : 0,\r\n\"current_month_expense\"=> isset($curmonth_expense_result->amount) ? $curmonth_expense_result->amount : 0\r\n\r\n);\t\r\n\r\nreturn $transaction;\r\n}",
"public function getPayRateBasic()\n\t{\n\t\t$current_date = Carbon::now()->format('Y-m-d');\n\t\t$payrate = PayRateBasic::where([\n\t\t\t['applied_finish','=', null],\n\t\t\t['applied_begin', '<=', $current_date],\n\t\t])->orWhere([\n\t\t\t['applied_finish', '>', $current_date],\n\t\t\t['applied_begin', '<=', $current_date],\n\t\t])->first();\n\t\treturn $payrate;\n\t}",
"protected function refundedData()\n {\n $charges = $this->search('charge');\n\n return $this->days()->mapToGroups(function ($day) use ($charges) {\n return [$day->format('M Y') => $charges->filter(function ($charge) use ($day) {\n return $charge->created >= $day->startOfDay()->getTimestamp()\n && $charge->created <= $day->endOfDay()->getTimestamp();\n })->sum(function ($charge) {\n return $charge->amount_refunded / 100;\n })];\n });\n }",
"function allocateBudget() {\n\n\t\t$connection = Yii::app()->db;\n\t\t\n\t\t$budget = $this->budget;\n\t\t$priorities = array(\n\t\t\t\"Venue\" => $this->venue_priority === NULL ? -1 : $this->venue_priority, \n\t\t\t\"Caterer\" => $this->caterer_priority === NULL ? -1 : $this->caterer_priority, \n\t\t\t\"Photographer\" => $this->photographer_priority === NULL ? -1 : $this->photographer_priority, \n\t\t\t\"Music\" => $this->music_priority === NULL ? -1 : $this->music_priority, \n\t\t\t\"Decor\" => $this->decor_priority === NULL ? -1 : $this->decor_priority, \n\t\t\t\"BrideDress\" => $this->dress_priority === NULL ? -1 : $this->dress_priority,\n\t\t\t\"GroomDress\" => $this->dress_priority === NULL ? -1 : $this->dress_priority,\n\t\t\t\"MaidDress\" => $this->dress_priority === NULL ? -1 : $this->dress_priority,\n\t\t\t\"MenDress\" => $this->dress_priority === NULL ? -1 : $this->dress_priority,\n\t\t\t\"Invitations\" => $this->invitation_priority === NULL ? -1 : $this->invitation_priority, \n\t\t\t\"Cakes\" => $this->cake_priority === NULL ? -1 : $this->cake_priority\n\t\t\t);\n\t\t\n\t\t$Database[\"Caterer\"] = CHtml::listData(Caterer::model()->findAllBySQL('select * from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax order by price_per_pax'),'id','price_per_pax');\n\t\t$Database[\"Venue\"] = CHtml::listData(Venue::model()->findAllBySQL('select * from venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests.' order by price'),'id','price');\n\t\t$Database[\"Photographer\"] = CHtml::listData(Photographer::model()->findAllBySQL('select * from photographer where status=\"enabled\" order by price'),'id','price');\n\t\t$Database[\"Music\"] = CHtml::listData(Music::model()->findAllBySQL('select * from music where status=\"enabled\" order by price'),'id','price');\n\t\t$Database[\"Decor\"] = CHtml::listData(Decor::model()->findAllBySQL('select * from decor where status=\"enabled\" order by price'),'id','price');\n\t\t$Database[\"BrideDress\"] = CHtml::listData(Dress::model()->findAllBySQL('select * from dress where status=\"enabled\" and category=\"bride\" order by price'),'id','price');\n\t\t$Database[\"GroomDress\"] = CHtml::listData(Dress::model()->findAllBySQL('select * from dress where status=\"enabled\" and category=\"groom\" order by price'),'id','price');\n\t\t$Database[\"MaidDress\"] = CHtml::listData(Dress::model()->findAllBySQL('select * from dress where status=\"enabled\" and category=\"bridesmaid\" order by price'),'id','price');\n\t\t$Database[\"MenDress\"] = CHtml::listData(Dress::model()->findAllBySQL('select * from dress where status=\"enabled\" and category=\"groomsman\" order by price'),'id','price');\n\t\t$Database[\"Invitations\"] = array(200, 300, 400, 500, 600, 700, 800, 900, 1000);\n\t\t$Database[\"Cakes\"] = CHtml::listData(Cake::model()->findAllBySQL('select * from cake where status=\"enabled\" order by price'),'id','price');\n\t\t\n$average[0] = array(\n\t\"Venue\" => $connection->createCommand('select (min(price)+avg(price))/2 from Venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests)->queryScalar(), \n\t\"Caterer\" => $connection->createCommand('select (min(price_per_pax)+avg(price_per_pax))/2 from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax')->queryScalar(), \n\t\"Photographer\" => $connection->createCommand('select (min(price)+avg(price))/2 from Photographer where status=\"enabled\"')->queryScalar(), \n\t\"Music\" => $connection->createCommand('select (min(price)+avg(price))/2 from music where status=\"enabled\"')->queryScalar(), \n\t\"Decor\" => $connection->createCommand('select (min(price)+avg(price))/2 from decor where status=\"enabled\"')->queryScalar(), \n\t\"BrideDress\" => $connection->createCommand('select (min(price)+avg(price))/2 from dress where category=\"bride\" and status=\"enabled\"')->queryScalar(),\n\t\"GroomDress\" => $connection->createCommand('select (min(price)+avg(price))/2 from dress where category=\"groom\" and status=\"enabled\"')->queryScalar(),\n\t\"MaidDress\" => $connection->createCommand('select (min(price)+avg(price))/2 from dress where category=\"bridesmaid\" and status=\"enabled\"')->queryScalar(),\n\t\"MenDress\" => $connection->createCommand('select (min(price)+avg(price))/2 from dress where category=\"groomsman\" and status=\"enabled\"')->queryScalar(),\n\t\"Invitations\" => 400, \n\t\"Cakes\" => $connection->createCommand('select (min(price)+avg(price))/2 from cake where status=\"enabled\"')->queryScalar()\n\t);\n\n$average[1] = array(\n\t\"Venue\" => $connection->createCommand('select avg(price) from Venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests)->queryScalar(), \n\t\"Caterer\" => $connection->createCommand('select avg(price_per_pax) from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax')->queryScalar(), \n\t\"Photographer\" => $connection->createCommand('select avg(price) from Photographer where status=\"enabled\"')->queryScalar(), \n\t\"Music\" => $connection->createCommand('select avg(price) from music where status=\"enabled\"')->queryScalar(), \n\t\"Decor\" => $connection->createCommand('select avg(price) from decor where status=\"enabled\"')->queryScalar(), \n\t\"BrideDress\" => $connection->createCommand('select avg(price) from dress where category=\"bride\" and status=\"enabled\"')->queryScalar(),\n\t\"GroomDress\" => $connection->createCommand('select avg(price) from dress where category=\"groom\" and status=\"enabled\"')->queryScalar(),\n\t\"MaidDress\" => $connection->createCommand('select avg(price) from dress where category=\"bridesmaid\" and status=\"enabled\"')->queryScalar(),\n\t\"MenDress\" => $connection->createCommand('select avg(price) from dress where category=\"groomsman\" and status=\"enabled\"')->queryScalar(),\n\t\"Invitations\" => 600, \n\t\"Cakes\" => $connection->createCommand('select avg(price) from cake where status=\"enabled\"')->queryScalar()\n\t);\n\n$average[2] = array(\n\t\"Venue\" => $connection->createCommand('select (max(price)+avg(price))/2 from venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests)->queryScalar(), \n\t\"Caterer\" => $connection->createCommand('select (max(price_per_pax)+avg(price_per_pax))/2 from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax')->queryScalar(), \n\t\"Photographer\" => $connection->createCommand('select (max(price)+avg(price))/2 from Photographer where status=\"enabled\"')->queryScalar(), \n\t\"Music\" => $connection->createCommand('select (max(price)+avg(price))/2 from music where status=\"enabled\"')->queryScalar(), \n\t\"Decor\" => $connection->createCommand('select (max(price)+avg(price))/2 from decor where status=\"enabled\"')->queryScalar(), \n\t\"BrideDress\" => $connection->createCommand('select (max(price)+avg(price))/2 from dress where category=\"bride\" and status=\"enabled\"')->queryScalar(),\n\t\"GroomDress\" => $connection->createCommand('select (max(price)+avg(price))/2 from dress where category=\"groom\" and status=\"enabled\"')->queryScalar(),\n\t\"MaidDress\" => $connection->createCommand('select (max(price)+avg(price))/2 from dress where category=\"bridesmaid\" and status=\"enabled\"')->queryScalar(),\n\t\"MenDress\" => $connection->createCommand('select (max(price)+avg(price))/2 from dress where category=\"groomsman\" and status=\"enabled\"')->queryScalar(),\n\t\"Invitations\" => 800, \n\t\"Cakes\" => $connection->createCommand('select (max(price)+avg(price))/2 from cake where status=\"enabled\"')->queryScalar()\n\t);\n\n$min = array(\n\t\"Venue\" => $connection->createCommand('select min(price) from venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests)->queryScalar(), \n\t\"Caterer\" => $connection->createCommand('select min(price_per_pax) from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax')->queryScalar(), \n\t\"Photographer\" => $connection->createCommand('select min(price) from Photographer where status=\"enabled\"')->queryScalar(), \n\t\"Music\" => $connection->createCommand('select min(price) from music where status=\"enabled\"')->queryScalar(), \n\t\"Decor\" => $connection->createCommand('select min(price) from decor where status=\"enabled\"')->queryScalar(), \n\t\"BrideDress\" => $connection->createCommand('select min(price) from dress where category=\"bride\" and status=\"enabled\"')->queryScalar(),\n\t\"GroomDress\" => $connection->createCommand('select min(price) from dress where category=\"groom\" and status=\"enabled\"')->queryScalar(),\n\t\"MaidDress\" => $connection->createCommand('select min(price) from dress where category=\"bridesmaid\" and status=\"enabled\"')->queryScalar(),\n\t\"MenDress\" => $connection->createCommand('select min(price) from dress where category=\"groomsman\" and status=\"enabled\"')->queryScalar(),\n\t\"Invitations\" => 200, \n\t\"Cakes\" => $connection->createCommand('select min(price) from cake where status=\"enabled\"')->queryScalar()\n\t);\n\n$max = array(\n\t\"Venue\" => $connection->createCommand('select max(price) from venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and capacity>='.$this->number_guests)->queryScalar(), \n\t\"Caterer\" => $connection->createCommand('select max(price_per_pax) from caterer where status=\"enabled\" and '.$this->number_guests.'>=min_pax')->queryScalar(), \n\t\"Photographer\" => $connection->createCommand('select max(price) from Photographer where status=\"enabled\"')->queryScalar(), \n\t\"Music\" => $connection->createCommand('select max(price) from music where status=\"enabled\"')->queryScalar(), \n\t\"Decor\" => $connection->createCommand('select max(price) from decor where status=\"enabled\"')->queryScalar(), \n\t\"BrideDress\" => $connection->createCommand('select max(price) from dress where category=\"bride\" and status=\"enabled\"')->queryScalar(),\n\t\"GroomDress\" => $connection->createCommand('select max(price) from dress where category=\"groom\" and status=\"enabled\"')->queryScalar(),\n\t\"MaidDress\" => $connection->createCommand('select max(price) from dress where category=\"bridesmaid\" and status=\"enabled\"')->queryScalar(),\n\t\"MenDress\" => $connection->createCommand('select max(price) from dress where category=\"groomsman\" and status=\"enabled\"')->queryScalar(),\n\t\"Invitations\" => 1000, \n\t\"Cakes\" => $connection->createCommand('select max(price) from cake where status=\"enabled\"')->queryScalar()\n\t);\n\n$number = array(\n\t\"Venue\" => 1, \n\t\"Caterer\"=>$this->number_guests, \n\t\"Photographer\"=>1, \n\t\"Music\"=>1, \n\t\"Decor\"=>1, \n\t\"BrideDress\"=>1, \n\t\"GroomDress\"=>1, \n\t\"MaidDress\" =>$this->number_bridesmaid, \n\t\"MenDress\"=>$this->number_groomsmen, \n\t\"Invitations\" =>$this->number_guests, \n\t\"Cakes\" => 1,\n\t);\n\n$exists = array(\n\t\"Venue\" => $this->venue_priority === NULL ? 0 : 1, \n\t\"Caterer\"=>$this->caterer_priority === NULL ? 0 : 1, \n\t\"Photographer\"=>$this->photographer_priority === NULL ? 0 : 1, \n\t\"Music\"=>$this->music_priority === NULL ? 0 : 1, \n\t\"Decor\"=>$this->decor_priority === NULL ? 0 : 1, \n\t\"BrideDress\"=>$this->dress_priority === NULL ? 0 : 1, \n\t\"GroomDress\"=>$this->dress_priority === NULL ? 0 : 1, \n\t\"MaidDress\" =>($this->dress_priority === NULL || $this->number_bridesmaid==0) ? 0 : 1, \n\t\"MenDress\"=>($this->dress_priority === NULL || $this->number_groomsmen==0) ? 0 : 1,\n\t\"Invitations\" => 0, \n\t\"Cakes\" => $this->cake_priority === NULL ? 0 : 1,\n\t);\n// if($this->number_bridesmaid===0){\n// \t$exists[\"MaidDress\"] = 0;\n// }\n// if($this->number_groomsmen===0){\n// \t$exists[\"GroomDress\"] = 0;\n// }\n$Finalbudget = array(\n\t\"Venue\" => 0, \n\t\"Caterer\"=>0, \n\t\"Photographer\"=>0, \n\t\"Music\"=>0, \n\t\"Decor\"=>0, \n\t\"BrideDress\"=>0, \n\t\"GroomDress\"=>0, \n\t\"MaidDress\" =>0, \n\t\"MenDress\"=>0, \n\t\"Invitations\" => 0, \n\t\"Cakes\" => 0,\n\t);\n\n$Avgbudget = array(\n\t\"Venue\" => 0, \n\t\"Caterer\"=>0, \n\t\"Photographer\"=>0, \n\t\"Music\"=>0, \n\t\"Decor\"=>0, \n\t\"BrideDress\"=>0, \n\t\"GroomDress\"=>0, \n\t\"MaidDress\" =>0, \n\t\"MenDress\"=>0, \n\t\"Invitations\" => 0, \n\t\"Cakes\" => 0,\n\t);\n\n\t\t//start of code\n$this->reduction($priorities, $average, $min, $max, $number, $exists, $budget, $Finalbudget, $Avgbudget);\n\t\t// echo \"<h1> ITERATION 1</h1>\";\nif($budget < 0) {\n\t\t\t// echo \"<br>Budget too low\";\n}\n\t\t//after first check and execution\nelse {\n\t\tforeach($number as $k=>$ak){\t\n\t\t\tif($exists[$k]!==0){\n\t\t\t\tforeach($Database[$k] as $value) {\n\t\t\t\t\t\t// echo $value.\"<br>\";\n\t\t\t\t\tif($value === $Avgbudget[$k]) {\n\t\t\t\t\t\t$Finalbudget[$k] = $value;\n\t\t\t\t\t\t$budget -= $value * $number[$k];\n\t\t\t\t\t\t$exists[$k] = 0;\n\t\t\t\t\t\t$this->reduction($priorities, $average, $min, $max, $number, $exists, $budget, $Finalbudget, $Avgbudget);\n\t\t\t\t\t\t\t// echo \"<h1> ITERATION \".$k.\"</h1>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif($value>$Avgbudget[$k]) {\n\n\t\t\t\t\t\t$Finalbudget[$k] = $prev;\n\t\t\t\t\t\t$budget -= $prev*$number[$k];\n\t\t\t\t\t\t$exists[$k] = 0;\n\t\t\t\t\t\t$this->reduction($priorities, $average, $min, $max, $number, $exists, $budget, $Finalbudget, $Avgbudget);\n\t\t\t\t\t\t\t// echo \"<h1> ITERATION \".$k.\"</h1>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$prev = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($budget < 0) {\n\t\t\t\t\t// echo \"<br>Budget too low\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n}\n\n$fbudget = 0;\n\t\t// echo \"<h3>\";\nforeach($Finalbudget as $k => $ak) {\n\t\t\t// echo $k.\" = \".$ak.\"<br>\";\n\t$fbudget += $ak*$number[$k];\n}\n\t\t// echo \"</h3>\";\n\t\t// echo \"<h1> Total money spent : \".$fbudget.\"</h1>\";\n\t\t// echo \"<h1> Money left : \".$budget.\"</h1>\";\nif($Finalbudget['Venue'] !== 0) {\n\t$this->venue_id = $connection->createCommand('select id from venue where status=\"enabled\" and id not in (select venue_id from wedding where status = \"confirmed\" and date = \\''.$this->date.'\\' and venue_id IS NOT NULL) and '.$this->number_guests.'<= capacity and price = '.$Finalbudget['Venue'])->queryScalar();\n}\n\nif($Finalbudget['Caterer'] !== 0) {\n\t$this->caterer_id = $connection->createCommand('select id from caterer where status=\"enabled\" and min_pax<='.$this->number_guests.' and price_per_pax = '.$Finalbudget['Caterer'])->queryScalar();\n}\n\nif($Finalbudget['Photographer'] !== 0) {\n\t$this->photographer_id = $connection->createCommand('select id from Photographer where status=\"enabled\" and price = '.$Finalbudget['Photographer'])->queryScalar();\n}\n\nif($Finalbudget['Music'] !== 0) {\n\t$this->music_id = $connection->createCommand('select id from music where status=\"enabled\" and price = '.$Finalbudget['Music'])->queryScalar();\n}\n\nif($Finalbudget['Decor'] !== 0) {\n\t$this->decor_id = $connection->createCommand('select id from decor where status=\"enabled\" and price = '.$Finalbudget['Decor'])->queryScalar();\n}\n\nif($Finalbudget['BrideDress'] !== 0) {\n\t$this->bride_id = $connection->createCommand('select id from dress where status=\"enabled\" and price = '.$Finalbudget['BrideDress'].' and category = \"bride\"')->queryScalar();\n}\n\nif($Finalbudget['GroomDress'] !== 0) {\n\t$this->groom_id = $connection->createCommand('select id from dress where status=\"enabled\" and price = '.$Finalbudget['GroomDress'].' and category = \"groom\"')->queryScalar();\n}\n\nif($Finalbudget['MaidDress'] !== 0) {\n\t$this->bridesmaid_id = $connection->createCommand('select id from dress where status=\"enabled\" and price = '.$Finalbudget['MaidDress'].' and category = \"bridesmaid\"')->queryScalar();\n}\n\nif($Finalbudget['MenDress'] !== 0) {\n\t$this->groomsmen_id = $connection->createCommand('select id from dress where status=\"enabled\" and price = '.$Finalbudget['MenDress'].' and category = \"groomsman\"')->queryScalar();\n}\n\nif($Finalbudget['Cakes'] !== 0) {\n\t$this->cake_id = $connection->createCommand('select id from cake where status=\"enabled\" and price = '.$Finalbudget['Cakes'])->queryScalar();\n}\n\t\n}",
"function showProductionFabRate($id)\n\t{\n\t\t//declare vars\n\t\t$data = array();\n\t\t//statement\n\t\t$select = \"SELECT * FROM product_fabric_rate\n\t\t\t\t WHERE id\t= '$id'\";\n\t\t//execute query\n\t\t$query\t= mysql_query($select);\n\t\t//echo $select.mysql_error();exit;\n\t\t//holds the data\n\t\twhile($result = mysql_fetch_object($query))\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t\t$result->id,\t\t\t\t//0\n\t\t\t\t\t$result->prod_rate_id,\t\t//1\n\t\t\t\t\t$result->fabric_name,\t\t//2\n\t\t\t\t\t$result->fab_rate,\t\t\t//3\t\n\t\t\t\t\t$result->fab_amount,\t\t//4\t\n\t\t\t\t\t$result->fab_cost\t\t\t//5\t\n\t\t\t\t\t);\n\t\t}\n\t\t//return the data\n\t\treturn $data;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the extension install type. | public function setInstallType($type)
{
if ($type === 'composer' || $type === 'local') {
$this->installtype = $type;
}
} | [
"public function actionInstall($type)\n {\n $model = Yii::$app->big->extensionManager->getModel();\n $model->type = $type;\n if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('cms', 'Extension installed.'));\n if (Yii::$app->toolbar->stayAfterSave()) {\n return $this->redirect(['edit', 'id' => $model->id]);\n } else {\n return $this->redirect(['index']);\n }\n }\n return $this->render('edit', [\n 'model' => $model,\n ]);\n }",
"public function setExtensionType($extension, $exttype)\n {\n $payload = '';\n $payload .= pack('C', $extension);\n $payload .= pack('V', $exttype);\n\n $this->sendRequest(self::FUNCTION_SET_EXTENSION_TYPE, $payload);\n }",
"private function setExtension(): void\n {\n $r = array_keys(self::$mimeTypesValid, $this->getMimeType());\n if (!empty($r) && isset($r[0])) {\n $this->extension = $r[0];\n }\n }",
"public function setExtType($value) {\n return $this->set(self::EXT_TYPE, $value);\n }",
"public function setTypeExt($var)\n {\n GPBUtil::checkString($var, True);\n $this->type_ext = $var;\n\n return $this;\n }",
"function setExtension($ext);",
"function addMimeType($extension, $type) {\r\n $this->supported_mimetypes[strtolower($extension)] = strtolower($type);\r\n }",
"private function set_extension() {\n\n spl_autoload_extensions( $this->acceptedExt );\n\n }",
"public function setExtension($ext);",
"public function setSystemUpdateInstallType($val)\n {\n $this->_propDict[\"systemUpdateInstallType\"] = $val;\n return $this;\n }",
"public function set_type( $type ) {\n\n\t\tif ( isset( $this->options['type'] ) && $this->options['type'] === $type )\n\t\t\treturn;\n\n\t\tparent::set_type( $type );\n\n\t\t$this->options['type'] = $type;\n\n\t\t$this->clear_filesize_cache();\n\n\t}",
"function setPackageType($type)\n {\n $this->_isValid = 0;\n if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc',\n 'zendextbin', 'bundle'))) {\n return false;\n }\n\n if (in_array($type, array('zendextsrc', 'zendextbin'))) {\n $this->_setPackageVersion2_1();\n }\n\n if ($type != 'bundle') {\n $type .= 'release';\n }\n\n foreach (array('phprelease', 'extbinrelease', 'extsrcrelease',\n 'zendextsrcrelease', 'zendextbinrelease', 'bundle') as $test) {\n unset($this->_packageInfo[$test]);\n }\n\n if (!isset($this->_packageInfo[$type])) {\n // ensure that the release tag is set up\n $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('changelog'),\n array(), $type);\n }\n\n $this->_packageInfo[$type] = array();\n return true;\n }",
"protected function enableExtension($extension_type, $extension_machine_name, $extension_name) {\n if ($extension_type === 'module') {\n $edit = [\n \"modules[$extension_machine_name][enable]\" => $extension_machine_name,\n ];\n $this->drupalGet('admin/modules');\n $this->submitForm($edit, 'Install');\n }\n elseif ($extension_type === 'theme') {\n $this->drupalGet('admin/appearance');\n $this->click(\"a[title~=\\\"$extension_name\\\"]\");\n }\n }",
"public function set_type($type)\n\t{\n\t\t$this->contrib_type = $type;\n\t\t$this->type = $this->types->get($this->contrib_type);\n\t}",
"public function getExtensionType()\n {\n return $this->extension_type;\n }",
"public function setExtensionType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V14\\Enums\\ExtensionTypeEnum\\ExtensionType::class);\n $this->extension_type = $var;\n\n return $this;\n }",
"public function setExtension($extension);",
"public function setExtensionElement($element)\r\n {\r\n $this->removeExtensionElements(get_class($element));\r\n $this->addExtensionElement($element);\r\n }",
"function set($type, $exts=null)\r\n {\r\n if (!isset($exts)) {\r\n if (is_array($type)) {\r\n foreach ($type as $mime_type => $exts) {\r\n $this->set($mime_type, $exts);\r\n }\r\n }\r\n return;\r\n }\r\n if (!is_string($type)) return;\r\n // get rid of any parameters which might be included with the MIME type\r\n // e.g. text/plain; charset=iso-8859-1\r\n $type = strtr(strtolower(trim($type)), \",;\\t\\r\\n\", ' ');\r\n if ($sp_pos = strpos($type, ' ')) $type = substr($type, 0, $sp_pos);\r\n // not bothering with an extensive check of the MIME type, just checking for slash\r\n if (!strpos($type, '/')) return;\r\n // loop through extensions\r\n if (!is_array($exts)) $exts = explode(' ', $exts);\r\n foreach ($exts as $ext) {\r\n $ext = trim(str_replace('.', '', $ext));\r\n if ($ext == '') continue;\r\n $this->mime_types[strtolower($ext)] = $type;\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Work out the entity namespace root from a single entity reflection object. | public function getEntityNamespaceRootFromEntityReflection(
ReflectionClass $entityReflection
): string {
return $this->namespaceHelper->tidy(
$this->namespaceHelper->getNamespaceRootToDirectoryFromFqn(
$entityReflection->getName(),
AbstractGenerator::ENTITIES_FOLDER_NAME
)
);
} | [
"abstract public function getEntityNamespace();",
"public function getNamespace()\n {\n // If this is an entity reference with an exact namespace, return it.\n if (!$this->loaded)\n {\n $effectiveNamespace = $this->namespace;\n if ($effectiveNamespace === NULL)\n $effectiveNamespace = $this->service->getNamespace();\n if ($effectiveNamespace->isExact())\n return $effectiveNamespace;\n }\n \n // Extract the namespace from this entity's content.\n $acl = $this['eai:acl'];\n return Splunk_Namespace::createExact(\n $acl['owner'], $acl['app'], $acl['sharing']);\n }",
"public static function getEntityNamespace()\n {\n return isset(static::$entityNamespace) ? static::$entityNamespace : get_called_class();\n }",
"public function getRootNamespace()\n\n {\n return \"App\\\\Entity\\\\\";\n }",
"public static function getEntityNamespace(): string\n {\n return isset(static::$entityNamespace) ? static::$entityNamespace : get_called_class();\n }",
"function tidy_get_root($object){}",
"function static_get_root_entity(ElggEntity $entity) {\n\t$root_entity = false;\n\t$page_owner = elgg_get_page_owner_entity();\n\t\n\tif ($entity->getContainerGUID() == $entity->site_guid) {\n\t\t// top page on site\n\t\t$root_entity = $entity;\n\t} elseif(!empty($page_owner) && ($entity->getContainerGUID() == $page_owner->getGUID())) {\n\t\t// top page in group\n\t\t$root_entity = $entity;\n\t} else {\n\t\t// subpage\n\t\t$relations = $entity->getEntitiesFromRelationship(array(\"relationship\" => \"subpage_of\", \"limit\" => 1));\n\t\tif ($relations) {\n\t\t\t$root_entity = $relations[0];\n\t\t}\n\t}\n\t\n\treturn $root_entity;\n}",
"public function getRootEntity()\n {\n if (!isset($this->data[$this->entitySectionName])) {\n throw new \\LogicException('This object does not contain the root entity.');\n }\n\n return $this->data[$this->entitySectionName];\n }",
"public function getRootEntity()\n\t{\n\t\t$from = $this->getDQLPart('from');\n\t\treturn $from[0]->getFrom();\n\t}",
"public function getRoot(): string\n {\n $class = get_class($this);\n\n do {\n if (0 === strpos($class, 'OpenApi\\\\Annotations\\\\')) {\n break;\n }\n } while ($class = get_parent_class($class));\n\n return $class;\n }",
"private function getEntityNamespace()\n\t{\n\t\treturn 'Acme\\TestBundle\\Entity\\Product';\n\t}",
"public function getRootEntities();",
"protected function realNamespace()\n {\n // Sometimes I have one class that inherits the entity and store of another\n // Like how Vfi Client is fake and simply inherits Iam Client\n // In this case $vfi->client REAL MASTER namespace should actually be Dynatron\\Iam\n // Not Dynatron\\Vfi like $this->manager->namespace will reveal.\n\n // I need the REAL MASTER namespace for cases like events\n // I want to fire true Iam\\Client events not Vfi\\Client is using $vfi->client\n // or Iam\\Client if using $iam->client...both are truely Iam and should fire only\n // Dynatron\\Iam events.\n $class = get_class($this);\n $parent = get_parent_class($this);\n\n if (preg_match(\"/Repository\\\\\\\\[A-Za-z]*Store/\", $parent)) {\n // Store is not inherited from another namespace\n $namespace = $this->manager->namespace;\n } else {\n // Store is inherited from another namespace\n $tmp = explode('\\\\', $parent);\n $namespace = implode('\\\\', array_slice($tmp, 0, count($tmp)-3));\n }\n return $namespace;\n }",
"public function getRootNamespace()\n {\n return $this->rootNamespace;\n }",
"public function getNamespaceObject()\n {\n return $this->_namespace;\n }",
"public function getEntitySubNamespace(\n string $entityFqn\n ): string {\n return $this->tidy(\n substr(\n $entityFqn,\n strrpos(\n $entityFqn,\n '\\\\' . AbstractGenerator::ENTITIES_FOLDER_NAME . '\\\\'\n )\n + strlen('\\\\' . AbstractGenerator::ENTITIES_FOLDER_NAME . '\\\\')\n )\n );\n }",
"public function getEntityNamespaces()\n {\n return $this->attributes['entityNamespaces'];\n }",
"function getRootEntityName() {\n\n if (isset($_SESSION['glpirootentityname'])) {\n return $_SESSION['glpirootentityname'];\n }\n\n $entity = new Entity();\n if ($entity->getFromDB(0)) {\n $_SESSION['glpirootentityname'] = $entity->fields['name'];\n } else {\n $_SESSION['glpirootentityname'] = 'No root entity / DB troubles';\n }\n return $_SESSION['glpirootentityname'];\n }",
"public function getEntityClass()\n {\n if (!$this->entityClass) {\n $default = Document::class;\n $self = static::class;\n $parts = explode('\\\\', $self);\n\n if ($self === self::class || count($parts) < 3) {\n return $this->entityClass = $default;\n }\n\n $alias = Inflector::singularize(substr(array_pop($parts), 0, -5));\n $name = implode('\\\\', array_slice($parts, 0, -1)) . '\\Document\\\\' . $alias;\n if (!class_exists($name)) {\n return $this->entityClass = $default;\n }\n\n $class = App::className($name, 'Model/Document');\n $this->entityClass = $class;\n }\n\n return $this->entityClass;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Untuk mendapatkan family berdasarkan criteria dan value | public function getFamilyBy($criteria, $value, $start = 0, $limit = 25)
{
$query = $this->getEntityManager()
->createQueryBuilder()
->select(
"ef.id AS family_id,
ef.relation AS family_level,
ef.first_name AS family_fname,
ef.last_name AS family_lname,
TO_CHAR(ef.bod, '{$this->getHelper()->getSession()->get('date_format_text')}') AS family_born,
e.id AS family_education,
e.name AS family_educationname,
ef.institute AS family_institute"
)
->from('GatotKacaErpHumanResourcesBundle:EmployeeFamily', 'ef')
->leftJoin('GatotKacaErpMainBundle:Education', 'e', 'WITH', 'ef.education = e.id')
->where("ef.{$criteria} = :{$criteria}")
->orderBy('ef.relation', 'ASC')
->setParameter($criteria, $value)
->setFirstResult($start)
->setMaxResults($limit)
->getQuery();
$this->setModelLog("get family with {$criteria} {$value}");
return $query->getResult();
} | [
"public function applyCriteria();",
"private function set_family_health($arr){\r\n\t\t$qno = $this->getFirstQuestionNo('family_health');\r\n\t\t$err=null;\r\n\t\tfor($x=1;$x<=6;$x++){\r\n \t\ttry{\r\n \t\t\t$v=$this->vc->exists('q10_'.$x,$arr,\"enum\",array(\"values\"=>array(1,2,3)),false,false);\r\n \t\t\t$this->data['family_health']['q10_'.$x]=($v==\"\")?0:$v;\r\n \t\t}catch(ValidationException $e){\r\n \t\t\t$eob=$e->createErrorObject();\r\n \t\t\t$eob->message = \"Be sure to select an answer for all of the listed conditions\";\r\n \t\t\t$eob->name = \"Question \" . $qno;\r\n \t\t}\r\n \t}\r\n \tif (isset($eob)) {\r\n \t\t$err[] = $eob;\r\n \t}\r\n \treturn ($err)?$err:false;\r\n }",
"protected function _FormatCriteria()\t\t\t\t\t\t\t\t\t\t\t\t {}",
"public static function criteriaGrafik($model, $type='data', $addCols = array()){\n $criteria = new CDbCriteria;\n $criteria->select = 'count(pendaftaran_id) as jumlah';\n if ($_GET['filter'] == 'carabayar') {\n if (!empty($model->penjamin_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group .= 'penjamin_nama';\n } else if (!empty($model->carabayar_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group = 'penjamin_nama';\n } else {\n $criteria->select .= ', carabayar_nama as '.$type;\n $criteria->group = 'carabayar_nama';\n }\n } else if ($_GET['filter'] == 'wilayah') {\n if (!empty($model->kelurahan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kecamatan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kabupaten_id)) {\n $criteria->select .= ', kecamatan_nama as '.$type;\n $criteria->group .= 'kecamatan_nama';\n } else if (!empty($model->propinsi_id)) {\n $criteria->select .= ', kabupaten_nama as '.$type;\n $criteria->group .= 'kabupaten_nama';\n } else {\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n }\n\n if (!isset($_GET['filter'])){\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n\n if (count($addCols) > 0){\n if (is_array($addCols)){\n foreach ($addCols as $i => $v){\n $criteria->group .= ','.$v;\n $criteria->select .= ','.$v.' as '.$i;\n }\n } \n }\n\n return $criteria;\n }",
"public function getFamily();",
"function familyelderrelationrpt()\n\t{\n\t\t$this->load->model('constantmodel');\n\t\t\n\t\t$this->data['elder_psychologicalstatus'] = $this->constantmodel->get_sub_constant(44);\n\t\t$this->data['elder_elderbehaviour'] = $this->constantmodel->get_sub_constant(43);\n\t\t$this->data['elder_elderpariah'] = $this->constantmodel->get_sub_constant(56);\n\t\t$this->data['elder_choice'] = $this->constantmodel->get_sub_constant(38);\n\t\t\n\t}",
"private function setSearchCriteriaText()\n {\n $criteriaText = '';\n\n /**\n * Gender filtering if defined\n * We have array from $_SESSION and we un-pack it\n */\n\n if(!empty($_SESSION['FilterForm']['gender']))\n {\n if(array_search('M', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Male ';\n }\n\n if(array_search('F', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Female ';\n }\n }\n\n /**\n * Filter by country if defined\n */\n\n if(!empty($_SESSION['FilterForm']['country.id']))\n {\n $criteriaText .= ' AND ' . CitizenType::model()->findByPk($_SESSION['FilterForm']['country.id'])->name . ' ';\n }\n\n /**\n * Filter by state if defined\n * Also decline state if country != USA or country != Any Country\n */\n\n if(!empty($_SESSION['FilterForm']['states.id']) && $_SESSION['FilterForm']['country.id'] <= 1)\n {\n $criteriaText .= ' AND ' . States::model()->findByPk($_SESSION['FilterForm']['states.id'])->name . ' ';\n }\n\n /**\n * Filter by Focus if defined\n */\n\n if(!empty($_SESSION['FilterForm']['focus']))\n {\n foreach(BasicProfile::$ProfileTypeArray as $key => $type)\n {\n if(array_search($key, $_SESSION['FilterForm']['focus']) !== FALSE)\n {\n $criteriaText .= ' AND ' . BasicProfile::$ProfileTypeArray[$key] . ' ';\n }\n }\n }\n\n /**\n * Filter by Race if defined\n */\n\n if(!empty($_SESSION['FilterForm']['race_id']))\n {\n $criteriaText .= ' AND ' . RaceType::model()->findByPk($_SESSION['FilterForm']['race_id'])->name . ' ';\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 2400 (5 key from array)\n */\n\n $SATUsed = false;\n\n if(!empty($_SESSION['FilterForm']['SATMax']) && $_SESSION['FilterForm']['SATMax'] <= 4)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n $SATUsed = true;\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 600 (0 key from array)\n */\n\n if(!$SATUsed && !empty($_SESSION['FilterForm']['SATMin']) && $_SESSION['FilterForm']['SATMin'] > 0)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n }\n\n /**\n * If we haven't defined university then cut off extra 'AND' from result string\n */\n if(empty($_SESSION['search_q']))\n {\n $criteriaText = substr($criteriaText, 4);\n }\n /*\n * If we still have no text then simply define this text as 'None'\n */\n\n if(empty($criteriaText) && empty($_SESSION['search_q'])) \n {\n $criteriaText = 'None';\n }\n\n /**\n * Actual criteria text defining\n */\n\n if(!empty($_SESSION['search_q']))\n \n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $_SESSION['search_q'] . $criteriaText;\n \n else \n \n \n {\n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $criteriaText;;\n }\n }",
"public static function criteriaGrafik($model, $type='data', $addCols = array()){\n $criteria = new CDbCriteria;\n $criteria->select = 'count(pendaftaran_id) as jumlah';\n if ($_GET['filter'] == 'carabayar') {\n if (!empty($model->penjamin_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group .= 'penjamin_nama';\n } else if (!empty($model->carabayar_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group = 'penjamin_nama';\n } else {\n $criteria->select .= ', carabayar_nama as '.$type;\n $criteria->group = 'carabayar_nama';\n }\n } else if ($_GET['filter'] == 'wilayah') {\n if (!empty($model->kelurahan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kecamatan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kabupaten_id)) {\n $criteria->select .= ', kecamatan_nama as '.$type;\n $criteria->group .= 'kecamatan_nama';\n } else if (!empty($model->propinsi_id)) {\n $criteria->select .= ', kabupaten_nama as '.$type;\n $criteria->group .= 'kabupaten_nama';\n } else {\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n }\n\n if (!isset($_GET['filter'])){\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n\n if (count($addCols) > 0){\n if (is_array($addCols)){\n foreach ($addCols as $i => $v){\n $criteria->group .= ','.$v;\n $criteria->select .= ','.$v.' as '.$i;\n }\n } \n }\n\n return $criteria;\n }",
"public function getCriteria();",
"abstract public function getCriteria();",
"public static function criteriaGrafik($model, $type='data', $addCols = array()){\n $criteria = new CDbCriteria;\n $criteria->select = 'count(pendaftaran_id) as jumlah';\n if ($_GET['filter'] == 'carabayar') {\n if (!empty($model->penjamin_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group .= 'penjamin_nama,t.tgl_pendaftaran';\n } else if (!empty($model->carabayar_id)) {\n $criteria->select .= ', carabayar_nama as '.$type;\n $criteria->group = 'carabayar_nama,t.tgl_pendaftaran';\n } else {\n $criteria->select .= ', carabayar_nama as '.$type;\n $criteria->group = 'carabayar_nama,t.tgl_pendaftaran';\n }\n } else if ($_GET['filter'] == 'wilayah') {\n if (!empty($model->kelurahan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama,t.tgl_pendaftaran';\n } else if (!empty($model->kecamatan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama,t.tgl_pendaftaran';\n } else if (!empty($model->kabupaten_id)) {\n $criteria->select .= ', kecamatan_nama as '.$type;\n $criteria->group .= 'kecamatan_nama,t.tgl_pendaftaran';\n } else if (!empty($model->propinsi_id)) {\n $criteria->select .= ', kabupaten_nama as '.$type;\n $criteria->group .= 'kabupaten_nama,t.tgl_pendaftaran';\n } else {\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama,t.tgl_pendaftaran';\n }\n }\n\n if (!isset($_GET['filter'])){\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama,t.tgl_pendaftaran';\n }\n\n if (count($addCols) > 0){\n if (is_array($addCols)){\n foreach ($addCols as $i => $v){\n $criteria->group .= ','.$v;\n $criteria->select .= ','.$v.' as '.$i;\n }\n } \n }\n\n return $criteria;\n }",
"public function ReporterFilterData($value)\n {\n $em = $this->getEntityManager();\n if ($value == 'Display All') {\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.employeeId,up.email');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $result1 = $qb1->getQuery()->getResult();\n return $result1;\n } \n else {\n $qb = $em->createQueryBuilder();\n $qb->select('DISTINCT ur.id');\n $qb->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb->innerJoin('u.reportingPersons', 'ur');\n if ($value == 'Non Jyo')\n $qb->where(\"u.id !='14'\");\n elseif ($value == 'Jyo')\n $qb->where(\"u.id = '14'\");\n $result = $qb->getQuery()->getResult();\n\n for ($i = '0'; $i < sizeof($result); $i++) {\n $id = $result[$i]['id'];\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.employeeId,up.email');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $qb1->where(\"u.id='$id'\");\n $finalResult[$i] = $qb1->getQuery()->getResult();\n }\n \n return $finalResult;\n }\n }",
"function Show_VFam($val1,$val2)\n{\n\t \n\t$resref =\"SELECT * FROM `FAMILLE` WHERE FLAG=0 AND DESI='$val1'\";\n\t$countref=facoperator($resref, 'get', 'single');\n\n\t\t\n if($countref != null) {\n\t\textract(countref);\n\t\tif ('DEPENSE'==$val2){\n\t\t\t$val2=$DEPENSE;\n\t\t}\n\t\tif ('GAINS'==$val2){\n\t\t\t$val2=$GAINS;\n\t\t}\n\t\tif ('STOCK'==$val2){\n\t\t\t$val2=$STOCK;\n\t\t}\n\t}\n\treturn $val2;\n\n}",
"function fdf_enum_values($fdf_document, $function, $userdata){}",
"public function getEstablishmentFee($id){\n\n\n\n $tender = pnotice::whereid($id)->first();\n if($tender->ptype_id==2)\n {\n $fees = pestabishmentfee::wherelocality(Auth::user()->company->locality)->get();\n if(count($fees)>0){\n foreach($fees as $fee){\n if($fee->lower < $tender->bidbond && $tender->bidbond < $fee->upper && $fee->validity = $tender->period){\n return $fee->value;\n }\n }\n }\n}\n\n return 0;\n\n}",
"public function testFamily()\n {\n $Name = new Name();\n \n $value = 'Berger-Payment';\n $Name->set('family',$value);\n \n $this->assertEquals($value, $Name->getFamily());\n }",
"public function paramsFilter(){\n\t\t\t\n\t\t\t$f = [];\n\t\t\t\n\t\t\t// Установка металла\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Металл',\n 'variabled' => 'metall',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$metallList = ['Комбинированное золото','Красное золото','Белое золото','Золочёное серебро','Чернёное серебро'];\n\t\t\t$metallListVals = ['kombinZoloto','krasnZoloto','belZoloto','zoloZoloto','chernZoloto']; \n\t\t\tforeach( $metallList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $metallListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка для кого\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Для кого',\n 'variabled' => 'sex',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$dlaKogo = ['Для женщин','Для мужчин', 'Для женщин, Для мужчин'];\n\t\t\t$dlaKogoVals = ['woman','men', 'unisex']; \n\t\t\tforeach( $dlaKogo as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $dlaKogoVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка размера\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Размер',\n 'variabled' => 'size',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$razmerList = ['2.0','12.0','13.0','13.5','14.0','14.5','15.0','15.5','16.0','16.5','17.0','17.5','18.0','18.5','19.0','19.5','20.0','20.5','21.0','21.5','22.0','22.5','23.0','23.5','24.0','24.5','25.0'];\n\t\t\t$razmerListVals = ['2_0','12_0','13_0','13_5','14_0','14_5','15_0','15_5','16_0','16_5','17_0','17_5','18_0','18_5','19_0','19_5','20_0','20_5','21_0','21_5','22_0','22_5','23_0','23_5','24_0','24_5','25_0']; \n\t\t\tforeach( $razmerList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $razmerListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add; \n\t\t\t\n\t\t\t// Установка вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Вставка',\n 'variabled' => 'kamen',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$kamenList = ['Бриллиант','Сапфир','Изумруд','Рубин','Жемчуг','Топаз','Аметист','Гранат','Хризолит','Цитрин','Агат','Кварц','Янтарь','Опал','Фианит'];\n\t\t\t$kamenListVals = ['brilliant','sapfir','izumrud','rubin','jemchug','topaz','ametist','granat','hrizolit','citrin','agat','kvarc','jantar','opal','fianit']; \n\t\t\tforeach( $kamenList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $kamenListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка формы вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Форма вставки',\n 'variabled' => 'forma_vstavki',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t];\t\t\t\n\t\t\t$formaList = ['Кабошон','Круг','Овал','Груша','Маркиз', 'Багет', 'Квадрат', 'Октагон', 'Триллион', 'Сердце', 'Кушон', 'Пятигранник', 'Шестигранник', 'Восьмигранник'];\n\t\t\t$formaListVals = ['Kaboshon','Krug','Oval','Grusha','Markiz', 'Baget', 'Kvadrat', 'Oktagon', 'Trillion', 'Serdtce', 'Kushon', 'Piatigranniq', 'Shestigranniq', 'Vosmigrannic']; \n\t\t\tforeach( $formaList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $formaListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n \n /*\n\t\t\t\techo json_encode( $f );\n\t\t\t*/\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $f );\n\t\t\techo \"</pre>\";\t\n\t\t\t\n\t\t\t\n \n \n // металл\n \n // для кого\n \n // размер\n \n // Камень\n \n // Форма вставки\n \n \n /*{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},\n\t\t\t\t\n\t\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},\n\t\t\t\t\n\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}*/\n \n\t\t\t/*\n\t\t\t[{\"type\":\"range-values\",\"title\":\"Цена\",\"variabled\":\"Cena\",\"impact\":\"price\",\"data\":[{\"title\":\"Цена от:\",\"value\":\"0\",\"variabled\":\"_ot\"},{\"title\":\"Цена до:\",\"value\":\"900000\",\"variabled\":\"_do\"}]},{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}]*/\n\t\t\t\n\t\t\t\n\t\t}",
"private function kriteria()\n {\n $kriteria = $this->kriteria;\n $intital_kriteria = 1;\n $bobot_kriteria = [];\n foreach ($kriteria as $key => $value) {\n $kriteria['C' . $intital_kriteria] = $value->type_kriteria;\n $bobot_kriteria['C' . $intital_kriteria] = $value->bobot_kriteria;\n $intital_kriteria++;\n }\n $this->bobot_kriteria=$bobot_kriteria;\n return $kriteria;\n }",
"protected function _identify($p, $v){$this->_criteria[$p] = $v;}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getMetadata3 Get metadata | public function getMetadata3($handle)
{
list($response) = $this->getMetadata3WithHttpInfo($handle);
return $response;
} | [
"public function getMetadata();",
"public function getContentMetadata();",
"protected function fetchMetadata() {\n\t\tif(count($this->metadata) == 0) {\n\t\t\t$this->metadata = Metadata::getItemsByProject($this);\n\t\t}\n\n\t\treturn $this->metadata;\n\t}",
"public function metadata($data) {\n $request_url = $this->_apiURL.'metadata/'.$data.'?AccessID='.$this->_accessID.'&Expires='.$this->_expires.'&Signature='.$this->_signature;\n\n $result = $this->_curlRequest($request_url);\n \n return $result;\n }",
"protected function getMetadata3UsingGETRequest()\n {\n\n $resourcePath = '/v1/get-metadata-3';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function retrieveMetadata()\n {\n $response = $this->getClient()\n ->head($this->getUrl())\n ->send();\n\n $this->setMetadata($response->getHeaders(), true);\n\n return $this->metadata;\n }",
"function elgg_get_metadata(array $options = []) {\n\treturn _elgg_services()->metadataTable->getAll($options);\n}",
"public function getAllMetadata();",
"function getMetadata() {\n\t\treturn $this->_Metadata;\n\t}",
"public function get_metadata() {\n\t\tif ( ! isset( $this->metadata ) ) {\n\t\t\t$this->metadata = wp_get_attachment_metadata( $this->attachment_id );\n\t\t}\n\t\treturn $this->metadata; \n\t}",
"public function getAllMetadata()\n {\n return $this->metadata;\n }",
"public function getS3Metadata()\n {\n return $this->readOneof(4);\n }",
"public function getFileMetadata()\n {\n return $this->get('FileMetadata');\n }",
"private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}",
"public function getMetadata3Async($handle)\n {\n return $this->getMetadata3AsyncWithHttpInfo($handle)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getMetadataCache()\n {\n /*if (Zend_Registry::get('Zend_Cache_Manager')->hasCache('metadata')) {\n $cache = Zend_Registry::get('Zend_Cache_Manager')->getCache('metadata');\n return $cache;\n }*/\n }",
"function getMetaData($dataType){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta/';\n\t\t$request = $baseUrl . $endpoint . $dataType;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"public function _getMetadata()\r\n\t{\t\r\n\t\tif ( $this->metainfo !== null ) \r\n\t\t{\r\n\t\t\t$response['fields'] = $this->fields;\r\n\t\t\t$response['primarykeys'] = $this->primarykeys;\r\n\t\t\t$response['metainfo'] = $this->metainfo;\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$filename = \"models/metadata/$this->tablename.php\";\r\n\t\t\tif (file_exists($filename) )\r\n\t\t\t{\r\n\t\t\t\tinclude($filename);\r\n\r\n\t\t\t\treturn $metadata;\r\n\t\t\t}\r\n\t\t\t$conn = ORMConnection::getConnection(); \r\n\t\t\t$rs = $conn->MetaColumns($this->tablename,False);\r\n\t\r\n\t\t\tforeach($rs as $item)\r\n\t\t\t{\t\r\n\t\t\t\t$fields[$item->name]=null;\r\n\t\t\t\t$metainfo[$item->name]= (array)$item; //array(\"type\"=>$item->type,\"length\"=>$item->max_length);\r\n\t\t\t\tif (isset($item->primary_key) && $item->primary_key === true )\r\n\t\t\t\t{\r\n if(isset($item->auto_increment))\r\n\t\t\t\t\t$primarykeys[$item->name] = ($item->auto_increment===true)?-1:0;\r\n else\r\n $primarykeys[$item->name] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//$metainfo = $rs;\r\n\t\t\t$response[\"fields\"] = &$fields;\r\n\t\t\t$response[\"primarykeys\"] = &$primarykeys;\r\n\t\t\t$response[\"metainfo\"] = &$metainfo;\r\n \r\n\t\t}\r\n\t\t\r\n\t\treturn $response;\r\n\t}",
"public function getMetadataAttributes();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch the nodes for the provided context node. If $context ist NULL the document context is used. Use $filter and $stopAt to reduce the returned nodes. | private function fetchFor(
string $expression,
\DOMNode $context = NULL,
callable $filter = NULL,
callable $stopAt = NULL,
int $options = 0
) {
$nodes = $this->fetchNodes($expression, $context, $options);
if ($filter || $stopAt) {
return $this->filterNodes($nodes, $filter, $stopAt, $options);
}
return $nodes;
} | [
"public function getTokens(Context $context);",
"public function get_users_in_context(\\context $context) : \\core_privacy\\local\\request\\userlist_collection {\n $progress = static::get_log_tracer();\n\n $components = $this->get_component_list();\n $a = (object) [\n 'total' => count($components),\n 'progress' => 0,\n 'component' => '',\n 'datetime' => userdate(time()),\n ];\n $collection = new \\core_privacy\\local\\request\\userlist_collection($context);\n\n $progress->output(get_string('trace:fetchcomponents', 'core_privacy', $a), 1);\n foreach ($components as $component) {\n $a->component = $component;\n $a->progress++;\n $a->datetime = userdate(time());\n $progress->output(get_string('trace:preprocessingcomponent', 'core_privacy', $a), 2);\n $userlist = new local\\request\\userlist($context, $component);\n\n $this->handled_component_class_callback($component, core_userlist_provider::class, 'get_users_in_context', [$userlist]);\n\n // Add contexts that the component may not know about.\n \\core_privacy\\local\\request\\helper::add_shared_users_to_userlist($userlist);\n\n if (count($userlist)) {\n $collection->add_userlist($userlist);\n }\n }\n $progress->output(get_string('trace:done', 'core_privacy'), 1);\n\n return $collection;\n }",
"public function filterByUserContext($context)\n {\n $this->andWhere($this->expr()->eq('tag_user_context',':tag_user_context'))->setParameter('tag_user_context',$context,$this->getGateway()->getMetaData()->getColumn('tag_user_context')->getType());\n \n return $this;\n }",
"public function getFieldsByContext($context)\n\t{\n\t\treturn $this->getFields($this->getFieldNamesByContext($context));\n\t}",
"protected function filterNested(FilterContext $context)\n {\n $this->context = $context;\n\n // Iterate over each character of the filter string\n while ($this->context->position < strlen($this->filterRequest)) {\n $char = $this->getChar();\n switch ($char) {\n case '(':\n $this->processNextLevel();\n break;\n case ')':\n $this->executeQueryAndResetCommand();\n break 2;\n case ',':\n case '|':\n $this->executeQueryAndResetCommand();\n $this->setNextOperation();\n break;\n default:\n $this->appendCharToCommand($char);\n }\n $this->context->position++;\n }\n\n if (strlen($this->context->command) > 0) {\n $this->executeQueryAndResetCommand();\n }\n }",
"public function fetchListData($context)\n {\n if (is_null($this->getData('static-list-' . $context))) {\n $data = $this->config['static-list-data'][$context] ?? [];\n $this->setData('static-list-' . $context, $data);\n }\n\n return $this->getData('static-list-' . $context);\n }",
"public function getLayersForNode(ContextInterface $ctx, GetLayersForNodeRequest $request): GetLayersForNodeResponse;",
"function execAxis_following($axis, $contextNode) {\n\t\t$selectedNodes = array();\n\n\t\t// Get the current document position.\n\t\t$position = $this->nodes[$contextNode]['document-position'];\n\n\t\t$flag = FALSE;\n\n\t\t// Run through all nodes of the document.\n\t\tforeach ($this->nodes as $node => $data) {\n\t\t\t// Check if the context node has already been found.\n\t\t\tif ($flag) {\n\t\t\t\t// Check if the position is correct.\n\t\t\t\tif ($this->nodes[$node]['document-position'] == $position) {\n\t\t\t\t\t// Check if the node fits the node-test.\n\t\t\t\t\tif ($this->checkNodeTest($node, $axis['node-test'])) {\n\t\t\t\t\t\t// Add the node to the list of selected nodes.\n\t\t\t\t\t\t$selectedNodes[] = $node;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if this node is the context node.\n\t\t\tif ($node == $contextNode) {\n\t\t\t\t$flag = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $selectedNodes;\n\t}",
"public function parseNodeInContext(\n Node $node,\n Context $context\n ) : Context {\n\n // Visit the given node populating the code base\n // with anything we learn and get a new context\n // indicating the state of the world within the\n // given node\n $context =\n (new Element($node))->acceptKindVisitor(\n new ParseVisitor($context\n ->withLineNumberStart($node->lineno ?? 0)\n ->withLineNumberEnd($node->endLineno ?? 0)\n )\n );\n\n assert(!empty($context), 'Context cannot be null');\n\n // Recurse into each child node\n $child_context = $context;\n foreach($node->children as $child_node) {\n\n // Skip any non Node children.\n if (!($child_node instanceof Node)) {\n continue;\n }\n\n // Step into each child node and get an\n // updated context for the node\n $child_context =\n $this->parseNodeInContext(\n $child_node,\n $child_context\n );\n\n assert(!empty($child_context),\n 'Context cannot be null');\n }\n\n // Pass the context back up to our parent\n return $context;\n }",
"public function find_context(Orm\\Model $item, $context)\n {\n $common_id_property = $this->_properties['common_id_property'];\n $common_id = $item->get($common_id_property);\n\n if ($context == 'all' || is_array($context)) {\n $where = array(\n array($common_id_property, $common_id),\n );\n if (is_array($context) && !empty($context)) {\n $where[] = array($this->_properties['context_property'], 'IN', $context);\n }\n return $item->find('all', array('where' => $where));\n }\n\n if ($context === 'main' ? ($item->{$this->_properties['is_main_property']}) : ($item->{$this->_properties['context_property']} == $context)) {\n return $item->is_new() ? null : $item;\n } else {\n return $item->find('first', array(\n 'where' => array(\n array($common_id_property, $common_id),\n $context === 'main' ? array($this->_properties['is_main_property'], true) : array($this->_properties['context_property'], $context),\n )));\n }\n }",
"public function loadRulesetsByContext(Context $context) {\n $defintion = $context->getContextDefinition();\n\n return $this->entityTypeStorage\n ->loadByProperties([\n 'required_context' => $defintion->getDataType(),\n ]);\n }",
"private static function getAttachments($context, $itemId) {\r\n JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_dpattachments/models', 'DPAttachmentsModel');\r\n $model = JModelLegacy::getInstance('Attachments', 'DPAttachmentsModel');\r\n $model->getState();\r\n $model->setState('filter.item', $itemId);\r\n $model->setState('filter.context', $context);\r\n $model->setState('list.limit', 1000);\r\n $model->setState('list.start', 0);\r\n\r\n return $model->getItems();\r\n }",
"public function getApiContextFields(JJ_ApiContext $context = null) {\n\t\t$fields = JJ_RestfulServer::fields();\n\t\t$context = $context ? $context : JJ_ApiContext::create_from_string();\n\n\t\t$apiAccess = $this->owner->stat('api_access');\n\t\t$className = $this->owner->class;\n\t\t$con = $context->getContext();\n\t\t// try to get subcontext (view.logged_in)\n\t\tif (isset($apiAccess[$con])) {\n\t\t\treturn $this->scaffoldApiContextFields($apiAccess[$con], $context);\n\t\t}\n\t\t// throw warning\n\t\telse {\n\t\t\tuser_error(\"No \\$api_access context '{$context}' in {$this->owner->class} defined\", E_USER_WARNING);\n\t\t}\n\n\t\tif (isset($fields[$className])) {\n\t\t\t$toScaffold = array_key_exists($context, $fields[$className]) ? $fields[$className][$context] : $fields[$className];\n\t\t\treturn $this->scaffoldApiContextFields($toScaffold, $context);\n\t\t}\n\t\t\n\t\treturn $this->scaffoldApiContextFields(array(), $context);\n\t}",
"protected function getRelatedNodes() {\n // Retrieve the node context.\n /** @var \\Drupal\\node\\NodeInterface $node */\n $node = $this->getContextValue('node');\n\n // Demonstrates usage of `assert()` to give better feedback during\n // development if implicit assumptions aren't valid. When `zend.assertions`\n // is set to `-1` (production setting), this code is never evaluated so\n // it doesn't impact production performance.\n assert($node->hasField('field_related_events'), 'Node of type ' . $node->getType() . ' is missing the field_related_events field.');\n assert($node->hasField('field_tags'), 'Node of type ' . $node->getType() . ' is missing the field_tags field.');\n\n // Fetch the node ids of the curated field list.\n $field_curated = $node->field_related_events->getValue();\n $curated_nids = array_map(function($item) {\n return $item['target_id'];\n }, $field_curated);\n\n // Fetch the value of the related tag field.\n $tagged_nids = [];\n $related_tag = $node->field_related_tag->getValue();\n if (isset($related_tag[0]['target_id'])) {\n $related_tag = $related_tag[0]['target_id'];\n\n // Fetch the ids of nodes that have a matching tag field.\n // Exclude current node from query.\n // Set \"range\" to desired number of matches. Currently using 3.\n $tagged_nids = \\Drupal::entityQuery('node')\n ->condition('status', 1)\n ->condition('type', 'event')\n ->condition('field_tags.target_id', $related_tag)\n ->condition('nid', $node->id(), '<>')\n ->range(0, self::LIMIT)\n ->execute();\n }\n\n // Append the queried ids to the end of the curated and remove dups.\n $ids = array_unique(array_merge($curated_nids, $tagged_nids));\n // Limit to number of items desired.\n $ids = array_slice($ids, 0, self::LIMIT);\n\n // Now fetch the matching nodes.\n return \\Drupal::entityManager()->getStorage('node')->loadMultiple($ids);\n }",
"public function getFrom(Context $context)\n {\n if (is_null($this->typeGroup)) {\n return null;\n }\n $responseBody = $context->getResponse()->getBody();\n return $context->getJsonHelper()->mapTypes($responseBody, $this->typeGroup, $this->deserializers);\n }",
"public function getNodes($filter = NULL) {\n $names = self::filterNames($filter, $this->nodes);\n foreach($names as $name) {\n //OPTIMIZE: batch get nodes\n $result[] = $this->getNode($name);\n }\n return new jackalope_NodeIterator($result);\n }",
"protected function getParentSelectors($context)\n {\n $ancestor = $this->parent;\n while (!$ancestor instanceof SassRuleNode && $ancestor->hasParent()) {\n $ancestor = $ancestor->parent;\n }\n\n if ($ancestor instanceof SassRuleNode) {\n return $ancestor->resolveSelectors($context);\n }\n\n return array();\n }",
"public function query($query, DOMNode $context = null);",
"public function get($context)\n {\n $key = md5($context);\n\n $object = $this->createQuery('p')\n ->select('p.*, i.*')\n ->leftJoin('p.Items i')\n ->where('p.identifier_key = ?', array($key))\n ->execute()\n ->getFirst();\n\n if (!$object)\n {\n $object = new sfEasyCommentsPlaceholder();\n $object['identifier_key'] = $key;\n $object->save();\n }\n\n return $object;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the specified Koltsegcsoport in storage. | public function update($id, UpdateKoltsegcsoportRequest $request)
{
$koltsegcsoport = $this->koltsegcsoportRepository->find($id);
if (empty($koltsegcsoport)) {
return redirect(route('koltsegfocsoports.index'));
}
$koltsegcsoport = $this->koltsegcsoportRepository->update($request->all(), $id);
return redirect(route('koltsegfocsoports.index'));
} | [
"public function testUpdatePlannedTransferKpok()\n {\n }",
"public function testUpdateAllocationUsingPut()\n {\n }",
"public function testUpdateAllocationCompositionUsingPut()\n {\n }",
"public function testUpdateOrderTrackUsingPut()\n {\n }",
"public function testUpdateOrderUsingPut()\n {\n }",
"public function updated(VoceOrdine $voceOrdine)\n {\n //\n }",
"public function testUpdateNodeUsingPut()\n {\n }",
"function updateShipping($orderProductHC, $cost){\n set(\"order_Product\", $orderProductHC, \"Shipping\", $cost);\n }",
"public function testUpdateOrderItemUsingPUT()\n {\n }",
"public function update($department) { ; }",
"function soa_xfer_update()\n{\n\tglobal $soa_table_name;\n\n\tsql_query(\"UPDATE $soa_table_name SET xfer='\" . esc($_POST['xfer']) .\n\t\t\t\t \"' WHERE id=\" . esc($_POST['zone']))\n\t\tor ErrSQL(\"Error updating zone transfer access for zone \" . (int)$soa['id'] . \".\");\n\n\tzone_redirect($_POST['zone']);\n}",
"function update($segment_details) {\n return $this->put_request($this->_segments_base_route.'.json', $segment_details);\n }",
"public function testUpdateApprovedTransferKpok()\n {\n }",
"public function testUpdateExternalShipment()\n {\n }",
"private function updateAtStation($object, $station)\n {\n $object->setAtStation($station);\n }",
"public function testUpdateAchBankLinkUsingPut()\n {\n }",
"function updateObject(&$press) {\n\t\treturn $this->update(\n\t\t\t'UPDATE presses\n\t\t\t\tSET\n\t\t\t\t\tpath = ?,\n\t\t\t\t\tseq = ?,\n\t\t\t\t\tenabled = ?,\n\t\t\t\t\tprimary_locale = ?\n\t\t\t\tWHERE press_id = ?',\n\t\t\tarray(\n\t\t\t\t$press->getPath(),\n\t\t\t\t(int) $press->getSequence(),\n\t\t\t\t$press->getEnabled() ? 1 : 0,\n\t\t\t\t$press->getPrimaryLocale(),\n\t\t\t\t(int) $press->getId()\n\t\t\t)\n\t\t);\n\t}",
"public function testUpdateOverflowSettingsUsingPut()\n {\n }",
"public function put(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [oehdfrttot] column value. | public function getOehdfrttot()
{
return $this->oehdfrttot;
} | [
"public function getOehdotaxtot()\n {\n return $this->oehdotaxtot;\n }",
"public function getOedtcosttot()\n {\n return $this->oedtcosttot;\n }",
"public function getOehdtaxtot()\n {\n return $this->oehdtaxtot;\n }",
"public function getOedtbfcosttot()\n {\n return $this->oedtbfcosttot;\n }",
"public function getOehdcosttot()\n {\n return $this->oehdcosttot;\n }",
"public function getOedhbfcosttot()\n {\n return $this->oedhbfcosttot;\n }",
"public function getOedhtaxpcttot()\n {\n return $this->oedhtaxpcttot;\n }",
"public function getOedhloadtot()\n {\n return $this->oedhloadtot;\n }",
"public function getOedtcntrqty()\n {\n return $this->oedtcntrqty;\n }",
"public function getOehdqtyfrtin()\n {\n return $this->oehdqtyfrtin;\n }",
"public function getPodtcosttot()\n {\n return $this->podtcosttot;\n }",
"public function getPodtforeigncosttot()\n {\n return $this->podtforeigncosttot;\n }",
"public function getRowTotalWithTaxes()\n {\n \t$tax_rate = $this->getpop_tax_rate();\n \t$value = (($this->getpop_price_ht() + $this->getpop_eco_tax()) * $this->getpop_qty()) * (1 + $tax_rate / 100);\n \t$value = round($value, 2);\n \treturn $value;\n }",
"public function getOedtqtyord()\n {\n return $this->oedtqtyord;\n }",
"public function getOedtqtyshiptot()\n {\n return $this->oedtqtyshiptot;\n }",
"public function getValortotal()\n {\n return $this->valortotal;\n }",
"public function setOehdfrttot($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oehdfrttot !== $v) {\n $this->oehdfrttot = $v;\n $this->modifiedColumns[SoHeaderTableMap::COL_OEHDFRTTOT] = true;\n }\n\n return $this;\n }",
"public function getOrdrtotalcost()\n {\n return $this->ordrtotalcost;\n }",
"public function getTvaTotal()\n {\n \treturn ($this->getTotalCommandeTtc() - $this->getTotalCommandeHt());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter for WordPress SEO plugin by Yoast: Use for the OpenGraph image property. We only want to use images that are resized for Facebook shared link. We add "_fb_thumb" to those thumbnail files. If we return an empty string the image is not selected for the og:image meta information. | public function filterWpseoOpengraphImage($img)
{
if (strpos($img, '_fb_thumb.jpg') !== false) {
return $img;
}
return '';
} | [
"function prefix_filter_og_image( $img ) {\n if( is_post_type_archive( 'helpwanted' ) ) {\n\t $img = get_stylesheet_directory_uri().'/images/post-cover-image-jobs.jpg';\n\t\t}\n\t\tif( is_post_type_archive( 'rentals' ) ) {\n\t\t\t$img = get_stylesheet_directory_uri().'/images/post-cover-image-rrentals.jpg';\n\t\t}\n\t\tif( is_post_type_archive( 'classifieds' ) || is_front_page() ) {\n\t\t\t$img = get_stylesheet_directory_uri().'/images/post-cover-image-classifieds.jpg';\n\t\t}\n\t\tif( is_post_type_archive( 'realestate' ) ) {\n\t\t\t$img = get_stylesheet_directory_uri().'/images/post-cover-image-real-estate.jpg';\n\t\t}\n return $img;\n}",
"function get_meta_image($url_image_facebook = False)\n{\n if ($url_image_facebook) {\n return '<meta property=\"og:image\" content=\"' . $url_image_facebook . '\" />';\n }\n $default_url = base_url().\"uploads/resize/pagina_producto/visualizador/default.jpg\";\n return '<meta property=\"og:image\" content=\"' . $default_url . '\" />';\n}",
"function get_fb_image()\n\t{\n\t\tglobal $post, $options;\n\n\t\t/* We define the default image first and see if the post contains an image after */\n\t\t$fbimage = WOLF_SHARE_URL.'/share_image.jpg';\n\t\tif($this->get_share_option('share_image')!='')\n\t\t\t$fbimage = WOLF_SHARE_URL.'/userimage/'.$this->get_share_option('share_image');\n\n\t\tif(!is_404() && !is_search()){\n\t\t\tif ( $post ){\n\t\t\t\tif ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) {\n\t\t\t\t\t$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium');\n\t\t\t\t\t$fbimage = $src[0];\n\t\t\t\t}else{\n\n\t\t\t\t\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i',\n\t\t\t\t\t$post->post_content, $matches);\n\t\t\t\t\tif( $matches [1] )\n\t\t\t\t\t\t$fbimage = $matches [1] [0];\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $fbimage;\n\t}",
"function change_seo_image( $new_image ) {\n add_filter( 'wpseo_opengraph_image', function( $image ) use ( $new_image ) {\n if ( ! empty( $new_image ) ) {\n $image = $new_image;\n }\n\n return $image;\n } );\n}",
"public function getThumbnail()\n\t{\n if( !$this->_thumbnail )\n\t\t{\n jimport( 'joomla.filter.filterinput' );\n JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');\n\n // We will apply the most strict filter to the variable\n $noHtmlFilter = JFilterInput::getInstance();\n\n $thumbnail = false;\n\n // Check Open Graph tag\n preg_match('/<meta property=\"og:image\" content=\"([^\"]+)/', $this->_buffer, $match);\n if (!empty($match[1]))\n {\n $thumbnail = $match[1];\n $thumbnail = (string)str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\"), '', $thumbnail);\n $thumbnail = $noHtmlFilter->clean($thumbnail);\n $thumbnail = JHtmlString::truncate($thumbnail, 5120);\n $thumbnail = trim($thumbnail);\n }\n }\n hwdMediaShareFactory::load('utilities');\n $utilities = hwdMediaShareUtilities::getInstance();\n $isValid = $utilities->validateUrl( $thumbnail );\n\n if ($isValid)\n {\n $this->_thumbnail = $thumbnail;\n return $this->_thumbnail;\n }\n }",
"function DDBWP_thumbimage_filter($src,$att='&w=100&h=100&zc=1&q=80',$isresize=0)\r\n{\r\n\tglobal $thumb_url;\r\n\tif(strtolower(get_option('ddbwpthemes_timthumb'))=='yes' || get_option('ddbwpthemes_timthumb')=='' || $isresize)\r\n\t$imgurl = DDB_PUGIN_URL.'/thumb.php?src='.$src.$att.$thumb_url;\r\n\telse\r\n\t$imgurl = $src;\r\n\t\r\n\treturn apply_filters('DDBWP_thumbimage_filter',$imgurl);\r\n}",
"function wcv_rankmath_change_facebook_og_image ( $image ) {\n\tif ( WCV_Vendors::is_vendor_page() ) {\n\t\t$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );\n\t\t$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );\n\t\t$og_image = get_user_meta( $vendor_id, 'wcv_seo_fb_image_id', true );\n\n\t\tif (!empty($og_image)) {\n\t\t\t$image = wp_get_attachment_url( $og_image );\n\t\t}\n\t}\n\treturn $image;\n}",
"public function wpseo_opengraph_image( $url ) {\n\t\tglobal $post;\n\n\t\tif ( ! isset( $post ) ) {\n\t\t\treturn $url;\n\t\t}\n\t\t\n\t\tif ( is_singular( 'aiovg_videos' ) ) {\n\t\t\t$image = get_post_meta( $post->ID, '_yoast_wpseo_opengraph-image', true );\n\n\t\t\tif ( empty( $image ) ) {\n\t\t\t\t$image_url = get_post_meta( $post->ID, 'image', true );\n\t\t\t\t$image_id = get_post_meta( $post->ID, 'image_id', true );\n\n\t\t\t\t$image = aiovg_get_image_url( $image_id, 'large', $image_url );\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! empty( $image ) && 'placeholder-image.png' != basename( $image ) ) {\n\t\t\t\t$url = $image;\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\t$page_settings = get_option( 'aiovg_page_settings' );\n\n\t\t\tif ( $post->ID == $page_settings['category'] ) {\t\t\t\n\t\t\t\tif ( $slug = get_query_var( 'aiovg_category' ) ) {\n\t\t\t\t\t$term = get_term_by( 'slug', $slug, 'aiovg_categories' );\n\t\t\t\t\t$meta = get_option( 'wpseo_taxonomy_meta' );\n\t\t\t\t\t$image = '';\n\n\t\t\t\t\tif ( array_key_exists( 'aiovg_categories', $meta ) ) { // Get custom share image from Yoast\n\t\t\t\t\t\tif ( array_key_exists( $term->term_id, $meta['aiovg_categories'] ) ) {\n\t\t\t\t\t\t\tif ( array_key_exists( 'wpseo_opengraph-image', $meta['aiovg_categories'][ $term->term_id ] ) ) {\n\t\t\t\t\t\t\t\t$image = $meta['aiovg_categories'][ $term->term_id ]['wpseo_opengraph-image'];\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 ( empty( $image ) ) {\n\t\t\t\t\t\t$image_id = get_term_meta( $term->term_id, 'image_id', true );\n\t\t\t\t\t\t$image = aiovg_get_image_url( $image_id, 'large', $url );\n\t\t\t\t\t}\n\n\t\t\t\t\t$url = $image;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// Return\n\t\treturn $url;\n\t}",
"function rssmi_facebook_fix($mediaImage)\n{\n preg_match('@src=\"([^\"]+)\"@', $mediaImage, $match);\n if (strpos($match[1], \"fbcdn\") > 0) {\n $fb_img = $match[1];\n $fb_img = str_replace('/s130x130', '', $fb_img);\n $fb_img = str_replace('_s.jpg', '_n.jpg', $fb_img);\n\n if (rssmi_remoteFileExists($fb_img)) {\n $mediaImage = str_replace($match[1], $fb_img, $mediaImage);\n }\n }\n\n return $mediaImage;\n\n}",
"function get_item_thumbnail_default($object_id) {\n $type = get_post_meta($object_id, 'socialdb_object_dc_type', true);\n $icon = ( in_array($type, ['audio', 'video', 'pdf', 'text']) ) ? $type : \"image\";\n if(get_post($object_id)->post_type=='socialdb_collection'){\n if(has_filter('alter_thumbnail_collections')){\n return apply_filters( 'alter_thumbnail_collections', $icon) ;\n }else{\n return get_template_directory_uri() . \"/libraries/images/${icon}.png\"; \n } \n }else if(has_filter('alter_thumbnail_items')){\n return apply_filters( 'alter_thumbnail_items', $icon) ;\n }else{\n return get_template_directory_uri() . \"/libraries/images/${icon}.png\"; \n } \n \n}",
"public function fbPhoto($fbid,$type=\"large\"){\n \n return \"\".SERVER_URL.\"system_files/modules/resizer/imgresize?src=https://graph.facebook.com/\".$fbid.\"/picture?type=\".$type.\"&w=250&h=250&zc=1&a=t\";\n}",
"private function get_opengraph_image_taxonomy() {\n\t\t$ogimg = WPSEO_Taxonomy_Meta::get_meta_without_term( 'opengraph-image' );\n\t\tif ( $ogimg !== '' ) {\n\t\t\t$this->add_image( $ogimg );\n\t\t}\n\t}",
"public function twitter_image() {\n\n\t\tif ( ! $this->use_twitter_tags() ) return '';\n\n\t\t$output = '';\n\n\t\tforeach ( $this->get_image_details_from_cache( ! $this->get_option( 'multi_og_image' ) ) as $image ) {\n\t\t\t$output .= '<meta name=\"twitter:image\" content=\"' . \\esc_attr( $image['url'] ) . '\" />' . \"\\r\\n\";\n\n\t\t\tif ( $image['height'] && $image['width'] ) {\n\t\t\t\t$output .= '<meta name=\"twitter:image:width\" content=\"' . \\esc_attr( $image['width'] ) . '\" />' . \"\\r\\n\";\n\t\t\t\t$output .= '<meta name=\"twitter:image:height\" content=\"' . \\esc_attr( $image['height'] ) . '\" />' . \"\\r\\n\";\n\t\t\t}\n\n\t\t\tif ( $image['alt'] ) {\n\t\t\t\t$output .= '<meta name=\"twitter:image:alt\" content=\"' . \\esc_attr( $image['alt'] ) . '\" />' . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t// Only grab a single image. Twitter grabs the final (less favorable) image otherwise.\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $output;\n\t}",
"function kibble_get_taxonomy_image_src( $tax_term, $size = 'thumbnail' ) {\n if ( ! is_object( $tax_term ) ) return false;\n $src = get_option( 'kibble_tax_image_' . $tax_term->taxonomy . '_' . $tax_term->term_id );\n $tmp = false;\n if ( is_numeric( $src ) ) {\n $tmp = wp_get_attachment_image_src( $src, $size );\n if ( $tmp && ! is_wp_error( $tmp ) && is_array( $tmp ) && count( $tmp ) >= 3 )\n $tmp = array( 'ID' => $src, 'src' => $tmp[0], 'width' => $tmp[1], 'height' => $tmp[2] );\n else\n return false;\n } elseif ( ! empty( $src ) ) {\n $tmp = array( 'src' => $src );\n }\n if ( $tmp && ! is_wp_error( $tmp ) && is_array( $tmp ) && isset( $tmp['src'] ) )\n return $tmp;\n else\n return false;\n}",
"function wcv_rankmath_change_twitter_og_image ( $image ) {\n\tif ( WCV_Vendors::is_vendor_page() ) {\n\t\t$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );\n\t\t$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );\n\t\t$og_image = get_user_meta( $vendor_id, 'wcv_seo_twitter_image_id', true );\n\n\t\tif (!empty($og_image)) {\n\t\t\t$image = wp_get_attachment_url( $og_image );\n\t\t}\n\t}\n\treturn $image;\n}",
"function getImageDimensionsOg($image='')\n{\n $currentUrl = url()->current();\n if(strpos($currentUrl, 'localhost')) {\n return;\n }\n if(!empty($image)) {\n $imageUrl = url($image);\n $checkFile = remoteFileExists($imageUrl);\n if($checkFile === false) {\n return;\n }\n list($width, $height) = getimagesize($imageUrl);\n $string = '<meta property=\"og:image:width\" content=\"'.$width.'\" /><meta property=\"og:image:height\" content=\"'.$height.'\" />';\n return $string;\n }\n return;\n}",
"function be_schema_default_image($graph_piece)\n{\n $use_default = false;\n if (has_post_thumbnail()) {\n $image_src = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');\n if (empty($image_src[1]) || 1199 > $image_src[1])\n $use_default = true;\n } else {\n $use_default = true;\n }\n\n if ($use_default) {\n $graph_piece['image']['@id'] = home_url('#logo');\n }\n return $graph_piece;\n}",
"function bimber_mashsharer_gif_opengraph( $meta ) {\n\n\t$page_id = get_queried_object_id();\n\t$post_thumbnail_id = get_post_thumbnail_id( $page_id );\n\t$featured_image_url = wp_get_attachment_url( $post_thumbnail_id );\n\tif ( strpos( $featured_image_url, '.gif' ) ) {\n\t\t$meta = preg_replace( '/<meta property=\\\"og:url\\\".*/', '<meta property=\"og:url\" content=\"' . $featured_image_url . '\">', $meta );\n\t\t$meta = str_replace( '<meta property=\"og:type\" content=\"article\" />', '<meta property=\"og:type\" content=\"video.other\">', $meta );\n\t}\n\treturn $meta;\n}",
"function ta_set_yoast_facebook_share_image_size() {\n\treturn 'share-facebook';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Thumbnail template for rendering a picture. The default style are 'medium' | private function _thumbnailTmpl($picture, $style = 'medium')
{
echo '
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<a href="' . $picture['link'] . '" class="swipebox">
<img src="' . $picture['styles'][$style] . '" alt="">
</a>
</div>
</div>
';
} | [
"public function buildThumbnail();",
"public function gen_thumbnail()\n {\n }",
"function thumbnail($size = 'thumbnail', $inner = false, $default = true) {\t\t\r\n\t\t$natural = false;\r\n\t\t\r\n\t\tif (strpos($size, 'natural-') !== false) {\r\n\t\t\t$size = str_replace('natural-', '', $size);\r\n\t\t\t$natural = true;\r\n\t\t}\t\t\t\r\n\t\t$style = '';\r\n\t\tif (isset($this->args['thumbnail_height']) && $this->args['thumbnail_height'] && \r\n\t\t\tis_numeric($this->args['thumbnail_height'])) {\r\n\t\t\t$style = 'sty'.'le=\"height: '.$this->args['thumbnail_height'].'px\"';\r\n\t\t}\r\n\t\tif (magone_is_gpsi()) {\r\n\t\t\t$size = 'thumbnail';\r\n\t\t}\r\n\t\t\r\n\t\t// fix size of thumbnail to full from version 2.6\r\n\t\t// optimizer will work to display rigth image\r\n\t\t$size = 'full';\r\n\t\t\r\n\t\t\r\n\t\t$thumbnail = magone_get_post_image(\r\n\t\t\t$this->id, \r\n\t\t\t$size, \r\n\t\t\tarray(\r\n\t\t\t\t'alt' => $this->title_attr, \r\n\t\t\t\t'title' => $this->title_attr\r\n\t\t\t),\r\n\t\t\t$default\r\n\t\t);\r\n\t\t\r\n\t\tif (!$thumbnail) {\r\n\t\t\tif ($default) {\r\n\t\t\t\t$thumbnail = '<img src=\"'.esc_url(get_theme_mod('default_post_thumbnail')).'\" alt=\"'.esc_attr($this->title_attr).'\" title=\"'.esc_attr($this->title_attr).'\"/>';\r\n\t\t\t} else {\r\n\t\t\t\treturn '';\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$ret = '<a '.$style.' href=\"'.esc_url($this->link).'\" class=\"thumbnail '.($natural ? 'natural' : 'item').'-thumbnail\">';\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$ret .= $thumbnail;\r\n\t\tif ($inner && $this->args['show_format_icon']) {\r\n\t\t\t$ret .= '<span class=\"item-icon\"><span class=\"item-icon-inner\">'.$this->format_icon().'</span></span>';\r\n\t\t}\r\n\r\n\t\t// // thumbnail background\r\n\t\t\r\n\t\tif (isset($this->args['rainbow_thumb_bg']) && ($this->args['rainbow_thumb_bg']))\t{\r\n\t\t\tglobal $Rainbow_Colors;\r\n\t\t\t$color = $Rainbow_Colors[rand ( 0 , count($Rainbow_Colors) -1)];\r\n\t\t\t$colors = explode(',', $color);\r\n\t\t\t$first_color = $colors[0];\r\n\t\t\t$style = 'sty'.'le=\"background-color: '.$first_color.';'.\r\n\t\t\t\t'background-image: -webkit-linear-gradient(135deg,'.$color.');'.\r\n\t\t\t\t'background-image: -moz-linear-gradient(135deg,'.$color.');'.\r\n\t\t\t\t'background-image: -o-linear-gradient(135deg,'.$color.');'.\r\n\t\t\t\t'background-image: linear-gradient(135deg,'.$color.');\"';\r\n\t\t\t$ret .= '<span '.$style.' class=\"thumbnail-overlay\"></span>';\t\t\t\t\r\n\t\t} else if (isset($this->args['thumb_bg_color']) && $this->args['thumb_bg_color'] && $this->args['thumb_bg_color'] != '#000000') {\t\t\t\r\n\t\t\t$ret .= '<span class=\"thumbnail-overlay\"></span>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$ret .= '</a>';\r\n\t\tif (!$inner && $this->args['show_format_icon']) {\r\n\t\t\t$ret .= '<a href=\"'.esc_url($this->link).'\" class=\"item-icon\"><span class=\"item-icon-inner\">'.$this->format_icon().'</span></a>';\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}",
"public function createThumbnail() {\n $img_storage = '/images/' . Yii::app()->params['img_storage'] . '/product/';\n $root_path = Yii::getPathOfAlias('webroot');\n $file_path = $root_path . $img_storage;\n $image = new Imagick($root_path . $this->img);\n $ext = strtolower($image->getimageformat());\n $small_img_name = $this->id . 's.' . $ext;\n if ($image->getimagewidth() > $image->getimageheight())\n $image->thumbnailimage(100, 0);\n else\n $image->thumbnailimage(0, 100);\n $image->writeimage($file_path . $small_img_name);\n $image->destroy();\n $this->small_img = $img_storage . basename($file_path . $small_img_name);\n }",
"function createThumbnail ()\r\n \t{\r\n\r\n \t switch ($this->strategie)\r\n \t {\r\n \t \t\r\n \t \tcase 'gd':\r\n \t \t $this->image = $this->getGDThumbnail();\r\n \t \tbreak;\r\n \t \t\r\n \t \tcase 'im':\r\n \t \t $this->image = $this->getImageMagickThumbnail();\r\n \t \tbreak;\r\n \t \t\r\n \t \tcase 'exif';\r\n \t \t $this->image = $this->getExifThumbnail();\r\n \t \tbreak;\r\n \t \t\r\n \t \tdefault:\r\n \t \t $this->error[] = 'Unknown strategie!';\r\n \t \t\r\n \t }\r\n\r\n \t}",
"protected function getImageHelperFormMapperWithThumbnail()\n {\n return ($this->getSubject() ? $this->getSubject()->getImage() ? '<img src=\"'.$this->lis->getBrowserPath(\n $this->vus->asset($this->getSubject(), 'imageFile'),\n '480xY'\n ).'\" class=\"admin-preview img-responsive\" alt=\"thumbnail\"/>' : '' : '').'<span style=\"width:100%;display:block;\">amplada mínima 1200px (màx. 10MB amb JPG o PNG)</span>';\n }",
"public function createThumbnail()\n\t{\n\t\treturn $this->resize($this->thumbnailWidth, $this->thumbnailHeight);\n\t}",
"public function CMSThumbnail()\n {\n if (Director::isDev() || !$this->config()->get('use_imgix')) {\n return Parent::CMSThumbnail();\n }\n\n return $this->Pad($this->stat('cms_thumbnail_width'),$this->stat('cms_thumbnail_height'));\n }",
"public function getThumbnail();",
"function tapas_instance_thumbnail() {\n\n\treturn array(\n\t\t'display' => array(\n\t\t\t'default' => array(\n\t\t\t\t'label' => 'hidden',\n\t\t\t\t'module' => 'image',\n\t\t\t\t'type' => 'image',\n\t\t\t),\n\t\t\t'teaser' => array(\n\t\t\t\t'label' => 'hidden',\n\t\t\t\t'type' => 'image',\n\t\t\t),\n\t\t),\n\t\t'settings' => array(\n\t\t\t//'alt_field' => $alt,\n\t\t\t'default_image' => TAPAS_C_DEFAULT_IMAGE,\n\t\t\t'file_directory' => TAPAS_C_IMAGE_DIR,\n\t\t\t'file_extentions' => 'png gif jpg jpeg',\n\t\t\t'max_filesize' => TAPAS_THUMB_MAX_FILESIZE,\n\t\t\t'max_resolution' => TAPAS_THUMB_MAX_RES,\n\t\t\t'min_resolution' => TAPAS_THUMB_MIN_RES,\n\t\t),\n\t\t'widget' => array(\n\t\t\t'module' => 'image',\n\t\t\t'settings' => array(\n\t\t\t\t'preview_image_style' => TAPAS_THUMB_PREVIEW_STYLE,\n\t\t\t\t'progress_indicator' => TAPAS_THUMB_PROGRESS_IND,\n\t\t\t),\n\t\t\t'type' => 'image_image',\n\t\t)\n\t);\n}",
"public function getThumbnail()\n {\n $data = new ArrayData([\n 'HailImage' => $this\n ]);\n\n return $data->renderWith('ImageThumbnail');\n }",
"private function generateThumbnailGD(){\n\t\t\n\t}",
"function ninzio_thumbnail ($layout, $post_id){\r\n\r\n $thumb_size = 'Ninzio-Uni';\r\n\r\n if (is_single()) {\r\n $thumb_size = 'Ninzio-Whole';\r\n } else {\r\n switch ($layout) {\r\n case 'large' :\r\n case 'medium':\r\n case 'small' :\r\n $thumb_size = 'Ninzio-Half';\r\n break;\r\n case 'full' :\r\n $thumb_size = 'Ninzio-Whole';\r\n break;\r\n }\r\n }\r\n\r\n ?>\r\n <?php if (has_post_thumbnail()): ?>\r\n <?php\r\n $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');\r\n $href = (is_single()) ? $large_image_url[0] : get_permalink();\r\n ?>\r\n <a class=\"nz-more media\" href=\"<?php echo $href; ?>\">\r\n <div class=\"nz-thumbnail\">\r\n <?php echo get_the_post_thumbnail( $post_id, $thumb_size );?>\r\n <div class=\"ninzio-overlay\"></div>\r\n <div class=\"post-date\"><span><?php echo get_the_date(\"d\");?></span><span><?php echo get_the_date(\"M\");?></span></div>\r\n <?php if (is_sticky($post_id)): ?>\r\n <div class=\"post-sticky\"><span class=\"icon-pushpin\"></span></div>\r\n <?php endif ?>\r\n </div>\r\n </a>\r\n\r\n <?php endif ?>\r\n\r\n <?php }",
"function emvideo_tagtele_thumbnail($field, $item, $formatter, $node, $width, $height, $options = array()) {\n return \"http://s1.ttimg.com/img/videos/thumbs192x108/{$item['value']}_default.jpg\";\n}",
"function learn_press_courses_loop_item_thumbnail() {\n\t\tlearn_press_get_template( 'loop/course/thumbnail.php' );\n\t}",
"public function getThumbnail()\n {\n $txt = _t('InstagramRecord.NoImage', '(no image)');\n $width = $this->config()->image_mode == 'SHORTCODE'\n ? self::IMAGE_SIZES[2]\n : self::IMAGE_DIMENSIONS[0]\n ;\n\n if ($img = $this->Image($width)) {\n $txt = \"<img src='{$img->URL}' style='width: 150px;' />\";\n }\n\n return DBField::create_field('HTMLText', $txt);\n }",
"function emaudio_soundcloud_thumbnail($field, $item, $formatter, $node, $width, $height) {\n return $tn;\n}",
"function print_blog_thumbnail( $post_id, $item_size, $style = '' ){\n\t\n\t\t$thumbnail_types = get_post_meta( $post_id, 'post-option-thumbnail-types', true);\n\t\t\n\t\tif( $thumbnail_types == \"Image\" || empty($thumbnail_types) ){\n\t\t\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t\t$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );\n\t\t\t$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);\n\t\t\tif( !empty($thumbnail) ){\n\t\t\t\techo '<div class=\"blog-thumbnail-wrapper\">';\n\t\t\t\techo '<div class=\"blog-thumbnail-image\">';\n\t\t\t\techo '<a href=\"' . get_permalink() . '\"><img src=\"' . $thumbnail[0] .'\" alt=\"'. $alt_text .'\"/></a></div>';\n\t\t\t\t\n\t\t\t\tif( $style == 'full-style' ){\n\t\t\t\t\techo '<div class=\"blog-thumbnail-inner-info\">';\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-date\">' . get_the_time( GDL_DATE_FORMAT ) . '</div>';\n\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-author\"> ' . __('by','gdl_front_end') . ' ' . get_the_author_link() . '</div>';\n\t\t\t\t\t\n\t\t\t\t\tthe_tags('<div class=\"blog-thumbnail-tag\">', ', ', '</div>');\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"blog-thumbnail-comment\">';\n\t\t\t\t\tcomments_popup_link( __('0','gdl_front_end'),\n\t\t\t\t\t\t__('1','gdl_front_end'),\n\t\t\t\t\t\t__('%','gdl_front_end'), '',\n\t\t\t\t\t\t__('Comments are off','gdl_front_end') );\n\t\t\t\t\techo '</div>';\n\t\t\t\t\t\n\t\t\t\t\techo '</div>';//blog-thumbnail-inner-info\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo '</div>'; // blog-thumbnail-wrapper\n\t\t\t}\n\t\t\n\t\t}else if( $thumbnail_types == \"Video\" ){\n\t\t\t\n\t\t\t$video_link = get_post_meta( $post_id, 'post-option-thumbnail-video', true); \n\t\t\techo '<div class=\"blog-thumbnail-video\">';\n\t\t\techo get_video($video_link, gdl_get_width($item_size), gdl_get_height($item_size));\n\t\t\techo '</div>';\n\t\t\n\t\t}else if ( $thumbnail_types == \"Slider\" ){\n\n\t\t\t$slider_xml = get_post_meta( $post_id, 'post-option-thumbnail-xml', true); \n\t\t\t$slider_xml_dom = new DOMDocument();\n\t\t\t$slider_xml_dom->loadXML($slider_xml);\n\t\t\t\n\t\t\techo '<div class=\"blog-thumbnail-slider\">';\n\t\t\techo print_flex_slider($slider_xml_dom->documentElement, $item_size);\n\t\t\techo '</div>';\t\t\t\n\t\t\n\t\t}\t\n\t\t\n\t}",
"function emaudio_odeo_thumbnail($field, $item, $formatter, $node, $width, $height) {\n return '';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'gETCustomerIdCustomerSubscriptions' | public function gETCustomerIdCustomerSubscriptionsRequest($customer_id)
{
// verify the required parameter 'customer_id' is set
if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $customer_id when calling gETCustomerIdCustomerSubscriptions'
);
}
$resourcePath = '/customers/{customerId}/customer_subscriptions';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($customer_id !== null) {
$resourcePath = str_replace(
'{' . 'customerId' . '}',
ObjectSerializer::toPathValue($customer_id),
$resourcePath
);
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
[]
);
} else {
$headers = $this->headerSelector->selectHeaders(
[],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function gETCustomerSubscriptionIdCustomerRequest($customer_subscription_id)\n {\n // verify the required parameter 'customer_subscription_id' is set\n if ($customer_subscription_id === null || (is_array($customer_subscription_id) && count($customer_subscription_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_subscription_id when calling gETCustomerSubscriptionIdCustomer'\n );\n }\n\n $resourcePath = '/customer_subscriptions/{customerSubscriptionId}/customer';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($customer_subscription_id !== null) {\n $resourcePath = str_replace(\n '{' . 'customerSubscriptionId' . '}',\n ObjectSerializer::toPathValue($customer_subscription_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createSubscription($request);",
"public function generateSubscriptions();",
"private function _convertCreateSubscription($request)\n {\n $parameters = array();\n $parameters['Action'] = 'CreateSubscription';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMWSAuthToken()) {\n $parameters['MWSAuthToken'] = $request->getMWSAuthToken();\n }\n if ($request->isSetMarketplaceId()) {\n $parameters['MarketplaceId'] = $request->getMarketplaceId();\n }\n if ($request->isSetSubscription()) {\n $SubscriptionCreateSubscriptionInput = $request->getSubscription();\n foreach ($SubscriptionCreateSubscriptionInput->getNotificationType() as $NotificationTypeSubscriptionIndex => $NotificationTypeSubscription) {\n $parameters['Subscription' . '.' . 'NotificationType' . '.' . ($NotificationTypeSubscriptionIndex + 1)] = $NotificationTypeSubscription;\n }\n }\n\n return $parameters;\n }",
"function subscriptio_get_customer_subscriptions($customer = null, $include_terminated = false, $statuses = null)\n{\n\n // Guest have no subscriptions\n if (!is_user_logged_in()) {\n return array();\n }\n\n // Get customer\n $customer = ($customer !== null ? $customer : get_current_user_id());\n\n // Get customer subscriptions\n return subscriptio_get_subscriptions(array(\n 'customer' => $customer,\n 'include_terminated' => $include_terminated,\n 'statuses' => $statuses,\n ));\n}",
"protected function getPushNotificationSubscriptionsRequest()\n {\n\n $resourcePath = '/retailer/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/vnd.retailer.v4+json', 'application/vnd.retailer.v4+xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/vnd.retailer.v4+json', 'application/vnd.retailer.v4+xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function gETInStockSubscriptionIdCustomerRequest($in_stock_subscription_id)\n {\n // verify the required parameter 'in_stock_subscription_id' is set\n if ($in_stock_subscription_id === null || (is_array($in_stock_subscription_id) && count($in_stock_subscription_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $in_stock_subscription_id when calling gETInStockSubscriptionIdCustomer'\n );\n }\n\n $resourcePath = '/in_stock_subscriptions/{inStockSubscriptionId}/customer';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($in_stock_subscription_id !== null) {\n $resourcePath = str_replace(\n '{' . 'inStockSubscriptionId' . '}',\n ObjectSerializer::toPathValue($in_stock_subscription_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function _convertGetSubscription($request)\n {\n $parameters = array();\n $parameters['Action'] = 'GetSubscription';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMWSAuthToken()) {\n $parameters['MWSAuthToken'] = $request->getMWSAuthToken();\n }\n if ($request->isSetMarketplaceId()) {\n $parameters['MarketplaceId'] = $request->getMarketplaceId();\n }\n if ($request->isSetNotificationType()) {\n $parameters['NotificationType'] = $request->getNotificationType();\n }\n if ($request->isSetDestination()) {\n $DestinationGetSubscriptionInput = $request->getDestination();\n foreach ($DestinationGetSubscriptionInput->getDeliveryChannel() as $DeliveryChannelDestinationIndex => $DeliveryChannelDestination) {\n $parameters['Destination' . '.' . 'DeliveryChannel' . '.' . ($DeliveryChannelDestinationIndex + 1)] = $DeliveryChannelDestination;\n }\n }\n\n return $parameters;\n }",
"public static function create_subscription() {\n $response = array(\n 'error' => false,\n 'message' => 'Successfully created subscription'\n );\n \n if(isset($_REQUEST['stripe_customer_id']) && isset($_REQUEST['stripe_plan'])) {\n if(!isset($_REQUEST['tax_percent'])) {\n $_REQUEST['tax_percent'] = false;\n }\n\n $sub = Stripe::create_subscription($_REQUEST['stripe_customer_id'], $_REQUEST['stripe_plan'], $_REQUEST['tax_percent']);\n if($sub['error']) {\n $response = array(\n 'error' => true,\n 'message' => $sub['error']\n );\n }\n\n } else {\n $response = array(\n 'error' => true,\n 'message' => 'User ID or Token ID not set'\n );\n \n }\n\n echo json_encode($response);\n\n wp_die();\n }",
"public function testCreateSubscriptionWithExistingCustomerAndPlan(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t// Subscription parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParameters();\n\t\n\t\t// Customer parameters\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\n\t\n\t\t// Plan parameters\n\t\t$plan = PayUSubscriptionPlans::create(PayUTestUtil::buildSuccessParametersPlan($parameters));\n\t\t$parameters[PayUParameters::PLAN_ID] = $plan->id;\n\t\t$parameters[PayUParameters::PLAN_CODE] = $plan->planCode;\n\t\n\t\t// Credit card parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);\n\t\n\t\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\n\t\t$this->assertNotNull($response->id);\n\t\t$this->assertEquals($parameters[PayUParameters::PLAN_CODE], $response->plan->planCode);\n\t\t$this->assertNotNull($response->plan->id);\n\t\t$this->assertNotNull($response->customer->id);\n\t\t$this->assertCount( 1, $response->customer->creditCards);\n\t\t$this->assertEquals($parameters[PayUParameters::INSTALLMENTS_NUMBER], $response->installments);\n\t\t$this->assertEquals($parameters[PayUParameters::QUANTITY], $response->quantity);\n\t}",
"protected function publicationServiceApplicationControllerSubscriptionApiControllerCgetRequest()\n {\n\n $resourcePath = '/api/v1/course/changes/subscribe';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;",
"public function createSubscriptions($user)\n {\n }",
"public function createSubscription()\n {\n $this->validate($this->request, [\n 'plan_id' => 'required|integer|exists:billing_plans,id',\n 'start_date' => 'string'\n ]);\n\n /** @var User $user */\n $user = $this->request->user();\n $plan = $this->billingPlan->findOrFail($this->request->get('plan_id'));\n\n $sub = $this->authorizenet->subscriptions()->create($plan, $user, $this->request->get('start_date'));\n $user->subscribe('authorizenet', $sub['reference'], $plan);\n\n return $this->success(['user' => $user]);\n }",
"function createTrialSubscription() {\n \n /* \n * Constructing the parameters to be send to the ChargeBee. For demo \n * purpose a plan with id 'basic' is hard coded which has 15 month trial\n * in ChargeBee app. \n * Note : Here customer object received from client side is sent directly \n * to ChargeBee.It is possible as the html form's input names are \n * in the format customer[<attribute name>] eg: customer[first_name] \n * and hence the $_POST[\"customer\"] returns an associative array of the attributes.\n * \n */ \n $createTrialReqParams = array( \"plan_id\" => \"basic\",\n \"customer\" => $_POST[\"customer\"] );\n /* \n * Sends request to the ChargeBee server to create trial subscription\n * using the trial plan id set in createTrialReqParams array.\n */\n $result = ChargeBee_Subscription::create($createTrialReqParams);\n \n return $result; \n}",
"protected function subscriptionPurchaseAllowedRequest()\n {\n\n $resourcePath = '/accounts/purchaseable';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createCustomerAndSubscription($data){\n\n\t\ttry{\n\t\t\t$result = $this->createCustomer($data);\n\n\t\t\tif ($result->success) {\n\t\t\t //Get customer ID\n\t\t\t $customerId = $result->customer->id;\n\n\t\t\t //Get customer PaymentMethodToken\n\t\t\t $customerPaymentMethodToken = $result->customer->paymentMethods[0]->token;\n\n\t\t\t //Create subscription\n\t\t\t if(!empty($customerPaymentMethodToken) && !empty($data['plan'])){\n\t\t\t\t $result = $this->createSubscriptionForCustomer($customerPaymentMethodToken, $data);\n\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t foreach($result->errors->deepAll() AS $error) {\n\t\t\t echo($error->code . \": \" . $error->message . \"\\n\");\n\t\t\t }\n\t\t\t}\t\n\t\t} catch (\\Exception $ex) { \n\t return $ex->getMessage();\n\t }\t\t\n\t}",
"public function createSubscription($data) {\n return $this->postRequest('subscription', $data);\n }",
"public function testCreateSubscriptionWithDifferentTokenForPayerIdOfSubscription() {\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t// Subscription parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParameters();\n\t\t\t\n\t\t// Customer parameters\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\t$customer2 = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\n\t\t// Plan parameters\n\t\t$parameters = PayUTestUtil::buildSuccessParametersPlan($parameters);\n\t\n\t\t// Credit card parameters\n\t\t$creditCardParams = array(PayUParameters::CUSTOMER_ID => $customer2->id);\n\t\t$creditCard = PayUCreditCards::create(PayUTestUtil::buildSubscriptionParametersCreditCard($creditCardParams));\n\t\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\n\t\t$parameters[PayUParameters::TOKEN_ID] = $creditCard->token;\n\t\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: appendKeywords Append keywords's to the resource array | function appendKeywords($resource)
{
$keys = $this->fetchKeywords($resource);
$resource['keywords'] = $keys;
return $resource;
} | [
"private function appendKeywords($resource) {\n\t\t$keys = $this->fetchKeywords($resource);\n\t\t$resource[\"keywords\"] = \"$keys\";\n\t\treturn $resource;\n\t}",
"private function add_keywords( $keywords ) {\n\t\tif ( ! is_array( $keywords ) ) {\n\t\t\t$keywords = explode( ',', trim( $keywords ) );\n\t\t}\n\n\t\t$this->keywords = array_merge( $this->keywords, $keywords );\n\t}",
"public function addKeywords(array $keywords)\n {\n foreach ($keywords as $keyword) {\n $this->keywords[] = $keyword;\n }\n }",
"public function addKeywords(array $keywords)\n {\n foreach ($keywords as $keyword)\n {\n $this->addKeyword($keyword);\n }\n }",
"private function AddKeywordsField()\n {\n $name = 'Keywords';\n $this->AddField(Input::Text($name, $this->page->GetKeywords()));\n }",
"public function setKeywords($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->keywords = $arr;\n\n return $this;\n }",
"function addMetaKeywords($keywords)\n {\n $this->metaKeywords = array_merge($keywords, $this->metaKeywords);\n }",
"private function addKeyword()\n {\n $id_key = $this->httpRequest->getParameter('id_key', 'request', 'int');\n \n $this->model->action('misc','addKeyword', \n array('id_key' => (int)$id_key,\n 'id_text' => (int)$this->current_id_text));\n }",
"public function setKeywords($keywords);",
"public function appendKeywords($value)\n {\n return $this->append(self::KEYWORDS, $value);\n }",
"public function registerNewKeywords( $aKeywords ) {\n\t\tforeach ($aKeywords as $keyword => $route) {\n\t\t\t$this->registerNewKeyword($keyword, $route);\n\t\t}\n\t}",
"function add_verbatim_keywords(&$keywords, $string, $resource_type_field)\n\t{\n\tglobal $resource_field_verbatim_keyword_regex;\n\tif (empty($resource_field_verbatim_keyword_regex[$resource_type_field]))\n\t\t{\n\t\treturn;\t\t// return if regex not found or is blank\n\t\t}\n\tpreg_match_all($resource_field_verbatim_keyword_regex[$resource_type_field], $string, $matches);\n\tforeach ($matches as $match)\n\t\t{\n\t\tforeach ($match as $sub_match)\n\t\t\t{\n\t\t\tarray_push($keywords,$sub_match);\t\t// note that the keywords array is passed in by reference.\n\t\t\t}\n\t\t}\n\t}",
"public function setKeywords($keywords) {\r\n\t\t\r\n\t}",
"public function setKeywords($keywords, $isArray = false) {\r\n if ($isArray) {\r\n $this->keywords = $keywords;\r\n } else {\r\n $this->keywords = explode(',', $keywords);\r\n } //changes list of comma separated keywords to an array\r\n\r\n for ($i = 0; $i < sizeof($this->keywords); $i++) {\r\n $this->keywords[$i] = trim($this->keywords[$i]);\r\n } //removes spaces around keywords\r\n }",
"private function add_keyword( $keyword ) {\n\t\tarray_push( $this->keywords, $keyword );\n\t}",
"function addOtherKw($productid,$keyword)\n{\n\t$keywordManager = new keywordManager();\n\t$keywordManager->addOtherKw($productid,$keyword);\n}",
"function setKeyWords($val = null)\n {\n $this->keywords = $val;\n }",
"function add_keyword_mappings($ref,$string,$resource_type_field)\n\t{\n\t# Create keywords that do not yet exist.\n\t# Increase the hit count of each keyword that matches.\n\t# Store the position and field the string was entered against for advanced searching.\n\tif (trim($string)==\"\") {return false;}\n\t$keywords=split_keywords($string,true);\n\tfor ($n=0;$n<count($keywords);$n++)\n\t\t{\n\t\tglobal $noadd;\n\t\tif ((!(in_array($keywords[$n],$noadd))) && (strlen($keywords[$n])<=50))\n\t\t\t{\n\t\t\t#echo \"<li>adding \" . $keywords[$n];\n\t\t\t$keyword=resolve_keyword($keywords[$n]);\n\t\t\tif ($keyword===false)\n\t\t\t\t{\n\t\t\t\t# This is a new keyword. Create and discover the new keyword ref.\n\t\t\t\tsql_query(\"insert into keyword(keyword,soundex,hit_count) values ('\" . escape_check($keywords[$n]) . \t\"',soundex('\" . escape_check($keywords[$n]) . \"'),0)\");\n\t\t\t\t$keyword=sql_insert_id();\n\t\t\t\t#echo \"<li>New keyword.\";\n\t\t\t\t}\n\t\t\t# create mapping, increase hit count.\n\t\t\tsql_query(\"insert into resource_keyword(resource,keyword,position,resource_type_field) values ('$ref','$keyword','$n','$resource_type_field')\");\n\t\t\tsql_query(\"update keyword set hit_count=hit_count+1 where ref='$keyword' limit 1\");\n\t\t\t\n\t\t\t# Log this\n\t\t\tdaily_stat(\"Keyword added to resource\",$keyword);\n\t\t\t}\t\n\t\t}\t\n\t}",
"protected function getKeywords()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Show xml structure for account file | public function showStructureAccount() {
echo '<pre>', var_dump($this->xmlAccount), '</pre>';
} | [
"protected function getXML( ) {\n\t\t$xml ='<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t<raveUser>';\n\n\t\tforeach( $this->fields as $field => $type ) {\n\t\t\tif( isset( $this->$field ) ) {\n\t\t\t\t$xml .= '<'.$field.'>'.$this->$field.'</'.$field.'>';\n\t\t\t} // end if\n\t\t} // end foreach\n\n\t\t$xml .= '</raveUser>';\n\t\t\n\t\treturn $xml;\n\t}",
"public function displayXML()\n\t{\n\t\techo \"<pre>\";\n\t\tprint_r($this->haloXML);\n\t\techo \"</pre>\";\n\t}",
"function outputXML() {\n // XML headers\n header('Content-Type: text/xml; charset=utf-8');\n // prevent caching by browser\n header('Cache-Control: no-store, no-cache, must-revalidate');\n header('Cache-Control: post-check=0, pre-check=0', FALSE);\n header('Pragma: no-cache');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.LF;\n echo '<status>'.LF;\n // this allows multiple upload blocks to be implemented in the future\n foreach ($this->info as $id => $infoBlock) {\n echo sprintf(\n '<id value=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($id)\n );\n foreach ($infoBlock as $key => $value) {\n echo sprintf(\n '<%s>%s</%s>'.LF,\n papaya_strings::escapeHTMLChars($key),\n papaya_strings::escapeHTMLChars($value),\n papaya_strings::escapeHTMLChars($key)\n );\n }\n echo '</id>'.LF;\n }\n echo '</status>'.LF;\n exit;\n }",
"public function printXml() {\r\n\t\t global $_whomp_storage_path;\r\n\t\t \r\n\t\t header('Content-type: text/xml');\r\n\t\t readfile($_whomp_storage_path . $this->_xml_path);\r\n\t }",
"public function getXml();",
"function DisplayXml()\n\t{\n\t\tlog_access($this->id, 'xml');\n\t\n\t\t// Create XML document\n\t\t$doc = new DomDocument('1.0', 'UTF-8');\n\t\t$xml = $doc->appendChild($doc->createElement('xml'));\n\n\t\t// root element is <records>\n\t\t$records = $xml->appendChild($doc->createElement('records'));\n\n\t\t// add record for this reference\n\t\treference_to_endnote_xml($this->object, $doc, $records);\n\t\t\n\t\t// Dump XML\n\t\theader(\"Content-type: text/xml; charset=utf-8\\n\\n\");\n\t\techo $doc->saveXML();\n\t}",
"private function asXML() : DOMElement{\n $new = self::$userFile->createElement(\"user\");\n $new->setAttribute(\"id\", $this->id);\n $new->setAttribute(\"firstName\", $this->firstName);\n $new->setAttribute(\"middleName\", $this->middleName);\n $new->setAttribute(\"lastName\", $this->lastName);\n $new->setAttribute(\"email\", $this->email);\n $new->setAttribute(\"password\", $this->password);\n $new->setAttribute(\"fullAddress\", $this->fullAddress);\n $new->setAttribute(\"phone\", $this->phone);\n $new->setAttribute(\"avatarFile\", $this->avatarFile);\n $new->setAttribute(\"accountType\", $this->accountType);\n return $new;\n }",
"public function displayXml() {\n $xml = new SimpleXMLElement(\"<?xml version='1.0' encoding='UTF-8'?><httpResponse></httpResponse>\");\n $xml->addChild('code', $this->code);\n $xml->addChild('message', $this->message);\n\n echo $xml->asXml();\n }",
"function GetUserProfileXML() {\n\n $user = array();\n \n if (defined('ZIMBRA_USER_DIR')) {\n $userDir = ZIMBRA_USER_DIR;\n } else {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'ZIMBRA_USER_DIR not defined - Using default \"zimbra\"');\n $userDir = 'zimbra';\n }\n\n $user_file = BASE_PATH . $userDir . \"/\" . $this->_uid . '.xml';\n $user_file_xml = '';\n $defaultXmlInUse = false;\n\n // If specific User XML file does not exist - check if a default one is being used\n if (!file_exists($user_file)) {\n if (defined('ZIMBRA_USER_XML_DEFAULT') && ('ZIMBRA_USER_XML_DEFAULT' != \"\")) {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'ZIMBRA_USER_XML_DEFAULT is defined - Using default User XML settings');\n $user_file = BASE_PATH . $userDir . \"/\" . ZIMBRA_USER_XML_DEFAULT;\n $defaultXmlInUse = true;\n }\n }\n\n if (file_exists($user_file)) {\n $contents = array(); \n\n $file = fopen($user_file,\"r\");\n while(!feof($file)) {\n $user_file_xml = $user_file_xml . fgets($file);\n }\n $contents = $this->MakeXMLTree($user_file_xml);\n\n $match = '';\n $default = ''; \n if ((isset($contents['zimbrabackend'][0]['user']) && strtolower($contents['zimbrabackend'][0]['user']) == strtolower($this->_uid)) || ($defaultXmlInUse == true)) {\n if (isset($contents['zimbrabackend'][0]['profile'])) {\n $count = count($contents['zimbrabackend'][0]['profile']);\n } else $count = 0;\n\n for ($i=0;$i<$count;$i++) {\n if ( (!isset($contents['zimbrabackend'][0]['profile'][$i]['id']) )\n || (isset($contents['zimbrabackend'][0]['profile'][$i]['id']) && ($contents['zimbrabackend'][0]['profile'][$i]['id'] == \"\") )\n ) {\n if ($default == '') { // This profile is the first one with a \"\" id\n $default = $i;\n } \n }\n if (isset($contents['zimbrabackend'][0]['profile'][$i]['id']) && strtolower($contents['zimbrabackend'][0]['profile'][$i]['id']) == strtolower($this->_domain)) {\n $match = $i;\n break;\n }\n }\n }\n if (is_numeric($match)) {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'Using Profile \"'. $contents['zimbrabackend'][0]['profile'][$i]['id'] .'\" For User \"'. $contents['zimbrabackend'][0]['user'] .'\"');\n $user = $contents['zimbrabackend'][0]['profile'][$match];\n } else if (is_numeric($default)) {\n\t\t\t\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'Using Default Profile For User \"'. $contents['zimbrabackend'][0]['user'] .'\"');\n $user = $contents['zimbrabackend'][0]['profile'][$default];\n } else {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'No Default Profile or Matching Profile \"'. $this->_domain .'\" Found For User \"'. $contents['zimbrabackend'][0]['user'] .'\" - Default Rules Will Apply');\n }\n fclose($file);\n unset( $contents);\n } else {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'No XML Profile File ['.$user_file.'] Found For User - Default Rules Will Apply');\n }\n\n\n // Set Folder Criteria Per User File or to Defaults If No User File\n if (isset($user['usehtml']) && $this->IsBool($user['usehtml'])) {\n $this->_useHTML = $this->ToBool($user['usehtml']);\n } else {\n $this->_useHTML = $this->ToBool(ZIMBRA_HTML);\n }\n\n if (!($defaultXmlInUse) && (isset($user['sendasemail']))) {\n if (!defined('ZIMBRA_ENFORCE_VALID_EMAIL')) {\n $this->_enforcevalidemail = 'false';\n } else {\n $this->_enforcevalidemail = ZIMBRA_ENFORCE_VALID_EMAIL;\n }\n if ($this->ToBool($this->_enforcevalidemail) === true) {\n for ($i=0;$i<=count($this->_addresses);$i++) {\n if (strtolower($user['sendasemail']) == strtolower($this->_addresses[$i])) {\n $this->_sendAsEmailOverride = $user['sendasemail'];\n if (isset($user['sendasname'])) {\n $this->_sendAsNameOverride = $user['sendasname'];\n }\n break;\n }\n }\n } else {\n if (!empty($user['sendasemail'])) {\n $this->_sendAsEmailOverride = $user['sendasemail'];\n if (isset($user['sendasname'])) {\n $this->_sendAsNameOverride = $user['sendasname'];\n } \n }\n }\n }\n\n if (isset($user['timezone']) && !empty($user['timezone']) && $this->_tzFromDomain === false) {\n $tempTz = date_default_timezone_get();\n if (date_default_timezone_set($user['timezone']) === true) {\n $this->_tz = $user['timezone'];\n } else {\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->GetUserProfileXML(): ' . 'Provided Timezone In User File NOT VALID: Check list at (http://www.php.net/manual/en/timezones.php): '.$user['timezone']);\n }\n date_default_timezone_set( $tempTz );\n }\n\n if (defined('ZIMBRA_DISABLE_MESSAGES') && (ZIMBRA_DISABLE_MESSAGES === true)) { \n\n $user['message'][0]['active'] = 'false'; \n\n } else {\n\n // Process Message Node\n if (!isset($user['message'][0]['active']) || !$this->IsBool($user['message'][0]['active'])) {\n $user['message'][0]['active'] = 'true';\n }\n\n if (isset($user['message'][0]['exclude'][0])) {\n $user['message'][0]['folders'][0]['filtermethod'][0] = 'exclude';\n $user['message'][0]['folders'][0]['list'] = $user['message'][0]['exclude'];\n if (isset($user['message'][0]['exclude'][0]['id'][0])) {\n $user['message'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['message'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else if (isset($user['message'][0]['include'][0])) {\n $user['message'][0]['folders'][0]['filtermethod'][0] = 'include';\n $user['message'][0]['folders'][0]['list'] = $user['message'][0]['include'];\n if (isset($user['message'][0]['include'][0]['id'][0])) {\n $user['message'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['message'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else {\n $user['message'][0]['folders'][0]['filtermethod'][0] = 'none';\n }\n $user['message'][0]['virtual'] = 'false';\n $user['message'][0]['primary'][0]['identifier'] = 'name';\n $user['message'][0]['primary'][0]['name'] = 'Inbox';\n }\n\n if (defined('ZIMBRA_DISABLE_CONTACTS') && (ZIMBRA_DISABLE_CONTACTS === true)) { \n\n $user['contact'][0]['active'] = 'false'; \n\n } else {\n\n // Process Contact Node\n if (!isset($user['contact'][0]['active']) || !$this->IsBool($user['contact'][0]['active'])) {\n $user['contact'][0]['active'] = 'true';\n }\n\n if (!isset($user['contact'][0]['virtual']) || !$this->IsBool($user['contact'][0]['virtual'])) {\n $user['contact'][0]['virtual'] = (defined('ZIMBRA_VIRTUAL_CONTACTS') ? (($this->ToBool(ZIMBRA_VIRTUAL_CONTACTS)) ? 'true' : 'false') : 'true' );\n }\n\n if (isset($user['contact'][0]['primary'][0]['id'])) {\n $user['contact'][0]['primary'][0]['identifier'] = 'id';\n } else if (isset($user['contact'][0]['primary'][0]['name'])) {\n $user['contact'][0]['primary'][0]['identifier'] = 'name';\n } else {\n $user['contact'][0]['primary'][0]['identifier'] = 'name';\n $user['contact'][0]['primary'][0]['name'] = 'Contacts';\n }\n\n if (isset($user['contact'][0]['exclude'])) {\n $user['contact'][0]['folders'][0]['filtermethod'][0] = 'exclude';\n $user['contact'][0]['folders'][0]['list'] = $user['contact'][0]['exclude'];\n if (isset($user['contact'][0]['exclude'][0]['id'][0])) {\n $user['contact'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['contact'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else if (isset($user['contact'][0]['include'])) {\n $user['contact'][0]['folders'][0]['filtermethod'][0] = 'include';\n $user['contact'][0]['folders'][0]['list'] = $user['contact'][0]['include'];\n if (isset($user['contact'][0]['include'][0]['id'][0])) {\n $user['contact'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['contact'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else {\n if ($this->_ignoreEmailedContacts) {\n $user['contact'][0]['folders'][0]['filtermethod'][0] = 'exclude';\n $user['contact'][0]['folders'][0]['identifier'][0] = 'name';\n $user['contact'][0]['folders'][0]['list'][0]['name'] = 'Emailed Contacts';\n } else {\n $user['contact'][0]['folders'][0]['filtermethod'][0] = 'none';\n }\n }\n }\n\n if (defined('ZIMBRA_DISABLE_APPOINTMENTS') && (ZIMBRA_DISABLE_APPOINTMENTS === true)) { \n\n $user['appointment'][0]['active'] = 'false'; \n\n } else {\n\n // Process Appointment Node\n if (!isset($user['appointment'][0]['active']) || !$this->IsBool($user['appointment'][0]['active'])) {\n $user['appointment'][0]['active'] = 'true';\n }\n\n if (!isset($user['appointment'][0]['virtual']) || !$this->IsBool($user['appointment'][0]['virtual'])) {\n $user['appointment'][0]['virtual'] = (defined('ZIMBRA_VIRTUAL_APPOINTMENTS') ? (($this->ToBool(ZIMBRA_VIRTUAL_APPOINTMENTS)) ? 'true' : 'false') : 'true' );\n }\n\n if (isset($user['appointment'][0]['primary'][0]['id'])) {\n $user['appointment'][0]['primary'][0]['identifier'] = 'id';\n } else if (isset($user['appointment'][0]['primary'][0]['name'])) {\n $user['appointment'][0]['primary'][0]['identifier'] = 'name';\n } else {\n $user['appointment'][0]['primary'][0]['identifier'] = 'name';\n $user['appointment'][0]['primary'][0]['name'] = 'Calendar';\n }\n\n if (isset($user['appointment'][0]['exclude'])) {\n $user['appointment'][0]['folders'][0]['filtermethod'][0] = 'exclude';\n $user['appointment'][0]['folders'][0]['list'] = $user['appointment'][0]['exclude'];\n if (isset($user['appointment'][0]['exclude'][0]['id'][0])) {\n $user['appointment'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['appointment'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else if (isset($user['appointment'][0]['include'])) {\n $user['appointment'][0]['folders'][0]['filtermethod'][0] = 'include';\n $user['appointment'][0]['folders'][0]['list'] = $user['appointment'][0]['include'];\n if (isset($user['appointment'][0]['include'][0]['id'][0])) {\n $user['appointment'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['appointment'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else {\n $user['appointment'][0]['folders'][0]['filtermethod'][0] = 'none';\n }\n }\n\n if (defined('ZIMBRA_DISABLE_TASKS') && (ZIMBRA_DISABLE_TASKS === true)) { \n\n $user['task'][0]['active'] = 'false'; \n\n } else {\n\n // Process Task Node\n if (!isset($user['task'][0]['active']) || !$this->IsBool($user['task'][0]['active'])) {\n $user['task'][0]['active'] = 'true';\n }\n\n if (!isset($user['task'][0]['virtual']) || !$this->IsBool($user['task'][0]['virtual'])) {\n $user['task'][0]['virtual'] = (defined('ZIMBRA_VIRTUAL_TASKS') ? (($this->ToBool(ZIMBRA_VIRTUAL_TASKS)) ? 'true' : 'false') : 'true' );\n }\n\n if (isset($user['task'][0]['primary'][0]['id'])) {\n $user['task'][0]['primary'][0]['identifier'] = 'id';\n } else if (isset($user['task'][0]['primary'][0]['name'])) {\n $user['task'][0]['primary'][0]['identifier'] = 'name';\n } else {\n $user['task'][0]['primary'][0]['identifier'] = 'name';\n $user['task'][0]['primary'][0]['name'] = 'Tasks';\n }\n\n if (isset($user['task'][0]['exclude'])) {\n $user['task'][0]['folders'][0]['filtermethod'][0] = 'exclude';\n $user['task'][0]['folders'][0]['list'] = $user['task'][0]['exclude'];\n if (isset($user['task'][0]['exclude'][0]['id'][0])) {\n $user['task'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['task'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else if (isset($user['task'][0]['include'])) {\n $user['task'][0]['folders'][0]['filtermethod'][0] = 'include';\n $user['task'][0]['folders'][0]['list'] = $user['task'][0]['include'];\n if (isset($user['task'][0]['include'][0]['id'][0])) {\n $user['task'][0]['folders'][0]['identifier'][0] = 'id';\n } else {\n $user['task'][0]['folders'][0]['identifier'][0] = 'name';\n }\n } else {\n $user['task'][0]['folders'][0]['filtermethod'][0] = 'none';\n }\n }\n\n $user['document'][0]['active'] = 'true';\n $user['document'][0]['virtual'] = 'false';\n $user['document'][0]['primary'][0]['identifier'] = 'id';\n $user['document'][0]['primary'][0]['id'] = '16'; // Briefcase (in English)\n $user['document'][0]['folders'][0]['filtermethod'][0] = 'none';\n // Added wiki to accomodate servers that run, or once ran, version 5.0.x of zimbra\n $user['wiki'][0]['active'] = 'false';\n $user['wiki'][0]['virtual'] = 'false';\n $user['wiki'][0]['primary'][0]['identifier'] = 'id';\n $user['wiki'][0]['primary'][0]['id'] = '16'; // Briefcase (in English)\n $user['wiki'][0]['folders'][0]['filtermethod'][0] = 'none';\n // Added note to accomodate clients that can send Sticky Notes - eg. iOS7\n $user['note'][0]['active'] = 'true';\n $user['note'][0]['virtual'] = 'false';\n $user['note'][0]['primary'][0]['identifier'] = 'id';\n $user['note'][0]['primary'][0]['id'] = '0'; // Notes (in English) - Need to match folder name and set Folder ID\n $user['note'][0]['folders'][0]['filtermethod'][0] = 'none';\n\n if (defined('ZIMBRA_DISABLE_MESSAGES') && (ZIMBRA_DISABLE_MESSAGES === true)) { $user['message'][0]['active'] = 'false'; }\n if (defined('ZIMBRA_DISABLE_CONTACTS') && (ZIMBRA_DISABLE_CONTACTS === true)) { $user['contact'][0]['active'] = 'false'; }\n if (defined('ZIMBRA_DISABLE_APPOINTMENTS') && (ZIMBRA_DISABLE_APPOINTMENTS === true)) { $user['appointment'][0]['active'] = 'false'; }\n if (defined('ZIMBRA_DISABLE_TASKS') && (ZIMBRA_DISABLE_TASKS === true)) { $user['task'][0]['active'] = 'false'; }\n if (defined('ZIMBRA_DISABLE_NOTES') && (ZIMBRA_DISABLE_NOTES === true)) { $user['note'][0]['active'] = 'false'; }\n if (defined('ZIMBRA_DISABLE_DOCUMENTS') && (ZIMBRA_DISABLE_DOCUMENTS === true)) { $user['document'][0]['active'] = 'false'; }\n\n $this->_virtual['contact'] = array();\n $this->_virtual['appointment'] = array();\n $this->_virtual['task'] = array();\n $this->_virtual['note'] = array();\n\n $this->_primary['message'] = \"\";\n $this->_primary['contact'] = \"\";\n $this->_primary['appointment'] = \"\";\n $this->_primary['task'] = \"\";\n $this->_primary['note'] = \"\";\n\n/*\n // Update $_userFolderTypeActive with derived settings. System configs override user directives.\n foreach ( $this->_userFolderTypeActive as $key=>$value ) {\n if ($user[$key][0]['active'] == 'false') {\n $this->_userFolderTypeActive[$key] = false;\n }\n }\n*/\n // Override User settings with Zimbra account attribute disables.\n foreach ( $this->_userFolderTypeActive as $key=>$value ) {\n if ($value == false) {\n $user[$key][0]['active'] = 'false';\n }\n }\n unset( $key );\n unset( $value );\n\n return $user;\n }",
"function showXmlFile($path, $fields, $nb) {\n\t$xml = new DOMDocument ();\n\t$xml->formatOutput = true;\n\t$xml->preserveWhiteSpace = false;\n\t$xml->load ( $path );\n\t\n\t$nodes = $xml->getElementsByTagName ( $fields [1] );\n\t$retVal = array ();\n\tforeach ( $nodes as $node ) {\n\t\t$values = array ();\n\t\tfor($i = 2; $i < $nb; $i ++) {\n\t\t\t$tmp = $node->getElementsByTagName ( $fields [$i] );\n\t\t\t$tmp = $tmp->item ( 0 )->nodeValue;\n\t\t\t$values [] = $tmp;\n\t\t\techo \"$fields[$i] : $tmp \" . \"<br>\";\n\t\t}\n\t\t$retVal [] = $values;\n\t}\n\treturn $retVal;\n}",
"public function getAccountInformation ();",
"public function toXML();",
"public function xml() {\n\t\t$raw_xml = TgzHandler::readFile($this->filename, 'install/data.xml');\n\t\t$xml = new SimpleXMLElement($raw_xml);\n\t\treturn $xml;\n\t}",
"public function infoOwner() {\n echo 'Nom : '.$this->_surname.' Prénom : '.$this->_name.'<br>Age : '.$this->calcAge($this->_birthdate).'<br>Ville : '.$this->_city.'<br> Comptes :<ul>';\n foreach ($this->_accounts as $value) {\n echo \"<li>$value</li>\";\n }\n echo '</ul>';\n }",
"public function printSchema() {\r\n\t\t global $_whomp_storage_path;\r\n\t\t \r\n\t\t header('Content-type: text/xml');\r\n\t\t readfile($_whomp_storage_path . $this->_schema_path);\r\n\t }",
"public function toXml() {\n $xml = new SimpleXMLElement('<user></user>');\n $xml->addChild('name', $this->getName());\n $xml->addChild('surname', $this->getSurName());\n $xml->addChild('email', $this->getEmail());\n return $xml->asXML();\n }",
"public function export() {\r\n $xml = new \\SimpleXMLElement('<xml/>');\r\n\r\n $list = new Object\\KeyValue\\GroupConfig\\Listing();\r\n $list->load();\r\n $items = $list->getList();\r\n\r\n $groups = $xml->addChild('groups');\r\n\r\n foreach ($items as $item) {\r\n $group = $groups->addChild('group');\r\n $group->addChild(\"id\", $item->getId());\r\n $group->addChild(\"name\", $item->getName());\r\n $group->addChild(\"description\", $item->getDescription());\r\n }\r\n\r\n $list = new Object\\KeyValue\\KeyConfig\\Listing();\r\n $list->load();\r\n $items = $list->getList();\r\n\r\n $keys = $xml->addChild('keys');\r\n\r\n foreach ($items as $item) {\r\n $key= $keys->addChild('key');\r\n $id = $key->addChild('id', $item->getId());\r\n $name = $key->addChild('name', $item->getName());\r\n $description = $key->addChild('description', $item->getDescription());\r\n $type = $key->addChild('type', $item->getType());\r\n $unit = $key->addChild('unit', $item->getUnit());\r\n $group = $key->addChild('group', $item->getGroup());\r\n $possiblevalues = $key->addChild('possiblevalues', $item->getPossibleValues());\r\n }\r\n\r\n return $xml->asXML();\r\n }",
"public function printSchema() {\r\n\t\t \r\n\t\t echo $this->_template_schema->saveXML();\r\n\t }",
"static function getUserXML($userObject = null, $details=false)\r\n\t{\r\n\t\t$buffer = \"\";\r\n\t\t$loggedUser = AuthService::getLoggedUser();\r\n $confDriver = ConfService::getConfStorageImpl();\r\n\t\tif($userObject != null) $loggedUser = $userObject;\r\n\t\tif(!AuthService::usersEnabled()){\r\n\t\t\t$buffer.=\"<user id=\\\"shared\\\">\";\r\n\t\t\tif(!$details){\r\n\t\t\t\t$buffer.=\"<active_repo id=\\\"\".ConfService::getCurrentRootDirIndex().\"\\\" write=\\\"1\\\" read=\\\"1\\\"/>\";\r\n\t\t\t}\r\n\t\t\t$buffer.= AJXP_XMLWriter::writeRepositoriesData(null, $details);\r\n\t\t\t$buffer.=\"</user>\";\t\r\n\t\t}else if($loggedUser != null){\r\n\t\t\t$buffer.=\"<user id=\\\"\".$loggedUser->id.\"\\\">\";\r\n\t\t\tif(!$details){\r\n\t\t\t\t$buffer.=\"<active_repo id=\\\"\".ConfService::getCurrentRootDirIndex().\"\\\" write=\\\"\".($loggedUser->canWrite(ConfService::getCurrentRootDirIndex())?\"1\":\"0\").\"\\\" read=\\\"\".($loggedUser->canRead(ConfService::getCurrentRootDirIndex())?\"1\":\"0\").\"\\\"/>\";\r\n\t\t\t}else{\r\n\t\t\t\t$buffer .= \"<ajxp_roles>\";\r\n\t\t\t\tforeach ($loggedUser->getRoles() as $roleId => $boolean){\r\n\t\t\t\t\tif($boolean === true) $buffer.= \"<role id=\\\"$roleId\\\"/>\";\r\n\t\t\t\t}\r\n\t\t\t\t$buffer .= \"</ajxp_roles>\";\r\n\t\t\t}\r\n\t\t\t$buffer.= AJXP_XMLWriter::writeRepositoriesData($loggedUser, $details);\r\n\t\t\t$buffer.=\"<preferences>\";\r\n $preferences = $confDriver->getExposedPreferences($loggedUser);\r\n foreach($preferences as $prefName => $prefData){\r\n if($prefData[\"type\"] == \"string\"){\r\n $buffer.=\"<pref name=\\\"$prefName\\\" value=\\\"\".$prefData[\"value\"].\"\\\"/>\";\r\n }else if($prefData[\"type\"] == \"json\"){\r\n $buffer.=\"<pref name=\\\"$prefName\\\"><![CDATA[\".$prefData[\"value\"].\"]]></pref>\";\r\n }\r\n }\r\n\t\t\t$buffer.=\"</preferences>\";\r\n\t\t\t$buffer.=\"<special_rights is_admin=\\\"\".($loggedUser->isAdmin()?\"1\":\"0\").\"\\\"/>\";\r\n\t\t\t$bMarks = $loggedUser->getBookmarks();\r\n\t\t\tif(count($bMarks)){\r\n\t\t\t\t$buffer.= \"<bookmarks>\".AJXP_XMLWriter::writeBookmarks($bMarks, false).\"</bookmarks>\";\r\n\t\t\t}\r\n\t\t\t$buffer.=\"</user>\";\r\n\t\t}\r\n\t\treturn $buffer;\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an entity's webform field name. | public static function getEntityWebformFieldName(EntityInterface $entity = NULL) {
if ($entity === NULL || !method_exists($entity, 'hasField')) {
return '';
}
if ($entity instanceof ContentEntityInterface) {
$fields = $entity->getFieldDefinitions();
foreach ($fields as $field_name => $field_definition) {
if ($field_definition->getType() == 'webform') {
return $field_name;
}
}
}
return '';
} | [
"public function get_field_name();",
"public function getFieldName()\n {\n return $this->field->getAttribute('field_name');\n }",
"public function getFieldName()\n {\n return $this->field_name;\n }",
"function get_field_name($field) {\r\n\t\tif ( !empty($field->initial_name) ) {\r\n\t\t\t$field_name = $field->initial_name;\r\n\t\t} else {\r\n\t\t\t$field_name = $field->get_name();\r\n\t\t}\r\n\r\n\t\treturn $field_name;\r\n\t}",
"function name( $field ) {\n return $field;\n }",
"public function getEntityNameIdentifierField() {\n switch ($this->getCdf()->getType()) {\n case 'node':\n $name = 'title';\n break;\n\n case 'taxonomy_term':\n case 'file':\n case 'user':\n default:\n $name = 'name';\n break;\n }\n return $name;\n }",
"public function getFormName();",
"public function getIdFieldName()\n {\n return $this->id_field_name;\n }",
"function et_lead_gen_get_field_form_name( $id ) {\n\treturn 'et_lead_gen_field_' . $id;\n}",
"protected function getIdFieldName()\n {\n if ($this->idFieldName) {\n return $this->idFieldName;\n }\n\n if ($this->collection->getIdFieldName()) {\n return $this->collection->getIdFieldName();\n }\n\n return 'entity_id';\n }",
"protected function getFieldName()\n {\n $condition = $this->getCondition();\n\n if (isset($condition['fieldToCompare'])) {\n $entity = $this->getEntity();\n $fieldName = $condition['fieldToCompare'];\n\n $normalizeFieldName = Utils::normalizeFieldName($entity, $fieldName);\n if (is_array($normalizeFieldName)) { //if field is parent\n return reset($normalizeFieldName);\n }\n\n return $normalizeFieldName;\n }\n }",
"public function getHeraldFieldName() {\n if ($this->proxy) {\n return $this->proxy->getHeraldFieldName();\n }\n return $this->getFieldName();\n }",
"protected final function getIdentifierFieldName()\n {\n $entityName = $this->_entityName;\n return $entityName::obtainIdentifierFieldName();\n }",
"public function name($field) {\n\t\treturn $field;\n\t}",
"function _getFieldName($fieldNode)\n {\n $nodeName = $fieldNode->nodeName();\n $fieldName = $nodeName;\n foreach ($fieldNode->attributes() as $name => $content) {\n if ($name == $this->_options['fieldAttribute']) {\n $fieldName = $content;\n }\n }\n return $fieldName;\n }",
"private function getFormName()\n {\n return $this->name;\n }",
"function hc_field_name($field){\n\t\techo hc_get_field_name($field);\n\t}",
"public function getFldName ()\n {\n return $this->fld_name;\n }",
"public function getFieldsName();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for editing the specified documenttype. | public function edit($id)
{
$documenttype = DocumentType::find($id);
return view('admin.documenttype.edit', compact('documenttype'));
} | [
"public function edit(DocumentType $documentType)\n {\n return view('document-type.edit', compact('documentType'));\n }",
"public function edit()\n {\n $this->model->load('Type');\n $type = $this->model->Type->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'type' => $type\n );\n\n // Load view\n $this->view->load('types/edit', $data);\n }",
"public function editType()\n {\n $form = new srCertificateTypeFormGUI($this, $this->type);\n $this->tpl->setContent($form->getHTML());\n }",
"public function edit($id)\n {\n if (! Gate::allows('document_type_edit')) {\n return abort(401);\n }\n $document_type = DocumentType::findOrFail($id);\n\n return view('admin.document_types.edit', compact('document_type'));\n }",
"function getEditPage($iDocTypeID) {\n global $default;\n $oDocType = null;\n if (isset($iDocTypeID)) {\n $oDocType = DocumentType::get($iDocTypeID);\n\n }\n\n $sToRender .= renderHeading(_(\"Edit Document Type\"));\n $sToRender .= \"<table>\\n\";\n $sToRender .= \"<tr></tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"<td>\" . _(\"Document Type Name:\") . \" </td><td>\" . getDocTypeDisplay($oDocType) . \"</td>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"<tr>\\n\";\n $sToRender .= \"<td></td>\" . getUpdateButton($oDocType);\n $sToRender .= getCancelButton($oDocType);\n $sToRender .= \"</tr>\\n\";\n $sToRender .= \"</table>\\n\";\n\n\n return $sToRender;\n}",
"private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }",
"public function editAction()\n {\n $administrativedocumentId = $this->getRequest()->getParam('id');\n $administrativedocument = $this->_initAdministrativedocument();\n if ($administrativedocumentId && !$administrativedocument->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_administrativedoc')->__('This administrative document no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getAdministrativedocumentData(true);\n if (!empty($data)) {\n $administrativedocument->setData($data);\n }\n Mage::register('administrativedocument_data', $administrativedocument);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_administrativedoc')->__('Administrative Document'))\n ->_title(Mage::helper('bs_administrativedoc')->__('Administrative Documents'));\n if ($administrativedocument->getId()) {\n $this->_title($administrativedocument->getDocName());\n } else {\n $this->_title(Mage::helper('bs_administrativedoc')->__('Add document'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function edit_form()\n {\n return View::make(\"app.edit\");\n }",
"function forschungsatlas_admin_orgtype_edit($orgtype = array()){\n drupal_set_title($orgtype['name']);\n\n return drupal_get_form('forschungsatlas_admin_orgtype_form', $orgtype);\n}",
"protected function _getEditForm()\n {\n }",
"public static function edit_form()\n {\n $user = Users::findOne($_SESSION['user']);\n\n View::make('user/edit.html', array('user' => $user));\n }",
"function showEditForm( $formCallback=null ) {\n\t\tglobal $wgOut, $wgUser, $wgLang, $wgContLang, $wgMaxArticleSize, $wgTitle, $wgRequest;\n\n\t\t# If $wgTitle is null, that means we're in API mode.\n\t\t# Some hook probably called this function without checking\n\t\t# for is_null($wgTitle) first. Bail out right here so we don't\n\t\t# do lots of work just to discard it right after.\n\t\tif (is_null($wgTitle))\n\t\t\treturn;\n\n\t\t$fname = 'EditPage::showEditForm';\n\t\twfProfileIn( $fname );\n\n\t\t$sk = $wgUser->getSkin();\n\n\t\twfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ;\n\n\t\t#need to parse the preview early so that we know which templates are used,\n\t\t#otherwise users with \"show preview after edit box\" will get a blank list\n\t\t#we parse this near the beginning so that setHeaders can do the title\n\t\t#setting work instead of leaving it in getPreviewText\n\t\t$previewOutput = '';\n\t\tif ( $this->formtype == 'preview' ) {\n\t\t\t$previewOutput = $this->getPreviewText();\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\t# Enabled article-related sidebar, toplinks, etc.\n\t\t$wgOut->setArticleRelated( true );\n\n\t\tif ( $this->isConflict ) {\n\t\t\t$wgOut->wrapWikiMsg( \"<div class='mw-explainconflict'>\\n$1</div>\", 'explainconflict' );\n\n\t\t\t$this->textbox2 = $this->textbox1;\n\t\t\t$this->textbox1 = $this->getContent();\n\t\t\t$this->edittime = $this->mArticle->getTimestamp();\n\n\t\t\t# MeanEditor: too complicated for visual editing\n\t\t\t$this->noVisualEditor = false;\n\t\t} else {\n\t\t\tif ( $this->section != '' && $this->section != 'new' ) {\n\t\t\t\t$matches = array();\n\t\t\t\tif ( !$this->summary && !$this->preview && !$this->diff ) {\n\t\t\t\t\tpreg_match( \"/^(=+)(.+)\\\\1/mi\", $this->textbox1, $matches );\n\t\t\t\t\tif ( !empty( $matches[2] ) ) {\n\t\t\t\t\t\tglobal $wgParser;\n\t\t\t\t\t\t$this->summary = \"/* \" .\n\t\t\t\t\t\t\t$wgParser->stripSectionName(trim($matches[2])) .\n\t\t\t\t\t\t\t\" */ \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->missingComment ) {\n\t\t\t\t$wgOut->wrapWikiMsg( '<div id=\"mw-missingcommenttext\">$1</div>', 'missingcommenttext' );\n\t\t\t}\n\n\t\t\tif ( $this->missingSummary && $this->section != 'new' ) {\n\t\t\t\t$wgOut->wrapWikiMsg( '<div id=\"mw-missingsummary\">$1</div>', 'missingsummary' );\n\t\t\t}\n\n\t\t\tif ( $this->missingSummary && $this->section == 'new' ) {\n\t\t\t\t$wgOut->wrapWikiMsg( '<div id=\"mw-missingcommentheader\">$1</div>', 'missingcommentheader' );\n\t\t\t}\n\n\t\t\tif ( $this->hookError !== '' ) {\n\t\t\t\t$wgOut->addWikiText( $this->hookError );\n\t\t\t}\n\n\t\t\tif ( !$this->checkUnicodeCompliantBrowser() ) {\n\t\t\t\t$wgOut->addWikiMsg( 'nonunicodebrowser' );\n\t\t\t}\n\t\t\tif ( isset( $this->mArticle ) && isset( $this->mArticle->mRevision ) ) {\n\t\t\t// Let sysop know that this will make private content public if saved\n\n\t\t\t\tif ( !$this->mArticle->mRevision->userCan( Revision::DELETED_TEXT ) ) {\n\t\t\t\t\t$wgOut->wrapWikiMsg( \"<div class='mw-warning plainlinks'>\\n$1</div>\\n\", 'rev-deleted-text-permission' );\n\t\t\t\t} else if ( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {\n\t\t\t\t\t$wgOut->wrapWikiMsg( \"<div class='mw-warning plainlinks'>\\n$1</div>\\n\", 'rev-deleted-text-view' );\n\t\t\t\t}\n\n\t\t\t\tif ( !$this->mArticle->mRevision->isCurrent() ) {\n\t\t\t\t\t$this->mArticle->setOldSubtitle( $this->mArticle->mRevision->getId() );\n\t\t\t\t\t$wgOut->addWikiMsg( 'editingold' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( wfReadOnly() ) {\n\t\t\t$wgOut->wrapWikiMsg( \"<div id=\\\"mw-read-only-warning\\\">\\n$1\\n</div>\", array( 'readonlywarning', wfReadOnlyReason() ) );\n\t\t\t# MeanEditor: visual editing makes no sense here\n\t\t\t$this->noVisualEditor = true;\n\t\t} elseif ( $wgUser->isAnon() && $this->formtype != 'preview' ) {\n\t\t\t$wgOut->wrapWikiMsg( '<div id=\"mw-anon-edit-warning\">$1</div>', 'anoneditwarning' );\n\t\t} else {\n\t\t\tif ( $this->isCssJsSubpage ) {\n\t\t\t\t# Check the skin exists\n\t\t\t\tif ( $this->isValidCssJsSubpage ) {\n\t\t\t\t\tif ( $this->formtype !== 'preview' ) {\n\t\t\t\t\t\t$wgOut->addWikiMsg( 'usercssjsyoucanpreview' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$wgOut->addWikiMsg( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$classes = array(); // Textarea CSS\n\t\tif ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {\n\t\t} elseif ( $this->mTitle->isProtected( 'edit' ) ) {\n\t\t\t# Is the title semi-protected?\n\t\t\tif ( $this->mTitle->isSemiProtected() ) {\n\t\t\t\t$noticeMsg = 'semiprotectedpagewarning';\n\t\t\t\t$classes[] = 'mw-textarea-sprotected';\n\t\t\t} else {\n\t\t\t\t# Then it must be protected based on static groups (regular)\n\t\t\t\t$noticeMsg = 'protectedpagewarning';\n\t\t\t\t$classes[] = 'mw-textarea-protected';\n\t\t\t}\n\t\t\t$wgOut->addHTML( \"<div class='mw-warning-with-logexcerpt'>\\n\" );\n\t\t\t$wgOut->addWikiMsg( $noticeMsg );\n\t\t\tLogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 1 );\n\t\t\t$wgOut->addHTML( \"</div>\\n\" );\n\t\t}\n\t\tif ( $this->mTitle->isCascadeProtected() ) {\n\t\t\t# Is this page under cascading protection from some source pages?\n\t\t\tlist($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();\n\t\t\t$notice = \"<div class='mw-cascadeprotectedwarning'>$1\\n\";\n\t\t\t$cascadeSourcesCount = count( $cascadeSources );\n\t\t\tif ( $cascadeSourcesCount > 0 ) {\n\t\t\t\t# Explain, and list the titles responsible\n\t\t\t\tforeach( $cascadeSources as $page ) {\n\t\t\t\t\t$notice .= '* [[:' . $page->getPrefixedText() . \"]]\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$notice .= '</div>';\n\t\t\t$wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', $cascadeSourcesCount ) );\n\t\t}\n\t\tif ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) {\n\t\t\t$wgOut->wrapWikiMsg( '<div class=\"mw-titleprotectedwarning\">$1</div>', 'titleprotectedwarning' );\n\t\t}\n\n\t\tif ( $this->kblength === false ) {\n\t\t\t# MeanEditor: the length will probably be different in HTML\n\t\t\t$this->kblength = (int)(strlen( $this->textbox1 ) / 1024);\n\t\t}\n\t\tif ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {\n\t\t\t$wgOut->addHTML( \"<div class='error' id='mw-edit-longpageerror'>\\n\" );\n\t\t\t$wgOut->addWikiMsg( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) );\n\t\t\t$wgOut->addHTML( \"</div>\\n\" );\n\t\t} elseif ( $this->kblength > 29 ) {\n\t\t\t$wgOut->addHTML( \"<div id='mw-edit-longpagewarning'>\\n\" );\n\t\t\t$wgOut->addWikiMsg( 'longpagewarning', $wgLang->formatNum( $this->kblength ) );\n\t\t\t$wgOut->addHTML( \"</div>\\n\" );\n\t\t}\n\n\t\t$q = 'action='.$this->action;\n\t\t#if ( \"no\" == $redirect ) { $q .= \"&redirect=no\"; }\n\t\t$action = $wgTitle->escapeLocalURL( $q );\n\n\t\t$summary = wfMsg( 'summary' );\n\t\t$subject = wfMsg( 'subject' );\n\n\t\t$cancel = $sk->makeKnownLink( $wgTitle->getPrefixedText(),\n\t\t\t\twfMsgExt('cancel', array('parseinline')) );\n\t\t$separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );\n\t\t$edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));\n\t\t$edithelp = '<a target=\"helpwindow\" href=\"'.$edithelpurl.'\">'.\n\t\t\thtmlspecialchars( wfMsg( 'edithelp' ) ).'</a> '.\n\t\t\thtmlspecialchars( wfMsg( 'newwindow' ) );\n\n\t\tglobal $wgRightsText;\n\t\tif ( $wgRightsText ) {\n\t\t\t$copywarnMsg = array( 'copyrightwarning',\n\t\t\t\t'[[' . wfMsgForContent( 'copyrightpage' ) . ']]',\n\t\t\t\t$wgRightsText );\n\t\t} else {\n\t\t\t$copywarnMsg = array( 'copyrightwarning2',\n\t\t\t\t'[[' . wfMsgForContent( 'copyrightpage' ) . ']]' );\n\t\t}\n\n\t\t/* MeanEditor: always disable the toolbar */\n\t\tif ( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) {\n\t\t\t# prepare toolbar for edit buttons\n\t\t\t$toolbar = '';\n\t\t} else {\n\t\t\t$toolbar = '';\n\t\t}\n\n\t\t// activate checkboxes if user wants them to be always active\n\t\tif ( !$this->preview && !$this->diff ) {\n\t\t\t# Sort out the \"watch\" checkbox\n\t\t\tif ( $wgUser->getOption( 'watchdefault' ) ) {\n\t\t\t\t# Watch all edits\n\t\t\t\t$this->watchthis = true;\n\t\t\t} elseif ( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {\n\t\t\t\t# Watch creations\n\t\t\t\t$this->watchthis = true;\n\t\t\t} elseif ( $this->mTitle->userIsWatching() ) {\n\t\t\t\t# Already watched\n\t\t\t\t$this->watchthis = true;\n\t\t\t}\n\t\t\t\n\t\t\t# May be overriden by request parameters\n\t\t\tif( $wgRequest->getBool( 'watchthis' ) ) {\n\t\t\t\t$this->watchthis = true;\n\t\t\t}\n\n\t\t\tif ( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;\n\n\t\t\t# MeanEditor: User preference\n\t\t\tif( $wgUser->getOption( 'prefer_traditional_editor' ) ) $this->userWantsTraditionalEditor = true;\n\t\t}\n\n\t\t$wgOut->addHTML( $this->editFormPageTop );\n\n\t\tif ( $wgUser->getOption( 'previewontop' ) ) {\n\t\t\t$this->displayPreviewArea( $previewOutput, true );\n\t\t}\n\n\t\t$wgOut->addHTML( $this->editFormTextTop );\n\n\t\t# if this is a comment, show a subject line at the top, which is also the edit summary.\n\t\t# Otherwise, show a summary field at the bottom\n\t\t$summarytext = $wgContLang->recodeForEdit( $this->summary );\n\n\t\t# If a blank edit summary was previously provided, and the appropriate\n\t\t# user preference is active, pass a hidden tag as wpIgnoreBlankSummary. This will stop the\n\t\t# user being bounced back more than once in the event that a summary\n\t\t# is not required.\n\t\t#####\n\t\t# For a bit more sophisticated detection of blank summaries, hash the\n\t\t# automatic one and pass that in the hidden field wpAutoSummary.\n\t\t$summaryhiddens = '';\n\t\tif ( $this->missingSummary ) $summaryhiddens .= Xml::hidden( 'wpIgnoreBlankSummary', true );\n\t\t$autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary );\n\t\t$summaryhiddens .= Xml::hidden( 'wpAutoSummary', $autosumm );\n\t\tif ( $this->section == 'new' ) {\n\t\t\t$commentsubject = '';\n\t\t\tif ( !$wgRequest->getBool( 'nosummary' ) ) {\n\t\t\t\t# Add a class if 'missingsummary' is triggered to allow styling of the summary line\n\t\t\t\t$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';\n\n\t\t\t\t$commentsubject =\n\t\t\t\t\tXml::tags( 'label', array( 'for' => 'wpSummary' ), $subject );\n\t\t\t\t$commentsubject =\n\t\t\t\t\tXml::tags( 'span', array( 'class' => $summaryClass, 'id' => \"wpSummaryLabel\" ),\n\t\t\t\t\t\t$commentsubject );\n\t\t\t\t$commentsubject .= ' ';\n\t\t\t\t$commentsubject .= Xml::input( 'wpSummary',\n\t\t\t\t\t\t\t\t\t60,\n\t\t\t\t\t\t\t\t\t$summarytext,\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'id' => 'wpSummary',\n\t\t\t\t\t\t\t\t\t\t'maxlength' => '200',\n\t\t\t\t\t\t\t\t\t\t'tabindex' => '1'\n\t\t\t\t\t\t\t\t\t) );\n\t\t\t}\n\t\t\t$editsummary = \"<div class='editOptions'>\\n\";\n\t\t\tglobal $wgParser;\n\t\t\t$formattedSummary = wfMsgForContent( 'newsectionsummary', $wgParser->stripSectionName( $this->summary ) );\n\t\t\t$subjectpreview = $summarytext && $this->preview ? \"<div class=\\\"mw-summary-preview\\\">\". wfMsg('subject-preview') . $sk->commentBlock( $formattedSummary, $this->mTitle, true ).\"</div>\\n\" : '';\n\t\t\t$summarypreview = '';\n\t\t} else {\n\t\t\t$commentsubject = '';\n\n\t\t\t# Add a class if 'missingsummary' is triggered to allow styling of the summary line\n\t\t\t$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';\n\n\t\t\t$editsummary = Xml::tags( 'label', array( 'for' => 'wpSummary' ), $summary );\n\t\t\t$editsummary = Xml::tags( 'span', array( 'class' => $summaryClass, 'id' => \"wpSummaryLabel\" ),\n\t\t\t\t\t$editsummary ) . ' ';\n\n\t\t\t$editsummary .= Xml::input( 'wpSummary',\n\t\t\t\t60,\n\t\t\t\t$summarytext,\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'wpSummary',\n\t\t\t\t\t'maxlength' => '200',\n\t\t\t\t\t'tabindex' => '1'\n\t\t\t\t) );\n\t\t\t\n\t\t\t// No idea where this is closed.\n\t\t\t$editsummary = Xml::openElement( 'div', array( 'class' => 'editOptions' ) )\n\t\t\t\t\t\t\t. $editsummary . '<br/>';\n\t\t\t\t\n\t\t\t$summarypreview = '';\n\t\t\tif ( $summarytext && $this->preview ) {\n\t\t\t\t$summarypreview =\n\t\t\t\t\tXml::tags( 'div',\n\t\t\t\t\t\tarray( 'class' => 'mw-summary-preview' ),\n\t\t\t\t\t\twfMsg( 'summary-preview' ) .\n\t\t\t\t\t\t\t$sk->commentBlock( $this->summary, $this->mTitle )\n\t\t\t\t\t);\n\t\t\t}\n\t\t\t$subjectpreview = '';\n\t\t}\n\t\t$commentsubject .= $summaryhiddens;\n\n\n\t\t# Set focus to the edit box on load, except on preview or diff, where it would interfere with the display\n\t\tif ( !$this->preview && !$this->diff ) {\n\t\t\t$wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus()' );\n\t\t}\n\t\t$templates = $this->getTemplates();\n\t\t$formattedtemplates = $sk->formatTemplates( $templates, $this->preview, $this->section != '');\n\n\t\t$hiddencats = $this->mArticle->getHiddenCategories();\n\t\t$formattedhiddencats = $sk->formatHiddenCategories( $hiddencats );\n\n\t\tglobal $wgUseMetadataEdit ;\n\t\tif ( $wgUseMetadataEdit ) {\n\t\t\t$metadata = $this->mMetaData ;\n\t\t\t$metadata = htmlspecialchars( $wgContLang->recodeForEdit( $metadata ) ) ;\n\t\t\t$top = wfMsgWikiHtml( 'metadata_help' );\n\t\t\t/* ToDo: Replace with clean code */\n\t\t\t$ew = $wgUser->getOption( 'editwidth' );\n\t\t\tif ( $ew ) $ew = \" style=\\\"width:100%\\\"\";\n\t\t\telse $ew = '';\n\t\t\t$cols = $wgUser->getIntOption( 'cols' );\n\t\t\t/* /ToDo */\n\t\t\t$metadata = $top . \"<textarea name='metadata' rows='3' cols='{$cols}'{$ew}>{$metadata}</textarea>\" ;\n\t\t}\n\t\telse $metadata = \"\" ;\n\n\t\t$recreate = '';\n\t\tif ( $this->wasDeletedSinceLastEdit() ) {\n\t\t\tif ( 'save' != $this->formtype ) {\n\t\t\t\t$wgOut->wrapWikiMsg(\n\t\t\t\t\t\"<div class='error mw-deleted-while-editing'>\\n$1</div>\",\n\t\t\t\t\t'deletedwhileediting' );\n\t\t\t} else {\n\t\t\t\t// Hide the toolbar and edit area, user can click preview to get it back\n\t\t\t\t// Add an confirmation checkbox and explanation.\n\t\t\t\t$toolbar = '';\n\t\t\t\t$recreate = '<div class=\"mw-confirm-recreate\">' .\n\t\t\t\t\t\t$wgOut->parse( wfMsg( 'confirmrecreate', $this->lastDelete->user_name , $this->lastDelete->log_comment ) ) .\n\t\t\t\t\t\tXml::checkLabel( wfMsg( 'recreate' ), 'wpRecreate', 'wpRecreate', false,\n\t\t\t\t\t\t\tarray( 'title' => $sk->titleAttrib( 'recreate' ), 'tabindex' => 1, 'id' => 'wpRecreate' )\n\t\t\t\t\t\t) . '</div>';\n\t\t\t}\n\t\t}\n\n\t\t$tabindex = 2;\n\n\t\t$checkboxes = $this->getCheckboxes( $tabindex, $sk,\n\t\t\tarray( 'minor' => $this->minoredit, 'watch' => $this->watchthis, 'want_traditional_editor' => $this->userWantsTraditionalEditor ));\n\n\t\t$checkboxhtml = implode( $checkboxes, \"\\n\" );\n\n\t\t$buttons = $this->getEditButtons( $tabindex );\n\t\t$buttonshtml = implode( $buttons, \"\\n\" );\n\n\t\t$safemodehtml = $this->checkUnicodeCompliantBrowser()\n\t\t\t? '' : Xml::hidden( 'safemode', '1' );\n\n\t\t$wgOut->addHTML( <<<END\n{$toolbar}\n<form id=\"editform\" name=\"editform\" method=\"post\" action=\"$action\" enctype=\"multipart/form-data\">\nEND\n);\n\n\t\tif ( is_callable( $formCallback ) ) {\n\t\t\tcall_user_func_array( $formCallback, array( &$wgOut ) );\n\t\t}\n\n\t\twfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) );\n\n\t\t// Put these up at the top to ensure they aren't lost on early form submission\n\t\t$this->showFormBeforeText();\n\n\t\t$wgOut->addHTML( <<<END\n{$recreate}\n{$commentsubject}\n{$subjectpreview}\n{$this->editFormTextBeforeContent}\nEND\n);\n\n\tif ( $this->isConflict || $this->diff ) {\n\t\t# MeanEditor: should be redundant, but let's be sure\n\t\t$this->noVisualEditor = true;\n\t}\n\t# MeanEditor: also apply htmlspecialchars? See $encodedtext\n\t$html_text = $this->safeUnicodeOutput( $this->textbox1 );\n\tif (!($this->noVisualEditor || $this->userWantsTraditionalEditor)) {\n\t\t$this->noVisualEditor = wfRunHooks('EditPage::wiki2html', array($this->mArticle, $wgUser, &$this, &$html_text));\n\t}\n\tif (!$this->noVisualEditor && !$this->userWantsTraditionalEditor) {\n\t\t$this->noVisualEditor = wfRunHooks('EditPage::showBox', array(&$this, $html_text, $rows, $cols, $ew));\n\t}\n\tif (!$this->noVisualEditor && !$this->userWantsTraditionalEditor) {\n\t\t$wgOut->addHTML(\"<input type='hidden' value=\\\"0\\\" name=\\\"wpNoVisualEditor\\\" />\\n\");\n\t} else {\n\t\t$wgOut->addHTML(\"<input type='hidden' value=\\\"1\\\" name=\\\"wpNoVisualEditor\\\" />\\n\");\n\t\t$this->showTextbox1( $classes );\n }\n\n\t\t$wgOut->wrapWikiMsg( \"<div id=\\\"editpage-copywarn\\\">\\n$1\\n</div>\", $copywarnMsg );\n\t\t$wgOut->addHTML( <<<END\n{$this->editFormTextAfterWarn}\n{$metadata}\n{$editsummary}\n{$summarypreview}\n{$checkboxhtml}\n{$safemodehtml}\nEND\n);\n\n\t\t$wgOut->addHTML(\n\"<div class='editButtons'>\n{$buttonshtml}\n\t<span class='editHelp'>{$cancel}{$separator}{$edithelp}</span>\n</div><!-- editButtons -->\n</div><!-- editOptions -->\");\n\n\t\t/**\n\t\t * To make it harder for someone to slip a user a page\n\t\t * which submits an edit form to the wiki without their\n\t\t * knowledge, a random token is associated with the login\n\t\t * session. If it's not passed back with the submission,\n\t\t * we won't save the page, or render user JavaScript and\n\t\t * CSS previews.\n\t\t *\n\t\t * For anon editors, who may not have a session, we just\n\t\t * include the constant suffix to prevent editing from\n\t\t * broken text-mangling proxies.\n\t\t */\n\t\t$token = htmlspecialchars( $wgUser->editToken() );\n\t\t$wgOut->addHTML( \"\\n<input type='hidden' value=\\\"$token\\\" name=\\\"wpEditToken\\\" />\\n\" );\n\n\t\t$this->showEditTools();\n\n\t\t$wgOut->addHTML( <<<END\n{$this->editFormTextAfterTools}\n<div class='templatesUsed'>\n{$formattedtemplates}\n</div>\n<div class='hiddencats'>\n{$formattedhiddencats}\n</div>\nEND\n);\n\n\t\tif ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) {\n\t\t\t$wgOut->wrapWikiMsg( '==$1==', \"yourdiff\" );\n\n\t\t\t$de = new DifferenceEngine( $this->mTitle );\n\t\t\t$de->setText( $this->textbox2, $this->textbox1 );\n\t\t\t$de->showDiff( wfMsg( \"yourtext\" ), wfMsg( \"storedversion\" ) );\n\n\t\t\t$wgOut->wrapWikiMsg( '==$1==', \"yourtext\" );\n\t\t\t$this->showTextbox2();\n\t\t}\n\t\t$wgOut->addHTML( $this->editFormTextBottom );\n\t\t$wgOut->addHTML( \"</form>\\n\" );\n\t\tif ( !$wgUser->getOption( 'previewontop' ) ) {\n\t\t\t$this->displayPreviewArea( $previewOutput, false );\n\t\t}\n\n\t\twfProfileOut( $fname );\n\t}",
"public function editContact_type($contact_type_id) {\n\t\t$page = $this->page; \n\t\t$page['main'] ='contact_type/edit-contact_type';\n $page['contact_type_id'] = $contact_type_id;\n $page['contact_type'] = $this->contact_type->getDataById($contact_type_id);\n\t\t$this->load->view($page['template'], $page);\n }",
"protected function _editForm()\n\t{\n\t\t$this->_resetModerator( $this->topic['forum_id'] );\n\t\t\n\t\t$this->_genericPermissionCheck( 'edit_topic' );\n\t\t\t\t\t\t\t\t\n\t\t$this->output .= $this->registry->getClass('output')->getTemplate('mod')->editTopicTitle( $this->forum, $this->topic );\n\n\t\t$navigation = $this->registry->getClass('class_forums')->forumsBreadcrumbNav( $this->forum['id'] );\n\t\t\n\t\tif( is_array( $navigation ) AND count( $navigation ) )\n\t\t{\n\t\t\tforeach( $navigation as $_id => $_nav )\n\t\t\t{\n\t\t\t\t$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1], $_nav[2], $_nav[3] );\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$this->registry->getClass('output')->addNavigation( $this->topic['title'], \"showtopic={$this->topic['tid']}\", $this->topic['title_seo'], 'showtopic' );\n\t\t$this->registry->getClass('output')->setTitle( $this->lang->words['t_edit'].\": \".$this->topic['title'] . ' - ' . ipsRegistry::$settings['board_name']);\n\t}",
"public function getShowEdit(){\n\t\t$data=array(\n\t\t\t\"product_id\"=>$_GET['product_id'],\n\t\t\t\"id\"=>$_GET['id'],\n\t\t\t\"key\"=>$_GET['key'],\n\t\t\t\"value\"=>$_GET['value'],\n\t\t\t\"value_type\"=>$_GET['value_type']);\n\t\t$this->setTitle('Edit Meta Data Fields');\n\t\t$this->setContent( $this->getView('shopify/editForm',$data, dirname(__DIR__)) );\n\t}",
"public function edit_document_type() {\n $this->loadModel('DocumentMaster');\n $data = $this->request->data;\n $document_type['DocumentMaster']['desc'] = $data['document_type'];\n $document_type['DocumentMaster']['modiefied_date'] = date('Y-m-d');\n $this->DocumentMaster->id = $data['type_id'];\n $this->DocumentMaster->save($document_type);\n echo \"success\";\n die();\n }",
"public function edit_form(){\n\t\t?>\n\t\t<form action=\"<?php echo get_save_url($this->page) ?>\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>Editing</legend>\n\t\t\t\t<label for=\"text\">Content:</label><br>\n\t\t\t\t<textarea cols=\"78\" rows=\"20\" name=\"text\" id=\"text\"><?php echo $this->file->data; ?></textarea>\n\t\t\t\t<br>\n\n\t\t\t\t<input type=\"submit\" name=\"preview\" value=\"Preview\">\n\t\t\t\t<input type=\"submit\" name=\"save\" value=\"Save\">\n\t\t\t\t<input type=\"hidden\" name=\"updated\" value=\"<?php echo $this->file->time; ?>\">\n\t\t\t</fieldset>\n\t\t</form>\n\t\t<?php\n\t}",
"function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}",
"function showEditForm()\n{\n global $app;\n\n $tpl = new acmsTemplate($this->templatePath . \"edit_form.tpl\");\n $tpl->assign(\"Action\", \"edit\");\n $tpl->assign(\"ChunkID\", $this->ChunkID);\n $tpl->assign(\"ChunkName\", $this->ChunkName);\n $tpl->assign(\"Chunk\", $this->Chunk);\n $tpl->assign(\"Title\", $this->Title);\n $tpl->assign(\"Perms\", $this->Perms);\n\n $app->addBlock(10, CONTENT_ZONE, \"Edit Menu\", $tpl->get());\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this will pick total amount of money from event donator table | function find_sum_from_event($array_title){
$conn= mysqli_connect('localhost','root','','test');
$sql2="SELECT * from event_donator WHERE `event title`='$array_title' ";
$result2 = mysqli_query($conn,$sql2);
$total = 0;
if(mysqli_num_rows($result2) >0){
while($row2=mysqli_fetch_assoc($result2)){
$total += $row2["amount"];
}
}
return $total;
} | [
"function getTotalForEvent()\n\t{\n\t\t$dbh = PDOManager::getPDO();\n\t\t$sth = $dbh->prepare(\"SELECT SUM(s.cost_total) FROM sales AS s GROUP BY s.event_id WHERE s.event_id=:event_id\");\n\t\t$sth->execute(array(':event_id' => $_POST['event_id']));\n\t\t$result = $sth->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\treturn $result;\n\t}",
"public function getTotalDonated() {\n $collection = Mage::getResourceModel('donations/report_bymonth_collection'); /* @var $collection Lucky_Donations_Model_Mysql4_Report_Bymonth_Collection */\n $collection\n ->joinCharity()\n ->joinOrders()\n ->filterOrders()\n ->addFieldToFilter('charity.charity_id', $this->getCharityId())\n ->groupByCharity();\n $collection->getSelect()->columns(new Zend_Db_Expr('SUM(main_table.amount) AS `total_donated`'));\n $total = $collection->getFirstItem()->getTotalDonated();\n return Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->setFormat(array('precision' => 0))->toCurrency(is_numeric($total) ? $total : 0);\n }",
"function ewd_get_total_donations_amount() {\n\n\tglobal $ewd_options;\n\t\n\t// Create the Query\n\t$posts_per_page = -1;\n\t$post_type \t\t= 'donation';\n\t$post_status \t= 'publish'; \n\t\t\t\t\n\t$query = new WP_Query( array ( \n\t\t\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t\t\t\t\t\t'post_status' => $post_status,\n\t\t\t\t\t\t\t\t'no_found_rows' => 1,\n\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t);\n\t\n\t//Get post type count\n\t$post_count = $query->post_count;\n\t$i = 1;\n\t\n\t$total_amount = '';\n\t\n\t// Displays info\n\tif( $post_count > 0) :\n\t\n\t\t// Loop\n\t\twhile ($query->have_posts()) : $query->the_post();\n\t\t\t\n\t\t\t$donation_id = get_the_ID();\n\t\t\t$donation_amount = get_post_meta($donation_id, 'ewd_amount', true);\n\t\t\t\n\t\t\t$total_amount \t+= $donation_amount;\n\t\t\t\n\t\tendwhile;\n\t\t\n\tendif;\n\t\n\treturn $total_amount;\n\t\n}",
"public function totalEarned() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Return' || $record->transactionType == 'Sold')\n $total += $record->cost;\n\n return $total;\n }",
"function getTotal(){\r\n global $conn;\r\n if (isset($_GET[\"Owner_ID\"]) && isset($_GET[\"Event_ID\"])) {\r\n $Owner_ID = $_GET['Owner_ID'];\r\n $Event_ID = $_GET['Event_ID'];\r\n \r\n $SQLStr = \"SELECT SUM(Price) AS Total \" .\r\n \"FROM Reserved \" .\r\n \"WHERE Event_ID = '{$Event_ID}' AND Transaction_ID = '{$Owner_ID}';\";\r\n \r\n \r\n $stmt = sqlsrv_query($conn, $SQLStr);\r\n if($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){\r\n //echo $row[\"Total\"];\r\n echo number_format((float)$row[\"Total\"],'2', '.', '');\r\n } else { errorHandling($row); }\r\n } else { echo(\"getTotal(): Owner_ID, or Event_ID not set\"); }\r\n}",
"function total_donation_amount($campaign_id) \n { \n $sql = \"SELECT amount FROM payment WHERE campaign_id = ? \"; \n\t $query = $this->db->query($sql,$campaign_id); \n\t if($query->num_rows())\n\t { \n\t foreach($query->result_array() as $r) \n\t { \n\t\t $amount[] = $r['amount']; \n\t\t }\n\t\t return array_sum($amount); \n\t}\n }",
"public function GetTotalEarningAdmin() {\n\n try {\n\n $sqlQuery = \"select sum(`total_fare`) from `\".self::table_ride.\"` where `status`='2'\";\n\n $result = $this->connect->query($sqlQuery);\n\n if($result->num_rows>0) {\n\n $row = $result->fetch_assoc();\n\n }\n \n\n return $row;\n\n } catch(Exception $e) {\n\n return $e;\n\n }\n\n }",
"function getPotentialAmount(){\n\t\t\t$account_no = \"potentialMoney\";\n\t\t\t//getting money transfer details from database\n\t\t\t$transaction = $this->manageContent->getValueWhere_descending(\"money_transfer_log\",\"*\",\"membership_id\",$account_no);\n\t\t\tif(!empty($transaction))\n\t\t\t{\n\t\t\t\t//initialize the variables\n\t\t\t\t$sl_no = 1;\n\t\t\t\t$total_amount = 0;\n\t\t\t\tforeach($transaction as $transactions){\n\t\t\t\t\t//checking for only debited amount\n\t\t\t\t\tif(!empty($transactions['debit']))\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//checking for membership product or not\n\t\t\t\t\t\tif(substr($transactions['product_id'],0,2) == 'M_')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"membership_product\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(substr($transactions['product_id'],0,1) == 'C')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$coupon_details = $this->manageContent->getValueWhere(\"coupon_table\",\"*\",\"coupon_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $coupon_details[0]['coupon_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"product_table\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//getting member details\n\t\t\t\t\t\t$memberDetails = $this->manageContent->getValueWhere(\"member_table\",\"*\",\"membership_id\",$transactions['notes']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//showing the details of money debited in detail\n\t\t\t\t\t\techo '<tr>\n\t\t\t\t\t\t\t\t<td>'.$sl_no.'</td>\n\t\t\t\t\t\t\t\t<td>'.$memberDetails[0]['name'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$product_name.'</td>\n\t\t\t\t\t\t\t\t<td>'.$transactions['product_quantity'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$this->changeDateFormat($transactions['date']).'</td>\n\t\t\t\t\t\t\t\t<td> € '.$transactions['debit'].'</td>\n\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// total amount calculation\n\t\t\t\t\t\t\t$total_amount = $total_amount + $transactions['debit'];\n\t\t\t\t\t\t\t//increment of serial_no variable\n\t\t\t\t\t\t\t$sl_no++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $total_amount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}",
"function totalAmountOfExpenses($table_name)\r\n {\r\n include \"conn.php\";\r\n $sql= \"SELECT SUM(amount) AS total FROM $table_name WHERE deleted= 0 AND userid= '$_SESSION[id]'\";\r\n $result= mysqli_query($conn, $sql);\r\n \r\n $total= mysqli_fetch_assoc($result);\r\n return $total['total'];\r\n }",
"public function getTotalDue(){\n return $this->_get(self::TOTAL_DUE);\n }",
"public function cash_sum($id){\n $this->db->select_sum('member_cash');\n $this->db->from('member');\n $this->db->where('event_id', $id);\n $query = $this->db->get();\n $row = $query->row_array();\n return $row['member_cash'];\n }",
"public function totalValue()\n {\n $result = $this->attributes['money'];\n\n $result += $this->garages()->leftJoin('garage_models', 'garages.garage_model_id', '=', 'garage_models.id')->sum('garage_models.price');\n $result += $this->trucks()->leftJoin('truck_models', 'trucks.truck_model_id', '=', 'truck_models.id')->sum('truck_models.price');\n $result += $this->trailers()->leftJoin('trailer_models', 'trailers.trailer_model_id', '=', 'trailer_models.id')->sum('trailer_models.price');\n\n $bankLoans = $this->bankLoans()->with('bankLoanType')->get();\n\n $result -= $bankLoans->reduce(function ($carry, $item) {\n /** @var BankLoanType $bankLoanType */\n $bankLoanType = $item->bankLoanType;\n return $carry += ($bankLoanType->period - $item->paid) * $bankLoanType->payment;\n }, 0);\n\n return $result;\n }",
"function invoiceTotal() {\n $amount = 0;\n foreach($this->invoice as $codekey => $codeval) {\n $amount += $codeval['chg'];\n }\n return sprintf('%.2f', $amount);\n }",
"function Fetch_Balance_Total_By_Event_Names($application_id, $event_names, $event_types = null)\n{\n\tsettype($application_id, 'integer');\n\t$db = ECash::getMasterDb();\n\t$event_type_where = '';\n\t$event_names_list = \"('\" . implode(\"','\",$event_names) . \"')\";\n\n\tif (is_array($event_types) && sizeof($event_types>0))\n\t{\n\t\t$event_types_list = \"('\" . implode(\"','\", $event_types). \"')\";\n\t\t$event_type_where = \"AND eat.name_short IN {$event_types_list}\";\n\t}\n\t$query = \"-- eCash 3.0, File: \" . __FILE__ . \", Method: \" . __METHOD__ . \", Line: \" . __LINE__ . \"\n\t\tSELECT\n\t\t\t\tSUM(IF( tr.transaction_status IN ('complete', 'pending') {$event_type_where}, ea.amount, 0)) total_amount\n\t\tFROM\tevent_amount AS ea\n\t\tJOIN \tevent_amount_type AS eat USING (event_amount_type_id)\n\t\tJOIN \tevent_schedule AS es ON es.event_schedule_id = ea.event_schedule_id\n\t\tJOIN \tevent_type AS et ON et.event_type_id = es.event_type_id\n\t\tJOIN \ttransaction_register AS tr ON tr.event_schedule_id = es.event_schedule_id\n\t\tWHERE\n\t\t\t\tea.application_id = $application_id\n\t\tAND\n\t\t\t\tet.name_short IN $event_names_list \";\n\n\n $result = $db->query($query);\n\n if ($row = $result->fetch(PDO::FETCH_OBJ))\n\t\treturn $row->total_amount;\n\telse\n\t\treturn 0;\n}",
"function calculate_due_amount()\n {\n\n $db = JFactory::getDBO();\n \n $party_id = intval(JRequest::getVar(\"party_id\"));\n $type = JRequest::getVar(\"type\");\n \n if($type == 'c')\n {\n $query = \"select sum(bill_amount - amount_paid) from `#__sales_invoice` where customer_id=\" . $party_id . \" and status=\" . UNPAID . \" and (bill_amount - amount_paid) > 0\";\n }\n else if($type == 's')\n {\n $query = \"select sum(bill_amount - amount_paid) from `#__purchase_invoice` where supplier_id=\" . $party_id . \" and status=\" . UNPAID . \" and (bill_amount - amount_paid) > 0\";\n }\n else if($type == 't')\n {\n $query = \"select sum(transportation_amount - transportation_amount_paid) from `#__purchase_invoice` where transporter_id=\" . $party_id . \" and transporter_payment_mode=\" . CREDIT . \" and (transportation_amount - transportation_amount_paid) > 0\";\n }\n \n $db->setQuery($query);\n $amount_due = floatval($db->loadResult());\n \n echo $amount_due;\n }",
"function get_event_total($event)\n {\n $this->db->from('cadetEvent');\n $query = $this->db->where($event, 1);\n return $query->count_all_results();\n }",
"public function getDutiableAmount();",
"function calculateTotalDiscount() {\t\t\t\n\t\t$user = & JFactory::getUser();\n\t\t$db = & JFactory::getDBO();\n\t\t$nullDate = $db->getNullDate();\n\t\t$events = $this->getEvents();\t\t\t\n\t\t$totalDiscount = 0 ;\n\t\tfor ($i = 0 , $n = count($events) ; $i < $n ; $i++) {\n\t\t\t$event = $events[$i] ;\n\t\t\t$registrantTotalAmount = $event->rate*$event->quantity ;\n\t\t\t$registrantDiscount = 0 ;\n\t\t\t//Member discount\n\t\t\tif ($user->get('id')) {\n\t\t\t\tif ($event->discount > 0) {\n\t\t\t\t\tif ($event->discount_type == 1) {\n\t\t\t\t\t\t$registrantDiscount = $registrantTotalAmount*$event->discount/100 ;\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$registrantDiscount = $event->quantity*$event->discount ;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\t//Calculate the coupon discount\n\t\t\tif (isset($_SESSION['coupon_id'])) {\n\t\t\t\t$sql = 'SELECT * FROM #__eb_coupons WHERE id='.(int)$_SESSION['coupon_id'];\n\t\t\t\t$db->setQuery($sql) ;\n\t\t\t\t$coupon = $db->loadObject();\n\t\t\t\tif ($coupon && ($coupon->event_id == 0 || $coupon->event_id == $event->id)) {\n\t\t\t\t\tif ($coupon->coupon_type == 0) {\n\t\t\t\t\t\t$registrantDiscount += $registrantTotalAmount*$coupon->discount/100 ; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$registrantDiscount += $registrantDiscount + $coupon->discount ;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\t\n\t\t\t//Early bird discount\n\t\t\tif (($event->early_bird_discount_amount > 0) && ($event->early_bird_discount_date != $nullDate) && (strtotime($event->early_bird_discount_date)>= mktime())) {\t\t\t\t\t\n\t\t\t\tif ($event->early_bird_discount_type == 1) {\n\t\t\t\t\t$registrantDiscount += $registrantTotalAmount*$event->early_bird_discount_amount/100 ;\t\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$registrantDiscount += $event->quantity*$event->early_bird_discount_amount ;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\t\n\t\t\t$totalDiscount += $registrantDiscount ;\n\t\t}\n\t\treturn $totalDiscount ;\t\n\t}",
"public function getDonationTotal() {\n\t\treturn $this -> data['donationTotal'];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to ensure support for handling facets and number of facet terms in search requests. | function testFacet()
{
$facetName = 'dc.title';
$numFacets = 1;
$searchRequest = $this->requestFactory->getSearchRequest();
$searchRequest->setQuery('dc.title:danmark');
$searchRequest->setFacets($facetName);
$searchRequest->setNumFacets($numFacets);
$searchResult = $this->client->execute($searchRequest);
$this->assertNoErrors('Search should not throw errors');
$searchFacetFound = false;
$facetResults = $searchResult->facets;
$this->assertEqual(sizeof($facetResults), 1, 'Search should return 1 facet');
$facet = array_shift($facetResults);
$this->assertEqual($facet->name, $facetName, 'Expected facet used in search was not part of search result');
$this->assertEqual(sizeof($facet->terms), $numFacets, 'Returned number of facet terms does not match expected number');
} | [
"public function testFacets() {\r\n\t\t$dataProvider = new ASolrDataProvider(\"ASolrDocument\");\r\n\t\t$criteria = $dataProvider->getCriteria();\r\n\t\t$criteria->setQuery(\"name:test\");\r\n\t\t$criteria->facet = true;\r\n\t\t$criteria->addFacetField(\"name\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[* TO 10]\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[10 TO 20]\");\r\n\t\t$criteria->addFacetQuery(\"popularity:[20 TO *]\");\r\n\t\t$this->assertGreaterThan(54, $dataProvider->getTotalItemCount());\r\n\t\t$fieldFacets = $dataProvider->getFieldFacets();\r\n\t\t$this->assertTrue(isset($fieldFacets->name));\r\n\t\t$this->assertTrue($fieldFacets->name instanceof ASolrFacet);\r\n\t\t$this->assertTrue(isset($fieldFacets->name['test']));\r\n\t\t$this->assertGreaterThan(54, $fieldFacets->name['test']);\r\n\r\n\t\t$queryFacets = $dataProvider->getQueryFacets();\r\n\t\t$this->assertTrue(isset($queryFacets[\"popularity:[* TO 10]\"]));\r\n\t\t$this->assertGreaterThan(10, $queryFacets[\"popularity:[* TO 10]\"]['value']);\r\n\t}",
"public function testMultipleFacets() {\n // Create 2 facets.\n $this->createFacet('Snow Owl', 'snow_owl');\n // Clear all the caches between building the 2 facets - because things fail\n // otherwise.\n $this->resetAll();\n $this->createFacet('Forest Owl', 'forest_owl', 'category');\n\n // Make sure numbers are displayed.\n $edit = [\n 'widget_config[show_numbers]' => 1,\n 'facet_settings[min_count]' => 1,\n ];\n $this->drupalGet('admin/config/search/facets/snow_owl/edit');\n $this->submitForm($edit, 'Save');\n $this->drupalGet('admin/config/search/facets/forest_owl/edit');\n $this->submitForm($edit, 'Save');\n\n // Go to the view and check the default behavior.\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('Displaying 5 search results');\n $this->assertFacetLabel('item (3)');\n $this->assertFacetLabel('article (2)');\n $this->assertFacetLabel('item_category (2)');\n $this->assertFacetLabel('article_category (2)');\n\n // Start filtering.\n $this->clickPartialLink('item_category');\n $this->assertSession()->pageTextContains('Displaying 2 search results');\n $this->checkFacetIsActive('item_category');\n $this->assertFacetLabel('item (2)');\n\n // Go back to the overview and start another filter, from the second facet\n // block this time.\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('Displaying 5 search results');\n $this->clickPartialLink('article (2)');\n $this->assertSession()->pageTextContains('Displaying 2 search results');\n $this->checkFacetIsActive('article');\n $this->assertFacetLabel('article_category (2)');\n // As min_count=1 and query_operator='and' we expect zero-result\n // item_category to be hidden, see testMultipleFacets().\n $this->assertSession()->pageTextNotContains('item_category');\n }",
"public function testNoFacetCountError()\n {\n\n set_option('solr_search_facet_limit', '25');\n\n // Missing facet length.\n $this->request->setMethod('POST')->setPost(array(\n 'solr_search_facet_limit' => ''\n ));\n\n $this->dispatch('solr-search/results');\n\n // Should not set option.\n $this->assertEquals('25', get_option('solr_search_facet_limit'));\n\n // Should flash error.\n $this->_assertFormError('solr_search_facet_limit');\n\n }",
"public function testMultipleFacets() {\n // Create 2 facets.\n $this->createFacet('Snow Owl', 'snow_owl', 'type', static::VIEW_DISPLAY);\n $this->createFacet('Forest Owl', 'forest_owl', 'category', static::VIEW_DISPLAY);\n\n foreach (['snow_owl', 'forest_owl'] as $facet_id) {\n $this->updateFacet($facet_id, ['min_count' => 0]);\n }\n\n // Go to the view and check the default behavior.\n $this->drupalGet(static::VIEW_URL);\n $this->assertSession()->pageTextContains('Displaying 5 search results');\n $this->assertFacetLabel('item (3)');\n $this->assertFacetLabel('article (2)');\n $this->assertFacetLabel('item_category (2)');\n $this->assertFacetLabel('article_category (2)');\n\n // Start filtering.\n $this->clickPartialLink('item_category');\n $this->assertSession()->pageTextContains('Displaying 2 search results');\n $this->checkFacetIsActive('item_category');\n $this->assertFacetLabel('item (2)');\n\n // Go back to the overview and start another filter, from the second facet\n // block this time.\n $this->drupalGet(static::VIEW_URL);\n $this->assertSession()->pageTextContains('Displaying 5 search results');\n $this->clickPartialLink('article (2)');\n $this->assertSession()->pageTextContains('Displaying 2 search results');\n $this->checkFacetIsActive('article');\n $this->assertFacetLabel('article_category (2)');\n $this->assertFacetLabel('item_category (0)');\n }",
"public function testMultipleFacets() {\n // Create facets.\n $this->createFacet('Giraffe', 'giraffe', 'keywords');\n // Clear all the caches between building the 2 facets - because things fail\n // otherwise.\n $this->resetAll();\n $this->createFacet('Llama', 'llama');\n\n // Add a summary.\n $values = [\n 'name' => 'Owlß',\n 'id' => 'owl',\n 'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',\n ];\n $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');\n $this->drupalPostForm(NULL, [], 'Save');\n\n // Edit the summary and enable the giraffe's.\n $summaries = [\n 'facets[giraffe][checked]' => TRUE,\n 'facets[giraffe][label]' => 'Summary giraffe',\n ];\n $this->drupalPostForm('admin/config/search/facets/facet-summary/owl/edit', $summaries, 'Save');\n\n $block = [\n 'region' => 'footer',\n 'id' => str_replace('_', '-', 'owl'),\n 'weight' => 50,\n ];\n $block = $this->drupalPlaceBlock('facets_summary_block:owl', $block);\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertText('Displaying 5 search results');\n $this->assertText($block->label());\n $this->assertFacetBlocksAppear();\n\n $this->clickLink('apple');\n $list_items = $this->getSession()\n ->getPage()\n ->findById('block-' . $block->id())\n ->findAll('css', 'li');\n $this->assertCount(1, $list_items);\n\n $this->clickLink('item');\n $list_items = $this->getSession()\n ->getPage()\n ->findById('block-' . $block->id())\n ->findAll('css', 'li');\n $this->assertCount(1, $list_items);\n\n // Edit the summary and enable the giraffe's.\n $summaries = [\n 'facets[giraffe][checked]' => TRUE,\n 'facets[giraffe][label]' => 'Summary giraffe',\n 'facets[llama][checked]' => TRUE,\n 'facets[llama][label]' => 'Summary llama',\n ];\n $this->drupalPostForm('admin/config/search/facets/facet-summary/owl/edit', $summaries, 'Save');\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertText('Displaying 5 search results');\n $this->assertText($block->label());\n $this->assertFacetBlocksAppear();\n\n $this->clickLink('apple');\n $list_items = $this->getSession()\n ->getPage()\n ->findById('block-' . $block->id())\n ->findAll('css', 'li');\n $this->assertCount(1, $list_items);\n\n $this->clickLink('item');\n $list_items = $this->getSession()\n ->getPage()\n ->findById('block-' . $block->id())\n ->findAll('css', 'li');\n $this->assertCount(2, $list_items);\n\n $this->checkShowCountProcessor();\n $this->checkResetFacetsProcessor();\n }",
"public function testFacetedSearch() {\n\t\t$connection = new ASolrConnection();\n\t\t$connection->clientOptions->hostname = SOLR_HOSTNAME;\n\t\t$connection->clientOptions->port = SOLR_PORT;\n\t\t$connection->clientOptions->path = SOLR_PATH;\n\t\t$doc = new SolrInputDocument();\n\n\t\t$doc->addField('id', 334455);\n\t\t$doc->addField('cat', 'Software');\n\t\t$doc->addField('cat', 'Lucene');\n\t\t$doc->addField(\"popularity\",20);\n\t\t$doc->addField(\"incubationdate_dt\",date(\"Y-m-d\\TH:i:s\\Z\"));\n\t\t$this->assertTrue($connection->index($doc));\n\t\t$this->assertTrue($connection->commit());\n\t\t$criteria = new ASolrCriteria;\n\t\t$criteria->query = \"lucene\";\n\t\t$criteria->offset = 0;\n\t\t$criteria->limit = 10;\n\t\t$criteria->facet = true;\n\t\t$criteria->addFacetField(\"cat\")->addFacetField(\"name\");\n\t\t$criteria->addFacetDateField(\"incubationdate_dt\");\n\t\t$criteria->facetDateStart = \"2005-10-10T00:00:00Z\";\n\t\t$criteria->facetDateEnd = \"2015-10-10T00:00:00Z\";\n\t\t$criteria->facetDateGap = \"+12MONTH\";\n\t\t$criteria->addFacetQuery(\"popularity:[* TO 10]\");\n\t\t$criteria->addFacetQuery(\"popularity:[10 TO 20]\");\n\t\t$criteria->addFacetQuery(\"popularity:[20 TO *]\");\n\n\t\t$response = $connection->search($criteria);\n\t\t$this->assertTrue($response instanceof ASolrQueryResponse);\n\t\t$this->assertTrue(isset($response->getDateFacets()->incubationdate_dt));\n\t\t$this->assertTrue($response->getDateFacets()->incubationdate_dt instanceof ASolrFacet);\n\n\t\t$results = $response->getResults();\n\t\t$this->assertTrue(count($results) > 0);\n\t\tforeach($results as $n => $result) {\n\t\t\t$this->assertEquals($n, $result->getPosition());\n\t\t}\n\t\t$this->assertTrue($connection->delete(334455));\n\t\t$this->assertTrue($connection->commit());\n\t}",
"function parse_facet() {\n // TODO: We should probably do some validation here\n // Handle normal faceting. This comes in the form of http://...&facet=langauge\n if (!empty($this->http_request->params['facet'][0])) {\n $facets = array();\n foreach ($this->http_request->params['facet'] as $facet) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.mincount'] = 1;\n\n if (!empty($this->http_request->params['facet_limit_' . $facet][0])) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.limit'] = $this->http_request->params['facet_limit_' . $facet][0];\n }\n }\n $this->solr_data_store_request->params['facet.field'] = $this->http_request->params['facet'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n\n // Handle facet query faceting. This comes in the form of http://...&facet_query=circ_fac_score:[2 TO *]\n if (!empty($this->http_request->params['facet_query'][0])) { \n $this->solr_data_store_request->params['facet.query'] = $this->http_request->params['facet_query'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n }",
"public function testInvalidFacetCountError()\n {\n\n set_option('solr_search_facet_limit', '25');\n\n // Invalid facet limit.\n $this->request->setMethod('POST')->setPost(array(\n 'solr_search_facet_limit' => 'invalid'\n ));\n\n $this->dispatch('solr-search/results');\n\n // Should not set option.\n $this->assertEquals('25', get_option('solr_search_facet_limit'));\n\n // Should flash error.\n $this->_assertFormError('solr_search_facet_limit');\n\n }",
"public function testUnwantedValues() {\n // Go to the Add facet page and make sure that returns a 200.\n $facet_add_page = '/admin/config/search/facets/add-facet';\n $this->drupalGet($facet_add_page);\n $this->assertSession()->statusCodeEquals(200);\n\n // Configure the facet source by selecting one of the Search API views.\n $this->drupalGet($facet_add_page);\n $this->submitForm(['facet_source_id' => 'search_api:views_page__search_api_test_view__page_1'], 'Configure facet source');\n\n // Fill in all fields and make sure the 'field is required' message is no\n // longer shown.\n $facet_source_form = [\n 'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',\n 'facet_source_configs[search_api:views_page__search_api_test_view__page_1][field_identifier]' => 'type',\n ];\n $this->submitForm($facet_source_form, 'Save');\n\n $form_values = [\n 'name' => 'name 1',\n 'id' => 'name 1',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->pageTextContains('The machine-readable name must contain only lowercase letters, numbers, and underscores.');\n\n $form_values = [\n 'name' => 'name 1',\n 'id' => 'name:&1',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->pageTextContains('The machine-readable name must contain only lowercase letters, numbers, and underscores.');\n\n // Post the form with valid values, so we can test the next step.\n $form_values = [\n 'name' => 'name 1',\n 'id' => 'name_1',\n ];\n $this->submitForm($form_values, 'Save');\n\n // Create an array of values that are not allowed in the url.\n $unwanted_values = [' ', '!', '@', '#', '$', '%', '^', '&'];\n foreach ($unwanted_values as $unwanted_value) {\n $form_values = [\n 'facet_settings[url_alias]' => 'alias' . $unwanted_value . '1',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->pageTextContains('The URL alias contains characters that are not allowed.');\n }\n\n // Post an alias with allowed values.\n $form_values = [\n 'facet_settings[url_alias]' => 'alias~-_.1',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->pageTextContains('Facet name 1 has been updated.');\n }",
"public function testFacetBuild()\n {\n $context = new SearchContext(\n [\n 'config' => $config = new SearchConfig(\n [\n 'itemsPerPage' => 20\n ]\n ),\n 'page' => 1,\n 'query' => [\n 'foo' => 'bar',\n 'filter' => [\n 'foobar' => 'bestit'\n ]\n ],\n 'language' => 'en'\n ]\n );\n\n $sortingCollection = new SortingCollection(\n [\n new Sorting('name_desc', 'name_desc', 'name desc'),\n $active = new Sorting('name_asc', 'name_asc', 'name asc'),\n $default = new Sorting('price_asc', 'price_asc', 'price asc'),\n ]\n );\n\n $sortingCollection->setActive($active);\n $sortingCollection->setDefault($default);\n\n $this->facetConfigCollection->add(\n $facetConfig = (new FacetConfig())\n ->setName('foobar')\n ->setField('foobar')\n ->setAlias('foobar')\n ->setType(FacetType::TEXT)\n );\n\n $request = ProductProjectionSearchRequest::of()\n ->offset(($context->getPage() - 1) * $context->getConfig()->getItemsPerPage())\n ->limit($context->getConfig()->getItemsPerPage())\n ->sort('name asc')\n ->markMatchingVariants(false);\n\n $builder = new FacetBuilder($this->facetConfigCollection);\n $resolvedValues = $builder->resolve($context->getQuery()['filter']);\n\n $request = $builder->build($request, $context, $resolvedValues);\n\n $this->eventDispatcher\n ->expects(static::once())\n ->method('dispatch')\n ->with(\n static::equalTo(FilterEvent::PRODUCTS_REQUEST_POST),\n static::isInstanceOf(ProductProjectionSearchRequestEvent::class)\n );\n\n $this->client\n ->expects(self::once())\n ->method('execute')\n ->with(self::equalTo($request))\n ->willReturn($response = $this->createMock(PagedSearchResponse::class));\n\n static::assertEquals($response, $this->fixture->execute($context, $sortingCollection));\n }",
"public function testFramework() {\n $facet_name = \"Test Facet name\";\n $facet_id = 'test_facet_name';\n\n // Check if the overview is empty.\n $this->checkEmptyOverview();\n\n // Add a new facet and edit it. Check adding a duplicate.\n $this->addFacet($facet_name);\n $this->editFacet($facet_name);\n $this->addFacetDuplicate($facet_name);\n\n // By default, the view should show all entities.\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('Displaying 5 search results');\n\n // Create and place a block for \"Test Facet name\" facet.\n $this->blocks[$facet_id] = $this->createBlock($facet_id);\n\n // Verify that the facet results are correct.\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('item');\n $this->assertSession()->pageTextContains('article');\n\n // Verify that facet blocks appear as expected.\n $this->assertFacetBlocksAppear();\n\n // Verify that the facet only shows when the facet source is visible, it\n // should not show up on the user page.\n $this->setOptionShowOnlyWhenFacetSourceVisible($facet_name);\n $this->drupalGet('user/2');\n $this->assertNoFacetBlocksAppear();\n\n // Do not show the block on empty behaviors.\n $this->clearIndex();\n $this->drupalGet('search-api-test-fulltext');\n\n // Verify that no facet blocks appear. Empty behavior \"None\" is selected by\n // default.\n $this->assertNoFacetBlocksAppear();\n\n // Verify that the \"empty_text\" appears as expected.\n $this->setEmptyBehaviorFacetText($facet_name);\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->responseContains('block-test-facet-name');\n $this->assertSession()->responseContains('No results found for this block!');\n\n // Delete the block.\n $this->deleteBlock($facet_id);\n\n // Delete the facet and make sure the overview is empty again.\n $this->deleteUnusedFacet($facet_name);\n $this->checkEmptyOverview();\n }",
"function prepareFacets()\n {\n // load facet data\n if ($this->isTaxonomyAttribute())\n {\n $facetGenerator = $this->dieselSearchHelper->dieselSearch()->getGeneratorObject(true);\n // determine \"open branch\"\n $cVal = $this->path();\n if ($cVal)\n {\n $openToBuf = new Java('com.dieselpoint.util.FastStringBuffer', $cVal);\n }\n else if ($this->defaultTreePosition)\n {\n $openToBuf = new Java('com.dieselpoint.util.FastStringBuffer', $this->defaultTreePosition);\n }\n else\n {\n $openToBuf = new Java('com.dieselpoint.util.FastStringBuffer', '');\n }\n // determine tree root\n if ($this->facetStyle == WFDieselFacet::STYLE_TREE)\n {\n if ($this->treeDataPath)\n {\n $treeRootPath = ($this->treeRoot ? $this->treeRoot . \"\\t\" . $this->treeDataPath : $this->treeDataPath);\n $treeRootBuf = new Java('com.dieselpoint.util.FastStringBuffer', $treeRootPath);\n }\n else\n {\n $treeRootBuf = new Java('com.dieselpoint.util.FastStringBuffer', ($this->treeRoot ? $this->treeRoot : \"\"));\n }\n }\n else\n {\n $treeRootBuf = new Java('com.dieselpoint.util.FastStringBuffer', $cVal ? $cVal : \"\");\n }\n if ($this->dieselSearchHelper->dieselSearch()->logPerformanceInfo()) $this->dieselSearchHelper->dieselSearch()->startTrackingTime();\n //$facets = $facetGenerator->getTaxonomyTree($this->attributeID, $openToBuf, $treeRootBuf, $this->maxHits); // built-in facetgenerator\n $facets = $facetGenerator->getTaxonomyTree($this->attributeID, $treeRootBuf, 3, $this->maxHits); // mouser facetgenerator (handles multiple depths)\n if ($this->dieselSearchHelper->dieselSearch()->logPerformanceInfo()) $this->dieselSearchHelper->dieselSearch()->stopTrackingTime(\"Generating facet with getTaxonomyTree(\\\"{$this->attributeID}\\\", \\\"{$openToBuf}\\\", \\\"{$treeRootBuf}\\\", {$this->maxHits}) for {$this->id}\");\n if (count($facets) == 1 and $facets[0]->getAttributeValue()->equals('')) // needed to extract facets from trees\n {\n $facets = $facets[0]->getChildren();\n }\n if (!$facets)\n {\n $facets = array();\n }\n //print \"OTB: $openToBuf, TRB: $treeRootBuf<BR>\";\n //if ($this->attributeID == 'location') $this->printAttributeValue($facets);\n// //print \"Tree has \" . $tree->length() . \" items.<BR>\\n\";\n// if (count($tree) == 1)\n// {\n// //print \"Tree has 1 item: p/v/c: \" . $tree[0]->getPath() . \" / \" . $tree[0]->getAttributeValue() . ' / ' . count($tree[0]->getChildren()) . \"<BR>\\n\";\n// if ($tree[0]->getAttributeValue()->equals(\"\"))\n// {\n// $facets = $tree[0]->getChildren();\n// if (!$facets) $facets = array();\n// }\n// else\n// {\n// $facets = $tree;\n// }\n// }\n// else if (count($tree) == 0)\n// {\n// print \"Tree has 0 items: \";\n// $facets = array();\n// }\n// else\n// {\n// throw( new Exception(\"Tree has more than one item at root... what does this mean?\") );\n// }\n }\n else\n {\n $facetGenerator = $this->dieselSearchHelper->dieselSearch()->getGeneratorObject();\n if ($this->rangeCount)\n {\n $facetGenerator->setRangeCount($this->rangeCount);\n }\n if ($this->dieselSearchHelper->dieselSearch()->logPerformanceInfo()) $this->dieselSearchHelper->dieselSearch()->startTrackingTime();\n $facets = $facetGenerator->getList($this->attributeID, $this->maxRows, $this->sortByFrequency, $this->maxHits);\n if ($this->dieselSearchHelper->dieselSearch()->logPerformanceInfo()) $this->dieselSearchHelper->dieselSearch()->stopTrackingTime(\"Generating facet with getList(\\\"{$this->attributeID}\\\", {$this->maxRows}, \" . ($this->sortByFrequency ? 'true' : 'false') . \", {$this->maxHits}) for {$this->id}\");\n }\n return $facets;\n }",
"protected function buildFacets(): void\n {\n $facets = $this->clientQuery->getFacetSet();\n // Facets should be set from the index configuration\n foreach ($this->index->getFacetFields() as $class => $config) {\n $shortClass = getShortFieldName($config['BaseClass']);\n $field = $shortClass . '_' . str_replace('.', '_', $config['Field']);\n /** @var Field $facet */\n $facet = $facets->createFacetField('facet-' . $config['Title']);\n $facet->setField($field);\n }\n // Count however, comes from the query\n $facets->setMinCount($this->query->getFacetsMinCount());\n }",
"public function testExcludeFacet() {\n $facet_name = 'test & facet';\n $facet_id = 'test_facet';\n $facet_edit_page = 'admin/config/search/facets/' . $facet_id . '/edit';\n $this->createFacet($facet_name, $facet_id);\n\n $this->drupalGet($facet_edit_page);\n $this->assertSession()->checkboxNotChecked('edit-facet-settings-exclude');\n $this->submitForm(['facet_settings[exclude]' => TRUE], 'Save');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->checkboxChecked('edit-facet-settings-exclude');\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('foo bar baz');\n $this->assertSession()->pageTextContains('foo baz');\n $this->assertFacetLabel('item');\n\n $this->clickLink('item');\n $this->checkFacetIsActive('item');\n $this->assertSession()->pageTextContains('foo baz');\n $this->assertSession()->pageTextContains('bar baz');\n $this->assertSession()->pageTextNotContains('foo bar baz');\n\n $this->drupalGet($facet_edit_page);\n $this->submitForm(['facet_settings[exclude]' => FALSE], 'Save');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->checkboxNotChecked('edit-facet-settings-exclude');\n\n $this->drupalGet('search-api-test-fulltext');\n $this->assertSession()->pageTextContains('foo bar baz');\n $this->assertSession()->pageTextContains('foo baz');\n $this->assertFacetLabel('item');\n\n $this->clickLink('item');\n $this->checkFacetIsActive('item');\n $this->assertSession()->pageTextContains('foo bar baz');\n $this->assertSession()->pageTextContains('foo test');\n $this->assertSession()->pageTextContains('bar');\n $this->assertSession()->pageTextNotContains('foo baz');\n }",
"public function testSearchTermsByGet() {\n $this->markTestIncomplete('This test has not been implemented.');\n }",
"public function testNoEnabledFacets() {\n $facetManager = $this->prophesize(DefaultFacetManager::class)\n ->reveal();\n $etm = $this->prophesize(EntityTypeManagerInterface::class)\n ->reveal();\n $configuration = ['owl' => ['enable' => FALSE, 'condition' => 'not_empty']];\n $dfp = new DependentFacetProcessor($configuration, 'dependent_facet_processor', [], $facetManager, $etm);\n\n $facet = new Facet(['id' => 'owl', 'name' => 'øwl'], 'facets_facet');\n\n $computed = $dfp->build($facet, $this->results);\n $this->assertEquals($computed, $this->results);\n }",
"function _edan_custom_search_process_facets($facets, $args) {\n $out = array();\n\n $uri = _edan_args_to_query($args);\n\n // TODO: Dates, Ranges, Queries\n\n if (isset($facets) && is_array($facets)) {\n foreach ($facets as $field => $vals) {\n if (count($vals) < 1 || $field == 'docFldUsed') {\n continue;\n }\n\n $out['fields'][$field] = _edan_custom_search_process_facets_fields($vals, $uri);\n }\n }\n\n return $out;\n}",
"function faceting($connector)\n{\n $request = $connector->search('food');\n\n $request->resultsOptions()\n ->addDistinctFacet('Organic', 'Organic')\n ->addDistinctFacet('Category', 'Category');\n // CODE SAMPLE END\n\n // CODE SAMPLE faceting-distinct-facet BEGIN\n $request->resultsOptions()\n ->addDistinctFacet('Manufacturer', 'Manufacturer', ['Early']);\n // CODE SAMPLE END\n\n // CODE SAMPLE faceting-range-facet BEGIN\n $request->resultsOptions()\n ->addRangeFacet('Price', 'Price', 10, 60);\n // CODE SAMPLE END\n\n $response = $connector->query($request);\n\n echo 'Facets of interest:' . PHP_EOL;\n // CODE SAMPLE render-distinct-facets BEGIN\n $distinctFacetsToDisplay = ['Manufacturer', 'Category', 'Organic'];\n $facets = $response->getFacets();\n foreach ($facets as $facet) {\n if (in_array($facet['name'], $distinctFacetsToDisplay)) {\n echo $facet['name'] . ': ' . PHP_EOL;\n foreach ($facet['items'] as $option) {\n echo ' [' . ($option->selected ? 'X' : ' ') . '] '\n . $option->item . ' (' . $option->count . ')' . PHP_EOL;\n }\n }\n }\n // CODE SAMPLE END\n}",
"function apachesolr_check_facetapi() {\n if (!module_exists('facetapi')) {\n $filename = db_query_range(\"SELECT filename FROM {system} WHERE type = 'module' AND name = 'facetapi'\", 0, 1)\n ->fetchField();\n if ($filename && file_exists($filename)) {\n drupal_set_message(t('If you <a href=\"@modules\">enable the facetapi module</a>, Apache Solr Search will provide you with configurable facets.', array('@modules' => url('admin/modules'))));\n }\n else {\n drupal_set_message(t('If you install the facetapi module from !href, Apache Solr Search will provide you with configurable facets.', array('!href' => url('http://drupal.org/project/facetapi'))));\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new DOMWrapper. \param [in] $node The DOMNode to wrap. \param [in] $filter Optional. A filter to apply when iterating over the children of \em node. May be boolean or a string. If boolean \em true means that all children which are not DOMElements will be automatically skipped. If \em false all DOMNodes which are children of \em node will be iterated. If a string, all children which are not DOMElements will automatically be skipped, and in addition all DOMElements which do not have the tag name specified by the filter will be skipped. Defaults to \em true. | public function __construct (\DOMNode $node, $filter=true) {
$this->root=$node;
$this->filter=is_bool($filter) ? $filter : StringUtil::ToLower($filter);
$this->rewind();
} | [
"public function addNodeFilter(TreeWalkerFilterInterface $filter)\n {\n if (!in_array($filter, $this->nodeFilters)) {\n $this->nodeFilters[] = $filter;\n }\n }",
"private function sanitizeNode(DOMNode $node)\n {\n // Traverse the nodes, without foreach because nodes may be removed\n $child = (!empty($node->childNodes) && $node->childNodes->length > 0) ? $node->childNodes->item(0) : null;\n while ($child !== null)\n {\n $tag = $child->nodeName;\n\n // Allow text nodes\n if ($tag === \"#text\")\n {\n $child = $child->nextSibling;\n continue;\n }\n\n if (isset($this->remove_tags[$tag]))\n {\n // Tag is on the list of nodes to fully remove including child nodes\n $remove = $child;\n $child = $child->nextSibling;\n $node->removeChild($remove);\n }\n elseif (!isset($this->allowed_tags[$tag]))\n {\n // Add the child nodes of the disalowed tag to the parent node in its place,\n // and move the pointer to the first inserted child node, or the next node.\n $child = $this->unwrapContents($node, $child);\n }\n else\n {\n // Sanitize the attributes of an allowed tag\n if ($child->attributes !== null)\n $this->sanitizeAttributes($child);\n\n // And now process the contents\n $this->sanitizeNode($child);\n\n // Finally, call a callback if applicable\n if (isset($this->tag_callback[$tag]))\n $this->tag_callback[$tag]($child);\n\n $child = $child->nextSibling;\n }\n }\n }",
"static function isolateNode($node){\n\t\t$dom = new DOMDocument;\n\t\tif(get_class($node) == 'DOMDocument'){//DOMDocument is not a node, so get primary element in document\n\t\t\t$node = $node->documentElement;\n\t\t}\n\t\t$dom->appendChild($dom->importNode($node,true));\n\t\treturn $dom;\n\t}",
"protected function processNode(\\DOMElement $element) {\r\n foreach ($element->childNodes as $node) {\r\n if (in_array($node->tagName, $this->childNodeFilters)) {\r\n //get a document name with basic stripping for valid name\r\n $documentName = strtolower(str_replace(array(' ', '.', '/', '\\\\', '&', ','), '', $node->nodeValue));\r\n if (!isset($this->feedWriters[$documentName])) {\r\n $fullPath = $this->outputDirectory . DIRECTORY_SEPARATOR . $documentName . \".xml\";\r\n $this->feedWriters[$documentName] = new FeedWriter($fullPath, $this->feedReader->rootNode);\r\n }\r\n $this->feedWriters[$documentName]->writeElementFromDOMElement($element);\r\n }\r\n }\r\n }",
"public static function recursive_force_closing_tags( $dom, $node = null ) {\n\t\t_deprecated_function( __METHOD__, '0.7' );\n\n\t\tif ( is_null( $node ) ) {\n\t\t\t$node = $dom->getElementsByTagName( 'body' )->item( 0 );\n\t\t}\n\n\t\tif ( XML_ELEMENT_NODE !== $node->nodeType ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( self::is_self_closing_tag( $node->nodeName ) ) {\n\t\t\t/*\n\t\t\t * Ensure there is no text content to accidentally force a child\n\t\t\t */\n\t\t\t$node->textContent = null;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( self::is_node_empty( $node ) ) {\n\t\t\t$text_node = $dom->createTextNode( '' );\n\t\t\t$node->appendChild( $text_node );\n\n\t\t\treturn;\n\t\t}\n\n\t\t$num_children = $node->childNodes->length;\n\t\tfor ( $i = $num_children - 1; $i >= 0; $i -- ) {\n\t\t\t$child = $node->childNodes->item( $i );\n\t\t\tself::recursive_force_closing_tags( $dom, $child );\n\t\t}\n\n\t}",
"protected function _filterNode($nodeList, $filter) {}",
"protected function node($node) {\n // A listing of types is at http://php.net/manual/en/dom.constants.php\n switch ($node->nodeType) {\n case XML_ELEMENT_NODE:\n $this->element($node);\n break;\n case XML_TEXT_NODE:\n $this->text($node);\n break;\n case XML_CDATA_SECTION_NODE:\n $this->cdata($node);\n break;\n // FIXME: It appears that the parser doesn't do PI's.\n case XML_PI_NODE:\n $this->processorInstruction($ele);\n break;\n case XML_COMMENT_NODE:\n $this->comment($node);\n break;\n // Currently we don't support embedding DTDs.\n default:\n print '<!-- Skipped -->';\n break;\n }\n }",
"function getFilteredChilds($a_filter,$a_node,$a_order = \"\",$a_direction = \"ASC\")\n\t{\n\t\t$childs = $this->getChilds($a_node,$a_order,$a_direction);\n\n\t\tforeach($childs as $child)\n\t\t{\n\t\t\tif(!in_array($child[\"type\"],$a_filter))\n\t\t\t{\n\t\t\t\t$filtered[] = $child;\n\t\t\t}\n\t\t}\n\t\treturn $filtered ? $filtered : array();\n\t}",
"public function getNodes($filter = NULL) {\n $names = self::filterNames($filter, $this->nodes);\n foreach($names as $name) {\n //OPTIMIZE: batch get nodes\n $result[] = $this->getNode($name);\n }\n return new jackalope_NodeIterator($result);\n }",
"public function initListObject(DOMElement $node) { return new XDTNodeList($node); }",
"public static function skipNodeAndChildren(DOMNode $node)\n {\n if ($node->nextSibling) {\n return $node->nextSibling;\n }\n\n if ($node->parentNode === null) {\n return null;\n }\n\n return self::skipNodeAndChildren($node->parentNode);\n }",
"public function makeFirstChildOf($node);",
"public static function get_content_from_dom_node( $dom, $node ) {\n\t\t/**\n\t\t * Self closing tags regex.\n\t\t *\n\t\t * @var string Regular expression to match self-closing tags\n\t\t * that saveXML() has generated a closing tag for.\n\t\t */\n\t\tstatic $self_closing_tags_regex;\n\n\t\t/*\n\t\t * Cache this regex so we don't have to recreate it every call.\n\t\t */\n\t\tif ( ! isset( $self_closing_tags_regex ) ) {\n\t\t\t$self_closing_tags = implode( '|', self::$self_closing_tags );\n\t\t\t$self_closing_tags_regex = \"#</({$self_closing_tags})>#i\";\n\t\t}\n\n\t\t$html = $dom->saveHTML( $node );\n\n\t\t// Whitespace just causes unit tests to fail... so whitespace begone.\n\t\tif ( '' === trim( $html ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Restore noscript elements which were temporarily removed to prevent libxml<2.8 parsing problems.\n\t\tif ( version_compare( LIBXML_DOTTED_VERSION, '2.8', '<' ) ) {\n\t\t\t$html = str_replace(\n\t\t\t\tarray_keys( self::$noscript_placeholder_comments ),\n\t\t\t\tarray_values( self::$noscript_placeholder_comments ),\n\t\t\t\t$html\n\t\t\t);\n\t\t}\n\n\t\t$html = self::restore_amp_bind_attributes( $html );\n\n\t\t// Restore amp-mustache placeholders which were replaced to prevent URL-encoded corruption by saveHTML.\n\t\t$placeholders = self::get_mustache_tag_placeholders();\n\t\t$html = str_replace(\n\t\t\tarray_values( $placeholders ),\n\t\t\tarray_keys( $placeholders ),\n\t\t\t$html\n\t\t);\n\n\t\t/*\n\t\t * Travis w/PHP 7.1 generates <br></br> and <hr></hr> vs. <br/> and <hr/>, respectively.\n\t\t * Travis w/PHP 7.x generates <source ...></source> vs. <source ... />. Etc.\n\t\t * Seems like LIBXML_NOEMPTYTAG was passed, but as you can see it was not.\n\t\t * This does not happen in my (@mikeschinkel) local testing, btw.\n\t\t */\n\t\t$html = preg_replace( $self_closing_tags_regex, '', $html );\n\n\t\treturn $html;\n\t}",
"private function convert_child_nodes_to_blocks_or_html( $node ) {\n\t\t$content = '';\n\n\t\tforeach ( $node->childNodes as $child_node ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\t\t\t$node_type = $child_node->nodeType; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\t\t\t$node_name = $child_node->nodeName; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\n\t\t\tif ( XML_ELEMENT_NODE === $node_type ) {\n\t\t\t\tif ( 'td' === $node_name || 'thead' === $node_name || 'tbody' === $node_name || 'tr' === $node_name || 'th' === $node_name ) {\n\t\t\t\t\t$inline_content = $this->convert_child_nodes_to_blocks_or_html( $child_node );\n\t\t\t\t\t$content .= \"<{$node_name}>{$inline_content}</{$node_name}>\";\n\t\t\t\t} elseif ( 'a' === $node_name ) {\n\t\t\t\t\t$href = esc_url( $child_node->getAttribute( 'href' ) );\n\t\t\t\t\t$link_content = $this->convert_child_nodes_to_blocks_or_html( $child_node );\n\t\t\t\t\t$content .= \"<a href=\\\"{$href}\\\">{$link_content}</a>\";\n\t\t\t\t} elseif ( 'em' === $node_name || 'strong' === $node_name ) {\n\t\t\t\t\t$inline_content = $this->convert_child_nodes_to_blocks_or_html( $child_node );\n\t\t\t\t\t$content .= \"<{$node_name}>{$inline_content}</{$node_name}>\";\n\t\t\t\t} elseif ( 'img' === $node_name ) {\n\t\t\t\t\t// Only handle images as inline content for now due to how Markdown is processed by CommonMark.\n\t\t\t\t\t$src = esc_url( $child_node->getAttribute( 'src' ) );\n\t\t\t\t\t$alt = esc_attr( $child_node->getAttribute( 'alt' ) );\n\t\t\t\t\t$content .= \"<img src=\\\"{$src}\\\" alt=\\\"{$alt}\\\" />\";\n\t\t\t\t} elseif ( 'code' === $node_name ) {\n\t\t\t\t\t$inline_content = $this->convert_child_nodes_to_blocks_or_html( $child_node );\n\t\t\t\t\t$content .= \"<code>{$inline_content}</code>\";\n\t\t\t\t} else {\n\t\t\t\t\t$content .= $this->convert_node_to_block( $child_node );\n\t\t\t\t}\n\t\t\t} elseif ( XML_TEXT_NODE === $node_type ) {\n\t\t\t\t$content .= $child_node->nodeValue; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}",
"public function makeChildOf($node) {\n return $this->moveTo($node, 'child');\n }",
"private static function wrap_nodes($nodes, $dom_xpath = null)\n {\n $wrapped = array();\n foreach ($nodes as $node) {\n $wrapped[] = new Node($node, $dom_xpath);\n }\n\n return $wrapped;\n }",
"protected function filterNode( DOMElement $element )\n {\n $style = null;\n foreach ( $this->rules as $rule )\n {\n if ( $rule->handles( $element ) )\n {\n $rule->filter( $element, $this->styleInferencer );\n }\n }\n\n foreach ( $element->childNodes as $child )\n {\n if ( $child->nodeType === XML_ELEMENT_NODE )\n {\n $this->filterNode( $child );\n }\n }\n }",
"public static function toDomNodeInterface(\\DOMNode $item = null)\n {\n if (!$item) {\n return new NullDomNode();\n }\n\n if (!$item instanceof DomNodeInterface) {\n return new OtherDomNode($item);\n }\n\n return $item;\n }",
"public function filter( DOMDocument $document )\n {\n $xpath = new DOMXPath( $document );\n $xpath->registerNamespace( 'office', ezcDocumentOdt::NS_ODT_OFFICE );\n $root = $xpath->query( '//office:body' )->item( 0 );\n $this->filterNode( $root );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation teamBuilderConfigProductTypesIdReplacePostWithHttpInfo Replace attributes for a model instance and persist it into the data source. | public function teamBuilderConfigProductTypesIdReplacePostWithHttpInfo($id, $data = null)
{
// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigProductTypesIdReplacePost');
}
// parse inputs
$resourcePath = "/TeamBuilderConfigProductTypes/{id}/replace";
$httpBody = '';
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));
// path params
if ($id !== null) {
$resourcePath = str_replace(
"{" . "id" . "}",
$this->apiClient->getSerializer()->toPathValue($id),
$resourcePath
);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// body params
$_tempBody = null;
if (isset($data)) {
$_tempBody = $data;
}
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');
if (strlen($apiKey) !== 0) {
$queryParams['access_token'] = $apiKey;
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'POST',
$queryParams,
$httpBody,
$headerParams,
'\Swagger\Client\Model\TeamBuilderConfigProductType',
'/TeamBuilderConfigProductTypes/{id}/replace'
);
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\TeamBuilderConfigProductType', $httpHeader), $statusCode, $httpHeader);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\TeamBuilderConfigProductType', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function teamBuilderConfigsIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\TeamBuilderConfig',\n '/TeamBuilderConfigs/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\TeamBuilderConfig', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\TeamBuilderConfig', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdReplacePost($id, $data = null)\n {\n list($response) = $this->teamBuilderConfigsIdReplacePostWithHttpInfo($id, $data);\n return $response;\n }",
"public function productGroupsIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling productGroupsIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/ProductGroups/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductGroup',\n '/ProductGroups/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductGroup', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductGroup', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function invitationTicketsIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling invitationTicketsIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/InvitationTickets/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\InvitationTicket',\n '/InvitationTickets/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InvitationTicket', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InvitationTicket', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function productsIdReplacePost($id, $data = null)\n {\n list($response) = $this->productsIdReplacePostWithHttpInfo($id, $data);\n return $response;\n }",
"public function teamBuilderConfigsIdProductTypesFkPutWithHttpInfo($id, $fk, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductTypesFkPut');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductTypesFkPut');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productTypes/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductType',\n '/TeamBuilderConfigs/{id}/productTypes/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductType', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductType', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function productGroupsIdReplacePost($id, $data = null)\n {\n list($response) = $this->productGroupsIdReplacePostWithHttpInfo($id, $data);\n return $response;\n }",
"public function teamBuilderConfigsIdProductTypesFkDeleteWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductTypesFkDelete');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductTypesFkDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productTypes/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamBuilderConfigs/{id}/productTypes/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductGroupsNkTypesDeleteWithHttpInfo($id, $nk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductGroupsNkTypesDelete');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductGroupsNkTypesDelete');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productGroups/{nk}/types\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/TeamBuilderConfigs/{id}/productGroups/{nk}/types'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }",
"public function updateProductType($id, $data);",
"public function productMaterialsIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling productMaterialsIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/ProductMaterials/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductMaterial',\n '/ProductMaterials/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function invitationTicketsIdReplacePost($id, $data = null)\n {\n list($response) = $this->invitationTicketsIdReplacePostWithHttpInfo($id, $data);\n return $response;\n }",
"public function teamBuilderConfigProductGroupsIdPutWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigProductGroupsIdPut');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigProductGroups/{id}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\TeamBuilderConfigProductGroup',\n '/TeamBuilderConfigProductGroups/{id}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\TeamBuilderConfigProductGroup', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\TeamBuilderConfigProductGroup', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function portalsIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling portalsIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/Portals/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Portal',\n '/Portals/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Portal', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Portal', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductTypesFkGetWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductTypesFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductTypesFkGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productTypes/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductType',\n '/TeamBuilderConfigs/{id}/productTypes/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductType', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductType', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function testTeamBuilderConfigsIdProductTypesFkPut()\n {\n\n }",
"public function customersIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling customersIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/Customers/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Customer',\n '/Customers/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Customer', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Customer', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function patchEntityType($entityTypeId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->patch()\n ->go();\n }",
"public function teamBuilderConfigsIdProductTypesNkSizesPostWithHttpInfo($id, $nk, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductTypesNkSizesPost');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductTypesNkSizesPost');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productTypes/{nk}/sizes\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSize',\n '/TeamBuilderConfigs/{id}/productTypes/{nk}/sizes'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSize', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSize', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This function decodes the string. If you are showing the string in the body of a page, you can set the $_form variable to "false", and the function will use the "BR" tag to the new lines. But, if you need to show the string in a textarea, text or other input types of a form set the $_form variable to "true", then the function will use the "\r\n" to the new lines | function decodeText($_str, $_form) {
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
$_str = strtr($_str, $trans_tbl);
if ($_form) {
$_nl = "\r\n";
} else {
$_nl = "<br>";
}
$_str = str_replace("#BR#", "$_nl", $_str);
return($_str);
} | [
"function quoted_printable_decode ($str) {}",
"function quoted_printable_decode($str)\n{\n}",
"function zeek_text_area_decode($text) {\n\treturn preg_replace('/\\r\\n/', \"\\n\", base64_decode($text));\n}",
"public function decode($str);",
"function decodeString($string);",
"function decode($str)\n {\n\n global $exemptRequest;\n\n //decode using the appropriate protocol handler\n $arr = $this->M->decode($str);\n\n //sanitize all data from the request\n $arr = sanitize($arr,$exemptRequest);\n \n return $arr; \n\n }",
"protected static function decode($str)\n\t{\n\t\t$str = preg_replace_callback(\"/\\&\\#(\\d+)([^\\d])/is\", array(__CLASS__, \"decodeCb\"), $str);\n\t\t$str = preg_replace_callback(\"/\\&\\#x([\\da-f]+)([^\\da-f])/is\", array(__CLASS__, \"decodeCbHex\"), $str);\n\t\t$str = preg_replace(self::$htmlMnemonics[\"html\"], self::$htmlMnemonics[\"text\"],$str);\n\t\treturn $str;\n\t}",
"private function _parseString()\n {\n parse_str( $this->_body, $_POST );\n }",
"function make_readable($string) {\n $string = preg_replace_callback(\"/(&#[0-9]+;)/\",\n create_function('$m', 'return mb_convert_encoding($m[1], \"UTF-8\", \"HTML-ENTITIES\");'),\n $string);\n $string = str_replace(\"<\",\"<\",$string);\n $string = str_replace(\">\",\">\",$string);\n $string = str_replace(\"\\n\",\"<br>\",$string);\n return $string; }",
"function _b($strString, $blnHtmlEntities = true) {\r\n\t\t// Text Block Print\r\n\t\tif ($blnHtmlEntities && (gettype($strString) != 'object'))\r\n\t\t\tprint(nl2br(Application::HtmlEntities($strString)));\r\n\t\telse\r\n\t\t\tprint(nl2br($strString));\r\n\t}",
"function decode2HTML ($str='') {\r\n \t \treturn htmlspecialchars_decode($str, ENT_QUOTES); \r\n}",
"#[Pure]\nfunction quoted_printable_decode(string $string): string {}",
"public function decode($string);",
"function string_code_nl2br( $p_string, $p_wrap = 100 ) {\n\t\t\t$t_output = '';\n\t\t\t$t_pieces = preg_split( '/(\\[code[^>]*\\].*?\\[\\/code\\])/is', $p_string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\t\t\tif( isset( $t_pieces[1] ) ) {\n\t\t\t\tforeach( $t_pieces as $t_piece ) {\n\t\t\t\t\tif( preg_match( '/(\\[code[^>]*\\].*?\\[\\/code\\])/is', $t_piece ) ) {\n\t\t\t\t\t\t$t_piece = preg_replace( '/<br[^>]*?>/', '', $t_piece );\n\n\t\t\t\t\t\t# @@@ thraxisp - this may want to be replaced by html_entity_decode (or equivalent)\n\t\t\t\t\t\t# if other encoded characters are a problem\n\t\t\t\t\t\t$t_piece = preg_replace( '/ /', ' ', $t_piece );\n\t\t\t\t\t\tif( ON == config_get( 'wrap_in_preformatted_text' ) ) {\n\t\t\t\t\t\t\t$t_output .= preg_replace( '/([^\\n]{' . $p_wrap . ',}?[\\s]+)(?!\\[\\/code\\])/', \"$1\\n\", $t_piece );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$t_output .= $t_piece;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$t_output .= $t_piece;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $t_output;\n\t\t\t} else {\n\t\t\t\treturn $p_string;\n\t\t\t}\n\t\t}",
"public static function reverse_sanitize($str){\t\t \n\t\t return @htmlspecialchars_decode($str);\n\t\t}",
"public function nl2brPre($string)\n\t{\n\t // First, check for <pre> tag\n\t if(!strpos($string, \"<pre>\"))\n\t {\n\t echo nl2br($string);\n\t } else {\n\t\t\n\t\t // If there is a <pre>, we have to split by line\n\t\t // and manually replace the linebreaks with <br />\n\t\t $strArr=explode(\"\\n\", $string);\n\t\t $output=\"\";\n\t\t $preFound=false;\n\t\t\n\t\t // Loop over each line\n\t\t foreach($strArr as $line)\n\t\t { // See if the line has a <pre>. If it does, set $preFound to true\n\t\t if(strpos($line, \"<pre>\"))\n\t\t {\n\t\t $preFound=true;\n\t\t }\n\t\t elseif(strpos($line, \"</pre>\"))\n\t\t {\n\t\t $preFound=false;\n\t\t }\n\t\t \n\t\t // If we are in a pre tag, just give a \\n, else a <br />\n\t\t if($preFound)\n\t\t {\n\t\t $output .= $line . \"\\n\";\n\t\t }\n\t\t else\n\t\t {\n\t\t $output .= $line . \"<br />\";\n\t\t }\n\t\t }\n\t\t\n\t\t echo $output;\n\t\t}\n\t}",
"function quoted_printable_decode($in)\n{\n\treturn '';\n}",
"function browserString($string)\n{\n\treturn nl2br(trim(htmlentities($string)));\n}",
"function calendar_readmultiline($string) {\n /**\n * replace html line breaks with ASCII line feeds\n * replace htmlencoded | with ASCII vertical bar\n */\n $string = str_replace(array('<br />','<br>','|'),array(\"\\n\",\"\\n\",'|'),$string);\n return $string;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the connection timeout | public function getTimeout(): int {
$this->checkConnection();
return $this->connection->getConnectionTimeout();
} | [
"abstract public function getConnTimeout();",
"public function connectionTimeout()\n {\n return $this->connectionTimeout;\n }",
"public function get_connection_timeout()\n {\n return $this->curl_connect_timeout;\n }",
"public function getConnectionTimeout()\n {\n return $this->connectionTimeout;\n }",
"function getConnectionTimeout() {\r\n return $this->connectionTimeout;\r\n }",
"public function getConnectionTimeout() {\n return $this->settings->get('advanced.connection_timeout');\n }",
"public function getConnectTimeout() {\n return $this->connect_timeout;\n }",
"public function getConnectTimeout()\n {\n return $this->connectTimeout;\n }",
"public function _get_connect_timeout(){\n\t\treturn (int) $this->_connect_timeout;\n\t}",
"public function getTimeout(): int\n {\n return $this->timeout;\n }",
"public function connectTimeout();",
"public function getTimeout();",
"public function getTrackingConnectTimeout();",
"public function getConnectTimeOut(): float\n {\n return $this->_connectTimeOut;\n }",
"public\n function getConnectionTimeout(): ?int\n {\n return $this->socket ? $this->socket->getConnectionTimeout() : null;\n }",
"public function getTimeout()\n {\n return $this->storage->getTimeout();\n }",
"public function getGetTimeout(){\n return $this->getTimeout;\n }",
"public function getDefaultConnectTimeout();",
"public function get_networkTimeout(): int\n {\n return $this->_getIntAttr('networkTimeout');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get custom fields for this content type. INPUT: $content_type (str) the name of the content type, e.g. post, page. OUTPUT: array of associative arrays where each associative array describes a custom field to be used for the $content_type specified. FUTURE: read these arrays from the database. | private static function _get_custom_fields($content_type)
{
$data = get_option( CCTM::db_key );
if (isset($data[$content_type]['custom_fields']))
{
return $data[$content_type]['custom_fields'];
}
else
{
return array();
}
} | [
"function get_all_fields_of_type($type)\n{\n\tglobal $post;\n//\tprint_r($post); exit;\t\n\t$values = array();\n\n#\treturn get_post_meta($post_id, $fieldname, true);\n\t\n\t$data = get_option( CCTM::db_key );\n\t\n\t$post_type = $post->post_type;\n\tif ( !isset($data[$post_type]['custom_fields']) )\n\t{\n\t\treturn sprintf( __('No custom fields defined for %1$s field.', CCTM::txtdomain), $fieldname );\n\t}\n\t\n\tforeach ( $data[$post_type]['custom_fields'] as $def )\n\t{\n\t\tif ($def['type'] == $type )\n\t\t{\n\t\t\t$values[] = get_custom_field($def['name']);\n\t\t}\t\t\n\t}\n\t\n\treturn $values;\n\n}",
"function globallink_get_config_fields($content_type) {\n $arr = array();\n\n $result = db_select('globallink_field_config', 'tf')\n ->fields('tf')\n ->condition('content_type', $content_type, '=')\n ->execute();\n\n foreach ($result as $row) {\n $arr[$row->field_name] = $row;\n }\n\n return $arr;\n}",
"public function getCustomTypeFields(): array;",
"protected function getCustomFields()\n {\n $listId = $this->list;\n\n if (!isset( self::$customFields[$listId])) {\n $sql = 'SELECT custom_fields FROM lists WHERE id = ' . $listId;\n $result = mysqli_query($this->getDbConnection(), $sql);\n\n if ($result && mysqli_num_rows($result)) {\n $customFields = array();\n $row = mysqli_fetch_array($result);\n $customFieldsStrings = explode('%s%', $row['custom_fields']);\n\n foreach ($customFieldsStrings as $customField) {\n $customFieldArray = explode(':', $customField);\n $key = str_replace(' ', '', $customFieldArray[0]);\n if (isset($customFieldArray[1])) {\n $dataType = trim($customFieldArray[1]);\n $customFields[] = array('field_name' => $key, 'data_type' => $dataType);\n }\n }\n self::$customFields[$listId] = $customFields;\n } else {\n self::$customFields[$listId] = array();\n }\n }\n return self::$customFields[$listId];\n }",
"protected function _getFields()\n\t{\n\t\treturn array('xf_content_type_field' => array(\n\t\t\t'content_type'\t\t=> array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 25, 'requiredError' => 'content_type_please_enter_valid_name'),\n\t\t\t'field_name'\t\t=> array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 50, 'requiredError' => 'content_type_please_enter_valid_field_name'),\n\t\t\t'field_value'\t\t=> array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 75, 'requiredError' => 'content_type_please_enter_valid_field_value')\n\t\t));\n\t}",
"private function getCustomFields()\n\t{\n\t\t$hash = md5($this->_name . 'cf');\n\n\t\tif (Cache::has($hash))\n\t\t{\n\t\t\treturn Cache::get($hash);\n\t\t}\n\n\t\t$db = $this->db;\n\t\t\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->quoteName(['id', 'name', 'value']))\n\t\t\t->from($db->quoteName('#__k2_extra_fields'))\n\t\t\t->where($db->quoteName('published') . ' = 1');\n\n\t\t$db->setQuery($query);\n\n\t\t$rows = $db->loadObjectList();\n\n\t\t$filter = InputFilter::getInstance();\n\n\t\t$result = [];\n\n\t\tforeach ($rows as $key => $row)\n\t\t{\n\t\t\t$params = json_decode($row->value);\n\n\t\t\tif (isset($params[0]) && isset($params[0]->alias) && !empty($params[0]->alias))\n\t\t\t{\n\t\t\t\t$alias = $params[0]->alias;\n\t\t\t} else \n\t\t\t{\n\t\t\t\t// Fallback to item ID\n\t\t\t\tif (!$alias = $filter->clean($row->name, 'WORD'))\n\t\t\t\t{\n\t\t\t\t\t$alias = $rows->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result[$alias] = $row->name;\n\t\t}\n\n\t\treturn Cache::set($hash, $result);\n\t}",
"public function get_post_type_custom_fields( $post_type ) {\r\n\r\n\t\tif ( false === self::$is_set_custom_fields ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = $this->data_option;\r\n\r\n\t\tif ( ! isset( $data[ $post_type ] ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn $data[ $post_type ];\r\n\t}",
"protected function _getFields()\n\t{\n\t\treturn array('xf_content_type' => array(\n\t\t\t'content_type'\t=> array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 25, 'requiredError' => 'please_enter_valid_name'),\n\t\t\t'addon_id'\t\t=> array('type' => self::TYPE_STRING, 'maxLength' => 25, 'default' => ''),\n\t\t\t'fields'\t\t=> array('type' => self::TYPE_SERIALIZED, 'default' => 'a:0:{}')\n\t\t));\n\t}",
"public function getCustomFields()\n\t{\n\t\treturn $this->call('get', 'CustomFields');\n\t}",
"public static function get_course_custom_fields() {\n global $DB;\n\n if (static::require_elis_dependencies() === true) {\n // Get custom fields.\n $sql = 'SELECT shortname, name, datatype, multivalued\n FROM {'.field::TABLE.'} f\n JOIN {'.field_contextlevel::TABLE.'} fctx ON f.id = fctx.fieldid AND fctx.contextlevel = ?';\n $sqlparams = array(CONTEXT_ELIS_COURSE);\n return $DB->get_records_sql($sql, $sqlparams);\n } else {\n return array();\n }\n }",
"public static function get_class_custom_fields() {\n global $DB, $CFG;\n\n if (static::require_elis_dependencies() === true) {\n require_once(elis::lib('data/customfield.class.php'));\n $sql = 'SELECT shortname, name, datatype, multivalued\n FROM {'.field::TABLE.'} f\n JOIN {'.field_contextlevel::TABLE.'} fctx ON f.id = fctx.fieldid AND fctx.contextlevel = ?';\n $sqlparams = array(CONTEXT_ELIS_CLASS);\n return $DB->get_records_sql($sql, $sqlparams);\n } else {\n return array();\n }\n }",
"public function getCustomFields() : array\r\n {\r\n return $this->custom_fields;\r\n }",
"public function get_meta_fields_for_post_type() {\n\n\t\tif ( jet_engine()->meta_boxes ) {\n\t\t\treturn jet_engine()->meta_boxes->get_fields_for_select( 'plain' );\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\n\t}",
"public static function get_user_custom_fields() {\n global $DB;\n\n if (static::require_elis_dependencies() === true) {\n // Get custom fields.\n $sql = 'SELECT shortname, name, datatype, multivalued\n FROM {'.field::TABLE.'} f\n JOIN {'.field_contextlevel::TABLE.'} fctx ON f.id = fctx.fieldid AND fctx.contextlevel = ?';\n $sqlparams = array(CONTEXT_ELIS_USER);\n return $DB->get_records_sql($sql, $sqlparams);\n } else {\n return array();\n }\n }",
"function getExtIdCustomFieldCandidates() {\n // Mantis customFields types\n $mType_string = 0;\n $mType_numeric = 1;\n\n $query = \"SELECT * FROM `mantis_custom_field_table` WHERE `type` IN ($mType_string, $mType_numeric) ORDER BY name\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n throw new Exception(\"get ExtId candidates FAILED\");\n }\n\n $candidates = array();\n while ($row = mysql_fetch_object($result)) {\n $candidates[\"$row->id\"] = $row->name;\n }\n return $candidates;\n}",
"public function getCustomFields(): array\n {\n return $this->_custom_fields ?? [] ;\n }",
"public static function Getfieldsfortype ($posttype) {\n global $acf;\n $fields = array();\n\n // Normal fields\n foreach (self::$WPFIELDS as $key => $name) {\n $field = array(\n 'advanced' => false\n , 'id' => $key\n , 'name' => $name\n , 'key' => $key\n , 'type' => null\n , 'formatin' => null\n , 'formatout' => null\n , 'default' => null\n );\n\n $fields[] = $field;\n }\n\n // Advanced custom fields\n if ($acf && method_exists($acf, 'get_field_groups')) {\n $fieldgroups = $acf->get_field_groups();\n\n foreach ($fieldgroups as $fieldgroup) {\n $rules = $fieldgroup['location']['rules'];\n $passes = false;\n\n foreach ($rules as $rule) {\n if (\n 'post_type' == $rule['param']\n && '==' == $rule['operator']\n && $posttype == $rule['value']\n ) {\n $passes = true;\n break;\n }\n }\n\n if ($passes) {\n foreach ($fieldgroup['fields'] as $field) {\n if (!in_array($field['type'], self::$ACFFIELDS)) continue;\n\n $type = null;\n $formatin = null;\n $formatout = null;\n\n switch ($field['type']) {\n case 'post_object':\n case 'relationship':\n $type = 'lookup';\n break;\n\n case 'date_picker':\n $type = 'format';\n $formatin = 'm/d/y';\n $formatout = 'Ymd';\n break;\n\n case 'time_picker':\n $type = 'format';\n $format = '';\n if ($field['timepicker_show_date_format']) {\n $format .= $field['timepicker_date_format'] . ' ';\n }\n $format .= $field['timepicker_time_format'];\n break;\n\n case 'true_false':\n $type = 'boolean';\n break;\n }\n\n $fields[] = array(\n 'advanced' => true\n , 'id' => $field['key']\n , 'name' => $field['label']\n , 'key' => $field['name']\n , 'type' => $type\n , 'formatin' => $formatin\n , 'formatout' => $formatout\n , 'default' => isset($field['default_value'])\n ? $field['default_value']\n : null\n );\n }\n }\n }\n }\n\n return $fields;\n }",
"function _omniture_get_items_by_content_type($content_type) {\n $items = array();\n \n if (empty($content_type)) {\n return $items;\n }\n \n $result = db_select('omniture', 'o')\n ->fields('o')\n ->condition('o.value', $content_type, '=')\n ->condition('o.type', 'content_type', '=')\n ->execute();\n \n foreach ($result as $row) {\n $items[] = $row;\n }\n \n return $items;\n}",
"public function getCustomFields() { return $this->data['customFields']; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get a product parent attributes. | public function get_parent_attributes($wp_product_id, $sl_attributes){
foreach ($sl_attributes as $sl_attribute_name => $sl_attributes_values) {
$attribute_taxonomy_name_exists = false;
$attribute_taxonomy_name = wc_attribute_taxonomy_name($sl_attribute_name);
if (!taxonomy_exists($attribute_taxonomy_name)){
if (strpos($sl_attribute_name, '_') !== false){
$sl_attribute_name_hyphen = str_replace('_', '-', $sl_attribute_name);
$attribute_taxonomy_name_hyphen = wc_attribute_taxonomy_name($sl_attribute_name_hyphen);
if (taxonomy_exists($attribute_taxonomy_name_hyphen)){
$attribute_taxonomy_name_exists = true;
}
}
}else{
$attribute_taxonomy_name_exists = true;
}
if (!$attribute_taxonomy_name_exists){
unset($sl_attributes[$sl_attribute_name]);
}
}
$products_attributes_data = array();
$wp_product = wc_get_product( $wp_product_id );
$wp_product_attributes = $wp_product->get_attributes();
if (!empty($wp_product_attributes)){
foreach ($wp_product_attributes as $wp_product_attribute_name => $wp_product_attribute) {
$wp_product_attribute_name_sanitized = sanitize_title($wp_product_attribute_name);
if (strpos($wp_product_attribute_name_sanitized, 'pa_') === 0){
$cut_wp_product_attribute = substr($wp_product_attribute_name_sanitized, 3, strlen($wp_product_attribute_name_sanitized));
if (taxonomy_exists($wp_product_attribute_name_sanitized)){
$products_attributes_data[$cut_wp_product_attribute] = wp_get_object_terms( $wp_product_id, $wp_product_attribute_name_sanitized, array('fields' => 'names'));
}
}
}
}
if (!empty($products_attributes_data)){
foreach ($products_attributes_data as $product_attribute_name => $product_attribute_values) {
if (isset($sl_attributes[$product_attribute_name])){
$sl_attributes[$product_attribute_name] = array_filter(array_unique(array_merge($sl_attributes[$product_attribute_name], $product_attribute_values)));
}
}
}
return $sl_attributes;
} | [
"public function getParentProduct()\n {\n return $this->parentProduct;\n }",
"public function parent()\n {\n // A simple product can have multiple parents\n // Parents can be \"grouped products\" or \"configurable products\"\n // Only one of those parents can be a \"configurable product\"\n // An example of a grouped product \"Buy a phone and a car charger\"\n $parents = $this->_parents();\n\n foreach ($parents as $parent)\n {\n if ($this->_configurableProduct($parent))\n {\n return $parent;\n }\n }\n\n return NULL;\n }",
"public function parentAttributeDetails(): array\n {\n return $this->parentAttributeDetails;\n }",
"function get_parent_product(){\n \t\n \tif ($this->uid_product) {\n \t\t$products_uid = $this->uid_product;\n \t}else{\n \t$products_uid=$this->conn_db->get_parent_product_uid($this->uid);\n \t}\n $product = t3lib_div::makeInstance('tx_commerce_product');\n \t$product->init($products_uid);\n \treturn $product;\n \t\n }",
"public function getParentKey()\n {\n return $this->parent->getAttribute($this->localKey);\n }",
"public function getParentAttribute() {\n\n\t\tif ( !$this->parentObject && $this->post_parent ) {\n\n\t\t\t// Query database for fields\n\t\t\t$this->parentObject = get_post( $this->post_parent );\n\n\t\t\tif ( $this->parentObject ) {\n\t\t\t\t$this->parentObject = new self( $this->parentObject );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this->parentObject;\n\t}",
"public function get_parent_property()\n {\n return CourseCategory::PROPERTY_PARENT;\n }",
"private function ProductParentSku() {\n\t\t$db = JFactory::getDBO();\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_PRODUCT_PARENT_SKU'));\n\t\tif (!$this->category_path && isset($this->product_sku)) {\n\t\t\t/* Check if we are dealing with a child product */\n\t\t\tif ($this->product_parent_sku !== $this->product_sku) {\n\t\t\t\t$this->child_product = true;\n\t\t\t\t/**\n\t\t\t\t * Get the parent id first\n\t\t\t\t * This assumes that the Parent Product already has been added\n\t\t\t\t */\n\t\t\t\t$db->setQuery(\"SELECT product_id FROM #__vm_product WHERE product_sku = '\".$this->product_parent_sku.\"'\");\n\t\t\t\t$this->product_parent_id = $db->loadResult();\n\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_PRODUCT_PARENT_SKU'), true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->product_parent_id = 0;\n\t\t\t\t$this->child_product = false;\n\t\t\t}\n\t\t}\n\t}",
"public function get_parent_property()\n {\n return CourseGroup::PROPERTY_PARENT_ID;\n }",
"function fnGetSubAttributesByParentAttribute($id)\n\t\t{\n\t\t\t$arrInventoryAttributes = array();\n\t\t\t$sSQL = \"select a.*, a1.attribute_name as parent_name from pms_inventory_attributes a LEFT JOIN pms_inventory_attributes a1 ON a.parentid = a1.id where a.parentid='\".mysql_real_escape_string($id).\"'\";\n\t\t\t$this->query($sSQL);\n\t\t\tif($this->num_rows() > 0)\n\t\t\t{\n\t\t\t\twhile($this->next_record())\n\t\t\t\t{\n\t\t\t\t\t$arrInventoryAttributes[] = $this->fetchrow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $arrInventoryAttributes;\n\t\t}",
"public function get_parent()\n\t\t{\n\t\t\tforeach($this->productCategories as $productCategory)\n\t\t\t{\n\t\t\t\treturn $productCategory->category;\n\t\t\t}\n\n\t\t\treturn Category::makeNull();\n\t\t}",
"public function getParentData();",
"public function get_pathParent()\n\t\t{\n\t\t\tif ($this->_pathParent === null)\n\t\t\t{\n\t\t\t\tif ($this->parent->isNull())\n\t\t\t\t{\n\t\t\t\t\t$this->_pathParent = Page::loadFor('module', 'Products');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->_pathParent = $this->parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->_pathParent;\n\t\t}",
"function getParentId() {\n return $this->getFieldValue('parent_id');\n }",
"function getProductMasterparentCategorie() \t{\n \t\treturn $this->product->getMasterparentCategorie();\t\n \t}",
"public function getParentPrimaryKey()\n {\n return $this->getParentEntityDescriptor()\n ->getPrimaryKey()\n ->getField();\n }",
"public function getParentId()\n {\n return $this->getValue('nb_commerce_product_category_parent_id');\n }",
"public static function get_parent( \\WC_Product $product ) {\n\n\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t$parent = wc_get_product( $product->get_parent_id() );\n\t\t} else {\n\t\t\t$parent = $product->is_type( 'variation' ) ? wc_get_product( $product->id ) : false;\n\t\t}\n\n\t\treturn $parent;\n\t}",
"public function getParentKey()\n {\n $arr = $this->parent->getAttribute($this->localKey);\n if (!is_array($arr)) {\n $arr = (array)json_decode($arr, true) ?: [];\n }\n $arr = array_values(array_unique($arr));\n return $arr;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns html of a weekly summary | function weekly_summary() {
global $wpdb;
$img_base = $this->plugin_url . 'images/';
//count total
$current_total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '" . time() . "'" );
$date = date( "Y-m-d", strtotime( "-1 week" ) );
$last_total = $wpdb->get_var( "SELECT supporter_count FROM {$wpdb->base_prefix}pro_sites_daily_stats WHERE date >= '$date' ORDER BY date ASC LIMIT 1" );
if ( $current_total > $last_total ) {
$active_diff = "<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( $current_total - $last_total ) . "</span>";
} else if ( $current_total < $last_total ) {
$active_diff = "<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( - ( $current_total - $last_total ) ) . "</span>";
} else {
$active_diff = "<span style='font-size: 18px; font-family: arial;'>" . __( 'no change', 'psts' ) . "</span>";
}
$text = sprintf( __( '%s active Pro Sites %s since last week', 'psts' ), "<p><span style='font-size: 24px; font-family: arial;'>" . number_format_i18n( $current_total ) . "</span><span style='color: rgb(85, 85, 85);'>", "</span>$active_diff<span style='color: rgb(85, 85, 85);'>" ) . "</span></p>";
//activity stats
$week_start = strtotime( "-1 week" );
$week_start_date = date( 'Y-m-d', $week_start );
$this_week['total_signups'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date'" );
$this_week['upgrades'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date'" );
$this_week['cancels'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date'" );
$number_trial = count( ProSites_Helper_Registration::get_all_trial_blogs() );
$week_end = $week_start;
$week_start = strtotime( "-1 week", $week_start );
$week_start_date = date( 'Y-m-d', $week_start );
$week_end_date = date( 'Y-m-d', $week_end );
$last_week['total_signups'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'" );
$last_week['upgrades'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'" );
$last_week['cancels'] = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'" );
if ( $this_week['total_signups'] > $last_week['total_signups'] ) {
$diff = "<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( $this_week['total_signups'] - $last_week['total_signups'] ) . "</span>";
} else if ( $this_week['total_signups'] < $last_week['total_signups'] ) {
$diff = "<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( - ( $this_week['total_signups'] - $last_week['total_signups'] ) ) . "</span>";
} else {
$diff = "<span style='font-size: 18px; font-family: arial;'>" . __( 'no change', 'psts' ) . "</span>";
}
$text .= sprintf( __( '%s new signups this week %s compared to last week', 'psts' ), "\n<p><span style='font-size: 24px; font-family: arial;'>" . number_format_i18n( $this_week['total_signups'] ) . "</span><span style='color: rgb(85, 85, 85);'>", "</span>$diff<span style='color: rgb(85, 85, 85);'>" ) . "</span></p>";
if ( $this_week['upgrades'] > $last_week['upgrades'] ) {
$diff = "<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( $this_week['upgrades'] - $last_week['upgrades'] ) . "</span>";
} else if ( $this_week['upgrades'] < $last_week['upgrades'] ) {
$diff = "<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( - ( $this_week['upgrades'] - $last_week['upgrades'] ) ) . "</span>";
} else {
$diff = "<span style='font-size: 18px; font-family: arial;'>" . __( 'no change', 'psts' ) . "</span>";
}
$text .= sprintf( __( '%s upgrades this week %s compared to last week', 'psts' ), "\n<p><span style='font-size: 24px; font-family: arial;'>" . number_format_i18n( $this_week['upgrades'] ) . "</span><span style='color: rgb(85, 85, 85);'>", "</span>$diff<span style='color: rgb(85, 85, 85);'>" ) . "</span></p>";
if ( $this_week['cancels'] > $last_week['cancels'] ) {
$diff = "<img src='{$img_base}red-up.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( $this_week['cancels'] - $last_week['cancels'] ) . "</span>";
} else if ( $this_week['cancels'] < $last_week['cancels'] ) {
$diff = "<img src='{$img_base}green-down.gif'><span style='font-size: 18px; font-family: arial;'>" . number_format_i18n( - ( $this_week['cancels'] - $last_week['cancels'] ) ) . "</span>";
} else {
$diff = "<span style='font-size: 18px; font-family: arial;'>" . __( 'no change', 'psts' ) . "</span>";
}
$text .= sprintf( __( '%s cancelations this week %s compared to last week', 'psts' ), "\n<p><span style='font-size: 24px; font-family: arial;'>" . number_format_i18n( $this_week['cancels'] ) . "</span><span style='color: rgb(85, 85, 85);'>", "</span>$diff<span style='color: rgb(85, 85, 85);'>" ) . "</span></p>";
// Current active trials
$text .= sprintf( '<p>' . __( '%s active trials.', 'psts' ) . '</p>', "<span style='font-size: 24px; font-family: arial;'>" . number_format_i18n( $number_trial ) . "</span>" );
return $text;
} | [
"function reportWeekly($week, $units, $weeklySummary, $json, $camAPIKey, $oneway, $onewayCompass)\n{\n\t// Assumes a properly formatted $week associative array.\n\t$reportOutput;\n\n\t$weekdays = array(\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\");\n\t$weekdaysShort = array(\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\");\n\t$unixDay = time();\n\t$today = date('N', $unixDay); // Returns 1-7\n\t$cityName = $_GET[\"cityName\"];\n\t$unitChoices = unitChoice($units);\t// temp == [1], speed == [2]\n\n\t// Look for webcams. If any are in the area, then present a carousel. Otherwise, present a psa message.\n\t$camArray = makeCamArray($json, $camAPIKey);\n\n\tif($camArray[0] != '')\n\t{\n\t\t$reportOutput .= \"<div class='summaryTable'>\\n\";\n\t\t$reportOutput .= \"<div class='summaryRow'>\\n\";\n\t\t$reportOutput .= \"\t<div class='summaryTitleCell'>\n\t\t\t\t\t\t\t\t<div id='slider1'> \";\n\t\t\t\t\t\t\t\tif(sizeof($camArray) < 5)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$reportOutput .= \t\t\" <a class='buttons prev' href='#''><</a>\";\n\t\t\t\t\t\t\t\t}\n\t\t$reportOutput .= \"\t<div class='viewport' style='\";\n\n\t\t\t\t\t\t\t\t\tif(sizeof($camArray) < 7)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$carouselWidth = (184 + 20) * sizeof($camArray); // width of a pic is 184, + 20px padding\n\t\t\t\t\t\t\t\t\t\t$carouselWidth = \"$carouselWidth\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$carouselWidth = 5 * (184 + 20);// \"80%\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$reportOutput .= \"width:\" . $carouselWidth . \"px;'>\";\n\n\t\t\t\t\t\t\t\t\t$reportOutput .= \"<ul class='overview'>\";\n\t\t\t\t\t\t\t\t\t\tfor($i = 0; $i < 10; $i++)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif($camArray[$i] != '')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$reportOutput .= \"<li><img src='\" . $camArray[$i] . \"' alt='webcam image' /></li>\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$reportOutput .= \"\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div><!--viewport-->\";\n\t\t\t\t\t\t\t\tif(sizeof($camArray) < 5)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$reportOutput .= \"<a class='buttons next' href='#'>></a>\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t$reportOutput .= \"</div><!--slider1-->\n\t\t\t\t\t\t\t</div><!--summaryTitleCell-->\";\n\t\t$reportOutput .= \"</div><!--summaryRow-->\\n\";\n\t\t$reportOutput .= \"</div><!--summaryTable-->\\n\";\n\t}\n\n\t$reportOutput .= \"<div class='summaryTable'>\\n\";\n\t\t$reportOutput .= \"<div class='summaryRow'>\\n\";\n\t\t\t$reportOutput .= \"<div class='summaryTitleCell' id='weeklySummary'>\\n\";\n\t\t\t$reportOutput .= \"<h3><b>Weekly Summary: </b>\" . $weeklySummary. \"</h3><br/>\";\n\t\t\t$reportOutput .= \"</div><!--summaryTitleCell-->\\n\";\n\t\t$reportOutput .= \"</div><!--summaryRow-->\\n\";\n\n\t\t$reportOutput .= \"<div class='summaryRow'>\\n\";\n\t\t\t$reportOutput .= \"<div class='summaryTitleCell' style='width: 80%; margin-left:auto; margin-right:auto;'>\\n\";\n\t\t\t\t$reportOutput .= \"<div id='chart_div' style='width: 100%;'></div>\\n\";\n\t\t\t$reportOutput .= \"</div><!--summaryTitleCell-->\\n\";\n\t\t$reportOutput .= \"</div><!--summaryRow-->\\n\";\n\n\t$reportOutput .= \"</div><!--summaryTable-->\\n\";\n\n\n\t$reportOutput .= \"</div><!--summaryTable-->\\n\";\n\n\t$reportOutput .= \"<div class='summaryTable' id='weekly'>\\n\";\n\n\t// Make the metascore graph\n\t$metaArray = array();\n\tarray_push($metaArray, $today);\t// First element will indicate the starting day for the chart.\n\n\tfor($i = 0; $i <= 6; $i++)\n\t{\n\t\tif (function_exists('meta'))\n\t\t{\n\t\t\tif($oneway === \"true\")\n\t\t\t{\n\t\t\t\tarray_push($metaArray, meta($json, $units, \"d{$i}\", $json->daily->data[$i]->time, $onewayCompass));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($metaArray, meta($json, $units, \"d{$i}\", $json->daily->data[$i]->time));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarray_push($metaArray, \"N/A\");\n\t\t}\n\t}\t\t\n\n\t$graphData = makeGraph($metaArray);\n\n\t// Weekly weather report output\n\t$today = date('N', $unixDay); // Returns 1-7\n\n\t$reportOutput .= \"<div class='summaryTable'>\\n\";\n\t$reportOutput .= \"<div class='summaryRow'>\\n\";\n\tfor($i = 0; $i <= 6; $i++)\n\t{\n\t\t$reportOutput .= \"<div class='dayCell'>\";\n\t\t\tif($today <= 6)\n\t\t\t{\n\t\t\t\tif (function_exists('meta'))\n\t\t\t\t{\n\t\t\t\t\t$metaFlag = \"d\" . $i;\n\t\t\t\t\tif($oneway === \"true\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$reportOutput .= \"<b>\" . $weekdaysShort[$today] . \": </b>\" . meta($json, $units, $metaFlag, $json->daily->data[$i]->time, $onewayCompass) . \"%<br/>\\n\";\t// weekday\n\t\t\t\t\t}\n\t\t\t\t\tif($oneway === \"false\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$reportOutput .= \"<b>\" . $weekdaysShort[$today] . \": </b>\" . meta($json, $units, $metaFlag, $json->daily->data[$i]->time) . \"%<br/>\\n\";\t// weekday\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$reportOutput .= \"<b>N/A</b><br/>\\n\"; \n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (function_exists('meta'))\n\t\t\t\t{\n\t\t\t\t\t$metaFlag = \"d\" . $i;\n\t\t\t\t\tif($oneway === \"true\")\n\t\t\t\t\t{\n\t\t\t\t\t$reportOutput .= \"<b>\" . $weekdaysShort[$today - 7] . \": </b>\" . meta($json, $units, $metaFlag, $json->daily->data[$i]->time, $onewayCompass) . \"%<br/>\\n\";\t// weekday\n\t\t\t\t\t}\n\t\t\t\t\tif($oneway === \"false\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$reportOutput .= \"<b>\" . $weekdaysShort[$today - 7] . \": </b>\" . meta($json, $units, $metaFlag, $json->daily->data[$i]->time) . \"%<br/>\\n\";\t// weekday\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$reportOutput .= \"<b>N/A</b><br/>\\n\"; \n\t\t\t\t}\n\t\t\t}\n\t\t\t$reportOutput .= \"<img src='graphics/icons/\" . $week[$i][5] . \".png' alt='Current Weather: \" . $week[$i][5] . \"' height='50' width='50'/><br/>\";\n\t\t\t$reportOutput .= round($week[$i][4][1]) . \"°\" . $unitChoices[1] . \" Max<br/>\\n\";\n\t\t\t$reportOutput .= round($week[$i][4][0]) . \"°\" . $unitChoices[1] . \" Min<br/><br/>\\n\";\n\n\t\t\t$reportOutput .= round($week[$i][1]) . \" \" . $unitChoices[2] . \" / \" . compass($week[$i][2]) . \"<br/><br/>\\n\";\n\n\t\t\t$reportOutput .= \"Feels like:<br/>\" . $json->daily->data[$i]->apparentTemperatureMin . \"°\" . $unitChoices[1] . \" to \" . $json->daily->data[$i]->apparentTemperatureMax . \"°\" . $unitChoices[1] . \"<br/><br/>\\n\";\n\n\t\t\tif($json->daily->data[$i]->precipAccumulation != 'undefined')\n\t\t\t{\n\t\t\t\t$precipAccumulation = $json->daily->data[$i]->precipAccumulation;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$precipAccumulation = \"N/A\";\n\t\t\t}\n\n\t\t\t$reportOutput .= getPrecipInfo($week[$i][3][3], $json->daily->data[$i]->precipIntensity, $precipAccumulation, $units) . \"<br/><br/>\";\n\n\t\t\t$reportOutput .= \"<b>\" . $week[$i][0] . \"</b><br/>\\n\";\n\t\t$reportOutput .= \"</div><!--dayCell-->\\n\";\n\t\t$today++;\n\t}\n\t$reportOutput .= \"</div><!--summaryRow-->\\n\";\n\t$reportOutput .= \"</div><!--summaryTable-->\\n\";\n\n\t$ret = array();\n\n\tarray_push($ret, $graphData, $reportOutput);\n\n\treturn $ret;\n}",
"public function getWeeklyData();",
"public static function renderSummary($jsonObj){\n $week = $jsonObj->weeks[0]->days;\n $curStartDate = $week[0]->date; // use the first day of the current week as our \"week of\" date\n\n $html = '<article><h1>Menu plan for the week of ' . $curStartDate . '</h1>';\n\n // we have multiple locations i.e. multiple tables to display\n foreach (self::$locs as $value) {\n $html .= self::renderTable($value, $week);\n }\n\n $html .= '</article>';\n\n return $html;\n }",
"public function getWeeklyViews()\n\t{\n $time = $this->input->getParam('time', null);\n $sessionModel = new Session_Model();\n $day = $this->getWeekStartEnd($time);\n $perDay = strtotime($day['startDay'])-3600*24;\n $nextDay = strtotime($day['endDay'])+3600*24;\n $weeklyViews = $sessionModel->getWeeklyViews($day['startDay'], $day['endDay']);\n $weekViews = $this->twig->render('admin/adminHome/weeklyViews', array(\n 'weeklyViews' => $weeklyViews,\n 'startDay' => $day['startDay'],\n 'endDay' => $day['endDay'],\n 'perDay' => $perDay,\n 'nextDay' => $nextDay,\n 'year' => date('Y')\n )); \n \n $this->_returnAjax($weekViews,FALSE);\n\t}",
"function GraphWeek( $sViewType, $lYear, $lang )\n{\n\tif ($sViewType == \"Views\" ) {\n\t $sSQL = \"SELECT stats.date, stats.ip, WEEKOFYEAR( stats.date ) as Week, Count(stats.ip) AS total \";// ww\n\t $sSQL .= \"FROM stats \";\n\t \n\t $sGroupBy = \"GROUP BY WEEKOFYEAR( stats.date ) \";// ww\n\t \n\t $sDataSource = \"stats\";\n\t} elseif ( $sViewType == \"Visits\" ) {\n\t $sSQL = \"SELECT groupipsbydate.date, groupipsbydate.ip, WEEKOFYEAR( groupipsbydate.date ) as Week, Count(groupipsbydate.ip) AS total \";\n\t $sSQL .= \"FROM groupipsbydate \";\n\t \n\t $sGroupBy = \"GROUP BY WEEKOFYEAR( groupipsbydate.date ) \"; // ww\n\t \n\t $sDataSource = \"groupipsbydate\";\n\t}\n\t\n\t$sHaving = \" HAVING ((1=1) \";\n\n\tif (strlen( $lYear ) > 0 ) {\n\t $sHaving .= \"AND (YEAR( \". $sDataSource .\".date)=\" . $lYear . \") \";\n\t $sGroupBy .= \", YEAR( \". $sDataSource .\".date) \";\n\t}\n\n\t$sHaving .= \")\";\n \n global $db;\n\t$data = $db->query($sSQL . $sGroupBy . $sHaving);\n \n $aWeeks = array();\n\t\n\tfor ($i = 0; $i < 54; $i++) {\n\t\t$aWeeks[$i] = 0;\n\t}\t\n\t\n\t$lTotal = 0;\n\t$lTop = 0;\n\t\n\tforeach($data->fetchAll() as $row) {\n\t if ($row[\"total\"] > $lTop) {\n\t $lTop = $row[\"total\"];\n\t\t}\n\t \n\t\t$aWeeks[ $row[\"Week\"] -1 ] = $row[\"total\"];\n\t $lTotal = $lTotal + $row[\"total\"];\n\t}\n \n?> \n <table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" class=\"titlebg\">\n\t <tr>\n\t\t <td class=\"titlebg\" width=\"10\">»</td>\n\t\t <td colspan=53 class=\"smallerheader titlebg\"><?=$lang[\"status\"]; ?>: <?=$sViewType;?> <?=$lang[\"view_year_weekly\"]; ?></td>\n\t\t <td class=\"titlebg\" width=\"10\"></td>\n </tr>\n\t\t<tr>\n\t\t <td class=\"listbg\"></td>\n\t\t <td class=\"listbg\" valign=\"bottom\"></td>\n\t\t\t<?php\n\t\t\t\tforeach ( $aWeeks as $lCounter) {\n\t\t\t\t$lHeight = ($lTop > 0) ? ($lCounter/$lTop ) * 150 : 0;\n\t\t\t?>\n\t\t\t\t<td class=\"listbg\" valign=\"bottom\" align=\"center\">\n\t\t\t\t <img src=\"assets/insya.gif\" height=<?=$lHeight?> width=\"10\" alt=\"<?=$lCounter;?>\">\n\t\t\t\t</td>\n\t\t\t<?php } ?>\n\t\t\t<td class=\"listbg\" width=\"10\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t <td class=\"listbg\"></td>\n\t\t <td class=\"listbg\"><?=$sViewType;?></td>\n\t\t\t<?php foreach ( $aWeeks as $lCounter) { ?>\n\t\t\t\t<td class=\"listbg\" align=\"center\"><?=$lCounter; ?></td>\n\t\t\t<?php } ?>\n\t\t\t<td class=\"listbg\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t <td class=\"listbg\"></td>\n\t\t <td class=\"listbg\">%</td>\n\t\t\t<?php\t\n\t\t\tforeach ( $aWeeks as $lCounter) {\n\t\t\t\t$lPercent = ($lTotal > 0 ) ? ($lCounter/$lTotal) : 0;\n\t\t\t?>\n\t\t\t\t\t<td class=\"listbg\" align=\"center\"><?=FormatPercent($lPercent); ?></td>\n\t\t\t<?php } ?>\n\t\t\t<td class=\"listbg\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t <td class=\"listbg\"></td>\n\t\t <td class=\"listbg\"><?=$lang[\"week\"]; ?></td>\n\t\t\t<?php foreach ( $aWeeks as $key => $lCounter) { ?>\n\t\t\t\t<td class=\"listbg\" align=\"center\"><?= $key+1; ?></td>\n\t\t\t<?php } ?>\n\t\t\t<td class=\"listbg\"></td>\n\t\t</tr>\n\t</table>\n\t<br /><br />\n<?php\t\n}",
"public function getWeeklyReportTable($bWeek, $eWeek)\n {\n if($result = $this->_connection->query(\"\n SELECT cwiid, SUM(minutes) FROM(\n SELECT cwiid, swipedate, time_format(timediff(timeout, timein), '%i') AS minutes FROM `swipes`\n WHERE swipedate BETWEEN '\".$bWeek.\"' AND '\".$eWeek.\"'\n GROUP BY cwiid, swipedate, timein) AS swipesByDayId GROUP BY cwiid\"))\n {\n echo \"\n <table border='1'>\n <tr>\n <th>Student ID</th>\n <th>Total time</th>\n </tr>\";\n while($row = $result->fetch_array(MYSQLI_NUM))\n {\n echo \"<tr> <td>\".$row[0].\" </td> <td class='\".$this->getColor($row[1]).\"'> \".$row[1].\" Minutes </td> </tr>\";\n }\n echo \"</table>\";\n }\n else\n {\n echo $this->_connection->errno;\n }\n }",
"protected function getDailySummary()\n {\n $strBuffer = '\n<fieldset class=\"tl_tbox\">\n<legend style=\"cursor: default;\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_summary'] . '</legend>\n<div class=\"daily_summary\">';\n\n $arrAllowedProducts = \\Isotope\\Backend\\Product\\Permission::getAllowedIds();\n\n $objOrders = Database::getInstance()->prepare(\"\n SELECT\n c.id AS config_id,\n c.name AS config_name,\n c.currency,\n COUNT(DISTINCT o.id) AS total_orders,\n SUM(i.tax_free_price * i.quantity) AS total_sales,\n SUM(i.quantity) AS total_items\n FROM tl_iso_product_collection o\n LEFT JOIN tl_iso_product_collection_item i ON o.id=i.pid\n LEFT OUTER JOIN tl_iso_config c ON o.config_id=c.id\n WHERE o.type='order' AND o.order_status>0 AND o.locked>=?\n \" . Report::getProductProcedure('i', 'product_id') . \"\n \" . Report::getConfigProcedure('o', 'config_id') . \"\n GROUP BY config_id\n \")->execute(strtotime('-24 hours'));\n\n if (!$objOrders->numRows) {\n\n $strBuffer .= '\n<p class=\"tl_info\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_empty'] . '</p>';\n\n } else {\n\n $i = -1;\n $strBuffer .= '\n<div class=\"tl_listing_container list_view\">\n <table class=\"tl_listing\">\n <tr>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['currency'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['orders#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['products#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['sales#'] . '</th>\n </tr>';\n\n\n while ($objOrders->next())\n {\n $strBuffer .= '\n <tr class=\"row_' . ++$i . ($i%2 ? 'odd' : 'even') . '\">\n <td class=\"tl_file_list\">' . $objOrders->config_name . '</td>\n <td class=\"tl_file_list\">' . $objOrders->currency . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_orders . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_items . '</td>\n <td class=\"tl_file_list\">' . Isotope::formatPrice($objOrders->total_sales) . '</td>\n </tr>';\n }\n\n $strBuffer .= '\n </table>\n</div>';\n }\n\n\n $strBuffer .= '\n</div>\n</fieldset>';\n\n return $strBuffer;\n }",
"public function weekly() {\n\n $data = $this->mdl_reports->scheduled_reports(\"weekly\");\n for ($i = 0; $i < count($data); $i++) {\n $this->create_report($data[$i]['report_type_id'], $data[$i]['company_id'], $data[$i]['tab_one_ids'], $data[$i]['tab_two_ids'], $data[$i]['email']);\n }\n }",
"public function overviewWeek()\n {\n $start = Carbon::tomorrow();\n $collection = collect();\n\n for ($date = new Carbon($start); $date->lte((new Carbon($start))->addWeek()); $date->addDay()) {\n\n $collection->put($date->format('d-m-Y'),$this->overviewGet($date));\n }\n return $collection;\n }",
"function getWeekHTML($wo, $m, $y){\n\t\t// Show sunday - saturday \n\t\t// $wo = week offset, +1 next week, -1 = last week\n\t\t// $day for 1 day view\n\n\t\t$NumDays = 7;\n\n\t\t$cws = null; // currentweekstart\n\t\t$dws = null; // displayweekstart\n\t\t\n\t\tif($this->startDay == 0){\n\t\t\tif(date(\"w\")==0){\n\t\t\t\t// today is Sunday $cws = today\n\t\t\t\t$cws = strtotime(\"now\");\n\t\t\t} else {\n\t\t\t\t$cws = strtotime(\"last Sunday\");\n\t\t\t}\n\t\t} else {\n\t\t\t// get current week's Sunday ($cws = currentweekstart)\n\t\t\tif(date(\"w\")==1){\n\t\t\t\t// today is Sunday $cws = today\n\t\t\t\t$cws = strtotime(\"now\");\n\t\t\t} else {\n\t\t\t\t$cws = strtotime(\"last Monday\");\n\t\t\t}\n\t\t}\n\n\t\tif($wo == 0){\n\t\t\t$dws = $cws;\n\t\t} else {\n\t\t\t$dws = strtotime(strval($wo).\" week\", $cws); \n\t\t}\t\t\n\t\t\n\t\t$bookings = $this->getBookings($this->resAdmin, '', '', date(\"Y-m-d\", $dws), $NumDays, \"week\");\n\n\t\t$bookoffs = null;\n\t\tif($this->fd_show_bookoffs){\n\t\t\t$bookoffs = $this->getBookoffs($this->resAdmin, date(\"m\", $dws), date(\"y\", $dws), date(\"Y-m-d\", $dws), $NumDays, \"week\");\n\t\t\t//print_r($bookoffs);\n\t\t}\n\t\t$statuses = $this->getStatuses();\n\t\t\n\t\t$header = JText::_('RS1_FRONTDESK_SCRN_VIEW_WEEK');\n\t\t$prevWeek = $this->getWeekviewLinkOnClick($wo-1);\n\t\t$nextWeek = $this->getWeekviewLinkOnClick($wo+1);\n\t\t$lang = JFactory::getLanguage();\n\t\tsetlocale(LC_TIME, str_replace(\"-\", \"_\", $lang->getTag()).\".utf8\");\n\t\t// on a Windows server you need to spell it out\n\t\t// offical names can be found here..\n\t\t// http://msdn.microsoft.com/en-ca/library/39cwe7zf(v=vs.80).aspx\n\t\t//setlocale(LC_TIME,\"swedish\");\n\t\t// Using the first two letteres seems to work in many cases.\n\t\tif(WINDOWS){\t\n\t\t\tsetlocale(LC_TIME, substr($lang->getTag(),0,2)); \n\t\t}\n\t\t//setlocale(LC_TIME,\"french\");\n\t\t// for Greek you may need to hard code..\n\t\t//setlocale(LC_TIME, array('el_GR.UTF-8','el_GR','greek'));\n\t\t\n\t\t$s = \"\";\n\t\t$i2=1;\n\t\t$colspan = 8;\n\t\tif($this->mobile){\n\t\t\t$colspan = 5;\n\t\t}\n\t\t$array_daynames = getLongDayNamesArray($this->startDay);\n\t\t$s .= \"<div id=\\\"sv_apptpro_front_desk_top\\\">\\n\";\n\t\t$s .= \"<table width=\\\"100%\\\" align=\\\"center\\\" border=\\\"0\\\" class=\\\"calendar_week_view\\\" cellspacing=\\\"0\\\" >\\n\";\n\t\t$s .= \"<tr class=\\\"calendar_week_view_header_row\\\">\\n\";\n\t\t$s .= \"<td width=\\\"5%\\\" align=\\\"left\\\" ><input type=\\\"button\\\" onclick=\\\"$prevWeek\\\" value=\\\"<<\\\"></td>\\n\";\n\t\t$s .= \"<td style=\\\"text-align:center\\\" colspan=\\\"\".($colspan-2).\"\\\" class=\\\"calendarHeader\\\" >$header</td>\\n\"; \n\t\t$s .= \"<td width=\\\"5%\\\" align=\\\"right\\\" ><input type=\\\"button\\\" onclick=\\\"$nextWeek\\\" value=\\\">>\\\"></td>\\n\";\n\t\t$s .= \"</tr>\\n\";\n\t\tfor($i=0; $i<$NumDays; $i++){\n\t\t\t// week day\n\t\t\t$link = \"# onclick='goDayView(\\\"\".date(\"Y-m-d\", strtotime(strval($i).\" day\", $dws)).\"\\\");return false;'\";\t\t\t\t\t\t\n\t\t\t$s .= \"<tr>\\n\";\n\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\">\\n\";\n\t\t\t$s .= \" <table class=\\\"week_day_table\\\" width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" >\\n\";\n\t\t\t$s .= \" <tr >\\n\";\n\n\t\t\tif(WINDOWS){\n\t\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\"> <a href=\".$link.\">\".$array_daynames[$i].\" \".iconv(getIconvCharset(), 'UTF-8//IGNORE',strftime($this->week_view_header_date_format, strtotime(strval($i).\" day\", $dws))).\"</a></td>\\n\";\n\t\t\t} else {\n\t\t\t\t$s .= \" <td colspan=\\\"\".$colspan.\"\\\"> <a href=\".$link.\">\".$array_daynames[$i].\" \".strftime($this->week_view_header_date_format, strtotime(strval($i).\" day\", $dws)).\"</a></td>\\n\";\n\t\t\t}\n\t\t\t$s .= \" </tr>\\n\";\t\t\n\t\t\t$day_to_check = date(\"Y-m-d\", strtotime(strval($i).\" day\", $dws));\n\t\t\t$k = 0;\n\t\t\tforeach($bookings as $booking){\n\t\t\t\tif($booking->startdate == $day_to_check){\n\t\t\t\t\tif($this->fd_read_only){\n\t\t\t\t\t\tif($this->fd_detail_popup){\n\t\t\t\t\t\t\t$link = JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid). \"&format=readonly class=\\\"modal\\\" rel=\\\"{handler: 'iframe', size: {x: 800, y: 600}, onClose: function() {}}\\\" \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link = \"'#' onclick=\\\"alert('\".JText::_('RS1_DETAIL_VIEW_DISABLED').\"');return true;\\\" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$link \t= JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid);\n\t\t\t\t\t}\n\n\t\t\t\t\t$s .= \"<tr class='week_row'>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\"><input type=\\\"checkbox\\\" id=\\\"cb\".$i2.\"\\\" name=\\\"cid[]\\\" value=\\\"\".$booking->id_requests.\"\\\" /></td>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"10%\\\" align=\\\"left\\\">\".$booking->display_starttime.\"</td>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> \".JText::_(stripslashes($booking->resname)).\"</td>\\n\";\n\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> \".JText::_(stripslashes($booking->ServiceName)).\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\tif($this->fd_allow_show_seats){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"left\\\"> \".$booking->booked_seats.\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$s .= \" <td width=\\\"15%\\\" align=\\\"left\\\"> <a href=\".$link.\">\".stripslashes($booking->name).\"</a></td>\";\n\t\t\t\t\tif($this->fd_show_contact_info){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"30%\\\" align=\\\"left\\\"><a href=\\\"mailto:\".$booking->email.\"\\\">\".$booking->email.\"</a></td>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\" width=\\\"10%\\\"><span class='color_\".$booking->payment_status.\"'>\".translated_status($booking->payment_status).\"</span></td>\\n\";\n\t\t\t\t\n\t\t\t\t\tif($this->apptpro_config->status_quick_change == \"No\"){\n\t\t\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\"><span class='color_\".$booking->request_status.\"'>\".translated_status($booking->request_status).\"</span></td>\\n\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= \" <td width=\\\"10%\\\" align=\\\"center\\\"><span class='color_\".$booking->request_status.\"'>\".substr(translated_status($booking->request_status),0,3).\"</span></td>\\n\";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$s .= \" <td align=\\\"center\\\">\\n\";\n\t\t\t\t\t\t$s .= \" <select id=\\\"booking_status_\".$booking->id_requests.\"\\\" name=\\\"booking_status\".$booking->id_requests.\"\\\" \"; \n\t\t\t\t\t\t$s .= \"\t\t\tonfocus=\\\"this.oldvalue = this.value;\\\" onchange=\\\"quick_status_change('\".$booking->id_requests.\"',this); return false;\\\"\";\n\t\t\t\t\t\t$s .= \"\t\t\tstyle=\\\"width:auto\\\">\\n\";\n\t\t\t\t\t\tforeach($statuses as $status_row){\n\t\t\t\t\t\t\t$s .= \"\t\t<option value=\\\"\".$status_row->internal_value.\"\\\" class=\\\"color_\".$status_row->internal_value.\"\\\" \";\n\t\t\t\t\t\t\t\tif($booking->request_status == $status_row->internal_value ? $s .=\" selected='selected' \":\"\");\n\t\t\t\t\t\t\t\t$s .= \">\".JText::_($status_row->status).\"</option>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s .= \"\t\t</select>\\n\";\n\t\t\t\t\t\t$s .= \"</td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif($this->fd_show_financials){\n\t\t\t\t\t\t$s .= \" <td align=\\\"right\\\">\".translated_status($booking->payment_status).($booking->invoice_number != \"\"?\"<br/>(\".$booking->invoice_number.\")\":\"\").\"</td>\\n\";\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$s .= \"</tr>\\n\";\n\t\t\t\t\t$i2++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->fd_show_bookoffs){\n\t\t\t\tforeach($bookoffs as $bookoff){\n\t\t\t\t\tif($bookoff->off_date == $day_to_check){\n\t\t\t\t\t\tif($bookoff->full_day == \"Yes\"){\n\t\t\t\t\t\t\t$display_timeoff = JText::_('RS1_FRONTDESK_BO_FULLDAY');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$display_timeoff = $bookoff->display_bo_starttime.\" - \".$bookoff->display_bo_endtime;\n\t\t\t\t\t\t\tif($bookoff->description != \"\"){\n\t\t\t\t\t\t\t\t$display_timeoff .= \"\\n\".$bookoff->description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s .= \"<tr><td colspan=8><label class='calendar_text_bookoff' title='\".$display_timeoff.\"'>\".$bookoff->name.\" - \".$display_timeoff.\"</label></td></tr>\";\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t $s .= \" </table>\\n\";\n\t\t $s .= \" </td>\\n\";\n\t\t $s .= \" </tr>\\n\";\n\t\t}\n\t\t$s .= \"</table>\\n\";\n\t\t$s .= \"</div>\\n\";\n\t\t$s .= \"<input type=\\\"hidden\\\" name=\\\"cur_week_offset\\\" id=\\\"cur_week_offset\\\" value=\\\"\".$wo.\"\\\">\";\n\n\t\tif($this->printerView == \"Yes\"){\n\t\t\t// remove all links\n\t\t\t$s = preg_replace(array('\"<a href(.*?)>\"', '\"</a>\"'), array('',''), $s);\n\t\t}\n\n\t\treturn $s; \t\n\t}",
"public function counterize_feed_weekly_stats( $only_this_week = false, $header_override = '' )\n\t{\n\t\tglobal $wpdb;\n\t\t$sevendaysago = date( 'Y-m-d', time() - 604800 ); //604800 = 86400 * 7\n\t\tif( ! $only_this_week )\n\t\t{\n\t\t\t$sql = \"SELECT \"\n\t\t\t\t. \" \tDAYNAME( `timestamp` ) AS `label`, \"\n\t\t\t\t. \" \tCOUNT( 1 ) AS `count`, \"\n\t\t\t\t. \" \tDAYOFWEEK( `timestamp` ) AS `day` \"\n\t\t\t\t. \" FROM `\" . counterize_logTable() . \"` \"\n\t\t\t\t. \" GROUP BY `label` \"\n\t\t\t\t. \" ORDER BY `day` ASC\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = \"SELECT \"\n\t\t\t\t. \" \tDATE_FORMAT( `timestamp`, '%b %d' ) AS `label`, \"\n\t\t\t\t. \" \tDATE_FORMAT( `timestamp`, '%b' ) AS `month`, \"\n\t\t\t\t. \" \tDATE_FORMAT( `timestamp`, '%d' ) AS `day`, \"\n\t\t\t\t. \" \tCOUNT( 1 ) AS `count`\"\n\t\t\t\t. \" FROM `\" . counterize_logTable() . \"` \"\n\t\t\t\t. \" WHERE `timestamp` >= '{$sevendaysago}' \"\n\t\t\t\t. \" GROUP BY `label` \"\n\t\t\t\t. \" ORDER BY `label` ASC\";\n\t\t}\n\n\t\t$rows = $wpdb->get_results( $sql );\n\n\t\tif( $only_this_week )\n\t\t{\n\t\t\t$title = __( 'Hits for the last 7 days', COUNTERIZE_PLUGIN_TRAFFIC_TD );\n\t\t\tif( ! empty( $header_override ) )\n\t\t\t{\n\t\t\t\t$title = $header_override;\n\t\t\t}\n\t\t\t$feed = new CounterizeFeed( $title, __( 'Date', COUNTERIZE_PLUGIN_TRAFFIC_TD ) );\n\t\t\tforeach( $rows as $row )\n\t\t\t{\n\t\t\t\t$feed->add_item_2( $row->count, sprintf( __( $row->month . ' %d', COUNTERIZE_PLUGIN_TRAFFIC_TD ), $row->day ) );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = __( 'Hits based on day of week', COUNTERIZE_PLUGIN_TRAFFIC_TD );\n\t\t\tif( ! empty( $header_override ) )\n\t\t\t{\n\t\t\t\t$title = $header_override;\n\t\t\t}\n\t\t\t$feed = new CounterizeFeed( $title, __( 'Day of week', COUNTERIZE_PLUGIN_TRAFFIC_TD ) );\n\t\t\tforeach( $rows as $row )\n\t\t\t{\n\t\t\t\t$feed->add_item_2( $row->count, __( $row->label, COUNTERIZE_PLUGIN_TRAFFIC_TD ) );\n\t\t\t}\n\t\t}\n\n\t\tunset( $rows, $sql );\n\n\t\t$feed->refresh_percentages();\n\n\t\treturn $feed;\n\t}",
"function _get_summary() {\n\t\t$row = $this->book->get_status_counts_neh();\n\t\t\n \t\t$html = '<div id=\"summary-widget\" class=\"widget\">'.\n\t\t\t\t\t\t'<h3>Summary</h3>'.\n\t\t\t\t\t\t'<div class=\"inner\">'.\n\t\t\t\t\t\t'Image Types identified:<br>'.\n\t\t\t\t\t\t' '.$row->type_illustration.' Paintings/Drawings/Diagrams<br>'.\n\t\t\t\t\t\t' '.$row->type_photo.' Photographs<br>'.\n\t\t\t\t\t\t' '.$row->type_diagram.' Chart/Table<br>'. \n\t\t\t\t\t\t' '.$row->type_map.' Maps<br>'.\n\t\t\t\t\t\t' '.$row->type_bookplate.' Bookplates<br>'.\n\t\t\t\t\t\t' '.$row->no_images.' With No Images<br>'.\n\t\t\t\t\t\t$row->total_items.' total items / '.$row->total_pages.' total pages<br>'.\n\t\t\t\t\t\t$row->new_items.' new items / '.$row->pages_new_items.' new pages<br>'.\n\t\t\t\t\t\t$row->in_progress.' in progress items / '.$row->pages_in_progress.' in progress pages<br>'.\n\t\t\t\t\t\t$row->completed.' completed items / '.$row->pages_complete.' completed pages<br>'.\n\t\t\t\t\t\t$row->exported.' exported items / '.$row->pages_exported.' exported pages<br>'.\n\t\t\t\t\t\t'<strong>'.($row->exported+$row->completed).' completed & exported items<br>'.($row->pages_exported+$row->pages_complete).' completed & exported pages<br></strong>'.\n\t\t\t\t\t\t'<strong>Avg time per item: '.$row->average_time.'</strong>'.\n\t\t\t\t\t\t'</div>'.\n\t\t\t\t\t\t'</div>';\n\t\treturn $html;\n\t}",
"public function getWeekTopShtXml()\n\t{\n\t\t$sqlId='weekTopSht';\n\t\treturn $this->getQueryTags(WEEK_TOP_SHT_LIBRARY,$sqlId);\n\t}",
"function api_getWeeklyTotal(){\n\t$db=Database::getDB();\n\t$date=TPR_Validator::getPostParam('date');\n\tif(TPR_Validator::isDateString($date)){\n\t\t$timestamp=$date.' 00:00';\n\t\t$result=$db->getUserMinutesForWeek($timestamp);\n\t\tif($result){\n\t\t\ttpr_asyncOK(['minutes'=>$result['total']]);\n\t\t}else{\n\t\t\ttpr_asyncError('Database Error: '.$db->getError());\n\t\t}\n\t}else{\n\t\ttpr_asyncError('Invalid Date');\n\t}\n}",
"public function counterize_render_weekly_stats( $only_this_week = false, $print_header = true, $header_override = '' )\n\t{\n\t\t$feed = $this->counterize_feed_weekly_stats( $only_this_week, $header_override );\n\n\t\tif( is_admin() )\n\t\t{\n\t\t\t$feed->render_feed_horizontal( 80, '100%', $print_header );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$feed->render_feed_vertical( true, '100%', false, false, false, $print_header );\n\t\t}\n\t}",
"public function weeklySummary(Request $request)\n {\n //get fc to validate dates\n $fc = new ForecastingController();\n\n //if date check fails run dates for this week only\n if (!$fc->checkIsAValidDate($request->date)) {\n $startDate = Carbon::now()->startOfWeek();\n $endDate = Carbon::now()->endOfWeek();\n } else {\n //valid passed date generate those dates\n $startDate = Carbon::parse($request->date)->startOfWeek();\n $endDate = Carbon::parse($request->date)->endOfWeek();\n }\n $title = \"Weekly Stock on Hand\";\n\n //get stock on hand infrmation\n $counts = StockOnHand::where(\"store_id\", $this->store->id)\n ->whereBetween('created_at', [$startDate->format('Y-m-d'), $endDate->format('Y-m-d')])\n ->orderby('created_at', 'asc')\n ->get();\n\n $countMap = [];\n $productMap = [];\n\n //remap count data, gather products\n foreach ($counts as $count) {\n $products = $count->products()->with(\"units\")->get();\n\n foreach ($products as $product) {\n\n //map daily entry to value in total\n if (!isset($counter[$product->id][$count->created_at->format('D')])) {\n $countMap[$product->id][$count->created_at->format('D')] = 0;\n }\n\n $countMap[$product->id][$count->created_at->format('D')] += ($product->pivot->count / $product->units->quantity);\n\n $productMap[$product->id] = $product;\n }\n\n //var_dump($countMap);\n }\n\n\n //dd($counts);\n $days = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n $chartData1 = $this->chartData($countMap, $productMap, $days);\n\n return view(\"soh.weekly\", [\n \"title\" => $title,\n \"startDate\" => $startDate,\n \"endDate\" => $endDate,\n \"counts\" => $counts,\n \"countMap\" => $countMap,\n \"productMap\" => $productMap,\n \"days\" => $days,\n \"chartData1\" => $chartData1\n ]);\n }",
"function generate_weekly_report_txt($c_data=array()){\n\t\t\n\t\tApp::import('Helper','txt');\n\t\t$txt = new txtHelper();\n\t\t$line = array(\"Store number\",\"Terminal\",\"Vendor\",\"Product\",\"Item\",\"Face Value\",\"Billed downloads\",\"Billed returns\",\"Net Billed Downloads\",\"Net Face Value\",\"Net Cost\",\"Net Commission\",\"Merchant\",\"Site\",\"Street\",\"Postcode\",\"City\",\"Duplicate Downloads\",\"All Downloads\",\"Duplicate Returns\",\"All Returns\",\"Net All Downloads\",\"Download Face Value\",\"Download Cost\",\"Download Commission\",\"Return Face Value\",\"Return Cost\",\"Return Commission\",\"From\",\"To\");\n\t\t$txt->addRow($line);\n\t\tif(!empty($c_data)){\n\t\t\tforeach($c_data as $data){\n\t\t\t\n\t\t\t\t$line = array($data['u']['u_id'],'X','X','X',$data['p']['p_id'],'X',$data['0']['total'],'X',$data['0']['total'],'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X');\n\t\t\t\t$txt->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $txt->render(date(\"d_M_Y_h_i_s\").\"_weekly\");\n\t\texit();\n\t}",
"function calendar_week_header($view) {\r\n $len = isset($view->date_info->style_name_size) ? $view->date_info->style_name_size : (!empty($view->date_info->mini) ? 1 : 3);\r\n $with_week = !empty($view->date_info->style_with_weekno);\r\n \r\n // create week header\r\n $untranslated_days = calendar_untranslated_days();\r\n if ($len == 99) {\r\n $translated_days = date_week_days_ordered(date_week_days(TRUE));\r\n }\r\n else {\r\n $translated_days = date_week_days_ordered(date_week_days_abbr(TRUE));\r\n }\r\n if ($with_week) {\r\n $row[] = array('header' => TRUE, 'class' => \"days week\", 'data' => ' ');\r\n }\r\n foreach ($untranslated_days as $delta => $day) {\r\n $label = $len < 3 ? drupal_substr($translated_days[$delta], 0 , $len) : $translated_days[$delta];\r\n $row[] = array('header' => TRUE, 'class' => \"days \". $day, 'data' => $label);\r\n }\r\n return $row;\r\n}",
"function getCFLProjsSummary($season, $week)\n{\n echo \"<table class=\\\"proj-table\\\"><tr><td>\";\n getCFLCellPosition('QB', $season, $week, 5);\n echo \"</td><td>\";\n getCFLCellPosition('RB', $season, $week, 5);\n echo \"</td></tr><tr><td>\";\n getCFLCellPosition('WR', $season, $week, 5);\n echo \"</td><td>\";\n getCFLCellPosition('DST', $season, $week, 5);\n echo \"</td></tr></table>\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the File::format_size() method | public function testFormatSize()
{
$this->assertEquals("1000 bytes", File::format_size(1000));
$this->assertEquals("1023 bytes", File::format_size(1023));
$this->assertEquals("1 KB", File::format_size(1025));
$this->assertEquals("10 KB", File::format_size(10000));
$this->assertEquals("49 KB", File::format_size(50000));
$this->assertEquals("977 KB", File::format_size(1000000));
$this->assertEquals("1 MB", File::format_size(1024*1024));
$this->assertEquals("954 MB", File::format_size(1000000000));
$this->assertEquals("1 GB", File::format_size(1024*1024*1024));
$this->assertEquals("9.3 GB", File::format_size(10000000000));
// It use any denomination higher than GB. It also doesn't overflow with >32 bit integers
$this->assertEquals("93132.3 GB", File::format_size(100000000000000));
} | [
"function testFormatSize() {\n\t\t$this->assertEquals(\"1000 bytes\", File::format_size(1000));\n\t\t$this->assertEquals(\"1023 bytes\", File::format_size(1023));\n\t\t$this->assertEquals(\"1 KB\", File::format_size(1025));\n\t\t$this->assertEquals(\"9.8 KB\", File::format_size(10000));\n\t\t$this->assertEquals(\"49 KB\", File::format_size(50000));\n\t\t$this->assertEquals(\"977 KB\", File::format_size(1000000));\n\t\t$this->assertEquals(\"1 MB\", File::format_size(1024*1024));\n\t\t$this->assertEquals(\"954 MB\", File::format_size(1000000000));\n\t\t$this->assertEquals(\"1 GB\", File::format_size(1024*1024*1024));\n\t\t$this->assertEquals(\"9.3 GB\", File::format_size(10000000000));\n\t\t// It use any denomination higher than GB. It also doesn't overflow with >32 bit integers\n\t\t$this->assertEquals(\"93132.3 GB\", File::format_size(100000000000000));\n\t}",
"public function testGetSize()\n {\n $this->assertEquals(\n 3,\n $this->file->getSize(),\n 'The uncompressed size of the file should be returned.'\n );\n }",
"public function testSizeOutputsSize()\n {\n $size = file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertTrue($size === (int) File::size(self::$temp.DS.'foo.txt'));\n }",
"abstract public function testFilesizeFromVal();",
"public function testSizeOutputsSize()\n {\n $size = file_put_contents(self::$temp . DS . 'foo.txt', 'foo');\n\n $this->assertTrue($size === (int) Storage::size(self::$temp . DS . 'foo.txt'));\n }",
"public function testFormatSize() {\n\n $this->assertEquals(\"99.00 B\", FileUtility::formatSize(99));\n $this->assertEquals(\"1.00 KB\", FileUtility::formatSize(1000));\n $this->assertEquals(\"1.00 MB\", FileUtility::formatSize(1000000));\n $this->assertEquals(\"1.00 GB\", FileUtility::formatSize(1000000000));\n $this->assertEquals(\"1.00 TB\", FileUtility::formatSize(1000000000000));\n $this->assertEquals(\"1.00 PB\", FileUtility::formatSize(1000000000000000));\n $this->assertEquals(\"1.00 EB\", FileUtility::formatSize(1000000000000000000));\n $this->assertEquals(\"1.00 ZB\", FileUtility::formatSize(1000000000000000000000));\n $this->assertEquals(\"1.00 YB\", FileUtility::formatSize(1000000000000000000000000));\n\n $this->assertEquals(\"0.099 KB\", FileUtility::formatSize(99, \"KB\", 3));\n $this->assertEquals(\"0.001 MB\", FileUtility::formatSize(1000, \"MB\", 3));\n $this->assertEquals(\"0.001 GB\", FileUtility::formatSize(1000000, \"GB\", 3));\n $this->assertEquals(\"0.001 TB\", FileUtility::formatSize(1000000000, \"TB\", 3));\n $this->assertEquals(\"0.001 PB\", FileUtility::formatSize(1000000000000, \"PB\", 3));\n $this->assertEquals(\"0.001 EB\", FileUtility::formatSize(1000000000000000, \"EB\", 3));\n $this->assertEquals(\"0.001 ZB\", FileUtility::formatSize(1000000000000000000, \"ZB\", 3));\n $this->assertEquals(\"0.001 YB\", FileUtility::formatSize(1000000000000000000000, \"YB\", 3));\n\n try {\n FileUtility::formatSize(99, \"exception\");\n } catch (Exception $ex) {\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The unit \\\"exception\\\" does not exists\", $ex->getMessage());\n }\n }",
"public function testGetFilesize() : void {\n\t\t$this->assertNotEquals('', $this->fileService->getFilesize($this->file));\n\t}",
"public function testFstatReturnsSizeInformation()\n {\n $handle = fopen($this->stream, 'rb+');\n $info = fstat($handle);\n fclose($handle);\n $this->assertInternalType('array', $info);\n $expectedSize = strlen(self::INITIAL_CONTENT);\n $this->assertArrayHasKey(7, $info, 'Missing numerical key.');\n $this->assertArrayHasKey('size', $info, 'Missing associative key.');\n $this->assertEquals($expectedSize, $info[7]);\n $this->assertEquals($expectedSize, $info['size']);\n }",
"public function testGetSize(): void\n {\n $model = File::load([\n \"size\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getSize());\n }",
"public function testGetNameSize()\n {\n $this->assertEquals(\n 2,\n $this->file->getNameSize(),\n 'The size of the file name should be returned.'\n );\n }",
"public function testFileSize()\n {\n $upload = Larupload::init('uploader')->upload($this->imageJPG);\n\n $this->assertEquals($upload->meta->size, $this->imageDetails['jpg']['size']);\n }",
"function theme_file_metadata_size($data) {\n return format_size($data);\n}",
"function xdiff_file_bdiff_size(string $file): int {}",
"function show_size($f,$format=true,$size=false)\n{\n\tif($format || $size!==false)\n\t{\n\t\tif($size===false) $size=show_size($f,false);\n\t\tif(!empty($GLOBALS['TIMED_OUT'])) $p = '>';\n\t\telse $p = '';\n\t\tif($size<=1024) return $p.$size.' bytes';\n\t\telse if($size<=1048576) return $p.round($size/1024,2).' Kb';\n\t\telse if($size<=1073741824) return $p.round($size/1048576,2).' Mb';\n\t\telse if($size<=1099511627776) return $p.round($size/1073741824,2).' Gb';\n\t\telse if($size<=1125899906842624) return $p.round($size/1099511627776,2).' Tb';\n\t\telse return $p.round($size/1125899906842624,2).' Pb';\n\t}else\n\t{\n\t\tif(d_is_file($f)) return sprintf(\"%u\",d_filesize($f)); // for files the size of which is more than 2 Gb and less than 4 Gb\n\t\t$size=0;\n\t\tsetreadable($f,true);\n\t\t$dh=opendir($f);\n\t\twhile(($file=readdir($dh))!==false)\n\t\t{\n\t\t\tif($file=='.' || $file=='..') continue;\n\t\t\t// delete the next lines if you don't want any limits\n\t\t\tif(!defined('NOLIMIT') && array_sum(explode(' ',microtime()))-START_TIME>DIRSIZE_LIMIT)\n\t\t\t{\n\t\t\t\t$GLOBALS['TIMED_OUT'] = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(d_is_file($f.'/'.$file)) $size+=sprintf(\"%u\",d_filesize($f.'/'.$file));\n\t\t\telse $size+=show_size($f.'/'.$file,false);\n\t\t}\n\t\tclosedir($dh);\n\t\treturn $size+d_filesize($f); // +d_filesize($f) for *nix directories\n\t}\n}",
"public function getSize($file);",
"function show_size($f,$format=true,$size=false,$skip_links=false)\n{\n\tif($format || $size!==false)\n\t{\n\t\tif($size===false) $size=show_size($f,false,false,$skip_links);\n\t\tif(!empty($GLOBALS['TIMED_OUT'])) $p = '>';\n\t\telse $p = '';\n\t\tif($size<=1024) return $p.$size.' байт';\n\t\telse if($size<=1048576) return $p.round($size/1024,2).' Кб';\n\t\telse if($size<=1073741824) return $p.round($size/1048576,2).' Мб';\n\t\telse if($size<=1099511627776) return $p.round($size/1073741824,2).' Гб';\n\t\telse if($size<=1125899906842624) return $p.round($size/1099511627776,2).' Тб';\n\t\telse return $p.round($size/1125899906842624,2).' Пб';\n\t}else\n\t{\n\t\tif($skip_links && is_link($f)) return 0;\n\t\t\n\t\tif(is_file($f))\n\t\t{\n\t\t\t$GLOBALS['show_size_files'] = 1;\n\t\t\t$GLOBALS['show_size_dirs'] = 0;\n\t\t\t\n\t\t\treturn filesize($f);\n\t\t}else if(!is_dir($f))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t$size=0;\n\n\t\t$dh=opendir($f);\n\t\t$fs=$ds=0;\n\t\t\n\t\twhile(($file=readdir($dh))!==false)\n\t\t{\n\t\t\tif($file=='.' || $file=='..') continue;\n\t\t\t// delete the next lines if you don't want any limits\n\t\t\tif($skip_links && is_link($f.'/'.$file)) continue;\n\t\t\t\n\t\t\tif(is_file($f.'/'.$file))\n\t\t\t{\n\t\t\t\t$size+=filesize($f.'/'.$file);\n\t\t\t\t$fs++;\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$size+=show_size($f.'/'.$file,false,false,$skip_links);\n\t\t\t\t$ds+=$GLOBALS['show_size_dirs'];\n\t\t\t\t$fs+=$GLOBALS['show_size_files'];\n\t\t\t}\n\t\t}\n\t\tclosedir($dh);\n\t\t\n\t\t$GLOBALS['show_size_files'] = $fs;\n\t\t$GLOBALS['show_size_dirs'] = 1+$ds;\n\t\treturn $size+filesize($f); // +filesize($f) for *nix directories\n\t}\n}",
"public function testGetSize()\n\t{\n\t\t$size = $this->object->getSize();\n\t\t$this->assertEquals($size, 648818);\n\t}",
"public function testCorrectFileSizeConfigValue()\n {\n $config = new \\Belyakov\\Library\\Config($this->getConfigPath($this->file));\n $this->assertEquals($config->getFileSize(), $this->testConfigFileSize);\n }",
"function check_file_size($file) {\n if ($file[\"size\"] > 1500000)\n return false;\n return true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check exists table Remove DB module | public function unInstallDb() {
Loader::includeModule($this->MODULE_ID);
if (Loader::includeModule($this->MODULE_ID)) {
$tableName = \Isaev\Seolinks\SeolinksTable::getTableName();
$connection = Application::getInstance()->getConnection();
if (\Bitrix\Main\Application::getConnection()->isTableExists($tableName) !== false) {
$connection->dropTable($tableName);
}
}
return true;
} | [
"public function drop_table_if_exists()\n\t{\n\t\t$this->_single_statement = 'drop table if exists '.$this->_db->quote_table($this->_table);\n\t}",
"static function todolist_delete_table() {\r\n global $wpdb;\r\n\r\n if (!current_user_can('activate_plugins')) return;\r\n\r\n $table_name = $wpdb->prefix . 'todolist';\r\n $check_table = $wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\");\r\n\r\n if ($check_table === $table_name) {\r\n $sql = \"DROP TABLE \" . $table_name . \";\";\r\n }\r\n $wpdb->query($wpdb->prepare($sql));\r\n }",
"public function removeTable() {\n\n\t\t$table=strtolower(get_class($this->base));\n\n\t\tif($this->provider->tableExists($table))\n\n\t\t\t$this->provider->dropTable($table);\n\t}",
"function bootstrapSlider_deactivation() {\n global $wpdb;\n $db = $wpdb->prefix . \"bootstrapSliderTable\";\n\n if($wpdb->get_var(\"show tables like '$db'\") == $db) {\n $sql = \"DROP TABLE IF EXISTS $db\";\n $wpdb->query($sql);\n }\n }",
"public function test_ensure_table_does_exist()\n {\n $users = $this->adapter->has_table('users', true);\n $this->assertEquals(false, $users);\n $t1 = new Ruckusing_Adapter_Sqlite3_TableDefinition($this->adapter, \"users\");\n $t1->column(\"email\", \"string\", array('limit' => 20));\n $sql = $t1->finish();\n\n $users = $this->adapter->table_exists('users', true);\n $this->assertEquals(true, $users);\n $this->drop_table('users');\n }",
"private function dropTestTableIfExists()\n {\n if ($this->db->tableExists($this->tableName)) {\n $this->db->dropTableName($this->tableName);\n }\n }",
"function dropTable()\n {\n global $objDatabase;\n\n $objResult = $objDatabase->Execute(\"SELECT id FROM \".$this->oldTable.\" ORDER BY id\");\n if ($objResult) {\n if ($objResult->RecordCount() == 0) {\n $objDatabase->Execute(\"DROP TABLE \".$this->oldTable);\n }\n }\n }",
"function drop_db_table () {\n\t\t$stm = DB::$pdo->prepare(\"DROP TABLE `\".$this->name['variable'].\"`\");\n\t\t$stm->execute();\n\t}",
"private function unistallDatabase()\n {\n $pluginTourLogTable = Database::get_main_table(TABLE_TOUR_LOG);\n\n $sql = \"DROP TABLE IF EXISTS $pluginTourLogTable\";\n\n Database::query($sql);\n }",
"private function __removeTables() {\n $db = get_db();\n $db->query(\"DROP TABLE IF EXISTS `{$db->prefix}iiif_items_job_statuses`;\");\n $db->query(\"DROP TABLE IF EXISTS `{$db->prefix}iiif_items_cached_json_data`;\");\n }",
"public function Drop(){\n $this->dbforge->drop_table(TABLE);\n echo('Compile for drop table '.TABLE.' success');\n }",
"private function deleteDatabaseTable()\n {\n Db::dropTables(Common::prefixTable('log_performance'));\n }",
"function navBoxes_deactivation()\n {\n global $wpdb;\n $db = $wpdb->prefix . \"navBoxesTable\";\n\n if ($wpdb->get_var(\"show tables like '$db'\") == $db) {\n $sql = \"DROP TABLE IF EXISTS $db\";\n $wpdb->query($sql);\n }\n }",
"public function tableExists();",
"public function uninstall()\n {\n $this->db->query(\"\n DROP TABLE \".Kohana::config('database.default.table_prefix').\"polling_locations;\n \n \");\n }",
"function wprfqq_remove () {\n global $wpdb;\n $table_name = $wpdb->prefix . 'wprfq';\n $sql = \"DROP TABLE IF EXISTS $table_name;\";\n $wpdb->query($sql);\n}",
"function gVerfolgung_delete() {\r\n\t$pntables = pnDBGetTables();\r\n\t\r\n\t$table = $pntables['gVerfolgung_Verfolgungsliste'];\r\n\t$sql = \"DROP TABLE IF EXISTS $table\";\r\n\tDBUtil::executeSQL ($sql, false, false);\r\n\t\r\n\t\r\n\t \r\n\t \r\n\treturn true;\r\n}",
"public function destroyTable(){\n\t\t// Connect to the database.\n\t\t$this->connect();\n\n\t\t// Assign the query\n\t\t$query = mysql_query(\n\t\t\"DROP TABLE `{$this->prefix}debug`\");\n\n\t\tif ($query){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->disconnect();\n\t}",
"private function dropTable()\n {\n ee()->load->library('smartforge');\n ee()->smartforge->drop_table($this->getTableName());\n\n ee()->cache->delete($this->getCacheKey());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the SermRevision column Example usage: $query>filterBySermrevision('fooValue'); // WHERE SermRevision = 'fooValue' $query>filterBySermrevision('%fooValue%', Criteria::LIKE); // WHERE SermRevision LIKE '%fooValue%' | public function filterBySermrevision($sermrevision = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($sermrevision)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(InvSerialMasterTableMap::COL_SERMREVISION, $sermrevision, $comparison);
} | [
"public static function getFilteredIdRevisions($status, $idModule=null,$idAuthor=null) {\n $sqlCancelledEditor = \"(vcp.id_state = \" . RevisionState::CancelledAuthorState . \")\";\n $sqlCancelled = \"(vcp.id_state = \" . RevisionState::CancelledState . \")\";\n $sqlReady = \"(vcp.id_state = \" . RevisionState::ReleasedState . \")\";\n $sqlApproved = \"(vcp.id_state = \" . RevisionState::ApprovedState . \")\";\n $sqlRejected = \"(vcp.id_state = \" . RevisionState::RejectedState . \")\";\n $sqlSent = \"(vcp.id_state = \" . RevisionState::SendForApprovalState . \")\";\n $sqlEditable = \"(vcp.id_state = \" . RevisionState::EditableState . \")\";\n\n\n $finalSql = '';\n $authorSql = '';\n if($status) {\n foreach ($status as $key => $sql) {\n if ($sql == 'true') {\n switch ($key) {\n case 'approved':\n $finalSql = $finalSql . ' or ' . $sqlApproved;\n break;\n case 'editable';\n $finalSql = $finalSql . ' or ' . $sqlEditable;\n break;\n case 'sent';\n $finalSql = $finalSql . ' or ' . $sqlSent;\n break;\n case 'reject';\n $finalSql = $finalSql . ' or ' . $sqlRejected;\n break;\n case 'cancelled';\n $finalSql = $finalSql . ' or ' . $sqlCancelled;\n break;\n case 'cancelledEditor';\n $finalSql = $finalSql . ' or ' . $sqlCancelledEditor;\n break;\n case 'release';\n $finalSql = $finalSql . ' or ' . $sqlReady;\n break;\n default:\n $finalSql = '';\n break;\n };\n }\n }\n }\n\n if($idAuthor){\n $authorSql=\" and (vcp.id_user_created=\".$idAuthor.\")\";\n }\n if($idAuthor && $finalSql==''){\n $finalSql=true;\n }else{\n $finalSql = substr($finalSql, 3);\n }\n \n if($idModule==null){\n $sql=\"SELECT DISTINCT vcm.id_module_revision FROM vc_module vcm LEFT JOIN vc_module_properties vcp ON vcp.id=vcm.id_properties\n WHERE (\".$finalSql.\")\".$authorSql;\n }else{\n $sql=\"SELECT DISTINCT vcm.id_module_revision FROM vc_module vcm LEFT JOIN vc_module_properties vcp ON vcp.id=vcm.id_properties\n WHERE vcm.id_module=\".$idModule.\" \n and (\".$finalSql.\")\".$authorSql;\n }\n $list = Yii::app()->db->createCommand($sql)->queryAll();\n $actualIdList = [];\n foreach ($list as $item) {\n array_push($actualIdList, $item['id_module_revision']);\n }\n return $actualIdList;\n }",
"public function setRevision($revision);",
"protected function filter($c)\n {\n //FROM UNTIL SET (SERIAL_TYPE -> SERIAL)\n if ($this->hasRequestParameter('from')){ //ver que es YYYY-mm-dd\n $criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('from'), Criteria::GREATER_EQUAL);\n }\n \n if ($this->hasRequestParameter('until')){ //ver que es YYYY-mm-dd\n if (isset($criterion)){\n\t$criterion->addAnd($c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL));\n }else{\n\t$criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL);\n }\n }\n \n if (isset($criterion)){\n $c->add($criterion);\n }\n\n if($this->hasRequestParameter('set')&&(is_int($this->getRequestParameter('set')))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n }\n\n\n if(($this->hasRequestParameter('set'))&&($ret = strstr($this->getRequestParameter('set'), ':('))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n\n $c->add(MmPeer::SERIAL_ID, intval(substr($ret, 2))); \n }\n\n }",
"public function vmRunOnHostFilter($vmID)\n\t{\n\t\t//If all clients running on a special VM host should be searched, no search string is allowed\n\t\t$this->searchWHERE = '';\n\t\t$this->vmRunOnHostWHERE = 'clients.vmRunOnHost = '.$vmID.' ';\n\t}",
"public function getRevisionsTo(string $revision): array;",
"public function setRevisionLog($revision_log);",
"public function setRevision($var)\n {\n GPBUtil::checkString($var, True);\n $this->revision = $var;\n\n return $this;\n }",
"public function find($className, $id, $revision)\n {\n if (!$this->metadataFactory->isAudited($className)) {\n throw Exception::notAudited($className);\n }\n\n $class = $this->em->getClassMetadata($className);\n $tableName = $this->config->getTablePrefix() . $class->table['name'] . $this->config->getTableSuffix();\n\n if (!is_array($id)) {\n $id = array($class->identifier[0] => $id);\n }\n\n $whereSQL = \"e.\" . $this->config->getRevisionFieldName() .\" <= ?\";\n\n foreach ($class->identifier AS $idField) {\n if (isset($class->fieldMappings[$idField])) {\n $columnName = $class->fieldMappings[$idField]['columnName'];\n } elseif (isset($class->associationMappings[$idField])) {\n $columnName = $class->associationMappings[$idField]['joinColumns'][0];\n }\n\n $whereSQL .= \" AND \" . $columnName . \" = ?\";\n }\n\n $columnList = \"\";\n $columnMap = array();\n\n foreach ($class->fieldNames as $columnName => $field) {\n if ($columnList) {\n $columnList .= ', ';\n }\n\n $type = Type::getType($class->fieldMappings[$field]['type']);\n $columnList .= $type->convertToPHPValueSQL(\n $class->getQuotedColumnName($field, $this->platform), $this->platform) .' AS ' . $field;\n $columnMap[$field] = $this->platform->getSQLResultCasing($columnName);\n }\n\n foreach ($class->associationMappings AS $assoc) {\n if ( ($assoc['type'] & ClassMetadata::TO_ONE) == 0 || !$assoc['isOwningSide']) {\n continue;\n }\n\n foreach ($assoc['targetToSourceKeyColumns'] as $sourceCol) {\n if ($columnList) {\n $columnList .= ', ';\n }\n\n $columnList .= $sourceCol;\n $columnMap[$sourceCol] = $this->platform->getSQLResultCasing($sourceCol);\n }\n }\n\n $values = array_merge(array($revision), array_values($id));\n\n $query = \"SELECT \" . $columnList . \" FROM \" . $tableName . \" e WHERE \" . $whereSQL . \" ORDER BY e.rev DESC\";\n $row = $this->em->getConnection()->fetchAssoc($query, $values);\n\n if (!$row) {\n throw Exception::noRevisionFound($class->name, $id, $revision);\n }\n\n return $this->createEntity($class->name, $row);\n }",
"public function setRevision($var)\n {\n GPBUtil::checkInt64($var);\n $this->revision = $var;\n }",
"public function setRevision($var)\n {\n GPBUtil::checkInt64($var);\n $this->revision = $var;\n\n return $this;\n }",
"public function setRevision(ServiceRevision $revision = null) {\n $this->revision = $revision;\n return $this;\n }",
"public function setModRevision($var)\n {\n GPBUtil::checkInt64($var);\n $this->mod_revision = $var;\n\n return $this;\n }",
"public function actionGetModuleByRevision() {\n $idRevision = Yii::app()->request->getPost('idRevision');\n $moduleRev= RevisionModule::model()->findByPk($idRevision);\n echo $moduleRev->id_module;\n }",
"public function onRevisionChange();",
"public function GETEntityRevisionsByRevisionID( $entity_id, $revision_id) {\n $params = array();\n $params['entity_id'] = $entity_id;\n $params['revision_id'] = $revision_id;\n return CentralIndex::doCurl(\"GET\",\"/entity/revisions/byRevisionID\",$params);\n }",
"public function addVersionFilter($version) {\n\t\tif ($version instanceof Df_Cms_Model_Page_Version) {\n\t\t\t$version = $version->getId();\n\t\t}\n\t\tif (is_array($version)) {\n\t\t\t$version = array('in' => $version);\n\t\t}\n\t\t$this->addFieldToFilter('version_id', $version);\n\t\treturn $this;\n\t}",
"public function getRevisionAuthor();",
"static function equal($column,$value) {\n return new EqualFilter($column,$value);\n }",
"public function scopeFilteredByString($query, $page, $column, $value){\n return self::where($column, \"like\", \"%$value%\")\n ->orderBy(\"created_at\", \"desc\")\n ->offset(self::PER_PAGE * ($page - 1))\n ->limit(self::PER_PAGE);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy the "testbench.yaml" file. | protected function copyTestbenchConfigurationFile(Application $app, Filesystem $filesystem, string $workingPath): void
{
$configurationFile = LazyCollection::make(function () {
yield 'testbench.yaml';
yield 'testbench.yaml.example';
yield 'testbench.yaml.dist';
})->map(fn ($file) => "{$workingPath}/{$file}")
->filter(fn ($file) => $filesystem->exists($file))
->first();
$testbenchFile = $app->basePath('testbench.yaml');
if ($filesystem->exists($testbenchFile)) {
$filesystem->copy($testbenchFile, "{$testbenchFile}.backup");
$this->beforeTerminating(function () use ($filesystem, $testbenchFile) {
if ($filesystem->exists("{$testbenchFile}.backup")) {
$filesystem->move("{$testbenchFile}.backup", $testbenchFile);
}
});
}
if (! \is_null($configurationFile)) {
$filesystem->copy($configurationFile, $testbenchFile);
$this->beforeTerminating(function () use ($filesystem, $testbenchFile) {
if ($filesystem->exists($testbenchFile)) {
$filesystem->delete($testbenchFile);
}
});
}
} | [
"protected function makeYamlCopy() {\n if ($this->yamlCopyRequired) {\n file_put_contents(\n $this->yamlDocsFile, (new YamlDumper(2))->dump(json_decode(file_get_contents($this->docsFile), true), 20)\n );\n }\n }",
"protected function makeYamlCopy(): void\n {\n if ($this->yamlCopyRequired) {\n file_put_contents(\n $this->yamlDocsFile,\n (new YamlDumper(2))->dump(\n json_decode(file_get_contents($this->docsFile), true),\n 20,\n 0,\n Yaml::DUMP_OBJECT_AS_MAP ^ Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE\n )\n );\n }\n }",
"public static function getSampleYamlFile()\n {\n return self::fixtureDir().'/fixture_sample.yml';\n }",
"protected function copyDefaultPrecommitToTestDirectory()\n {\n mkdir($this->path . '/hooks', 0777, true);\n shell_exec('cp -r hooks ' . $this->path);\n }",
"public function copyTempPreferences()\n {\n $cmd = \"mv {$this->originalDir}/parameters.yml {$this->buildDir}/app/config/parameters.yml\";\n $this->exec($cmd, 'Copying original/parameters.yml to build/app/config/parameters.yml');\n }",
"public function testAddYamlFile()\n {\n $path = $this->getPathToFixture('pass/valid1.yml');\n $this->cfg->addFile($path);\n\n $this->assertEquals('localhost', $this->cfg['host']);\n $this->assertEquals('11211', $this->cfg['port']);\n $this->assertEquals(\n [\n 'pdo_mysql',\n 'pdo_pgsql',\n 'pdo_sqlite',\n ],\n $this->cfg['drivers']\n );\n }",
"private function copyConfig()\n {\n // copy config\n $this->filesystem->copy($this->basePath . \"config/config.php\", config_path('titan.php'));\n $this->line(\"Config Copied: \" . config_path('titan.php'));\n }",
"private static function copyDefaultConfiguration(Event $event)\n {\n $cwd = getcwd();\n\n if (!file_exists($cwd . \"/config/config.yml\")) {\n if (copy($cwd . \"/config/config.dist.yml\", $cwd . \"/config/config.yml\")) {\n $event->getIO()->write(\"Created default config.yml.\");\n } else {\n $event->getIO()->writeError(\"Could not copy default config.yml!\");\n }\n }\n }",
"private function copyConfigFile()\n {\n $path = $this->getConfigPath();\n\n // if generatords config already exist\n if ($this->files->exists($path) && $this->option('force') === false) {\n $this->error(\"{$path} already exists! Run 'generate:publish-stubs --force' to override the config file.\");\n die;\n }\n\n File::copy(__DIR__ . '/../config/config.php', $path);\n }",
"public function copyTheHook()\n {\n $source = $this->config->getVendorDir() . 'felipebool/crook/theHook';\n $destination = $this->config->getProjectRoot() . 'theHook';\n\n copy($source, $destination);\n }",
"protected function writePhpUnitFile()\n {\n $stub = __DIR__.'/stubs/phpunit.stub';\n\n $this->files->copy($stub, $this->packageDirPath.'/phpunit.xml');\n }",
"function createTravisConfigYml()\n{\n $fileContent = <<<CONTENT\nparameters:\n database_driver: pdo_mysql\n database_host: localhost\n database_port: ~\n database_name: tickit\n database_user: root\n database_password:\n\n mailer_transport: smtp\n mailer_host: localhost\n mailer_user: ~\n mailer_password: ~\n\n locale: en\n secret: SomeRandomValue\nCONTENT;\n\n $configDir = getProjectRoot() . '/app/config';\n file_put_contents($configDir . '/parameters.yml', $fileContent);\n\n}",
"private function write()\n\t{\n\t\t$this->config->write($this->path, 'yaml');\n\t}",
"protected function setUpApp()\n {\n $this->copy(RESOURCE_PATH . '/example', $this->currentDir);\n }",
"public function testDump() {\n\t\tConfigure::config('test_reader', new PhpReader(TMP));\n\n\t\t$result = Configure::dump('config_test.php', 'test_reader');\n\t\t$this->assertTrue($result > 0);\n\t\t$result = file_get_contents(TMP . 'config_test.php');\n\t\t$this->assertContains('<?php', $result);\n\t\t$this->assertContains('$config = ', $result);\n\t\tif (file_exists(TMP . 'config_test.php')) {\n\t\t\tunlink(TMP . 'config_test.php');\n\t\t}\n\t}",
"public function testDumpFile(){\n $io = new IO($this->logger);\n $path = $this->root.\"TestFileDump\";\n $content = \"TEST\";\n $io->dumpFile($path, $content);\n $this->assertEquals(\\file_get_contents($path), $content);\n \\unlink($path);\n }",
"private function _insert_test_file()\n {\n }",
"final public function readYaml() {}",
"public function prepareResourcesStub()\n {\n $fs = new Filesystem();\n $sourcePath = realpath(__DIR__ . '/../Stubs/resources.json');\n $targetPath = \"{$this->tempDir}/resources.json\";\n $fs->copy($sourcePath, $targetPath);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array holding the urls of enqueuing styles. | protected function getEnqueuingStyles() {
return array(
dirname( __FILE__ ) . '/css/font-field-type.css',
dirname( __FILE__ ) . '/css/jquery.nouislider.css',
);
} | [
"protected function getEnqueuingStyles() { \r\n\t\treturn array();\r\n\t}",
"protected function getEnqueuingStyles() { \r\n\t\treturn array(\r\n\t\t\tdirname( __FILE__ ) . '/css/jquery-ui-1.10.3.min.css',\r\n\t\t\tdirname( __FILE__ ) . '/css/jquery-ui-timepicker-addon.min.css',\r\n\t\t); \r\n\t}",
"private function getRelativeEditorStyleUrls(): array\n {\n $urls = [];\n foreach (\\H5peditor::$styles as $style) {\n $urls[] = $this->h5pPublicFolderUrl . $this->h5pEditorPublicFolderName . '/' . $style . $this->getCacheBuster();\n }\n return $urls;\n }",
"public function getExternalLinks()\n {\n return [\n 'https://client.besteron.com/inline/css/widget.css'\n ];\n }",
"public function get_stylesheet_urls() {\n global $CFG;\n\n // We need to tell the CSS that is being included (for example the standard\n // theme CSS) which theme it is being included for. Prepare the necessary param.\n $param = '?for=' . $this->name;\n\n // Stylesheets, in order (standard, parent, this - some of which may be the same).\n $stylesheets = array();\n if ($this->name != 'standard' && $this->standardsheets) {\n $stylesheets[] = $CFG->httpsthemewww . '/standard/styles.php' . $param;\n }\n if (!empty($this->parent)) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->parent . '/styles.php' . $param;\n }\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->name . '/styles.php' . $param;\n\n // Additional styles for right-to-left languages, if applicable.\n if (right_to_left()) {\n $stylesheets[] = $CFG->httpsthemewww . '/standard/rtl.css';\n\n if (!empty($this->parent) && file_exists($CFG->themedir . '/' . $this->parent . '/rtl.css')) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->parent . '/rtl.css';\n }\n\n if (file_exists($this->dir . '/rtl.css')) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->name . '/rtl.css';\n }\n }\n\n // If the theme wants pluginsheets, get them included in the first (most\n // general) stylesheet we are including. That is, process them with the\n // standard CSS if we are using that, else with the parent CSS, else with\n // our own CSS.\n if (!empty($this->pluginsheets)) {\n $stylesheets[0] .= '&pluginsheets=1';\n }\n\n return $stylesheets;\n }",
"private function getRelativeCoreStyleUrls(): array\n {\n $urls = [];\n foreach (\\H5PCore::$styles as $style) {\n $urls[] = $this->h5pPublicFolderUrl . $this->h5pCorePublicFolderName . '/' . $style . $this->getCacheBuster();\n }\n return $urls;\n }",
"public function test_get_urls_from_stylesheet_provider() {\n return [\n // Empty string.\n [\"\", 0],\n // URLs that should be retrieved.\n [\"background:url(/theme/image.php/_s/boost/core/1581292565/t/expanded)\", 1],\n [\"background:url('/theme/image.php/_s/boost/core/1581292565/t/expanded')\", 1],\n [\"src:url(\\\"/theme/font.php/boost/core/1581292565/fontawesome-webfont.eot?#iefix&v=4.7.0\\\")\", 1],\n [\"background-image:url(pix/vline-rtl.gif)\", 1],\n // URLs that should not be retrieved.\n [\"background-image:url(data:image/gif;base64,R0lGODlhYADIAP=)\", 0],\n [\"background-image:url('data:image/gif;base64,R0lGODlhYADIAP=')\", 0],\n [\"background-image:url(\\\"data:image/svg+xml;charset=utf8,%3Csvg xmlns=\\'http://www.w3.org/2000/svg\\'\\\")\", 0],\n // Combination of URLs used above.\n [\"background-image:url(pix/vline-rtl.gif) background:url(/theme/image.php/_s/boost/core/158/t/expanded)\", 2],\n [\"background-image:url(data:image/gif;base64,R0lG=)src:url(\\\"/theme/font.php/fontawesome-webfont.eot\\\")\", 1],\n ];\n }",
"public function getCssUrlArray(): array {\n\t\treturn static::BASE_CSS_URL + [\n\t\t\t\t'?' => $this->_getQuery(),\n\t\t\t];\n\t}",
"public static function getDequeueStyles(): array {\n return apply_filters(Plugin::L10N . '/dequeue_styles', static::DEQUEUE_STYLES);\n }",
"public function cssUrls(){\n\n $files = $this->cssFiles;\n $sources = $this->cssSources;\n $scripts = array( );\n $urls = array( );\n\n foreach($files as $file)\n $scripts[ $file ] = file_get_contents( HOME . $file );\n\n foreach( $sources as $source => $contents )\n $scripts[ $source ] = $contents;\n\n foreach( $scripts as $cache_file => $content ){\n\n $cache_file = md5( $cache_file );\n\n /**\n * check if diagnostic mode is enabled\n * and if so do not compress data\n */\n if( $this->diagnosticMode == 1 ){\n\n\t /**\n \t * makes the SITEURL constant available\n \t * in CSS so that files etc can\n \t * be loaded properly\n\t */\n \t $content = str_replace( '%SITEURL%', SITEURL, $content );\n\n cache( $cache_file, $content, 'CSS' );\n\t\t\t}\n elseif( !cache_exists( $cache_file, 'CSS' ) ){\n\n \t /**\n\t * makes the SITEURL constant available\n \t * in CSS so that files etc can\n \t * be loaded properly\n \t */\n\t $content = str_replace( '%SITEURL%', SITEURL, $content );\n\n \t/**\n \t * remove comments\n \t */\n\t $content = preg_replace( '!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $content );\n\n \t/**\n \t * remove spaces, tabs etc\n \t */\n\t $content = str_replace( array( \"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' ' ), '', $content );\n\n cache( $cache_file, $content, 'CSS');\n }\n\n $url = SITEURL . '_inc/css/css.php?' . $cache_file;\n\n array_push( $urls, $url );\n\n }\n\n\t\treturn $urls;\n\n }",
"function getStyleSheetLink() {\n\tglobal $GALLERY_EMBEDDED_INSIDE;\n\tglobal $GALLERY_OK;\n\n\tstatic $styleSheetSet;\n\n\t$styleSheetLinks = '';\n\n\tif(! $styleSheetSet) {\n\t\tif (isset($GALLERY_OK) && $GALLERY_OK == false) {\n\t\t\t$styleSheetLinks = _getStyleSheetLink(\"config\");\n\t\t}\n\t\telse {\n\t\t\t$styleSheetLinks = _getStyleSheetLink(\"base\");\n\n\t\t\tif ($GALLERY_EMBEDDED_INSIDE) {\n\t\t\t\t$styleSheetLinks .= _getStyleSheetLink(\"embedded_style\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$styleSheetLinks .= _getStyleSheetLink(\"screen\");\n\t\t\t}\n\t\t}\n\n\t\t$styleSheetSet = true;\n\t}\n\n\treturn $styleSheetLinks;\n}",
"function get_the_css_urls() {\n\n md_get_the_css_urls();\n \n }",
"public function getUrls()\n {\n return $this->db->query('SELECT * FROM ' . $this->queueName)->fetchAll();\n }",
"public function getStylesheets();",
"public function getOptimizedStylesheetUrls() {\n\n\t\t$urls = $this->getStyleSheetUrls();\n\n\t\t$useMinifiedCss = CbSettings::getInstance()->get('use_minified_css');\n\t\t$baseUrlAssets = KenedoPlatform::p()->getUrlAssets();\n\t\t$baseDirAssets = KenedoPlatform::p()->getDirAssets();\n\t\t$baseUrlAssetsCustom = KenedoPlatform::p()->getUrlCustomizationAssets();\n\t\t$baseDirAssetsCustom = KenedoPlatform::p()->getDirCustomizationAssets();\n\n\t\t$useCacheBusting = CbSettings::getInstance()->get('use_assets_cache_buster');\n\t\t$cacheBusterQs = 'version='.ConfigboxViewHelper::getCacheBusterValue();\n\n\t\tforeach ($urls as &$url) {\n\n\t\t\tif ($useMinifiedCss) {\n\n\t\t\t\t// See if there is a min.css file, if so use it instead\n\t\t\t\tif (strpos($url, $baseUrlAssets) === 0) {\n\t\t\t\t\t$pathDir = str_replace($baseUrlAssets, $baseDirAssets, $url);\n\t\t\t\t\t$pathDirMin = str_replace('.css', '.min.css', $pathDir);\n\t\t\t\t\tif (is_file($pathDirMin)) {\n\t\t\t\t\t\t$url = str_replace($baseDirAssets, $baseUrlAssets, $pathDirMin);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Same for customization assets\n\t\t\t\tif (strpos($url, $baseUrlAssetsCustom) === 0) {\n\t\t\t\t\t$pathDir = str_replace($baseUrlAssetsCustom, $baseDirAssetsCustom, $url);\n\t\t\t\t\t$pathDirMin = str_replace('.css', '.min.css', $pathDir);\n\t\t\t\t\tif (is_file($pathDirMin)) {\n\t\t\t\t\t\t$url = str_replace($baseDirAssetsCustom, $baseUrlAssetsCustom, $pathDirMin);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ($useCacheBusting) {\n\t\t\t\t$url .= ((strpos($url, '?') === false) ? '?':'&') . $cacheBusterQs;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $urls;\n\n\t}",
"public function get_enqueued_styles() {\n\t\tif ( ! $this->finalized ) {\n\t\t\tthrow new \\Exception( 'Not finalized.' );\n\t\t}\n\t\treturn $this->enqueued_styles;\n\t}",
"public function styles() {\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'static_content_styles_css',\n\t\t\t\t'src' => $this->get_base_url() . '/css/static_content_styles.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray( 'field_types' => array( 'staticcontent' ) )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\t}",
"function _getUrls()\n\t{\n\t\t$urls = array();\n\t\tif($this->_themes)\n\t\t{\n\t\t\t$urls['theme'] = $this->url.'/themes/'.$this->_theme;\n\t\t\tif($this->_theme != $this->_coretheme) $urls['core'] = $this->url.'/themes/'.$this->_coretheme;\n\t\t}\n\t\t$urls['template'] = $this->url;\n\t\treturn $urls;\n\t}",
"public function getStylesheets()\n {\n $stlyesheets = array();\n \n $this->_lazyLoadBookXml();\n if ($this->_bookXml->theme) {\n foreach ($this->_bookXml->theme->stylesheet as $sheet) {\n if (isset($sheet['href'])) $stylesheets[] = array(\n 'href' => 'media/' . urlencode($this->_bookName) . '/' . (string) $sheet['href'],\n 'type' => (isset($sheet['type']) ? (string) $sheet['type'] : null),\n 'media' => (isset($sheet['media']) ? (string) $sheet['media'] : null),\n );\n }\n }\n \n return $stylesheets;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the BLID of the uploader | public function getBLID() {
return $this->blid;
} | [
"public function uploaderId(): int {\n return $this->info()['UserID'];\n }",
"public function get_uploader_id()\n {\n return $this->uploader_id;\n }",
"public function getUploaderId()\n {\n return $this->uploader_id;\n }",
"public function getUploadId()\n {\n return $this->uploadId;\n }",
"public function getFileUploadId() \n {\n if(isset($this->fileUpload) && isset($this->fileUpload->id)) {\n return $this->fileUpload->id;\n }\n \n return 0;\n }",
"public function getUploadIdupload()\n {\n return $this->upload_idUpload;\n }",
"function getBrfId()\n {\n return (int) $this->_iBrfId;\n }",
"public function getUploadId() { return (int)$this->upload_id; }",
"public function getBlobId()\n {\n return $this->blob_id;\n }",
"function getBrfId()\n {\n return is_null($this->_iBrfId) ? NULL : (int) $this->_iBrfId;\n }",
"public function getFileTransferId() : string\n {\n return $this->fileTransferId;\n }",
"function getID() {\n\t\treturn $this->data_array['file_id'];\n\t}",
"public function getFileId() {\n return $this->__id;\n }",
"public function getFileID()\n {\n return $this->get('FileID');\n }",
"public function getFile_id()\n\t{\n\t\treturn $this->file_id;\n\t}",
"private function getBraintreeId()\n {\n if ($this->payin->braintree_backup == null) {\n return false;\n }\n $b = Json::decode($this->payin->braintree_backup);\n return $b['id'];\n }",
"public function getFileId()\n {\n return $this->file_id;\n }",
"public function getUploader()\n\t{\n\t\treturn ($this->uploader) ? $this->uploader->name : '';\n\t}",
"public function get_upload_banner_dir(){\n\t\treturn $this->upload_banner_dir;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END If Activity Is Still Open Start of MailChimp function definitions mc_createlist() creates a Mail Chimp LIST and returns the LIST'S ID | function mc_createlist($apikey, $listname, $server) {
$auth = base64_encode( 'user:'.$apikey );
$data = array(
'apikey' => $apikey,
'name' => $listname,
'contact' => array(
'company' => 'Adam Anthony LLC',
'address1' => '123 Meadow Lane',
'address2' => 'Suite 7',
'city' => 'Alton',
'state' => 'NH',
'zip' => '03809',
'country' => 'US',
'phone' => '603-555-1212'
),
'permission_reminder' => 'You signed up!',
'campaign_defaults' => array(
'from_name' => 'Adam Anthony',
'from_email' => 'adam@anthony.net',
'subject' => 'Weekend Activity Planning',
'language' => 'en'
),
'email_type_option' => true
);
$json_data = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$server.'api.mailchimp.com/3.0/lists/');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Basic '.$auth));
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
$result = curl_exec($ch);
//var_dump($result);
// json to php array
$phpObj = json_decode($result);
// list id
return $phpObj->id;
} | [
"public function testCreateListSuccessfully(): void\n {\n $this->post('/mailchimp/lists', static::$listData);\n\n $content = \\json_decode($this->response->getContent(), true);\n\n $this->assertResponseOk();\n $this->seeJson(static::$listData);\n self::assertArrayHasKey('mail_chimp_id', $content);\n self::assertNotNull($content['mail_chimp_id']);\n\n $this->createdListIds[] = $content['mail_chimp_id']; // Store MailChimp list id for cleaning purposes\n }",
"function getmailchimplistdetail($listnum ='') { \n\t\t$f3=$this->f3; \n\t\t$uselog=$f3->get('uselog');\n\t\t\t$time_start2 = microtime(true);\n\t\t$email_logger = new MyLog('email.log');\n\t\tif ($listnum == '') {$listnum=$f3->get('PARAMS.listnum');}\n\t\t//$email_logger->write('in mailchimplistdetail #133 for list = '.$listnum,$uselog);\n\t\t$options =\tnew Option($this->db);\n\t\t$mailchimp_api = $options->find(\"optionname='mailchimp_api'\")[0]['optionvalue'];\n\t\t//require_once 'HTTP/Request2.php';\n\t\trequire_once 'vendor/drewm/mailchimp-api/src/MailChimp.php';\n\t\t$mailchimp = new DrewM\\MailChimp\\MailChimp($mailchimp_api);\n\t\t\n\t\t$time_end = microtime(true);\n\t/*\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" starting to get MC list members after \".$time;/*\n*/\n\t\tif (!empty($this->listdetail[$listnum])){\n\t\t\t$returnlist=$this->listdetail[$listnum];\n\t\t\t\n\t\t}\n\t\telse{\n\t\t$listcount = $mailchimp->get('lists/'.$listnum)['stats']['member_count'];\n\t\t$listcount = $listcount+$mailchimp->get('lists/'.$listnum)['stats']['cleaned_count'];\n\t\t$listcount = $listcount+$mailchimp->get('lists/'.$listnum)['stats']['unsubscribe_count'];\n\t\t\t\t//var_export($listcount); \n\t\t$per_batch = 100;\n\t\t$total_to_process = $listcount;\n\t\t$num_batches = ceil($total_to_process / $per_batch);\n\n/**\n * Process all relevant rows/entries in batches of size $per_batch\n */\n \t$returnlist = array();\nfor ($page=1; $page <= $num_batches; $page++)\n{\t\t$offset = ($page-1)*$per_batch;\n$argsarray=array('count'=>$per_batch,'offset'=>$offset,'fields'=>'members.id,members.email_address,members.merge_fields,members.status');\n//var_export('lists/'.$listnum.'/members?count='.$per_batch.'&offset='.$offset);\n\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members',$argsarray,30);\n//\t\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members/?count='.$per_batch.'&offset='.$offset.'&fields=members.id',array(),30);\n//\t\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members/',,30);\n\t\t//var_export($listsphp);\n/*\t\t\t\n/*$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" fetched MC list members after \".$time;\n\t\t\t*/\n\t\t$i=$offset;\n\t\tforeach ($listsphp['members'] as $list) {\n\t\t$returnlist[$i][ 'membname'] = $list['merge_fields']['FNAME'].' '.$list['merge_fields']['LNAME'];\n\t\t$returnlist[$i][ 'email'] = $list['email_address'];\n\t\t$returnlist[$i][ 'status'] = $list['status'];\n\t\t$returnlist[$i][ 'membnum'] = $list['merge_fields']['MNUM'];\n\t\t$i++;\n\t\t}\t\n\t\t\t}\n\t\t\t$this->listdetail[$listnum]=$returnlist;\n\t\t}// of else\n\t\t//\tprint \" 155 \";\n\t\t//var_export($this->listdetail[$listnum]);\n/*\t\t\t\n\t\t\t$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" split MC list members after \".$time;\n*/\t\t\t\n\t\t//$email_logger->write('in mailchimplistdetail #165 for list = '.$listnum.' '.var_export($listsphp,true) ,$uselog);\n\n\t\t// This will set credentials for Basic auth\n\t\t//$request->setAuth('apikey', $mailchimp_api, HTTP_Request2::AUTH_BASIC);\t\n\t\t//$listsjson = $request->send()->getBody();\n\t\t//$email_logger->write( \"In mailchimplistdetail #149\".$listsjson , $uselog );\n\t\t//$listsphp = json_decode($listsjson,true);\n\t\t////$email_logger->write( \"In mailchimplistdetail #172\".var_export($listsphp,true) , $uselog );\n\t\t////$email_logger->write( \"In mailchimplistdetail #173\".var_export($listsphp['members'],true) , $uselog );\n\n\t\t//$email_logger->write( \"In mailchimplistdetail #184\".var_export($returnlist,true) , $uselog );\n\n\t\t//$emc= new EmailController;\n\t\t//$email_logger->write( \"In mailchimplistdetail #187 \".var_export($emc->arraytojson($returnlist),true) , $uselog );\n\t\t//$email_logger->write( \"In mailchimplistdetail #188 \".$emc->arraytojson($returnlist) , $uselog );\n\t\t\n\t\treturn $returnlist;\n}",
"function getmailchimplistdetail($listnum ='') { \n\t\t$f3=$this->f3; \n\t\t$uselog=$f3->get('uselog');\n\t\t\t$time_start2 = microtime(true);\n\t\t$email_logger = new MyLog('email.log');\n\t\tif ($listnum == '') {$listnum=$f3->get('PARAMS.listnum');}\n\t\t//$email_logger->write('in mailchimplistdetail #133 for list = '.$listnum,$uselog);\n\t\t$options =\tnew Option($this->db);\n\t\t$mailchimp_api = $options->find(\"optionname='mailchimp_api'\")[0]['optionvalue'];\n\t\t//require_once 'HTTP/Request2.php';\n\t\trequire_once 'vendor/drewm/mailchimp-api/src/MailChimp.php';\n\t\t$mailchimp = new MailChimp($mailchimp_api);\n\t\t\n\t\t$time_end = microtime(true);\n\t/*\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" starting to get MC list members after \".$time;/*\n*/\n\t\tif (!empty($this->listdetail[$listnum])){\n\t\t\t$returnlist=$this->listdetail[$listnum];\n\t\t\t\n\t\t}\n\t\telse{\n\t\t$listcount = $mailchimp->get('lists/'.$listnum)['stats']['member_count'];\n\t\t$listcount = $listcount+$mailchimp->get('lists/'.$listnum)['stats']['cleaned_count'];\n\t\t$listcount = $listcount+$mailchimp->get('lists/'.$listnum)['stats']['unsubscribe_count'];\n\t\t\t\t//var_export($listcount); \n\t\t$per_batch = 100;\n\t\t$total_to_process = $listcount;\n\t\t$num_batches = ceil($total_to_process / $per_batch);\n\n/**\n * Process all relevant rows/entries in batches of size $per_batch\n */\n \t$returnlist = array();\nfor ($page=1; $page <= $num_batches; $page++)\n{\t\t$offset = ($page-1)*$per_batch;\n$argsarray=array('count'=>$per_batch,'offset'=>$offset,'fields'=>'members.id,members.email_address,members.merge_fields,members.status');\n//var_export('lists/'.$listnum.'/members?count='.$per_batch.'&offset='.$offset);\n\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members',$argsarray,30);\n//\t\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members/?count='.$per_batch.'&offset='.$offset.'&fields=members.id',array(),30);\n//\t\t$listsphp = $mailchimp->get('lists/'.$listnum.'/members/',,30);\n\t\t//var_export($listsphp);\n/*\t\t\t\n/*$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" fetched MC list members after \".$time;\n\t\t\t*/\n\t\t$i=$offset;\n\t\tforeach ($listsphp['members'] as $list) {\n\t\t$returnlist[$i][ 'membname'] = $list['merge_fields']['FNAME'].' '.$list['merge_fields']['LNAME'];\n\t\t$returnlist[$i][ 'email'] = $list['email_address'];\n\t\t$returnlist[$i][ 'status'] = $list['status'];\n\t\t$returnlist[$i][ 'membnum'] = $list['merge_fields']['MNUM'];\n\t\t$i++;\n\t\t}\t\n\t\t\t}\n\t\t\t$this->listdetail[$listnum]=$returnlist;\n\t\t}// of else\n\t\t//\tprint \" 155 \";\n\t\t//var_export($this->listdetail[$listnum]);\n/*\t\t\t\n\t\t\t$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start2;\n\t\t\tprint \" split MC list members after \".$time;\n*/\t\t\t\n\t\t//$email_logger->write('in mailchimplistdetail #165 for list = '.$listnum.' '.var_export($listsphp,true) ,$uselog);\n\n\t\t// This will set credentials for Basic auth\n\t\t//$request->setAuth('apikey', $mailchimp_api, HTTP_Request2::AUTH_BASIC);\t\n\t\t//$listsjson = $request->send()->getBody();\n\t\t//$email_logger->write( \"In mailchimplistdetail #149\".$listsjson , $uselog );\n\t\t//$listsphp = json_decode($listsjson,true);\n\t\t////$email_logger->write( \"In mailchimplistdetail #172\".var_export($listsphp,true) , $uselog );\n\t\t////$email_logger->write( \"In mailchimplistdetail #173\".var_export($listsphp['members'],true) , $uselog );\n\n\t\t//$email_logger->write( \"In mailchimplistdetail #184\".var_export($returnlist,true) , $uselog );\n\n\t\t//$emc= new EmailController;\n\t\t//$email_logger->write( \"In mailchimplistdetail #187 \".var_export($emc->arraytojson($returnlist),true) , $uselog );\n\t\t//$email_logger->write( \"In mailchimplistdetail #188 \".$emc->arraytojson($returnlist) , $uselog );\n\t\t\n\t\treturn $returnlist;\n}",
"function send_campaign($send_campaign_data, $email, $auth, $list_id){\n \n$url = 'https://us20.api.mailchimp.com/3.0/campaigns'; /* This URL is used for creating a new campaign to all users in your list, \ndocumentation: hhttps://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/ */\n \n$jsonString = json_encode($send_campaign_data); // json_encode converts $data to JSON code \n \n$curl = curl_init(); // Initializing cURL session\n \ncurl_setopt_array($curl, array( \n CURLOPT_URL => $url, /* Set CURLOPT_URL option for a cURL transfer and the value is the URL for creating\n a new Mailchimp list */\n CURLOPT_HTTPHEADER =>array('Content-Type: application/json', //Here the value is the JSON application and the authentication for accessing Mailchimp\n 'Authorization: Basic '.$auth),\n CURLOPT_RETURNTRANSFER => true, // It returns the transfer as a string\n CURLOPT_TIMEOUT => 10, // Maximum number of seconds to allow cURL functions to execute, set to 10 \n CURLOPT_POST => true, // Alternative port number to connect to\n CURLOPT_SSL_VERIFYPEER => false, // Verify the peer's SSL certificate\n CURLOPT_POSTFIELDS => $jsonString, // Post our JSON data \n));\n \n$result = curl_exec($curl); // Take URL and pass it to the browser\n \n$info = curl_getinfo($curl); // info about cURL session \n \n$httpCode = curl_getinfo($curl , CURLINFO_HTTP_CODE); //Output HTTP_CODE info\n \ncurl_close($curl); // close cURL resource, and free up system resources\n \nreturn $result; // Return the result \n \n}",
"public function syncLists() {\n $module = 'ProspectLists';\n $targetLists = $this->getTargetLists();\n foreach($targetLists as $targetList) {\n $list_id = $targetList['mailchimp_list'];\n $targetListId = $targetList['id'];\n $date_modified = $targetList['date_modified'];\n $last_sync_date = $targetList['last_sync_date'];\n //Sync New list from Sugar to MailChimp\n if(!empty($list_id)) {\n //Do fetch mailchimp details in crm for initial sync\n if(empty($last_sync_date) || strtotime($date_modified) > strtotime($last_sync_date)) {\n //Check if callback webhook is present in mailchimp otherwise create one\n $this->checkWebhookAvailability($list_id);\n //Sync New subscriber from Mailchimp to Sugar\n $this->syncMailChimpSubscribers($list_id);\n\n $this->update('', array('id' => $targetListId, 'module' => $module));\n }\n //Sync New subscriber from Sugar to MailChimp\n $subscribers = $this->getTargetListSubscribers($targetListId);\n if(!empty($subscribers)) {\n $listConfig = !is_array($this->settings['mailchimp_'.$list_id]) ? json_decode($this->settings['mailchimp_'.$list_id]) : (object) $this->settings['mailchimp_'.$list_id];\n if(!empty($listConfig)) {\n foreach($subscribers as $subscriber) {\n $table_name = $subscriber->table_name;\n $field_mapping = $listConfig->$table_name;\n if(!empty($field_mapping)) {\n $data = array();\n $subscriber_hash = $subscriber->subscriber_hash;\n $mergeFields = $this->prepareMergeFields($field_mapping, $subscriber);\n if(empty($subscriber_hash) || empty($subscriber->last_sync_date)) {\n //Create new member from sugar to mailchimp\n $data = $this->parseResponse($this->list->createMember($list_id, $subscriber->email1, $mergeFields));\n } else {\n //Check if subscriber is not in the list\n $response = $this->list->members($list_id, $subscriber_hash, array('id'));\n if(empty($response['id'])) {\n //Handle same subscriber to be added in multiple lists\n //Create new member from sugar to mailchimp\n $data = $this->parseResponse($this->list->createMember($list_id, $subscriber->email1, $mergeFields));\n } else {\n //Update existing member from sugar to mailchimp\n $data = $this->parseResponse($this->list->updateMember($list_id, $subscriber_hash, $subscriber->email1, $mergeFields));\n }\n }\n //Update responses in table\n $this->update($subscriber, $data);\n } else {\n $this->print->log($this->level, \"Missing field mapping for list: \".$list_id.\" and subscriber: \" . $subscriber->name . \". Please set field mapping in admin section.\");\n }\n }\n } else {\n $this->print->log($this->level, \"Unable to sync because field mapping not found for list: \".$list_id.\". Please set field mapping in admin section.\");\n }\n }\n }\n }\n }",
"public abstract function create_contact($list_id, $email);",
"public function createList($group_list_id) {\n\n $dar = $this->_getMailingListDao()->searchByGroupListId($group_list_id);\n\n if ($row = $dar->getRow()) {\n $list = new MailmanList($row['group_id'],$row['group_list_id']);\n $user=UserManager::instance()->getUserByID($list->getListAdminId());\n\t $list_admin_email= $user->getEmail();\n $list_dir = $GLOBALS['mailman_lib_dir'].\"/lists/\".$list->getName();\n\n\t if($list->isPublic() != 9) {\n\t\t if ((! is_dir($list_dir))) {\n\t\t\t // Create list\n\t\t\t system($GLOBALS['mailman_bin_dir'].\"/newlist -q \".$list->getName().\" \".$list_admin_email.\" \".$list->getPassword().\" >/dev/null\");\n\t\t\t // Then update configuraion\n\t\t\t if( is_dir($list_dir) && $this->updateListConfig($list) !=false ) {\n\t\t\t\t $result = $this->_getMailingListDao() -> updateList($list->getID(),$row['group_id'], $list->getDescription(), $list->isPublic(),'3');\n\t\t\t\t if (!$result) {\n\t\t\t\t\t printf('Unable to update the list status: '.db_error());\n\t\t\t\t\t return false;\n\t\t\t\t }\t\t\n\t\t\t\t else {\n\t\t\t\t\t return true;\n\t\t\t\t }\n\t\t\t }\n\t\t\t else {\n\t\t\t\t return false;\n\t\t\t }\n\t\t }\n\t\t else {\n\t\t\t $result = $this->_getMailingListDao() -> updateList($list->getID(),$row['group_id'], $list->getDescription(), $list->isPublic(),'3');\n\t\t\t if (!$result) {\n\t\t\t\t printf('Unable to update the list status: '.db_error());\n\t\t\t\t return false;\n\t\t\t }\t\t\n\t\t\t else {\n\t\t\t\t return true;\n\t\t\t }\n\t\t }\n\t }\n\t}\n\treturn false;\n }",
"public function create()\n {\n return MailingList::getMailingListsList();\n }",
"function createList($listOptions)\n{\n\tcall_integration_hook('integrate_list_' . $listOptions['id'], array(&$listOptions));\n\n\t$list = new GenericList($listOptions);\n\n\t$list->buildList();\n}",
"function addMaillist($action){\n\n\t\t// Get posted values to make them available for models\n\t\t$this->getPostedEntities();\n\n\t\t// does values validate\n\t\tif(count($action) == 2 && $this->validateList(array(\"maillist_id\"))) {\n\n\t\t\t$query = new Query();\n\t\t\t$user_id = $action[1];\n\n\t\t\t$maillist_id = $this->getProperty(\"maillist_id\", \"value\");\n\n\t\t\t// already signed up (to avoid faulty double entries)\n\t\t\t$sql = \"SELECT id FROM $this->db_maillists WHERE user_id = $user_id AND maillist_id = '$maillist_id'\";\n\t\t\tif(!$query->sql($sql)) {\n\t\t\t\t$sql = \"INSERT INTO \".$this->db_maillists.\" SET user_id=$user_id, maillist_id='$maillist_id'\";\n\t\t\t\t$query->sql($sql);\n\t\t\t}\n\n\t\t\tmessage()->addMessage(\"Subscribed to maillist\");\n\t\t\treturn true;\n\t\t}\n\n\t\tmessage()->addMessage(\"Could not subscribe to maillist\", array(\"type\" => \"error\"));\n\t\treturn false;\n\t}",
"function create($list)\n {\n $endpoint = 'https://api.hubapi.com/contacts/v1/lists';\n\n $options['json'] = $list;\n\n return $this->client->request('post', $endpoint, $options);\n }",
"public function mc_list_instance()\n {\n $api_key = $this->connections_settings->mailchimp_api_key();\n\n if (empty($api_key)) {\n throw new \\Exception(__('MailChimp API key not found.', 'mailoptin'));\n }\n\n $client = new MailchimpCurlHttpClient(['timeout' => 10]);\n\n return new MailchimpLists($api_key, 'apikey', ['timeout' => 10], $client);\n }",
"function inscription_liste_mc($flux='',$api,$listId,$email,$donnees_auteur,$email_type='',$optin,$update_existing=true,$replace_interests=false,$send_welcome=false){\n\t\n\t$retval = $api->listSubscribe($listId, $email,$donnees_auteur,$email_type,$optin,$update_existing,$replace_interests,$send_welcome);\n\n\t\n\tif ($api->errorCode){\n\t\tspip_log('inscription_liste','squirrel_chimp_lists');\n\t\t$messageErreur = _T('scl:api_errorcode').\"<br/><b>\".$api->errorCode.\"</b><br/>\".$api->errorMessage;\n\t\tif (autoriser('defaut')){\n\n\t\t\t$flux['data'] = array('message_erreur' => \"Plugin Squirrels Love Chimps $messageErreur\");\n\t\t\tspip_log(\"Admin $messageErreur\",'squirrel_chimp_lists');\n\t\t\treturn $flux;\n\t\t} // fin message pour admin\n\t\telse {\n\t\t\tspip_log(__LINE__,'squirrel_chimp_lists');\n\t\t\t// que le spiplog si on est juste un user\n\t\t\tspip_log(\"$messageErreur\",'squirrel_chimp_lists');\n\t\t\treturn $flux;\n\t\t} // autoriser\n\t} else {\n\t\tspip_log(__LINE__,'squirrel_chimp');\n\t\t$message_ok .=\"<br/><br/>\"._T('scl:demande_inscription_envoyee_ok', array('email' => \"$email\"));\n\t\tif($optin){\n\t\t\t$message_ok .=\"<br/>\"._T('scl:demande_inscription_envoyee1', array('email' => \"$email\"));\n\t\t\t$message_ok .=\"<br/>\"._T('scl:demande_inscription_envoyee2');\n\t\t\t$message_ok .=\"<br/><i>\"._T('scl:demande_inscription_envoyee3').\"</i>\";\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t$flux['data']['message_ok']=$message_ok ;\n\n}\n\t\t\treturn $flux;\n}",
"public function createMailing( Inx_Api_List_ListContext $oListContext );",
"function mailchimpSF_change_list_if_necessary() {\n\t// Simple permission check before going through all this\n\tif (!current_user_can(MCSF_CAP_THRESHOLD)) { return; }\n\n\t$api = mailchimpSF_get_api();\n\tif (!$api) { return; }\n\n\t//we *could* support paging, but few users have that many lists (and shouldn't)\n\t$lists = $api->lists(array(),0,100);\n\t$lists = $lists['data'];\n\n\tif (is_array($lists) && !empty($lists) && isset($_POST['mc_list_id'])) {\n\n\t\t/* If our incoming list ID (the one chosen in the select dropdown)\n\t\tis in our array of lists, the set it to be the active list */\n\t\tforeach($lists as $key => $list) {\n\t\t\tif ($list['id'] == $_POST['mc_list_id']) {\n\t\t\t\t$list_id = $_POST['mc_list_id'];\n\t\t\t\t$list_name = $list['name'];\n\t\t\t\t$list_key = $key;\n\t\t\t}\n\t\t}\n\n\t\t$orig_list = get_option('mc_list_id');\n\t\tif ( ! empty( $list_id ) ) {\n\t\t\tupdate_option('mc_list_id', $list_id);\n\t\t\tupdate_option('mc_list_name', $list_name);\n\t\t\tupdate_option('mc_email_type_option', $lists[$list_key]['email_type_option']);\n\n\n\t\t\t// See if the user changed the list\n\t\t\tif ($orig_list != $list_id){\n\t\t\t\t// The user changed the list, Reset the Form Defaults\n\t\t\t\tmailchimpSF_set_form_defaults($list_name);\n\t\t\t}\n\t//\t\temail_type_option\n\n\t\t\t// Grab the merge vars and interest groups\n\t\t\t$mv = $api->listMergeVars($list_id);\n\t\t\t$igs = $api->listInterestGroupings($list_id);\n\n\t\t\tupdate_option('mc_merge_vars', $mv);\n\t\t\tforeach($mv as $var){\n\t\t\t\t$opt = 'mc_mv_'.$var['tag'];\n\t\t\t\t//turn them all on by default\n\t\t\t\tif ($orig_list != $list_id) {\n\t\t\t\t\tupdate_option($opt, 'on' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate_option('mc_interest_groups', $igs);\n\t\t\tif (is_array($igs)) {\n\t\t\t\tforeach ($igs as $var){\n\t\t\t\t\t$opt = 'mc_show_interest_groups_'.$var['id'];\n\t\t\t\t\t//turn them all on by default\n\t\t\t\t\tif ($orig_list != $list_id) {\n\t\t\t\t\t\tupdate_option($opt, 'on' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$igs_text = ' ';\n\t\t\tif (is_array($igs)) {\n\t\t\t\t$igs_text .= sprintf(__('and %s Sets of Interest Groups', 'mailchimp_i18n'), count($igs));\n\t\t\t}\n\n\t\t\t$msg = '<p class=\"success_msg\">'.\n\t\t\t\tsprintf(\n\t\t\t\t\t__('<b>Success!</b> Loaded and saved the info for %d Merge Variables', 'mailchimp_i18n').$igs_text,\n\t\t\t\t\tcount($mv)\n\t\t\t\t).' '.\n\t\t\t\t__('from your list').' \"'.$list_name.'\"<br/><br/>'.\n\t\t\t\t__('Now you should either Turn On the MailChimp Widget or change your options below, then turn it on.', 'mailchimp_i18n').'</p>';\n\t\t\tmailchimpSF_global_msg($msg);\n\t\t}\n\t}\n}",
"public function newMailList($myMailName) \n {\n \t$graphicMailGet = \"{$this->APIURL}&Function=post_create_mailinglist&NewMailinglist={$myMailName}&ReturnMailingListID=true&SID=6\";\n \t$graphicMailReturned = $this->sendRequestGraphicMail($graphicMailGet);\n \t$graphicMailExploded = explode('|', $graphicMailReturned);\n\n \t// Check to see if successful\n \tif ($graphicMailExploded[0] == 0) \n \t{\n \t\treturn 0;\n \t}\n \telse\n \t{\n \t\treturn $graphicMailExploded[1];\n \t}\n }",
"public function testCreateListSuccessful(): void\n {\n /** @var \\DrewM\\MailChimp\\MailChimp $mailchimp */\n $mailchimp = $this->mock(MailChimp::class, function (MockInterface $mock): void {\n $mock->shouldReceive('post')->once()->with('/lists', [\n 'notify_on_subscribe' => 'list-id',\n 'notify_on_unsubscribe' => 'list-id'\n ])->andReturn(['response-must-be-array']);\n });\n\n $mailingList = new MailingMailingList($mailchimp);\n\n self::assertEquals(['response-must-be-array'], $mailingList->create('list-id'));\n }",
"function get_mailchimp_lists()\n{\n $lists = mailchimp_call(\"lists\", \"\");\n\n return json_decode($lists, true);\n}",
"function cp_insert_task_list( $args = array() ) {\n\tglobal $cp_bp_integration;\n\n\t$defaults = array(\n\t\t'post_title' => 'New Task List',\n\t\t'post_status' => 'publish',\n\t\t'post_type' => 'cp-task-lists',\n\t\t'project_id' => NULL,\n\t\t'task_list_description' => '',\n\t);\n\t$args = wp_parse_args( $args, $defaults );\n\n\textract( $args );\n\t$task_list_id = wp_insert_post( $args );\n\n\tif ( $project_id )\n\t\tupdate_post_meta( $task_list_id, '_cp-project-id', $project_id );\n\n\tupdate_post_meta( $task_list_id, '_cp-task-list-description', esc_html( $task_list_description ) );\n\n\t// Add CollabPress Activity entry\n\t$current_user = wp_get_current_user();\n\tcp_add_activity(\n\t\t__('added', 'collabpress'),\n\t\t__('task list', 'collabpress'),\n\t\t$current_user->ID,\n\t\t$task_list_id\n\t);\n\n\tdo_action( 'cp_task_list_added', $task_list_id );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the result of performing the power function with two variants | function variant_pow($left, $right)
{
} | [
"function power($a, $b)\n{\n return $a ** $b;\n}",
"function variant_pow ($left, $right) {}",
"public function pow($power);",
"function pow($number,$power)\r\n{\r\n}",
"function power($num1, $num2){\n if($num2 == 0){\n return 1;\n }\n if($num2 == 1){\n return $num1;\n }\n // echo \" return $num1 * power($num1, $num2-1)<br>\"; //Debug Info\n return $num1 * power($num1, $num2-1);\n }",
"function powerTwo($power) {\n\t$current = [1];\n\tfor ($i = 0; $i < $power; $i++) {\n\t\t$current = doubleValue($current);\n\t}\n\t\n\treturn $current;\n}",
"private function _pow()\r\n {\r\n list($a, $b) = $this->_stack->splice(-2, 2);\r\n \r\n $this->_validate($a);\r\n $this->_validate($b);\r\n \r\n $this->_stack->push(pow($a, $b));\r\n }",
"public function pow($a, $b)\n {\n return bcpow($this->input($a), $this->input($b));\n }",
"function gmp_pow ($base, $exp) {}",
"function gmp_pow($base, $exp)\n{\n}",
"public static function power($x, $y)\n {\n if (is_array($x) || is_array($y)) {\n return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y);\n }\n\n try {\n $x = Helpers::validateNumericNullBool($x);\n $y = Helpers::validateNumericNullBool($y);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n // Validate parameters\n if (!$x && !$y) {\n return ExcelError::NAN();\n }\n if (!$x && $y < 0.0) {\n return ExcelError::DIV0();\n }\n\n // Return\n $result = $x ** $y;\n\n return Helpers::numberOrNan($result);\n }",
"public function power(string $leftOperand, string $rightOperand, int $precision = 0): string\n {\n return (string) round(\n pow(\n floatval($leftOperand),\n floatval($rightOperand)\n ),\n ($precision ?? 0),\n $this->roundingStrategy\n );\n }",
"function powNumber ($number, $power = 2) {\n if($power == 0) {\n return 1;\n }\n return $number * powNumber($number, $power-1);\n}",
"public function exponencial()\n {\n $this->validate(['secondNumber' => ['required']]);\n\n return pow($this->firstNumber, $this->secondNumber);\n }",
"function variant_mul($left, $right) {}",
"public function pow($base, $exponent);",
"public function sq(){\n $this->pow(\"2\");\n }",
"function bc_pow_mod ($left_operand, $right_operand, $modulus, $scale = null)\n{\n return bcpowmod($left_operand, $right_operand, $modulus, $scale);\n}",
"function pow_mod($p, $q, $r) \n{ \n // Extract powers of 2 from $q \n $factors = array(); \n $div = $q; \n $power_of_two = 0; \n while(bccomp($div, \"0\") == BCCOMP_LARGER) \n { \n $rem = bcmod($div, 2); \n $div = bcdiv($div, 2); \n \n if($rem) array_push($factors, $power_of_two); \n $power_of_two++; \n } \n \n // Calculate partial results for each factor, using each partial result as a \n // starting point for the next. This depends of the factors of two being \n // generated in increasing order. \n \n $partial_results = array(); \n $part_res = $p; \n $idx = 0; \n \n foreach($factors as $factor) \n { \n while($idx < $factor) \n { \n $part_res = bcpow($part_res, \"2\"); \n $part_res = bcmod($part_res, $r); \n $idx++; \n } \n array_push($partial_results, $part_res); \n } \n\n // Calculate final result \n $result = \"1\"; \n foreach($partial_results as $part_res) \n { \n $result = bcmul($result, $part_res); \n $result = bcmod($result, $r); \n } \n return $result; \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to add core field relation to a type | function _addCoreFieldRelations()
{
$type = & $this->_type;
// Get core fields
$core = $this->_getCoreFields();
// Insert core field relations to the DB
foreach ($core as $fieldid) {
$obj = new stdClass();
$obj->field_id = (int)$fieldid;
$obj->type_id = $type->id;
$this->_db->insertObject('#__flexicontent_fields_type_relations', $obj);
}
} | [
"protected function _addRelationFieldInLocalModel() {\n if (!$this->isSingular()) {\n return;\n }\n\n //$column = Garp_Spawn_Relation_Set::getRelationColumn($this->name);\n $column = $this->column;\n $fieldParams = array(\n 'model' => $this->model,\n 'type' => 'numeric',\n 'editable' => true,\n 'visible' => true,\n 'primary' => $this->primary,\n 'required' => $this->required,\n 'relationAlias' => $this->name,\n 'relationType' => $this->type\n );\n if ($this->multilingual && $this->_localModel->isMultilingual()) {\n // The relation is added to the i18n model by Garp_Spawn_Config_Model_I18n\n return;\n }\n $this->_localModel->fields->add('relation', $column, $fieldParams);\n }",
"private function _update_relationship_fieldtype()\n\t{\n\t\t// UPDATE TABLE `exp_fieldtypes` SET name='relationships' WHERE name='rel';\n\t\tee()->db->where('name', 'rel');\n\t\tee()->db->update('fieldtypes', array('name'=>'relationship'));\n\n\t\t// UPDATE TABLE `exp_channel_fields` set field_type='relationships' where field_type='rel';\n\t\tee()->db->where('field_type', 'rel');\n\t\tee()->db->update('channel_fields', array('field_type'=>'relationship'));\n\n\t\tee()->db->where('field_type', 'relationship');\n\t\t$channel_fields = ee()->db->get('channel_fields');\n\t\tforeach ($channel_fields->result_array() as $channel_field)\n\t\t{\n\t\t\t$settings = array(\n\t\t\t\t'channels'\t\t=> array($channel_field['field_related_id']),\n\t\t\t\t'expired'\t\t=> 0,\n\t\t\t\t'future'\t\t=> 0,\n\t\t\t\t'categories'\t=> array(),\n\t\t\t\t'authors'\t\t=> array(),\n\t\t\t\t'statuses'\t\t=> array(),\n\t\t\t\t'limit'\t\t\t=> $channel_field['field_related_max'],\n\t\t\t\t'order_field'\t=> $channel_field['field_related_orderby'],\n\t\t\t\t'order_dir'\t\t=> $channel_field['field_related_sort'],\n\t\t\t\t'allow_multiple'\t=> 0\n\t\t\t);\n\n\t\t\tee()->db->where('field_id', $channel_field['field_id']);\n\t\t\tee()->db->update(\n\t\t\t\t'channel_fields',\n\t\t\t\tarray('field_settings'=>base64_encode(serialize($settings))));\n\n\t\t}\n\n\t}",
"function add_field( $table, $field, $type ) {\n $query = \"ALTER TABLE `\" . $table . \"` ADD `\" . $field . \"` \" . $type . \";\";\n $res = mysql_query($query) or err(mysql_error(),$query);\n return $res;\n }",
"function admin_change_relation_type() {\n\t\t//\n\t}",
"public function addFK( $type, $targetType, $field, $targetField);",
"function repec_add_association($content_type, $series_name, $field_content_type, $field_series) {\n db_insert('repec_assoc')\n ->fields(array(\n 'content_type' => $content_type,\n 'series_name' => $series_name,\n 'field_content_type' => $field_content_type,\n 'field_series' => $field_series,\n 'enabled' => 0\n ))\n ->execute();\n}",
"private function _addNewField( $table, $field ) {\n \n // pega o schema do campo\n $fieldSchema = $this->newSchema[$table][$field];\n\n // adiciona o campo\n $this->forge->add_column( $table, [ $field => $fieldSchema ] );\n }",
"public function addField(&$field)\n {\n if (is_a($field,'FieldModelBase') === true)\n $this->getChildren()->addControl($field);\n else\n throw new Exception('The field object must inherit from FieldModelBase');\n }",
"function _osa_addRelationshipField(&$form, $cid, $required = TRUE) {\n\n // get the profile id & title\n $gid = $form->getVar('_gid');\n $uf_group = new CRM_Core_DAO_UFGroup();\n $uf_group->id = $gid;\n if (! $uf_group->find(TRUE)) {\n CRM_Core_Error::fatal();\n }\n\n // create the field used by the CRM/Profile/Form/Dynamic.tpl template\n $label = ts('Relationship Type');\n $field_name = 'rel_id';\n $field = array(\n $field_name => array(\n 'name' => $field_name,\n 'group_id' => $gid,\n 'groupTitle' => $uf_group->title,\n 'title' => $label,\n )\n );\n\n // add it to the beginning of the list (display first)\n $form->_fields = $field + $form->_fields;\n\n // get the valid relationship types for this contact\n $r_types = CRM_Contact_BAO_Relationship::getContactRelationshipType($cid);\n $hh_val = OSA_REL_HEAD_HOUSEHOLD . '_b_a';\n unset($r_types[$hh_val]); // head of household is reserved for user who created it\n $options = array('' => ts('- select -')) + $r_types; // include a 'none' option\n\n // add an element to the QuickForm\n $form->add('select', $field_name, $label, $options, '', $required);\n if ($required) {\n $form->addRule($field_name, ts('%1 is a required field.', array(1 => $label)), 'required');\n }\n $form->assign('fields', $form->_fields);\n}",
"public function addVirtual($field, DataType $type = null) {\n $this->virtualFields[$field] = $type;\n }",
"protected function modifyBaseField() {\n $this->addBaseField('text');\n }",
"protected function addFields($model) {\n if ($model->isExtended()) {\n $this->addFields($model->getExtend());\n }\n /* \t $extended= $model->getExtend();\n foreach( $extended->getFields() as $field )\n {\n if ( !$field->isPrimaryKey())\n {\n $this->fields[]= sprintf(\"\\t%s.%s as %s__%s\", $extended->getAlias(), $field->getRealName(), $field->getModel()->getAlias(), $field->getRealName() );\n if ( $field->getIdent() == PerfORM::ForeignKeyField &&\n !$field->isEnabledLazyLoading()\n )\n {\n $this->addFields($field->getReference());\n }\n }\n }\n } */\n\n foreach ($model->getFields() as $field) {\n $this->fields[] = sprintf(\"\\t\\\"%s\\\".\\\"%s\\\" as \\\"%s__%s\\\"\", $model->getAlias(), $field->getRealName(), $model->getAlias(), $field->getRealName());\n if ($field->getIdent() == PerfORM::ForeignKeyField &&\n !$field->isEnabledLazyLoading()\n ) {\n $this->addFields($field->getReference());\n }\n }\n }",
"function acf_register_field_type($class) {}",
"private function setByTypeRelationField(string $module, CsvField $field, CsvField $moduleField): void\n {\n if (! $this->isRelatedType($field)) {\n return;\n }\n\n // skip for field with type \"related(Articles)\" when current module is \"Articles\"\n if ($this->getTableName() === $field->getAssocCsvModule()) {\n return;\n }\n\n // skip for fields associated with Footprint behavior ('related' type fields associated with Users table)\n if ($this->isFootprintField($field) || $this->isFootprintField($moduleField)) {\n return;\n }\n\n $this->setAssociation(\n 'belongsToMany',\n static::generateAssociationName($module, $field->getName()),\n [\n 'joinTable' => Inflector::tableize($module),\n 'className' => $field->getAssocCsvModule(),\n 'foreignKey' => $moduleField->getName(),\n 'targetForeignKey' => $field->getName(),\n ]\n );\n }",
"public function addField(Field $field)\n\t{\n\t\t$tmp = $this->fields->getValue($this->entity);\n\t\t$tmp[$field->name] = $field;\n\t\t$this->fields->setValue($this->entity, $tmp);\n\n\t\tif ($field->type == 'id')\n\t\t{\n\t\t\t$key = new \\ReflectionProperty('Joomla\\ORM\\Entity\\Entity', 'key');\n\t\t\t$key->setAccessible(true);\n\t\t\t$key->setValue($this->entity, $field->name);\n\t\t}\n\t}",
"function _voipextension_create_extension_main_field($node_type) {\n // Need to load the CCK include file where content_field_instance_create() is defined.\n module_load_include('inc', 'content', 'includes/content.crud');\n\n $field = _voipextension_main_field_definition($node_type);\n if (!content_fields($field['field_name'], $node_type)) {\n $field['type_name'] = $node_type;\n content_field_instance_create($field);\n }\n}",
"private function _registerFieldTypes()\n {\n Event::on(Fields::class, Fields::EVENT_REGISTER_FIELD_TYPES,\n function(RegisterComponentTypesEvent $event) {\n $event->types[] = ReadonlyCategories::class;\n }\n );\n }",
"public function addExtension(FieldExtensionInterface $extension);",
"private function addFieldJoin(RelationField $field) {\n if ($field->isLocalized()) {\n $this->localize = true;\n }\n\n $this->fieldJoins[$field->getName()] = $field;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end function Delete country images and return JSON response | public function deleteCountryImageAction()
{
//disable layout and helper
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
//get request
$request = $this->getRequest();
if ($request->isPost())
{
$options = $request->getPost();
$image_id = $options["image_id"];
$model = new Application_Model_CountryImages();
$res = $model->find($image_id);
if(false!==$res)
{
$model->delete("id={$image_id}");
//unlink image if files exists
if(file_exists("media/picture/country/images/".$res->getCountryImage()))
{
@unlink("media/picture/country/images/".$res->getCountryImage());
@unlink("media/picture/country/images/thumbs/".$res->getCountryImage());
}
$arrayResult = Array("error"=>0, "response"=>"Image has been deleted.");
}
else
{
$arrayResult = Array("error"=>1, "response"=>"Invalid request, no image found.");
}
/*
$country_id = $options["country_id"];
$lonelyPlanetCountryM = new Application_Model_LonelyPlanetCountry();
$lonelyPlanetCountryM = $lonelyPlanetCountryM->find($country_id);
if(false!==$lonelyPlanetCountryM)
{
$countryImages = unserialize($lonelyPlanetCountryM->getImages());
$bigImage = $countryImages[$image_id]["image_filename"];
$thumbImage = $countryImages[$image_id]["image_thumbnail_filename"];
unset($countryImages[$image_id]);
$remainingImg = serialize($countryImages);
$lonelyPlanetCountryM->setImages($remainingImg);
$res = $lonelyPlanetCountryM->save();
if($res)
{
//unlink images
@unlink("media/picture/country/".$bigImage);
@unlink("media/picture/country/".$thumbImage);
$arrayResult = Array("error"=>0, "response"=>"Image has been deleted.");
}
else
{
$arrayResult = Array("error"=>1, "response"=>"Error occured, please try again later.");
}
}
else
{
$arrayResult = Array("error"=>1, "response"=>"Invalid request, no image found.");
}*/
}
else
{
$arrayResult = Array("error"=>1, "response"=>"Invalid request, no image found.");
}
echo Zend_Json::encode($arrayResult);
exit;
} | [
"public function admin_delete_images(){\n\t\t\t\t\t$this->autoRender = false;\n\t\t\t\t\tif($this -> request ->is('post')){\n\t\t\t\t\t\t\tif(isset($this->data['country_image'])){\n\t\t\t\t\t\t\t\t\t $returnId= $this->Country->find('first',array('fields'=>'id','conditions'=>array('country_image'=>$this->data['country_image'])));\n\t\t\t\t\t\t\t\t//\tpr($returnId); die;\n\t\t\t\t\t\t\t\t\tif($returnId){\n\t\t\t\t\t\t\t\t\t\tif($this->Country->delete($returnId['Country']['id'])){\n\t\t\t\t\t\t\t\t\t\t\t\t@unlink(WWW_ROOT.'/images/countryImg'.$this->data['country_image']);\n\t\t\t\t\t\t\t\t\t\t\t\techo json_encode(array('status'=>'success','message'=>'deleted'));\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\techo json_encode(array('status'=>'successWithWarning','message'=>'not saved'));\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 }\n\t\t\t\t }\n\t\t\t\t }\n\t }",
"public function deleteCityImageAction()\n\t{\n\t\t//disable layout and helper\n\t\t$this->_helper->layout->disableLayout();\t\n\t\t$this->_helper->viewRenderer->setNoRender(true);\n\t\t\n\t\t//get request\n\t\t$id = \"\";\n\t\t$request = $this->getRequest();\n\t\tif ($request->isPost())\n\t\t{\n\t\t\t$options = $request->getPost();\n\t\t\t$id\t=\t$options[\"image_id\"];\n\t\t}\t\n\t\t$model\t=\tnew Application_Model_CityImages();\n\t\t$res\t=\t$model->find($id);\n\t\tif(false!==$res)\n\t\t{\n\t\t\t$model->delete(\"id={$id}\");\n\t\t\t\n\t\t\t//unlink image if files exists\n\t\t\tif(file_exists(\"media/picture/city/\".$res->getCityImage()))\n\t\t\t{\n\t\t\t\tunlink(\"media/picture/city/\".$res->getCityImage());\n\t\t\t}\t\n\t\t\t$arrayResult = Array(\"error\"=>0, \"response\"=>\"Image has been deleted.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayResult = Array(\"error\"=>1, \"response\"=>\"Invalid request, no image found.\");\n\t\t}\n\t\techo Zend_Json::encode($arrayResult);\n\t\texit;\n\t}",
"public static function deleteCountry() {\n $result = array();\n $deleted = lC_Countries_Admin::delete($_GET['cid']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function banner_images_delete($id){\n $this->output->set_content_type('application/json');\n $results = $this->Category_model->get_banner_images_byid($id);\n $category_id = $results['category_id'];\n if(!empty($results['image_url'])){\n unlink('./uploads/category-banner-images/'.$results['image_url']);\n }\n $results = $this->Category_model->banner_images_delete($id);\n if (!empty($results)) {\n $this->output->set_output(json_encode(['result' => 1, 'msg' => 'Deleted successful.', 'url' => base_url('category/add/'.$category_id)]));\n return FALSE;\n } else {\n $this->output->set_output(json_encode(['result' => -1, 'msg' => 'Deleted not successfully.']));\n return FALSE;\n }\n }",
"public function delete_abstractImage(){\n\t\t\tif($_SERVER['REQUEST_METHOD'] == \"POST\"){\n\t\t\t\tif($this->session->userdata(\"loggedin\") ==true && $this->session->userdata(\"adminLoggedin\") == true){\n\t\t\t\t\t$image = $this->config->item(\"upload_path\").$this->input->post(\"inputAbstractImage\");\n\t\t\t\t\tif(file_exists($image)){\n\t\t\t\t\t\tif(unlink($image)){\n\t\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\"success\" => true\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\"success\" => false,\n\t\t\t\t\t\t\t\t\t\"error\" => \"An error occurred.\"\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\telse{\n\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"success\" => false,\n\t\t\t\t\t\t\t\t\"error\" => \"File does not exist!\"\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\telse{\n\t\t\t\t\tshow_404();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404();\n\t\t\t}\n\t\t}",
"public function postAjax_delete_img()\n\t{\n\t\t\n\t\tif( Request::ajax() ){\n\t\t\t\n\t\t\t$bandera=false;\n\t\t\t\n\t\t\tif( Input::has('img_id') and Input::has('p_id') ){\n\t\t\t\t\n\t\t\t\t$imagen = ImagenesMosaico::find( Input::get('img_id') );\n\t\t\t\n\t\t\t\tif( $imagen ){\n\t\t\t\t\t\n\t\t\t\t\tif( $imagen->delete() ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$path=public_path().'/'.$this->pathUpload.'proy_id_'.Input::get('p_id').'/img/id_'.$imagen->id.'/';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( File::exists($path) ){\n\t\t\t\t\t\t\tFile::deleteDirectory($path);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$bandera=true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $bandera===true ){\n\t\t\t\t\n\t\t\t\treturn Response::json(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'success' => true,\n\t\t\t\t\t\t'img_id'\t => $imagen->id,\n\t\t\t\t\t\t'p_id'\t => $imagen->proyecto_id,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\treturn Response::json(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'success' => false,\n\t\t\t\t\t\t'id'\t => '',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public function banner_images_delete($id){\n $this->output->set_content_type('application/json');\n $results = $this->Services_model->get_banner_images_byid($id);\n $service_id = $results['service_id'];\n if(!empty($results['image_url'])){\n unlink('./uploads/service-banner-images/'.$results['image_url']);\n }\n $results = $this->Services_model->banner_images_delete($id);\n if (!empty($results)) {\n $this->output->set_output(json_encode(['result' => 1, 'msg' => 'Deleted successful.', 'url' => base_url('services/add/'.$service_id)]));\n return FALSE;\n } else {\n $this->output->set_output(json_encode(['result' => -1, 'msg' => 'Deleted not successfully.']));\n return FALSE;\n }\n }",
"function delete_image(){\r\n}",
"public function handleDeleteImage(){\n\n $session = $this->hlp->sess(\"images\");\n $img = $session->toDelete;\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $imgs = $this->listings->getListingImages($listingID);\n \n unset($imgs[$img]);\n\n //reindexed array after unset\n $newArray = array();\n \n foreach ($imgs as $image){\n array_push($newArray, $image);\n }\n \n unset($imgs);\n \n //final array - updated - without deleted images to store in db\n $images = serialize($newArray);\n \n $this->listings->updateListingImages($listingID, $images);\n $this->redirect(\"Listings:editListing\", $listingID);\n }",
"public function removeimage(){}",
"public function delete_catalog_photoAction() {\n $id = (int) Arr::get($this->post, 'id');\n if (!$id) die('Error!');\n\n $image = DB::select('image')->from( 'catalog_images' )->where( 'id', '=', $id )->find()->image;\n DB::delete( 'catalog_images' )->where( 'id', '=', $id )->execute();\n\n Files::deleteImage('catalog', $image);\n\n die(json_encode([\n 'status' => true,\n ]));\n }",
"public function deleteImage()\n {\n if ($this->delete($_SESSION['UserID'], $_POST['imageID'])) {\n return 200;\n } else {\n return 400;\n }\n }",
"function delete_img($path){\n $path = json_decode($path);\n // $path will be single path or path of array\n return File_helper::deleteFile($path);\n }",
"public function deleteImage(){\n\t\t$this->load->helper(array('response', 'input', 'security'));\n\t\t$filename = sanitize_filename($this->input->post('filename'));\n\t\t$imageId = sanitizeInteger($this->input->post('id'));\n\n\t\t// first delete the record in database\n\t\tif($this->images->deleteImageById($imageId)){\n\t\t\t// if it goes ok, delete the file\n\n\t\t\t$deleteFile = realpath(\"./uploads/\".$filename);\n\t\t\tif(unlink($deleteFile)){\n\t\t\t\t// if all good, return success answer\n\t\t\t\techo returnResponse('success', 'OK', 'jsonizeResponse');\n\t\t\t}else{\n\t\t\t\techo returnResponse('error', 'ERROR', 'jsonizeResponse');\n\t\t\t}\n\t\t}else{\n\t\t\techo returnResponse('error', 'ERROR', 'jsonizeResponse');\n\t\t}\n\n\t}",
"public function actionDeleteimageinbucket() {\n//first find out which service the API will be accessing and get the details of that service\n if ($service = CHttpRequest::getParam('which_service')) {\n $service_details = self::_get_service(CHttpRequest::getParam('which_service'));\n//if an image name is given, insert that image, else sync them all\n if ($image_name = CHttpRequest::getParam('image_name')) {\n $JSON_array = ApiHelper::_remove_image_from_bucket($service_details['bucket'], $image_name);\n }\n else\n//removes all images from bucket\n $JSON_array = ApiHelper::_remove_image_from_bucket($service_details['bucket']);\n }\n else\n throw new CHttpException(404, \"The page you are looking for does not exist.\");\n\n ApiHelper::_sendResponse(200, CJSON::encode($JSON_array));\n }",
"public function removeBusinessProfileImage() {\n if ($this->input->is_ajax_request()) {\n $identification = $this->input->post('identification');\n $business_id = $this->encrypt_decrypt->decrypt($identification, ENCRYPT_DECRYPT_KEY); //Decrypting the passed business id through ajax\n $updating_data[\"profile_image\"] = NULL;\n $business_info = $this->businessMaster_model->get_business_info(array(), array(), $business_id); //Business details information\n $this->businessMaster_model->update_business($updating_data, \"\", $business_id);\n /* ---Physically deleting images starts--- */\n unlink(UPLOADING_PATH . \"vendor-images/preview/\" . $business_info[\"profile_image\"]);\n unlink(UPLOADING_PATH . \"vendor-images/original/\" . $business_info[\"profile_image\"]);\n unlink(UPLOADING_PATH . \"vendor-images/thumb/\" . $business_info[\"profile_image\"]);\n unlink(UPLOADING_PATH . \"vendor-images/admin-preview/\" . $business_info[\"profile_image\"]);\n /* ---Physically deleting images ends--- */\n $result['status'] = 1;\n $result['image_url'] = ASSET_URL . \"uploads/vendor-images/admin-preview/No-Image-Placeholder.jpg\";\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode($result));\n }\n }",
"function ajax_delete_slider()\n {\n $id = $this->uri(3);\n $id = explode('-',$id);\n $img_id = $id[0];\n $name = $id[1];\n unlink('assets/images/slider_image/'.$name);\n $this->dashboard_model->delete_imgTable_info($img_id);\n $this->jsonMsgReturn(true,'Delete Success');\n }",
"public function delete_images() {\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $id = $data['id'];\n $this->Image->deleteImages($id);\n $this->redirect(array('controller'=>'users', 'action'=>'user_dashboard'));\n }\n }",
"public function del_image(){\n \tif($_POST){\n \t\textract($_POST);\n \t\t// pa('','d');\n\n \t\tif( Up::delete([\"file\"=>$file]))\n \t\t\techo \"deleted\";\n \t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns String containing multiple list items of alerts | public function getAlerts()
{
$data = '';
foreach ($this->alertTypes as $alert) {
if (isset($_SESSION[$alert])) {
foreach ($_SESSION[$alert] as $value) {
$data .= '<li class="' . $alert . '">' . $value . '</li>';
}
unset($_SESSION[$alert]);
}
}
echo $data;
} | [
"protected function alerts(){\n\t\t$return = '';\n\t\tif (isset($this->alert[0])){\n\t\t\t$return .= '<div id=\"ts3alerts\"><h3>Alerts</h3>';\n\t\t\tforeach ($this->alert as $var) {\n\t\t\t\t$return .= $var.'<br />';\n\t\t\t}\n\t\t\t$return .= '</div>';\n\t\t}\n\t\treturn $return;\n\t}",
"public function getListAlert()\n {\n global $wpdb;\n $result = $wpdb->get_results(\"SELECT * FROM alerts ORDER BY end_date\", ARRAY_A);\n return $result;\n }",
"private function getLatestAlertsList() {\r\n\t\t$sql = \"SELECT alertdate, message FROM alerts \";\r\n\t\t$sql .= \"ORDER BY alertdate DESC \";\r\n\t\t$sql .= \"LIMIT 0,6\";\r\n\t\t$result = mysql_query($sql) or die ('Error in SQL: ' . $sql);\r\n\r\n\t\t$i = 0;\r\n\t\twhile($row = mysql_fetch_array($result)) {\r\n\t\t\t$r[$i]['date'] = date(\"g:i a\", strtotime($row['alertdate'])) . \"<br />\" . date(\"M j\", strtotime($row['alertdate']));\r\n\t\t\t//$r[$i]['date'] = $row['alertdate'];\r\n\t\t\tif (strlen($row['message']) > 150) {\r\n\t\t\t\t$r[$i]['message'] = substr($row['message'], 0, 120) . ' ...';\r\n\t\t\t} else {\r\n\t\t\t\t$r[$i]['message'] = $row['message'];\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\treturn($r);\r\n\t}",
"public function alerts()\n {\n return $this->data['alerts'];\n }",
"public function buildAlerts()\r\n\t{\r\n\t\t$data\t= null;\r\n\t\t$check\t= array( 'success', 'error', 'block', 'info' );\r\n\t\t\r\n\t\tforeach ( $check as $type ) {\r\n\t\t\tif ( empty( $this->alerts[$type] ) ) continue;\r\n\t\t\t$data\t.=\t'<div class=\"alert alert-' . $type . '\"><h4>' . t( 'intouch.alert.' . $type ) . '</h4>'\r\n\t\t\t\t\t.\timplode( \"<br/>\", $this->alerts[$type] )\r\n\t\t\t\t\t.\t'</div>';\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}",
"public function buildAlerts()\r\n\t{\r\n\t\t$data\t= null;\r\n\t\t$check\t= array( 'success', 'error', 'block', 'info' );\r\n\t\r\n\t\tforeach ( $check as $type ) {\r\n\t\t\tif ( empty( $this->alerts[$type] ) ) continue;\r\n\t\t\t$data\t.=\t'<div class=\"alert alert-' . $type . '\"><h4>' . t( 'dunamis.alert.' . $type ) . '</h4>'\r\n\t\t\t\t\t.\timplode( \"<br/>\", $this->alerts[$type] )\r\n\t\t\t\t\t.\t'</div>';\r\n\t\t}\r\n\t\r\n\t\treturn $data;\r\n\t}",
"public function getAlertTypeOptions()\n {\n $output = '[';\n $output .= '\n {\n \"value\": \"0\",\n \"text\": \"All\"\n },\n ';\n\n $alerttypes = $this->alert_logic->getAlertTypes();\n\n if ($alerttypes !== false) {\n $last_index = count($alerttypes) - 1;\n foreach ($alerttypes as $index => $alerttype) {\n $separator = ',';\n\n if ($index == $last_index) {\n $separator = '';\n }\n\n $output .= '{\"value\": \"' . $alerttype['alerttype_id'] . '\", \"text\": \"' . $alerttype['alerttypename'] . '\"}' . $separator;\n }\n }\n\n $output .= ']';\n\n die($output);\n }",
"public function actionGetAlertList() {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n $alerts = Alert::getActive();\n $html = \"\";\n $statData = [\n //Alert::STATUS_ACCEPTED => [ucfirst(Alert::STATUS_ACCEPTED), 0],\n //Alert::STATUS_ASSIGNED => [ucfirst(Alert::STATUS_ASSIGNED), 0],\n //Alert::STATUS_PENDING => [ucfirst(Alert::STATUS_PENDING), 0],\n ];\n foreach ($alerts->each() as $alert) {\n if (isset($statData[$alert->status])) {\n $statData[$alert->status][1] += 1;\n } else {\n $statData[$alert->status] = [ucfirst($alert->status), 1];\n }\n\n switch ($alert->status) {\n case Alert::STATUS_ASSIGNED:\n $statusIcon = Html::tag('span', Html::tag('i', '', ['class' => 'fa fa-user-o']), ['class' => 'info-box-icon bg-yellow']);\n $style = \"warning\";\n break;\n case Alert::STATUS_ACCEPTED:\n $statusIcon = Html::tag('span', Html::tag('i', '', ['class' => 'fa fa-user']), ['class' => 'info-box-icon bg-green']);\n $style = \"success\";\n break;\n default:\n $statusIcon = Html::tag('span', Html::tag('i', '', ['class' => 'fa fa-question']), ['class' => 'info-box-icon bg-gray']);\n $style = \"default\";\n break;\n }\n $html .= Html::tag('li', Html::tag('div', Html::tag('div', $statusIcon, ['class' => 'col-xs-4 text-center']) .\n Html::tag('div', Html::a((isset($alert->camera->property->name) ? ucfirst($alert->camera->property->name) : $alert->camera->name), ['site/watch', 'alert_id' => $alert->id]) .\n Html::tag('span', Yii::$app->formatter->asDatetime($alert->updated_at), ['class' => \"product-description\"]) . Html::tag('div', $alert->status, ['class' => \"label label-$style\"]) .\n ($alert->user ? Html::tag('div', 'Assigned agent: ' . Html::a(ucfirst($alert->user->username), ['/user/view', 'id' => $alert->user_id], ['target' => '_blank']), ['class' => 'lead']) : Html::tag('div', 'Waiting for an agent: ' . (time() - $alert->updated_at) . ' s.', ['class' => 'small', 'style' => 'margin-top:5px;']))\n , ['class' => 'col-xs-8'])\n , ['class' => \"row\"])\n , ['class' => 'item']);\n }\n if (!$html)\n $html = \"There is no video in stack\";\n return ['result' => true, 'html' => $html, 'statistics' => array_values($statData)];\n }",
"private function renderHTML() {\n $content = '';\n \tforeach ($this->getAlert() as $item) {\n $content = $content.'<div'; \n $content = $content.$this->renderClass($item['type']);\n $content = $content.$this->renderID();\n \t\t$content = $content.' role=\"alert\"><strong>'.$item['title'].'</strong>'.$item['text'].'</div>';\n }\n\t\treturn $content;\n\t}",
"public function getAlertMessages()\n\t{\n\t\t$alerts = $this->alerts;\n\t\treturn $alerts;\n\t}",
"public function getAll()\n {\n return $this->alerts;\n }",
"function get_alerts(){\n\n\t$result = array();\n\n\t// Show alerts if we are a subscriber, Do not need it for admin users\n\tif( get_role_user() == \"bpuser\" ){\n\n\t\t$Notifications = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );\n\t\t$messages = bp_get_total_unread_messages_count( bp_loggedin_user_id() );\n\n\t\tif( $Notifications ) $result[\"Notifications\"] = '<span class=\"count\">'.$Notifications.'</span>';\n\t\tif( $messages ) $result[\"Messages\"] = '<span class=\"count\">'.$messages.'</span>';\n\n\t}\n\n\treturn $result;\n\n}",
"function getFormattedEmployeesList(){\n $employees_string_list = array_map(function($employee) {\n return (string)$employee;\n }, $this->employees);\n\n return implode(\"<br>\", $employees_string_list);\n }",
"public function get_title() {\n\n\t\t$alert_type = $this->get_alert_type_obj()->name;\n\n\t\t$output = array();\n\t\tforeach ( array( 'action', 'author', 'context' ) as $trigger_type ) {\n\t\t\t$output[ $trigger_type ] = $this->plugin->alerts->alert_triggers[ $trigger_type ]->get_display_value( 'list_table', $this );\n\t\t}\n\t\t$title = '';\n\t\tforeach ( $this->plugin->alerts->alert_triggers as $trigger_type => $trigger_obj ) {\n\t\t\t$value = $trigger_obj->get_display_value( 'list_table', $this );\n\t\t\t$title .= $value . ' > ';\n\t\t}\n\t\t$title = rtrim( $title, ' > ' );\n\t\treturn $title;\n\t}",
"public function build_alert( $alerts );",
"public function item_list(){\n\t\t$items = '\"item_list\": {\"items\":[';\n\t\tforeach ($this->itemList as $item){\n\t\t\t$items = $items . $item->toJson() . ',';\n\t\t}\n\t\t$items = substr($items, 0, -1); //remove the final comma\n\t\t$items = $items . ']}';\n\n\t\treturn $items;\n\n\t}",
"function toListItem()\n {\n return \"<li>$this->email $this->wins $this->losses $this->lastDayPlayed</li>\";\n }",
"public function getLogs(): string\n {\n $html = '<ul>';\n\n foreach ($_SESSION['ALOGGER'] as $line) {\n $html .= \"<li>{$line->date} : {$line->type} | {$line->text}</li>\";\n }\n\n $html .= '</ul>';\n unset($_SESSION['ALOGGER']);\n return $html;\n }",
"public function itemsListSBC()\n {\n $str = '';\n foreach ($this->items as $item) {\n $str .= \"$item->qty:$item->item_name, \";\n }\n return rtrim($str, ', ');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set SeatReservations value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setSeatReservations(\Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\ArrayType\ArrayOfBookRequestSeatData $seatReservations = null)
{
if (is_null($seatReservations) || (is_array($seatReservations) && empty($seatReservations))) {
unset($this->SeatReservations);
} else {
$this->SeatReservations = $seatReservations;
}
return $this;
} | [
"public function setReservations($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Compute\\V1\\Reservation::class);\n $this->reservations = $arr;\n\n return $this;\n }",
"public function setSeatReservations(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\ArrayType\\ArrayOfBookResponseSeatReservation $seatReservations = null)\n {\n if (is_null($seatReservations) || (is_array($seatReservations) && empty($seatReservations))) {\n unset($this->SeatReservations);\n } else {\n $this->SeatReservations = $seatReservations;\n }\n return $this;\n }",
"public function getSeatReservations()\n {\n return isset($this->SeatReservations) ? $this->SeatReservations : null;\n }",
"public function getReservations()\n {\n return $this->reservations;\n }",
"public function getReservations()\n {\n return $this->reservations;\n }",
"public function getReservations(): array\n {\n return $this->reservations;\n }",
"public function setReservedSeats(int $reservedSeats) : self\n {\n $this->reservedSeats = $reservedSeats;\n\n return $this;\n }",
"public function reservations() {\n return $this->hasMany('App\\Reservation', 'id');\n }",
"public function reservations()\n {\n return $this->hasMany(Reservation::class);\n }",
"public function reservations()\n {\n return $this->hasMany('App\\Reservation');\n }",
"public function removeReservation($reservation)\n {\n }",
"public function setReservationId($value) \n {\n $this->_fields['ReservationId']['FieldValue'] = $value;\n return $this;\n }",
"private function setSampleReservation(): void\n {\n // Predefined data.\n $dateTime = '2020-01-19 23:59:00';\n $phone = '+48564777597';\n $email = 'some_email@some_domain.com';\n $id = 69;\n $machineId = 1;\n $pin = '49971';\n\n $reservation = new Reservation(new DateTime($dateTime), $phone, $email, $machineId, $pin);\n $reservation->setId($id);\n\n $this->sampleReservation = $reservation;\n }",
"public function removeReservation(Reservation $reservation)\n {\n }",
"public function setReservation($forReservation)\n {\n $this->reservation = $forReservation;\n }",
"public function listProjectsLocationsReservations($parent, $optParams = [])\n {\n $params = ['parent' => $parent];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], ListReservationsResponse::class);\n }",
"public function reserves() {\n return $this->morphToMany('App\\Reservation', 'reservable')->withPivot('day', 'option');\n }",
"public function acceptsReservations($acceptsReservations)\n {\n return $this->setProperty('acceptsReservations', $acceptsReservations);\n }",
"public function noReservationsAvailableCase1()\n\t{\t\n\t\t$reservation = new Reservation();\n\t\t$reservation->setAttributes(array(\n\t\t\t\t'roomid' => 1,\n\t\t\t\t'datefrom' => $this->_dateOverlapFrom,\n\t\t\t\t'numberofnights'=> $this->_numberofnights,\n\t\t\t\t));\n\t\t$this->assertFalse($reservation->save()); \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ | | Verify Hostel | | Hostel addmin will send a request to admin for verifying a hostel after | submitting a register request. Admin will verify the hostel if he | meets the requirements of the hostel. | | public function verifyHostel(Request $request)
{
$user = JWTAuth::toUser($request->token);
$response = [
'data' => [
'code' => 400,
'errors' => '',
'message' => 'Invalid Token! User Not Found.',
],
'status' => false
];
if(!empty($user) && $user->isSuperAdmin())
{
$response = [
'data' => [
'code' => 400,
'message' => 'Something went wrong. Please try again later!',
],
'status' => false
];
$rules = [
'id' => 'required',
];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
$response['data']['message'] = 'Invalid input values.';
$response['data']['errors'] = $validator->messages();
} else {
DB::beginTransaction();
try {
$hostelData = Hostel::where('id', '=', $request->id)->first();
$hostel = Hostel::where('id', '=', $request->id)->update([
'isVerified' => 1,
]);
$userId = $hostelData->userId;
$user = User::find($userId)->update([
'verified' => 1,
]);
if ($hostel && $user){
DB::commit();
$response['data']['code'] = 200;
$response['status'] = true;
$response['data']['result'] = $hostel;
$response['data']['message'] = 'Hostel Verified Successfully';
}
// PUSH NOTIFICATION
// $title = "Hostel Verified";
// $message = "Congratulations! Your request to registered a new hostel have been approved";
// findDeviceToken($title, $message, $userId);
} catch (Exception $e) {
DB::rollBack();
throw $e;
}
}
}
return $response;
} | [
"public function rejectHostelVerification(Request $request)\n {\n $user = JWTAuth::toUser($request->token);\n\n $response = [\n 'data' => [\n 'code' => 400,\n 'errors' => '',\n 'message' => 'Invalid Token! User Not Found.',\n ],\n 'status' => false\n ];\n\n if(!empty($user) && $user->isSuperAdmin())\n {\n $response = [\n 'data' => [\n 'code' => 400,\n 'message' => 'Something went wrong. Please try again later!',\n ],\n 'status' => false\n ];\n \n $rules = [\n\n \t'id' => 'required',\n\n ];\n\n $validator = Validator::make($request->all(), $rules);\n\n if ($validator->fails()) {\n \n $response['data']['message'] = 'Invalid input values.';\n $response['data']['errors'] = $validator->messages();\n\n } else {\n\n DB::beginTransaction();\n try {\n\n $hostelData = Hostel::find($request->id);\n $userId = $hostelData->userId;\n\n $hostel = Hostel::where('id', '=', $request->id)->update([\n\n 'isVerified' => 2,\n\n ]);\n \n $user = User::find($userId)->update([\n\n 'verified' => 2, // Status = 2 means that the request to update hostel have been rejected by administrater\n\n ]);\n\n // PUSH NOTIFICATION\n\n // $title = \"Hostel Registration Rejected\";\n // $message = \"Sorry! Your request to register a new hostel have been rejected.\";\n\n // findDeviceToken($title, $message, $userId);\n\n if ($user){\n\n DB::commit();\n $response['data']['code'] = 200;\n $response['status'] = true;\n $response['data']['message'] = 'Sorry! Request to verify the hostel have been rejected!';\n \n }\n\n } catch (Exception $e){\n\n DB::rollBack();\n $response['data']['code'] = 400;\n $response['data']['message'] = 'Request Unsuccessfull';\n $response['status'] = false;\n }\n }\n }\n return $response;\n }",
"public function verifyrequest()\n {\n }",
"public function verificationVerify(): void\n {\n $this->testCase()->get(route($this->auth->route_verification_verify, ['id' => 1, 'hash' => 'wrong']))\n ->assertOk() // Should be 200\n ;\n }",
"public function start_verification(){\n $whitelist = array( '127.0.0.1', '::1' );\n if( !in_array( $_SERVER['REMOTE_ADDR'], $whitelist) ){\n\n if (!get_option( 'trial_period' )) {\n update_option( 'trial_period', date(\"Y-m-d\"));\n }\n if (get_option( 'enable_full_version' )) {\n $content = __('The license is verified.','redux-framework');\n }else{\n $content = __('The license is not verified.','redux-framework');\n }\n echo \"<script> jQuery('#info-verification_status p').html('$content'); jQuery('#info-verification_status').show('fast'); </script>\";\n if (get_option( 'enable_full_version' )) {\n echo \"<script> setTimeout(function(){jQuery('#validation_activate').click();},3000); </script>\";\n }\n $trial_period = $this->trial_period();\n $trial_period_limit = $this->trial_period_limit;\n if ($trial_period <= $trial_period_limit) {\n if ($trial_period == $trial_period_limit) {\n $count = __('last', 'redux-framework');\n }else{\n $count = $trial_period_limit-$trial_period;\n }\n $popup_content = __('Dear customer, thank you for using '.$this->theme_name.' theme! Please enter purchase code to register your copy. <br/><b>'.$count.' day(s)</b> trial period left. <br/><p align=\"center\"><a href=\"https://www.youtube.com/watch?v=nzBQf3nnJA8\" target=\"_blank\">how to obtain purchase code?</a></p>','redux-framework');\n }else{\n $popup_content = __('Dear customer, please register to proceed using '.$this->theme_name.' theme. <br/><p align=\"center\"><a href=\"https://www.youtube.com/watch?v=nzBQf3nnJA8\" target=\"_blank\">how to obtain purchase code?</a></p>','redux-framework');\n if (!get_option( 'enable_full_version' )) {\n echo \"<script>\n jQuery('.redux-group-tab-link-li').hide();\n jQuery('#toplevel_page_cesis_options ul').hide();\n jQuery('.redux-group-tab-link-li.redux-tlm-class').show().addClass('active');\n setTimeout(function(){\n jQuery('.redux-group-tab').hide();\n jQuery('.redux-group-tab.redux-tlm-class').show();\n }, 500);\n </script>\";\n }\n }\n if ($this->parent->args['page_slug'] == $this->dev_check_current_screen() && !get_option( 'enable_full_version' )) {\n echo '<div class=\"popup-license\" data-remodal-id=\"popup_license\" role=\"dialog\" aria-labelledby=\"modal1Title\" aria-describedby=\"modal1Desc\">\n <button data-remodal-action=\"close\" class=\"remodal-close\" aria-label=\"Close\"></button>\n <div>\n <h2 id=\"modal1Title\">'.__('Theme registration','redux-framework').'</h2>\n <p id=\"modal1Desc\">'.\n $popup_content\n .'</p>\n </div>\n <br>\n <button data-remodal-action=\"confirm\" class=\"remodal-confirm\">'.__('Register now','redux-framework').'</button>\n <button data-remodal-action=\"cancel\" class=\"remodal-cancel\">'.__('Remind me later','redux-framework').'</button>\n </div>';\n echo '<script type=\"text/javascript\" src=\"'. $this->extension_url . 'tlm/remodal.js\"></script>';\n echo \"<script> var inst = jQuery('[data-remodal-id=popup_license]').remodal(); setTimeout(function(){ inst.open(); }, 2500); </script>\";\n }\n\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n if(strpos($url,'staging') !== false || strpos($url,'temp.') !== false || strpos($url,'dev.') !== false || strpos($url,'www2') !== false || strpos($url,'development.') !== false|| strpos($url,'test.') !== false) {\n update_option( 'enable_full_version', 1);\n }\n }\n }",
"public function verificationVerify(): void\n {\n $this->testCase()->get(route($this->auth->route_verification_verify, ['id' => 1, 'hash' => 'wrong']))\n ->assertNotFound() // Should be 404\n ;\n }",
"public function sendVerification();",
"public function verifyRequest()\n {\n }",
"public function verify()\n {\n $hash = $this->request->param('hash');\n $this->Users->verifyUser($hash);\n \n // 7. display page showing user is verified\n }",
"public function verifyRegistration() {\n\t\tif (! SecurityUtil::checkPermission ( 'Users::', 'user::createshopadmin', ACCESS_MODERATE )) {\n\t\t\tthrow new Zikula_Exception_Forbidden ();\n\t\t}\n\t\t\n\t\tif ($this->request->isGet ()) {\n\t\t\t$uid = $this->request->getGet ()->get ( 'uid', null );\n\t\t\t$forceVerification = $this->currentUserIsAdmin () && $this->request->getGet ()->get ( 'force', false );\n\t\t\t$restoreView = $this->request->getGet ()->get ( 'restoreview', 'view' );\n\t\t\t$confirmed = false;\n\t\t} elseif ($this->request->isPost ()) {\n\t\t\t$this->checkCsrfToken ();\n\t\t\t$uid = $this->request->getPost ()->get ( 'uid', null );\n\t\t\t$forceVerification = $this->currentUserIsAdmin () && $this->request->getPost ()->get ( 'force', false );\n\t\t\t$restoreView = $this->request->getPost ()->get ( 'restoreview', 'view' );\n\t\t\t$confirmed = $this->request->getPost ()->get ( 'confirmed', false );\n\t\t} else {\n\t\t\tthrow new Zikula_Exception_Forbidden ();\n\t\t}\n\t\t\n\t\tif (! isset ( $uid ) || ! is_numeric ( $uid ) || (( int ) $uid != $uid)) {\n\t\t\t$this->registerError ( LogUtil::getErrorMsgArgs () );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Got just a uid.\n\t\t$reginfo = ModUtil::apiFunc ( $this->name, 'registration1', 'get', array (\n\t\t\t\t'uid' => $uid \n\t\t) );\n\t\tif (! $reginfo) {\n\t\t\t$this->registerError ( $this->__f ( 'Error! Unable to retrieve registration record with uid \\'%1$s\\'', $uid ) );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($restoreView == 'display') {\n\t\t\t$cancelUrl = ModUtil::url ( $this->name, 'admin1', 'displayRegistration1', array (\n\t\t\t\t\t'uid' => $reginfo ['uid'] \n\t\t\t) );\n\t\t} else {\n\t\t\t$cancelUrl = ModUtil::url ( $this->name, 'admin1', 'viewRegistrations1', array (\n\t\t\t\t\t'restoreview' => true \n\t\t\t) );\n\t\t}\n\t\t\n\t\t$approvalOrder = $this->getVar ( 'moderation_order', Users_Constant::APPROVAL_BEFORE );\n\t\t\n\t\tif ($reginfo ['isverified']) {\n\t\t\t$this->registerError ( $this->__f ( 'Error! A verification code cannot be sent for the registration record for \\'%1$s\\'. It is already verified.', $reginfo ['uname'] ) );\n\t\t\t$this->redirect ( $cancelUrl );\n\t\t} elseif (! $forceVerification && ($approvalOrder == Users_Constant::APPROVAL_BEFORE) && ! $reginfo ['isapproved']) {\n\t\t\t$this->registerError ( $this->__f ( 'Error! A verification code cannot be sent for the registration record for \\'%1$s\\'. It must first be approved.', $reginfo ['uname'] ) );\n\t\t\t$this->redirect ( $cancelUrl );\n\t\t}\n\t\t\n\t\tif (! $confirmed) {\n\t\t\t// So expiration can be displayed\n\t\t\t$regExpireDays = $this->getVar ( 'reg_expiredays', 0 );\n\t\t\tif (! $reginfo ['isverified'] && $reginfo ['verificationsent'] && ($regExpireDays > 0)) {\n\t\t\t\ttry {\n\t\t\t\t\t$expiresUTC = new DateTime ( $reginfo ['verificationsent'], new DateTimeZone ( 'UTC' ) );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\t$expiresUTC = new DateTime ( Users_Constant::EXPIRED, new DateTimeZone ( 'UTC' ) );\n\t\t\t\t}\n\t\t\t\t$expiresUTC->modify ( \"+{$regExpireDays} days\" );\n\t\t\t\t$reginfo ['validuntil'] = DateUtil::formatDatetime ( $expiresUTC->format ( Users_Constant::DATETIME_FORMAT ), $this->__ ( '%m-%d-%Y %H:%M' ) );\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->view->assign ( 'reginfo', $reginfo )->assign ( 'restoreview', $restoreView )->assign ( 'force', $forceVerification )->assign ( 'cancelurl', $cancelUrl )->fetch ( 'users_admin_verifyregistration.tpl' );\n\t\t} else {\n\t\t\t$verificationSent = ModUtil::apiFunc ( $this->name, 'registration1', 'sendVerificationCode', array (\n\t\t\t\t\t'reginfo' => $reginfo,\n\t\t\t\t\t'force' => $forceVerification \n\t\t\t) );\n\t\t\t\n\t\t\tif (! $verificationSent) {\n\t\t\t\t$this->registerError ( $this->__f ( 'Sorry! There was a problem sending a verification code to \\'%1$s\\'.', $reginfo ['uname'] ) );\n\t\t\t\t$this->redirect ( $cancelUrl );\n\t\t\t} else {\n\t\t\t\t$this->registerStatus ( $this->__f ( 'Done! Verification code sent to \\'%1$s\\'.', $reginfo ['uname'] ) );\n\t\t\t\t$this->redirect ( $cancelUrl );\n\t\t\t}\n\t\t}\n\t}",
"function HaveToBeAdmin()\n{\n if (!hpost(\"http://localhost:4567/api/isAdmin\", array(\"token\" => $_SESSION[\"me\"]->token))->admin) {\n// echo \"Guard Activer ! Redirect\";\n header(\"Location: /\");\n }\n}",
"public function requestVerification()\n {\n Event::dispatch(new VerificationRequest($this));\n }",
"public function postVerify() {\n\t\t// If the admin did not click 'yes', we should not verify\n\t\tif (!Input::get('yes'))\n\t\t\treturn Redirect::route('admin-users')\n\t\t\t\t->with('warning', 'Användaren verifierades inte.');\n\n\t\t// Now find user and edit the database table column, or show error if couldn't find.\n\t\ttry {\n\t\t\t$user = User::findOrFail(Input::get('user-id'));\n\t\t} catch(ModelNotFoundException $e) {\n\t\t return Redirect::route('admin-users')\n\t\t \t->with('error', 'Användaren som skulle verifieras hittades inte.');\n\t\t}\n\t\t\n\t\t$user->privileges = 'verified';\n\t\t$user->save();\n\n\t\t// Send mail to inform user that the account has been created and waiting for verification\n\t\tMail::send('emails.welcome-verified', array('name' => $user->name, 'email' => $user->email), function($message) use($user) {\n\t\t $message\n\t\t \t->to($user->email, $user->name)\n\t\t \t->from('no-reply@ds.se', 'Danderyds Sjukhus')\n\t\t \t->subject('Du är nu godkänd!');\n\t\t});\n\n\t\treturn Redirect::route('admin-users')\n\t\t\t->with('success', 'Användaren verifierades.');\n\t}",
"public function verifyOtp(){\n\n }",
"public function verify($param) {\n require_once 'src/core/model/AccountsTable.php';\n $username = $param[0];\n $tokenhash = $param[1];\n\n $result = \\core\\model\\AccountsTable::verifyEmail($username, $tokenhash);\n if ($result) {\n require_once 'src/inout/controller/NotificationController.php';\n $controller = new \\inout\\controller\\NotificationController();\n $controller->render('Verify email successfully! Now you can use our app with all functions.');\n } else {\n require_once 'src/inout/controller/NotificationController.php';\n $controller = new \\inout\\controller\\NotificationController();\n $controller->render('Unable to verify your email now! Please! Try again after few minutes.');\n }\n }",
"public function handle_action_verify() {\n\t\t$input = $this->context->input();\n\t\t$step = htmlspecialchars( $input->filter( INPUT_GET, 'step' ) );\n\t\t$nonce = htmlspecialchars( $input->filter( INPUT_GET, 'nonce' ) );\n\t\t$code = htmlspecialchars( $input->filter( INPUT_GET, 'googlesitekit_code' ) );\n\t\t$site_code = htmlspecialchars( $input->filter( INPUT_GET, 'googlesitekit_site_code' ) );\n\t\t$verification_token = htmlspecialchars( $input->filter( INPUT_GET, 'googlesitekit_verification_token' ) );\n\t\t$verification_method = htmlspecialchars( $input->filter( INPUT_GET, 'googlesitekit_verification_token_type' ) );\n\n\t\t$this->verify_nonce( $nonce );\n\n\t\tif ( ! current_user_can( Permissions::SETUP ) ) {\n\t\t\twp_die( esc_html__( 'You don\\'t have permissions to set up Site Kit.', 'google-site-kit' ), 403 );\n\t\t}\n\n\t\tif ( ! $code ) {\n\t\t\twp_die( esc_html__( 'Invalid request.', 'google-site-kit' ), 400 );\n\t\t}\n\n\t\tif ( ! $verification_token || ! $verification_method ) {\n\t\t\twp_die( esc_html__( 'Verifying site ownership requires a token and verification method.', 'google-site-kit' ), 400 );\n\t\t}\n\n\t\t$this->handle_verification( $verification_token, $verification_method );\n\n\t\t$proxy_query_params = array(\n\t\t\t'step' => $step,\n\t\t\t'verify' => 'true',\n\t\t\t'verification_method' => $verification_method,\n\t\t);\n\n\t\t// If the site does not have a site ID yet, a site code will be passed.\n\t\t// Handling the site code here will save the extra redirect from the proxy if successful.\n\t\tif ( $site_code ) {\n\t\t\ttry {\n\t\t\t\t$this->handle_site_code( $code, $site_code );\n\t\t\t} catch ( Missing_Verification_Exception $exception ) {\n\t\t\t\t$proxy_query_params['site_code'] = $site_code;\n\n\t\t\t\t$this->redirect_to_proxy( $code, $proxy_query_params );\n\t\t\t} catch ( Exchange_Site_Code_Exception $exception ) {\n\t\t\t\t$this->redirect_to_splash();\n\t\t\t}\n\t\t}\n\n\t\t$credentials = $this->credentials->get();\n\t\t$proxy_query_params['site_id'] = ! empty( $credentials['oauth2_client_id'] ) ? $credentials['oauth2_client_id'] : '';\n\n\t\t$this->redirect_to_proxy( $code, $proxy_query_params );\n\t}",
"public function admin_check() {\n\t\t$this->_check();\n\t}",
"function drush_devshop_rancher_pre_hosting_task() {\n\n $task = &drush_get_context('HOSTING_TASK');\n\n // On verify, connect to Rancher Server API\n if ($task->task_type == 'verify' && isset($task->ref->services['rancher'])) {\n drush_log('Checking RANCHER API access...', 'notice');\n\n if ($task->ref->services['rancher']->verify()) {\n drush_log('RANCHER: Able to connect to rancher server!', 'ok');\n }\n else {\n drush_set_error('DRUSH_RANCHER_ERROR', 'RANCHER: Unable to connect to rancher server API!');\n }\n }\n}",
"public function registrationRequired();",
"function drush_terminus_pantheon_hostname_add_validate($site_uuid = FALSE, $environment = FALSE, $hostname = FALSE) {\n $session_data = terminus_bootstrap();\n if ($session_data === FALSE) {\n return drush_set_error('DRUSH_PSITE_HOSTNAME_ADD_NO_SESSION', 'You must authenticate before using this command.');\n }\n drush_set_option('session_data', $session_data);\n\n if (!$site_uuid = terminus_site_input($site_uuid, TRUE, TRUE)) {\n return drush_set_error('DRUSH_PSITE_HOSTNAME_ADD_INVALID_UUID', dt('You must specify a valid site UUID.'));\n }\n drush_set_option('site_uuid', $site_uuid);\n\n if (!terminus_validate_environment($environment)) {\n if (!$environment = terminus_session_select_data('environment', $site_uuid)) {\n return drush_set_error('DRUSH_PSITE_HOSTNAME_ADD_INVALID_ENV', dt('You must specify a valid environment name.'));\n }\n }\n drush_set_option('environment', $environment);\n\n if (!terminus_validate_hostname($hostname)) {\n $hostname = drush_prompt(dt('Hostname (e.g. \"www.mysite.com\") you would like to add'), $hostname, TRUE);\n if (!terminus_validate_hostname($hostname)) {\n return drush_set_error('DRUSH_PSITE_HOSTNAME_ADD_INVALID_HOSTNAME', dt('You must specify a valid hostname.'));\n }\n }\n drush_set_option('hostname', $hostname);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove login page shake. | function cwpl_remove_shake() {
remove_action( 'login_head', 'wp_shake_js', 12 );
} | [
"function cwpl_remove_shake() {\n remove_action( 'login_head', 'wp_shake_js', 12 );\n}",
"public function wipe_auth() {\n parent::wipe_auth($this->site_name);\n }",
"function loginpage_hook() {\n\n return;\n }",
"public static final function InvalidateLogin(){\n unset($_SESSION['validated']);\n }",
"public function logOut(){\n $_SESSION['user_id']=''; unset($_SESSION['user_id']);\n $_SESSION['check_user'] = ''; unset($_SESSION['check_user']);\n }",
"static function logout_page_redirect() {\n \n if(self::does_login_page_exists()){\n self::login_page_redirect( '?login=false' );\n }\n \n }",
"public function logout()\n {\n try {\n Mage::getModel('core/cookie')->delete('sailthru_hid');\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }",
"public static function login_enqueue_scripts__kill_login_php() {\n\n\t\t?>\n\t\t\t</head>\n\t\t</html>\n\n\t\t<?php\n\n\t\twp_die( esc_html__( 'This site is currently in read-only mode. Log in is currently prohibited.' ) );\n\n\t}",
"public function logoff();",
"public function hideActiveLogin() {}",
"public function logoff(){\n\t\t$this->session->sess_destroy();\n\t\tredirect(base_url());\n\t}",
"public function logOut() {\r\n $sessione = USingleton::getInstance('USession');\r\n $sessione->terminaSessione();\r\n $this->controllaUserAutenticatoEImpostaHeader();\r\n $vAutenticazione = USingleton::getInstance('VAutenticazione');\r\n $vAutenticazione->restituisciHomePage();\r\n }",
"function limit_login_clear_auth_cookie() {\n\twp_clear_auth_cookie();\n\n\tif (!empty($_COOKIE[AUTH_COOKIE])) {\n\t\t$_COOKIE[AUTH_COOKIE] = '';\n\t}\n\tif (!empty($_COOKIE[SECURE_AUTH_COOKIE])) {\n\t\t$_COOKIE[SECURE_AUTH_COOKIE] = '';\n\t}\n\tif (!empty($_COOKIE[LOGGED_IN_COOKIE])) {\n\t\t$_COOKIE[LOGGED_IN_COOKIE] = '';\n\t}\n}",
"public static function logOut()\n {\n unset($_SESSION['user']);\n }",
"function clear_login()\n\t{\n\t\t$this->CI->session->unset_userdata('user');\n\t}",
"public static function unauthenticate(){\n\t\t// delete current user auth credentials from session\n\t\tif (isset($_SESSION['applications_loggedin'][Request::get_application()]))\n\t\t\tunset($_SESSION['applications_loggedin'][Request::get_application()]);\n\t}",
"public static function secure () {\n\n add_filter('login_errors', create_function('$a', 'return null;'));\n remove_action('wp_head', 'wp_generator');\n\n }",
"public static function logOut() {\n\t\tunset($_SESSION['user']);\n\t\tunset($_SESSION['loggedIn']);\n\t}",
"public function unlogin() {\n\t\t\tif ($user = $this->authorisator->getUser()) {\n\t\t\t\t/* @var $user ILoginUserDigest */\n\t\t\t\t$user->dao()->merge($user->setLoginKey(null));\n\t\t\t\t$this->authorisator->dropUser();\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->session->isStarted()) {\n\t\t\t\t$this->session->assign($this->getLoginKeyParamName(), null);\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the configured DSL. | public function loadDsl($dslPath)
{
if (file_exists($dslPath)) {
include_once $dslPath;
}
} | [
"abstract protected function loadDefinition();",
"public function load()\n {\n $this->_load($this->_path, $this->_buildDefaultSuiteTree());\n }",
"protected function load()\n {\n $this->config = array();\n\n if (file_exists($this->filePath)) {\n $this->config = Yaml::parse($this->filePath);\n }\n }",
"public function load(ConfiguratorInterface $configurator);",
"protected function getRouting_Loader_YmlService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/config/Loader/LoaderInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/config/Loader/Loader.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/config/Loader/FileLoader.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/routing/Loader/YamlFileLoader.php';\n\n return $this->privates['routing.loader.yml'] = new \\Symfony\\Component\\Routing\\Loader\\YamlFileLoader(($this->privates['file_locator'] ?? $this->getFileLocatorService()));\n }",
"public function load()\n\t{\n\t\tself::load_hooks($this);\n\t\t// look for help with this\n\t\tif ( method_exists( $this, 'help' ) ) {\n\t\t\tPlugins::register( array( $this, '_help_plugin_config' ), 'filter', 'plugin_config:' . $this->plugin_id(), 8 );\n\t\t\tPlugins::register( array( $this, '_help_plugin_ui' ), 'action', 'plugin_ui:' . $this->plugin_id(), 8 );\n\t\t}\n\t\t// look for a basic configure method\n\t\tif ( method_exists( $this, 'configure' ) ) {\n\t\t\tPlugins::register( array( $this, '_configure_plugin_config' ), 'filter', 'plugin_config:' . $this->plugin_id(), 8 );\n\t\t\tPlugins::register( array( $this, '_configure_plugin_ui' ), 'action', 'plugin_ui:' . $this->plugin_id(), 8 );\n\t\t}\n\t}",
"private function load(string $lang) {}",
"protected function loadConfigure()\n\t{\n\t\tif (Configure::read('Media.filter_plus'))\n\t\t\treturn;\n\t\t\n\t\t$layout_schemes = Configure::read('Typographer.layout_schemes');\n\t\tforeach ($layout_schemes as $layout_scheme)\n\t\t{\n\t\t\t@include (APP . 'plugins' . DS . 'typographer' . DS . 'config' . DS . $layout_scheme . '_config.php');\n\t\t\t\n\t\t\t$config_name = Inflector::camelize($layout_scheme);\n\t\t\t$variable_name = Inflector::variable($layout_scheme . '_tools');\n\t\t\t$tools = Configure::read(\"Typographer.{$config_name}.tools\");\n\t\t\tif ($tools)\n\t\t\t\t${$variable_name} = $tools;\n\t\t}\n\t\t\n\t\trequire APP . 'plugins' . DS . 'jj_media' . DS . 'config' . DS . 'core.php';\n\t}",
"public static function load($path) {\n self::$settings_list = new BedrockYAML($path);\n }",
"protected function load() {\n\t\t//\n\t\t// Avoiding multipe loads of configurations.\n\t\tif($this->_config === false) {\n\t\t\t//\n\t\t\t// Checking log configuration\n\t\t\t$this->checkLog();\n\t\t\t//\n\t\t\t// Logging operation start.\n\t\t\t$this->_log->log(LGGR_LOG_LEVEL_INFO, \"Loading workflow '{$this->name()}'.\");\n\t\t\t//\n\t\t\t// Reseting current stauts value.\n\t\t\t$this->_status = false;\n\t\t\t//\n\t\t\t// Global dependencies.\n\t\t\tglobal $WKFLDefaults;\n\t\t\tglobal $Defaults;\n\t\t\t//\n\t\t\t// Guessing names.\n\t\t\t$fileName = Names::SnakeFilename($this->name());\n\t\t\t$this->_path = Paths::Instance()->customPaths($WKFLDefaults[WKFL_DEFAULTS_PATHS][WKFL_DEFAULTS_PATH_WORKFLOWS], $fileName, Paths::EXTENSION_JSON);\n\t\t\t//\n\t\t\t// Checking path existence.\n\t\t\tif($this->_path && is_readable($this->_path)) {\n\t\t\t\t//\n\t\t\t\t// Loading configuration contents.\n\t\t\t\t$jsonString = file_get_contents($this->_path);\n\t\t\t\t//\n\t\t\t\t// Validating JSON strucutre.\n\t\t\t\tif(!$Defaults[GC_DEFAULTS_INSTALLED] && !self::GetValidator()->validate($jsonString, $info)) {\n\t\t\t\t\t$this->_log->log(LGGR_LOG_LEVEL_ERROR, \"Workflow '{$this->name()}' specification is not well formed. {$info[JV_FIELD_ERROR][JV_FIELD_MESSAGE]}\");\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Loading configuration.\n\t\t\t\t\t$this->_config = json_decode($jsonString);\n\t\t\t\t\tif($this->_config) {\n\t\t\t\t\t\t$this->_status = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif(!$this->_path) {\n\t\t\t\t$this->_log->log(LGGR_LOG_LEVEL_ERROR, \"Unknown workflow '{$this->name()}'.\");\n\t\t\t} else {\n\t\t\t\t$this->_log->log(LGGR_LOG_LEVEL_ERROR, \"Unable to read workflow path '{$this->_path}'.\");\n\t\t\t}\n\t\t}\n\t}",
"private function _load()\r\n {\r\n if (file_exists( $filepath = make_path(array(APPPATH, 'ln', $this->language . '.php' )) )) {\r\n require $filepath;\r\n if (isset($lang) && is_array($lang)) {\r\n $this->langfile = $lang;\r\n unset($lang);\r\n trigger_event_callbacks('lang', 'change', array($this->language));\r\n }\r\n else {\r\n show_error(\"The language file \\\"{$this->language}.php\\\" doesn't contain the variable \\\"\\$lang\\\".\");\r\n }\r\n }\r\n else {\r\n show_error(\"The language file \\\"{$this->language}.php\\\" can't be located in \\\"\".APPPATH.\"ln/\\\".\");\r\n }\r\n }",
"public function load()\n {\n $filename = $this->getFilePath();\n if (!file_exists($filename) || !is_readable($filename)) {\n throw new RuntimeException('The configuration YAML file does not exist!');\n }\n\n return Yaml::parse(file_get_contents($filename));\n }",
"public function load()\n\t{\n\n\t\t// try to load all commands in\n\t\tforeach($this->commands as $command){\n\n\t\t\t// ToDo: error checks etc\n\t\t\t$class = new $command();\n\n\t\t\t// register the command\n\t\t\t$this->discord->registerCommand(\n\t\t\t\t$class->key_word,\n\t\t\t\t$class->command(),\n\t\t\t\t$class->options\n\t\t\t);\n\n\t\t\t// register all alias's\n\t\t\tforeach($class->aliasis as $alias){\n\t\t\t\t$this->discord->registerAlias($alias, $class->key_word);\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}",
"public function load() {\n\n if ($this->exists() && is_null(self::$config)) {\n\n self::$config = include self::CONFIG_FILE;\n }\n }",
"private function load() {\n $config = $this->configurator->getConfig();\n\n // check if the container provides custom implementations of State or Transition\n $stateClass = isset($this->container['wellnet.state-machine.state']) ?\n $this->container['wellnet.state-machine.state'] : '\\\\Wellnet\\\\StateMachine\\\\State';\n $transitionClass = isset($this->container['wellnet.state-machine.transition']) ?\n $this->container['wellnet.state-machine.transition'] : '\\\\Wellnet\\\\StateMachine\\\\Transition';\n $defaultGuardClass = $config['defaults']['guard']['class'];\n\n // loops on transition sources; the states are created automatically when a new\n // source or a new destination is encountered.\n foreach ($config['transitions'] as $source => $destinations) {\n $from = $this->getOrCreateState($source, $stateClass);\n // loops on transition destinations (for a given source)\n foreach ($destinations as $destination) {\n $to = $this->getOrCreateState($destination['to'], $stateClass);\n // creates the Guard instance for a transition; if the Guard class is\n // not specified for this transition, use the default one\n $guardClass = isset($destination['guard']) ?\n $destination['guard'] : $defaultGuardClass;\n $guardArgs = isset($destination['guardArgs']) ?\n $destination['guardArgs'] : array();\n $guard = (new \\ReflectionClass($guardClass))->newInstance($guardArgs);\n $this->addTransition(new $transitionClass($from, $destination['input'], $to, $guard));\n }\n }\n $this->defaultInitialState = $config['defaults']['initialState'];\n }",
"public function load() {\n global $CONFIG;\n\n $mods = $CONFIG['modules'];\n foreach ($mods as $key => $item) {\n\n if (!is_array($item)) {\n $key = $item;\n }\n $cf = array('class' => $key, 'alias' => $key);\n if (is_array($item)) {\n $cf = array_merge($cf, $item);\n }\n\n $alias = $cf['alias'];\n $class = $cf['class'];\n\n\n $options = $cf['options'];\n\n $class = DCore::loadClass($class);\n $this->$alias = new $class($this, $options);\n $this->$alias->init();\n }\n /// load the project init.php file after all modules loaded\n if (file_exists(__PROTECTED_PATH . 'init.php'))\n include __PROTECTED_PATH . 'init.php';\n }",
"private function load() {\n\t\t\n\t}",
"public function load()\n\t{\n\t\t$this->interfaceBox->load();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if translate debug mode is on or false | static public function isTranslateDebugMode()
{
if ( null === self::$translateDebugMode ) {
/**
* TODO Load settings from config file
*/
self::$translateDebugMode = ( 'on' == Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.translate.xml')->translate->TranslateDebugMode ) ? true : false;
}
return (bool) self::$translateDebugMode;
} | [
"static public function isTranslateOnlineDebugMode()\r\n {\r\n if ( null === self::$translateOnlineDebugMode ) {\r\n self::$translateOnlineDebugMode = false;\r\n }\r\n return (bool) self::$translateOnlineDebugMode;\r\n }",
"public function isTranslatorEnabled()\n {\n return true;\n }",
"protected function translatable() : bool\n {\n return true;\n }",
"public function isTranslatorEnabled();",
"public function isTranslated()\n {\n return $this->getOption('translated') === true;\n }",
"protected function enable_debug_locale(){\n return $this->enable_locale('en_GB_debug');\n }",
"public function isTranslate() : bool\n {\n return $this->default_dblang_id !== $this->dblang_id;\n }",
"public function isTranslated()\n {\n return $this->_LOCALIZED_UID > 0;\n }",
"abstract public function isTranslatorEnabled();",
"public function getTranslate(): bool\n {\n return $this->translate;\n }",
"public function debug_enabled() {\n return 'yes' === $this->settings['debug'];\n }",
"public function isTranslationEnabled(): bool\n {\n return (bool) $this->translationEnabled;\n }",
"private function isTransliterationEnabled() {\n\t\tif ($this->_transliteration === null) {\n\t\t\t$this->autodetectTransliteration();\n\t\t}\n\n\t\treturn (bool) $this->_transliteration;\n\t}",
"public function isTranslated()\n {\n return isset($this->i18n);\n }",
"public function hasDebugModeEnabled();",
"public static function isTranslatable()\n {\n return config('arcanesoft.blog.translatable.enabled', false);\n }",
"function thb_is_translation_enabled() {\n\t\treturn defined( 'ICL_LANGUAGE_CODE' ) || function_exists( 'pll_current_language' ) || defined( 'QT_SUPPORTED_WP_VERSION' );\n\t}",
"public function isDebugMode();",
"static function is_debug_mode()\n {\n return s::get('debug');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter for 'Starts With A' (example) | function GetStartsWithAFilter($FldExpression) {
return $FldExpression . " LIKE 'A%'";
} | [
"function GetStartsWithAFilter($FldExpression, $dbid = 0)\n{\n return $FldExpression . Like(\"'A%'\", $dbid);\n}",
"function GetStartsWithAFilter($FldExpression, $dbid = 0) {\n\treturn $FldExpression . Like(\"'A%'\", $dbid);\n}",
"function GetStartsWithAFilter($FldExpression, $dbid) {\n\treturn $FldExpression . ewr_Like(\"'A%'\", $dbid);\n}",
"public function testFilterStartsWith()\n {\n $iterator = $this->_getTestIterator();\n $this->assertSame(\n 2,\n $iterator->filter(null, 'test 1', array('STARTS_WITH'))->count()\n );\n }",
"public function startsWith($letter) {\n return array_filter($this->items, function ($item) use ($letter) {\n return stripos($item, $letter) === 0;\n });\n }",
"public function beginsWithReturnsTrueForMatchingFirstPartDataProvider() {}",
"public function testCanFilterStartsWith(): void\n {\n $request = request();\n\n $request->merge([\n 'filter' => [\n 'email' => [\n 'starts_with' => 'client'\n ]\n ]\n ]);\n\n //$response = QueryBuilder::createFromRequest(new User(), $request, [])->get();\n \n //$this->assertNotEmpty($response);\n //$this->assertEquals(1, count($response));\n //$this->assertEquals('client@siocareer.com', $response[0]['email']);\n }",
"function arrayItemsStartedWithLetter($items, $letter, $property = 'name') {\n \n $filteredItems = array_filter($items, function($item) use ($letter, $property) {\n return substr(strtolower($item[$property]), 0, 1) == $letter;\n });\n \n return $filteredItems;\n}",
"public function beginsWithReturnsFalseForNotMatchingFirstPartDataProvider() {}",
"public function startsWith($substring);",
"function startsWith($string, $start, $ignoreCase=false){\r\n\t\treturn preg_match('/^'.$start.'.*$/'.($ignoreCase?\"i\":\"\"), $string)>0;\r\n\t}",
"function filterByFirstLetter($airports, $letter) {\n return array_filter($airports, function ($airport) use ($letter) {\n if ($airport['name'][0] === $letter) {\n return true;\n }\n return false;\n });\n}",
"public function testStartsWith1()\n {\n $this->assertTrue(Str::startsWith('foo', 'f'));\n }",
"function filter($instr) {\r\n\t\t$outstr = null;\r\n\t\t$filterChain = new Zend_Filter();\r\n\t\t$filterChain->addFilter(new Zend_Filter_StringToLower())\r\n \t\t\t->addFilter(new Zend_Filter_StripTags())\r\n \t\t\t->addFilter(new Zend_Filter_StringTrim());\r\n\r\n\t\t$instr = $filterChain->filter($instr);\r\n\t\t$instr = str_replace(\" \", \"-\", trim($instr));\r\n\t\tpreg_match_all(\"/^[a-z0-9\\-\\\\\\$]{1,}$/\", $instr, $parts);\r\n\r\n\t\tforeach ($parts as $part) {\r\n\t\t\t$outstr .= $part[0];\r\n\t\t}\r\n\r\n\t\treturn $outstr;\r\n\t}",
"function filterFirstLetter(array $var)\n{\n if(array_key_exists('name', $var)) {\n return getFirstLetter($var) === $_GET['filter_by_first_letter'];\n } else {\n throw new InvalidArgumentException();\n }\n}",
"public function testStartsWith2()\n {\n $this->assertFalse(Str::startsWith('foo', 'y'));\n }",
"function wpuf_starts_with( $string, $starts ) {\n\n $flag = strncmp( $string, $starts, strlen( $starts ) );\n\n if ( $flag == 0 ) {\n return true;\n } else {\n return false;\n }\n}",
"public function startsWith($element) {\n return $this->is(new NotPossible('starts with anything'));\n }",
"function startsWith($substring)\n {\n return \\Hamcrest\\Text\\StringStartsWith::startsWith($substring);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves pages for a blog, possibly filtered. (pages.list) | public function listPages($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PageList($data);
} else {
return $data;
}
} | [
"function getPages()\n\t{\n\t\tglobal $conn;\n\t\t\n\t\t$get = $conn->prepare(\"SELECT * FROM Page\");\n\t\t$get->bindParam(1, $site);\n\t\t$get->execute();\n\t\t\n\t\treturn $get->fetchAll();\n\t}",
"private function getPages()\n\t{\n\t\tself::$pages = $this->getAllTree(array('id', 'url', 'path', 'publish'));\n\t}",
"public function fetchPublishedPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'status = ? AND content_type = ?' => array(1, 2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'paging' => $this->posts_per_page,\n 'page' => 1,\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }",
"public function getPages();",
"protected function getAllPages()\n\t{\n\t\tif ( $this->_pagesBySlug === null )\n\t\t{\n\t\t\t$this->_pagesBySlug = ContentPage::getDb()->cache(function(){\n\t\t\t\treturn ContentPage::find()\n\t\t\t\t\t->select(['id', 'slug', 'is_main', 'parent_id', 'type', 'content_template_id'])\n\t\t\t\t\t->asArray()\n\t\t\t\t\t->andWhere([\n\t\t\t\t\t\t'active'=>1,\n\t\t\t\t\t\t'type'=>[ContentPage::TYPE_TEXT, ContentPage::TYPE_INTERNAL_LINK],\n\t\t\t\t\t])\n\t\t\t\t\t->indexBy('slug')\n\t\t\t\t\t->all();\n\t\t\t}, ContentModule::CACHE_TIME, new TagDependency(['tags'=>ContentModule::CACHE_TAG]));\n\t\t}\n\n\t\treturn $this->_pagesBySlug;\n\t}",
"public function PaginatedList()\n {\n $allPosts = $this->blogPosts ?: ArrayList::create();\n $posts = PaginatedList::create($allPosts);\n\n // Set appropriate page size\n if ($this->PostsPerPage > 0) {\n $pageSize = $this->PostsPerPage;\n } elseif ($count = $allPosts->count()) {\n $pageSize = $count;\n } else {\n $pageSize = 99999;\n }\n $posts->setPageLength($pageSize);\n\n // Set current page\n $start = max(0, (int)$this->request->getVar($posts->getPaginationGetVar()));\n $posts->setPageStart($start);\n\n return $posts;\n }",
"public function blogIndex()\n {\n if( !\\Auth::user()->admin ) die(403);\n\n return view('admin.pages', [\n 'pages' => Page::blogs()->get(),\n 'isBlog' => true\n ]);\n }",
"private static function _getPosts ()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $_baseURI, $_title, $_api;\r\n\t\t\t\r\n\t\t\t// Declarations\r\n\t\t\t$title = 'Blog - '.$_title;\r\n\t\t\t$retVal = new stdClass();\r\n\t\t\t$minDate = null;\r\n\t\t\t$maxDate = null;\r\n\t\t\t$tag = '';\r\n\t\t\t$page = '';\r\n\t\t\t\r\n\t\t\t// Get the page\r\n\t\t\t$page = Lib\\Url::GetInt('p', 1);\r\n\t\t\t\r\n\t\t\t// Figure up tags\r\n\t\t\tif (isset($_GET['tag']) && $_GET['tag']) {\r\n\t\t\t\t$tag = urldecode($_GET['tag']);\r\n\t\t\t\t$title = 'Blog - Posts tagged with ' . $tag . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check the dates\r\n\t\t\t$year = Lib\\Url::GetInt('year');\r\n\t\t\t$month = Lib\\Url::GetInt('month');\r\n\t\t\tif ($month && $year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, $month, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, $month + 1, 1, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . date('F Y', $minDate) . ' - ' . $_title;\r\n\t\t\t} else if ($year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, 1, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, 12, 31, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . $year . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If we're not on the home page, use the blog template\r\n\t\t\t$homePage = true;\r\n\t\t\tif ($page > 1 || $tag || $minDate || $maxDate) {\r\n\t\t\t\tLib\\Display::setTemplate('content_plain');\r\n\t\t\t\t$homePage = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$type = Lib\\Url::Get('type', 'blog,art,comic');\r\n\t\t\t\r\n\t\t\t// Generate the cache key\r\n\t\t\t$cacheKey = 'BlogHome_' . $page . '_' . $minDate . '_' . $maxDate . '_' . $tag . '_' . $type;\r\n\t\t\t\r\n\t\t\t$retVal = Lib\\Cache::Get($cacheKey);\r\n\t\t\tif (!$retVal) {\r\n\t\t\t\r\n\t\t\t\t// Grab the fifteen latest posts\r\n\t\t\t\t$retVal = new stdClass();\r\n\t\t\t\t$obj = Api\\Content::getContent(array( 'offset'=>($page - 1) * ENTRIES_PER_PAGE, 'tag'=>$tag, 'mindate'=>$minDate, 'maxdate'=>$maxDate, 'max'=>ENTRIES_PER_PAGE, 'parent'=>0, 'contentType'=>$type ));\r\n\t\t\t\tif (isset($obj->content)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Format each entry\r\n\t\t\t\t\t$arr = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($obj->content as $post) {\r\n\t\t\t\t\t\t$arr[] = self::_formatPost ($post, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t// Figure up the paging buttons\r\n\t\t\t\t\t$numPages = $obj->count / ENTRIES_PER_PAGE;\r\n\t\t\t\t\t$localDir = str_replace ('index.php', '', $_SERVER['SCRIPT_NAME']);\r\n\t\t\t\t\t$rawPage = preg_replace ('@/page/(\\d+)/@', '/', str_replace ($localDir, '/', $_SERVER['REQUEST_URI']));\r\n\r\n\t\t\t\t\t$t = new stdClass;\r\n\t\t\t\t\t$t->contentType = $type ? '/' . $type . '/' : '/';\r\n\t\t\t\t\tif ($numPages > $page) {\r\n\t\t\t\t\t\t$t->prev = $_baseURI . '?p='.($page + 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($page > 1) {\r\n\t\t\t\t\t\t$t->next = $_baseURI . '?p='.($page - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$t->articles = $arr;\r\n\t\t\t\t\t$retVal = Lib\\Display::compile($t, 'content_articles', $cacheKey);\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tLib\\Display::showError('Content returned empty or malformed', 'There was an error siplaying that page!');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tLib\\Display::setVariable('title', $_title);\r\n\t\t\tLib\\Display::setVariable('content', $retVal);\r\n\t\t\t\r\n\t\t}",
"public function paginatedList()\n {\n $all_posts = $this->blogPosts ?: ArrayList::create();\n\n $posts = PaginatedList::create($all_posts);\n\n $posts->setPageLength($this->PostsPerPage);\n\n // Set current page\n $start = $this->request->getVar($posts->getPaginationGetVar());\n $posts->setPageStart($start);\n\n return $posts;\n }",
"function GetContentsFromPage($pages, $pageNumber)\n {\n if (($pageNumber > 0) and ($pageNumber <= count($pages)))\n {\n --$pageNumber;\n $sqlCommand = \"\";\n\n for ($i = 0; $i < count($pages[$pageNumber]) - 1; $i++)\n {\n $sqlCommand .= \"blog_id=\" . $pages[$pageNumber][$i] . \" OR \";\n }\n\n $sqlCommand .= \"blog_id=\" . $pages[$pageNumber][count($pages[$pageNumber]) - 1] . \" \";\n\n $db = new Database();\n $blogs = $db->GetQueryResult(\"SELECT * FROM blog WHERE \" . $sqlCommand . \" ORDER BY published DESC;\");\n\n return $blogs;\n }\n\n return null;\n }",
"public function fetchAllPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'content_type = ?' => array(2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }",
"public function testBlogIndexCanGetPage1()\n {\n $response = $this->getActingAs($this->createUser(), self::API_BLOG_ENDPOINT . '?page=1');\n\n $blogs = $this->getBlogsFromResponse($response);\n\n $this->assertTrue(count($blogs) > 0);\n }",
"public function getAllPages()\n {\n $this->app->db->connect();\n $sql = <<<EOD\nSELECT\n*,\nCASE\nWHEN (deleted <= NOW()) THEN \"isDeleted\"\nWHEN (published <= NOW()) THEN \"isPublished\"\nELSE \"notPublished\"\nEND AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $res = $this->app->db->executeFetchAll($sql, [\"page\"]);\n return $res;\n }",
"public function get_all_pages() {\r\n\t\tMainWP_Child_Posts::get_instance()->get_all_pages();\r\n\t}",
"public function blogList(){\n\t\treturn \\View::make('admin.pages.blog.list');\n\t}",
"public function blogActionGet() : object\n {\n $page = $this->app->page;\n $request = $this->app->request;\n\n $slug = $request->getGet(\"post\") ?? null;\n\n $data = [\n \"title\" => \"Blogg\"\n ];\n \n $this->app->page->add(\"content/header\", $data);\n\n if ($slug) {\n $res = $this->content->getPost($slug);\n $data[\"content\"] = $res;\n $page->add(\"content/blogpost\", $data);\n } else {\n $res = $this->content->getAllPosts();\n $data[\"resultset\"] = $res;\n $page->add(\"content/blog\", $data);\n }\n\n return $page->render($data);\n }",
"static function get_content_pages()\n {\n global $db;\n\n // grab the pages and push them into an array\n $result = array();\n $query = mysqli_query(\n $db, \"SELECT * FROM `content_pages` ORDER BY `index`\"\n );\n while ($cur = mysqli_fetch_assoc($query)) {\n $result[] = $cur;\n }\n\n return (count($result) === 0) ? null : $result;\n }",
"function blogPosts(){\n\t\t$posts = DataObject::get('BlogEntry', 'ParentID = ' . $this->Blog, 'Date', $this->numberOfPosts);\n\t\treturn $posts;\n\t}",
"public function getList()\n {\n $blogPosts = [];\n\n $request = $this->dao->query(\n 'SELECT * FROM blog_posts ORDER BY update_date DESC'\n );\n\n while ($data = $request->fetch(\\PDO::FETCH_ASSOC)) {\n $blogPosts[] = new BlogPost($data);\n }\n\n $request->closeCursor();\n\n return $blogPosts;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The duration for the cron job event. The duration of the event is effective after the cron job's start time. Generated from protobuf field .google.protobuf.Duration cron_job_duration = 3; | public function setCronJobDuration($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
$this->cron_job_duration = $var;
return $this;
} | [
"public static function getCronTimeout()\n\t{\n\t\tif (!empty($GLOBALS['TL_CRON']['minutely']))\n\t\t{\n\t\t\treturn 60;\n\t\t}\n\t\telseif (!empty($GLOBALS['TL_CRON']['hourly']))\n\t\t{\n\t\t\treturn 3600;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 86400; // daily\n\t\t}\n\t}",
"function getJobDuration()\n {\n return $this->__jobduration ;\n }",
"public function getRunDuration()\n {\n return $this->run_duration;\n }",
"public function getProcessDuration();",
"private function getScheduledTaskRunDuration(): int\n {\n return round((hrtime(true) - $this->scheduledTaskStartMs) / 1e+6);\n }",
"public function getCronTimeExpression(): string\n {\n return $this->cronTimeExpression;\n }",
"public function get_cache_lifespan() {\r\n\t\t$lifespan = $this->options->get( 'purge_cron_interval' );\r\n\r\n\t\tif ( ! $lifespan ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t$unit = $this->options->get( 'purge_cron_unit' );\r\n\r\n\t\tif ( $lifespan < 0 || ! $unit || ! defined( $unit ) ) {\r\n\t\t\treturn 10 * HOUR_IN_SECONDS;\r\n\t\t}\r\n\r\n\t\treturn $lifespan * constant( $unit );\r\n\t}",
"public function getCronLastStart()\n {\n\t /** @var \\Cleantalk\\Common\\StorageHandler\\StorageHandler $storage_handler_class */\n\t $storage_handler_class = Mloader::get('StorageHandler');\n return (int) $storage_handler_class::getSetting('cleantalk_cron_last_start');\n }",
"public function getLastStartTimeCronjob()\n {\n return $this->_getConfig('cronjob_starttime');\n }",
"public static function timeToNextCronJob()\n {\n // Set the timezone\n date_default_timezone_set('Europe/Amsterdam');\n\n // This will magically set the $datetime to the next 10 minute mark\n $datetime = new \\DateTime();\n $time_to_next_10_minutes = 10 - ($datetime->format('i') % 10);\n\n // return the difference between now and the next 10 minute mark\n return ceil($time_to_next_10_minutes);\n }",
"public function getLastCronTime()\n\t{\n\t\t$cron = \\App\\Utils\\ConfReport::getCronVariables('last_start');\n\t\t$value = '-';\n\t\tif ($cron) {\n\t\t\t$value = date('Y-m-d H:i:s', $cron);\n\t\t}\n\t\treturn $value;\n\t}",
"public function setDuration($var)\n {\n GPBUtil::checkString($var, True);\n $this->duration = $var;\n\n return $this;\n }",
"public function setWorkflowRunTimeout($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->workflow_run_timeout = $var;\n\n return $this;\n }",
"public function duration()\n\t{\n\t\t$diff = $this->runEnd->getTimestamp() - $this->runStart->getTimestamp();\n\t\t\n\t\t// $dif = $this->runEnd->difference( $this->runStart );\n\n\t\t// $minutes = (int) $dif->getMinutes( true );\n\t\t// $seconds = $dif->getSeconds( true );\n\n\t\t// Since $seconds includes the minutes, calc the extra\n\t\t// $seconds = $seconds - ( $minutes * 60 );\n\n\t\treturn str_pad((string) $diff, 2, '0', STR_PAD_LEFT );// . ':' . str_pad( (string) $seconds, 2, '0', STR_PAD_LEFT);\n\t}",
"protected function _job($type)\n\t{\n\t\t$valid = $this->_validateCron($type);\n\t\tif (!$valid) {\n\t\t\tthrow new CronException(__(\"Your request to execute a %s CRON job is invalid, either it has been processed already or it is still being processed\", $type));\n\t\t}\n\n\t\t$data = array(\n\t\t\t'type' => $type,\n\t\t\t// 'execution_time' => scriptExecutionTime(),\n\t\t\t'status' => Cron::STATUS_PENDING,\n\t\t\t// 'request_id' => self::requestId(),\n\t\t\t// 'url' => Router::fullBaseUrl(),\n\t\t\t'message' => __('Your CRON Job is running in the background. Status can be viewed on the CRON index.')\n\t\t);\n\n\t\t$this->Cron->create();\n\t\t$this->Cron->set($data);\n\t\t$ret = $this->Cron->save(null, false);\n\t\t$cronId = $this->Cron->id;\n\n\t\t$ret = $this->_runTasks($type, $cronId);\n\n\t\t$this->Cron->summarizeCron($cronId);\n\n\t\tif ($ret) {\n\t\t\t$this->out('<success>Cron successfully executed.</success>');\n\t\t} else {\n\t\t\t$this->error('Error occured while running Cron');\n\t\t}\n\t}",
"public function duration()\n\t{\n\t\t$dif = $this->runEnd->difference( $this->runStart );\n\n\t\t$minutes = (int) $dif->getMinutes( true );\n\t\t$seconds = $dif->getSeconds( true );\n\n\t\t// Since $seconds includes the minutes, calc the extra\n\t\t$seconds = $seconds - ( $minutes * 60 );\n\n\t\treturn str_pad( (string) $minutes, 2, '0', STR_PAD_LEFT ) . ':' . str_pad( (string) $seconds, 2, '0', STR_PAD_LEFT );\n\t}",
"public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }",
"public function getCronSchedule()\n {\n return $this->cron_schedule;\n }",
"public function getCronExpression();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new season | public function add_season($season_data) {
$success = $this->db_wrapper->insert_data($this->table_name, array(
'season_title' => $season_data['title'],
'season_number' => $season_data['number'],
'show_id' => $season_data['show']
));
if($success) return true;
else return false;
} | [
"public function insertSeason($season) {\n try {\n\t$stmt = $this->db->prepare('INSERT INTO Season(fallYear) VALUES(:fallYear)');\n\t$stmt->bindValue(':fallYear', $season->fallYear);\n\t$stmt->execute();\n } catch(PDOException $e) {\n\t throw $e;\n }\n}",
"public function addProgramSeason($season_id)\n {\n //retrieve list of programs and seasons\n $season=Season::findOrFail($season_id);\n $programs=Program::all();\n \n return view('admin.programSeason',compact('season','programs'));\n }",
"public function addSeason()\n {\n $cities = Cities::OrderBy('id','desc')->get();\n $companies = Companies::OrderBy('id','desc')->get();\n $currencies = Currencies::OrderBy('id','desc')->get();\n return view('admin.seasons.create',array('page_title'=>\"Admin Dashboard Create Season\",'cities'=>$cities,'companies'=>$companies,'currencies'=>$currencies));\n \n }",
"public function addSeason($episode, $index = \"jhiuh76f7f454a43s54f76909hkghhh\"){\n\t\tif($index == \"jhiuh76f7f454a43s54f76909hkghhh\"){\n\t\t\t$this->season[] = $episode;\n\t\t}else{\n\t\t\t$this->episodes[] = $episode;\n\t\t\tif(!isset($this->season[$index])){\n\t\t\t\t$this->season[$index] = $episode;\n\t\t\t}\n\t\t}\t\n\t}",
"public function new_season($league_id,$new_year)\r\n\t{\r\n\t\t$content_data=array();\r\n\t\t//used to, one line at a time, display all actions completed or errors\r\n\t\t$content_data['action_messages']='';\r\n\t\t//***NI*** Needs more functionality to create new season\r\n\t\t\r\n\t\t//update player titles***\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Add new draft picks for the NEXT season, $new_year + 1 will be added in the method\r\n\t\t$this->Drafts->create_next_season_drafts($league_id,$new_year);\r\n\t\t$content_data['action_messages'] .='<br>'.($new_year+1).' Drafts Created.';\r\n\t\t\r\n\t\t//back to admin_panel\r\n\t\t$this->index('admin_panel', $content_data);\r\n\t\t\r\n\t}",
"function action_create_season()\n\t{\n\t\t// Loading form validation helper and the Markdown parser.\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('name', 'Name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('start_date', 'Start Date', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('end_date', 'End Date', 'trim|required|xss_clean');\n\n\t\t$name = $this->input->post('name');\n\t\t$start_date = $this->input->post('start_date');\n\t\t$end_date = $this->input->post('end_date');\n\n\t\t// If the start date is after the end_date, obviously that won't work.\n\t\tif (strtotime($start_date) > strtotime($end_date))\n\t\t{\n\t\t\techo json_encode(array(\n\t\t\t\t'status' => 'danger',\n\t\t\t\t'message' => 'The end date must be set to a date after the start date.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\n\t\t// A date of 0000-00-00 is garbage.\n\t\tif (strtotime($start_date) == 0 || strtotime($end_date) == 0)\n\t\t{\n\t\t\techo json_encode(array(\n\t\t\t\t'status' => 'danger',\n\t\t\t\t'message' => 'Either the start date or the end date has a value of 0000-00-00'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\tif ($this->seasons->insert($name, $start_date, $end_date))\n\t\t\t{\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'message' => 'Season added successfully!'\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\techo json_encode(array(\n\t\t\t'status' => 'danger',\n\t\t\t'message' => 'One or more of the fields are invalid.'\n\t\t));\n\t}",
"function addSLS(){\n\n $sports = $this->getSports();\n $season = $this->getSeason();\n $league = $this->getLeague();\n\n $league_id = $this->db->getInstance(\"server_league\",$league);\n $sport_id = $this->db->getInstance(\"server_sport\",$sports);\n $season_id = $this->db->getInstance(\"server_season\",$season,\"description\");\n\n $sql = \"INSERT INTO server_slseason (league, season, sport)\n VALUES (?,?,?)\";\n\n $this->db->Add_insert_delete_Query($sql,\n array($league_id, $season_id ,$sport_id),\n array(PDO::PARAM_INT, PDO::PARAM_INT,PDO::PARAM_INT));\n\n }",
"public function createSeason(Request $request) {\n $season = new Season($request->all());\n\n $season->save();\n\n return redirect('/admin');\n }",
"public function new_season($season_name,$start_date,$end_date,$isactive,$reg_needed,$reg_start_date,$reg_end_date,$reg_deposit_status,$reg_deposit_amount,$reg_fees_status,$reg_fees_amount)\n { \n $a_u_id= $this->permissions_model->get_active_user();\n $a_o_id= $this->permissions_model->get_active_org();\n \n //------------------------------------------------------------------------ \n $sql=\"SELECT public.new_season(?,?,?,?,?,?,?,?,?,?,?,?,?)\" ;\n $params = array($season_name,$start_date,$end_date,$isactive\n ,$reg_needed,$reg_start_date,$reg_end_date,$reg_deposit_status,$reg_deposit_amount,$reg_fees_status,$reg_fees_amount \n ,$a_u_id,$a_o_id) ;\n return $this->db->query($sql ,$params)->first_row()->new_season;\n }",
"function addEpisode($episode)\n {\n if (isset($this->seasons[$episode->seasonNumber]) === false) {\n $this->seasons[$episode->seasonNumber] = [];\n }\n $this->seasons[$episode->seasonNumber][] = $episode;\n $this->episodes[] = $episode;\n }",
"public function submitPilot(){\n //or should create series insert the season??\n }",
"function setSeasonId($id)\n {\n $this->__seasonid = $id ;\n }",
"public function setSeason($season) {\n $this->season = (object) array(\"value\" => $season);\n return $this;\n }",
"public function newSeason() {\n return view('admin/newSeason');\n }",
"function addSeason($year, $active_season){\n global $con;\n $stmCheck = $con->prepare(\"SELECT * FROM season WHERE year=?\");\n $stmCheck->execute(array($year));\n $rowsStmCheck = $stmCheck->fetchAll(PDO::FETCH_ASSOC);\n\n if(empty( $rowsStmCheck )){\n $stmt = $con->prepare(\"INSERT INTO season(year, active_season) Value(:year, :active_season)\");\n $stmt->execute(\n array(\n \":year\" => $year,\n \":active_season\" => $active_season\n ));\n echo \"\n <script>\n toastr.success('Great , Season has been successfully added .')\n </script>\";\n header(\"Refresh:3;url=season.php\");\n } else {\n echo \"\n <script>\n toastr.error('Failed , Season year has alread been used.')\n </script>\";\n }\n}",
"public function addSport() \n\t{\t\n\t\t$this->User->addSport($this->UserRequest->id, $this->dataPost->sport_id);\n\n\t\t$this->setData('Sports add');\n\t}",
"function _setSeasonData($season) {\n if ($season) {\n $result[] = JArrayHelper::fromObject($season);\n $result[0]['object'] = 'Season';\n return $result;\n }\n return false;\n }",
"public function setStartingSeason($year){\n\t if($year <> \"Select season...\"){\n\t $this->startYear = $year; \n\t } else{\n\t\t$this->startYear = date(\"Y\") - 1;\n\t\t}\t \n\t $this->endYear = $this->startYear + 1;\n\t $this->label = \"$this->startYear/\" . \"$this->endYear\";\n\t $this->populateLeague();\n\n\t}",
"public function season() {\n return $this->hasMany('\\App\\Seasons','id');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtiene todas las correlatividades para dicho plan | public function obtenerCorrelatividades()
{
$q = Doctrine_Query::create()
->select('c.*, m.nombre AS nombre, mc.nombre as nombrec')
->from('Correlatividades c')
->innerJoin('c.MateriasPlanes mp ON c.idmateriaplan = mp.idmateriaplan')
->innerJoin('c.MateriasPlanes mpc ON c.idmateriaplanc = mpc.idmateriaplan')
->innerJoin('mp.Materias m ON mp.idmateria = m.idmateria')
->innerJoin('mpc.Materias mc ON mpc.idmateria = mc.idmateria')
->where('mp.idplanestudio = '.$this->getIdplanestudio())
->orderBy('m.nombre ASC');
return $q->execute();
} | [
"function tieneCorrelativas(){\n \n // obtenemos el programa de asignatura que tenga vigencia para el anio actual\n $this->query = \"SELECT * \"\n . \"FROM correlativa_de \"\n . \"WHERE idAsignatura = '{$this->id}' OR idAsignatura_Correlativa_Anterior = '{$this->id}'\";\n \n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n \n // validamos el resultado de la query (si retorna false -> Ocurrio un error en la BD) Lanzamos una Excepcion informando el Error\n if (!$this->datos) {\n throw new Exception(\"Ocurrio un Error al obtener las asignaturas correlativas de la Asignatura: {$this->id}, '{$this->nombre}'.\");\n }\n \n \n if ($this->datos->num_rows > 0) {\n unset($this->query);\n unset($this->datos);\n \n return TRUE;\n } else {\n unset($this->query);\n unset($this->datos);\n \n return FALSE;\n }\n \n }",
"function correos(){\n\t\t//VERIFICAR SI EL FOR[RENTAS/SERVICIOS] TIENE UN VALOR\n\t\tif(isset($_GET[\"for\"])){ \n\t\t\t$for = $_GET[\"for\"]; \n\t } else { \n\t\t\t$for = \"\"; \n\t\t}\t\n\t\t//VERIFICAR SI EL ARCHIVES[TRUE/FALSE] TIENE UN VALOR\n\t\tif(isset($_GET[\"is_archived\"])){ \n\t\t\t$is_archived = $_GET[\"is_archived\"]; \n\t\t} else { \n\t\t\t$is_archived = \"true\"; \n\t\t}\n\t\t//VERIFICAR LA CLAVE UNICA DE [RENTAS/SERVICIOS] TIENE UN VALOR POR MEDIO DE UNA VARIABLE DE SESSION\n\t\tif(isset($_SESSION[\"idclaveUnica\"])){\n\t\t//if(isset($_GET[\"clave_unica\"])){\n\t\t\t$id=$_GET[\"clave_unica\"];\n $_SESSION[\"idclaveUnica\"] = $id;\n\t\t\t$email_info = VentasModel::getEmailsByUk($_GET[\"clave_unica\"],$_GET[\"for\"]);\n\t\t\t//echo '<script> location.reload(); </script>';\t\n\t\t\t//$email_info = DataBase::speed_crud(' SELECT c.CorreoElectronico FROM clientes as c, orden_rentas as q WHERE clave_unica='.$id.' AND c.IdCliente=q.IdCliente');\n\t\t\techo $email_info[1];\n\t\t}\n\n\n\t}",
"public function correo(){\n $ncontrol = $this->alumnos();\n $tcorreo2 = array();\n /*Busca en la base de datos alumno por alumno y regresa el correo*/\n for($i=0;$i<count($ncontrol);$i++) {\n $nprimero = array_pop($ncontrol);\n $tcorreo = DB::connection('sqlsrv')->select('SELECT \n CORREO1 \n FROM \n CAT_USUARIO \n JOIN CATR_ALUMNO ON CAT_USUARIO.PK_USUARIO = CATR_ALUMNO.ID_PADRE \n WHERE CATR_ALUMNO.NUMERO_CONTROL = :numerocontrol', ['numerocontrol' => $nprimero]);\n if($tcorreo != null){\n array_push($tcorreo2,$tcorreo);\n }\n }\n\n return $tcorreo2;\n }",
"function monta_corpo()\n {\n if (isset($this->array_total_participante))\n {\n foreach ($this->array_total_participante as $campo_participante => $dados_participante)\n {\n $val_grafico_participante = $dados_participante[5];\n $this->resumo_campos = $dados_participante;\n $this->monta_linha($dados_participante[5], 0, \"normal\", \"&participante=\" . urlencode($val_grafico_participante) . \"\");\n if (isset($this->array_total_pista[$campo_participante]))\n {\n foreach ($this->array_total_pista[$campo_participante] as $campo_pista => $dados_pista)\n {\n $val_grafico_pista = $dados_pista[5];\n $this->resumo_campos = $dados_pista;\n $this->monta_linha($dados_pista[5], 1, \"normal\", \"\");\n } // foreach pista\n } // isset pista\n } // foreach participante\n } // isset participante\n }",
"public function enviarCorreoCurso(){\n try{\n $CUR_id = $_POST[\"CUR_id\"];\n \n $curso = new Curso_model();\n $objCurso = $curso->listarCurso($CUR_id,'');\n $objCurso = $this->array_utf8_encode($objCurso);\n \n $TIPTRIP_descripcion = $objCurso[0][\"TIPTRIP_descripcion\"];\n $TIPCUR_descripcion = $objCurso[0][\"TIPCUR_descripcion\"];\n $CUR_fchini_Mes = strftime('%B',strtotime($objCurso[0][\"CUR_fchini2\"]));\n $CUR_fchfin_Anio = strftime('%Y',strtotime($objCurso[0][\"CUR_fchini2\"]));\n \n $detalle = new Detalle_model();\n $objCorreos = $detalle->listarCorreoCondicionales();\n foreach($objCorreos as $listaCorreos){\n $listaDestino = $listaDestino.\",\".$listaCorreos[\"CORR_correo\"];\n }\n $listaDestino = substr($listaDestino, 1);\n \n $email = new Email();\n $txt = \"<p>Señores:<p>\";\n $txt .= \"<p>El presente es para informarles la programación del Curso de \". $TIPCUR_descripcion .\" de los \".$TIPTRIP_descripcion.\" de fecha de \".$objCurso[0][\"CUR_fchini\"].\" al \".$objCurso[0][\"CUR_fchfin\"].\":<p>\";\n \n foreach( $objCurso as $listaCurso ){\n if( $listaCurso[\"PART_descripcion\"] == \"Instructor\" ){\n $txt .= \"<p>Instructor: \". $listaCurso[\"TRIP_nombre\"] .\" \". $listaCurso[\"TRIP_apellido\"] .\"<p>\"; \n }\n if( $listaCurso[\"PART_descripcion\"] == \"Alumno\" ){\n $txt .= \"<p>Alumno: \". $listaCurso[\"TRIP_nombre\"] .\" \". $listaCurso[\"TRIP_apellido\"] .\"<p>\";\n }\n }\n \n $txt .= \"<p>Fch. Inicio: \". $objCurso[0][\"CUR_fchini\"] .\"<p>\";\n $txt .= \"<p>Fch. Fin : \". $objCurso[0][\"CUR_fchfin\"] .\"<p>\";\n $txt .= \"<p><br/><p>\";\n \n $txt .= \"<p>Saludos cordiales.</p>\";\n \n $asunto = \"PROGRAMACIÓN DE CURSOS DE \".$TIPCUR_descripcion;\n $email->Enviar(utf8_decode($asunto),utf8_decode($txt),array($listaDestino),\"alexander.varon@peruvian.pe\",'','',\"curso\");\n \n \n echo \"exito\";\n } catch (Exception $e){\n $this->view->msg_catch = $e->getMessage();\n\t\t\t$this->view->render('error');\n }\n }",
"function RellenaDatosPorCentro()\n{\n\t\t//buscamos todos los atributos de la tupla\n $sql = \"SELECT *\n\t\t\tFROM TITULACION\n\t\t\tWHERE (\n\t\t\t\t(CODCENTRO = '$this->CODCENTRO') \n\t\t\t)\";\n\n\t//realiza la comprobacion\n\tif (!$resultado = $this->mysqli->query($sql))\n\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t}\n\treturn $resultado;\n}",
"public static function amigosConectados() {\n global $sql, $sesion_usuarioSesion, $textos, $configuracion;\n\n $tablas = array(\n \"c\" => \"contactos\",\n \"uc\" => \"usuarios_conectados\",\n \"u\" => \"usuarios\",\n \"p\" => \"personas\",\n \"i\" => \"imagenes\"\n );\n\n $columnas = array(\n \"id_contacto1\" => \"c.id_usuario_solicitante\",\n \"id_contacto2\" => \"c.id_usuario_solicitado\",\n \"estado\" => \"c.estado\",\n \"id_usuario\" => \"uc.id_usuario\",\n \"visible\" => \"uc.visible\",\n \"sobrenombre\" => \"u.sobrenombre\",\n \"usuario\" => \"u.usuario\",\n \"imagen\" => \"i.ruta\"\n );\n\n $condicion = \"(c.id_usuario_solicitante = \" . $sesion_usuarioSesion->id . \" AND c.id_usuario_solicitado = uc.id_usuario AND c.estado = '1' AND uc.id_usuario = u.id AND u.id_persona = p.id AND p.id_imagen = i.id AND uc.visible = '1') OR (c.id_usuario_solicitado = \" . $sesion_usuarioSesion->id . \" AND c.id_usuario_solicitante = uc.id_usuario AND c.estado = '1' AND uc.id_usuario = u.id AND u.id_persona = p.id AND p.id_imagen = i.id AND uc.visible = '1')\";\n\n //$sql->depurar = true;\n $consulta = $sql->seleccionar($tablas, $columnas, $condicion);\n if ($sql->filasDevueltas) {\n while ($contacto = $sql->filaEnObjeto($consulta)) {\n $contacto->foto = $configuracion[\"SERVIDOR\"][\"media\"] . $configuracion[\"RUTAS\"][\"imagenesMiniaturas\"] . \"/\" . $contacto->imagen;\n $lista[] = $contacto;\n }\n\n foreach ($lista as $elemento) {\n $item = HTML::enlace(HTML::imagen($elemento->foto, \"flotanteIzquierda margenDerecha miniaturaListaChat\"), '/users/' . $elemento->usuario);\n $opciones = array(\"onClick\" => \"javascript:chatWith('\" . $elemento->usuario . \"')\");\n $item .= HTML::enlace(HTML::frase($elemento->sobrenombre, \"claseUsuariosConectados margenSuperior\", \"usuarioChat_\" . $elemento->usuario), \"javascript:void(0)\", 'margenSuperior', \"\", $opciones);\n $listaContactos[] = $item;\n }\n\n $listaContactos = HTML::lista($listaContactos, \"listaVertical listaConIconos bordeSuperiorLista\", \"\", \"\");\n $codigo = HTML::contenedor($listaContactos, \"contenedorChat\");\n\n return $codigo;\n } else {\n return $textos->id(\"NO_HAY_CONTACTOS_CONECTADOS\");\n }\n }",
"public function Verificacion_Condiciones_Establecidas_Compras() {\n //DATOS RELACIONADOS CON EL VALOR MÍNIMO DEL PEDIDO Y CONDICION PARA REALIZAR EL PAGO.\n if ( Session::Get('cumple_condicion_cpras_tron_industial') == TRUE){\n Session::Set('valor_real_pedido', $this->Vr_Total_Pedido_Amigos );\n }else{\n Session::Set('valor_real_pedido', $this->Vr_Total_Pedido_Ocasional );\n }\n\n\n // VERIFICACIÓN DE SI CUMPLE CON EL VALOR MÍNIMO DE PEDIDO PARA PAGO EN PAYU LATAM\n if ( Session::Get('pago_minimo_payulatam') > Session::Get('valor_real_pedido' ) && Session::Get('valor_real_pedido' ) > 0 ){\n Session::Set('cumple_valor_minimo_pedido', FALSE);\n }else{\n Session::Set('cumple_valor_minimo_pedido', TRUE);\n }\n\n\n\n // VERIFICACIÓN DE SI CUMPLE O NO CON LAS COMPRAS MÍNIMAS DE PRODUCTOS TRON\n //Session::Get('minimo_compras_productos_tron')\n Session::Set('Cumple_Minimo_Compras_Productos_Tron', TRUE);\n if ( $this->Tengo_Productos_Tron == TRUE ){\n if ( ( $this->compras_tron + $this->compras_industrial ) < Session::Get('minimo_compras_productos_tron') ){\n Session::Set('Cumple_Minimo_Compras_Productos_Tron', FALSE);\n }else{\n Session::Set('Cumple_Minimo_Compras_Productos_Tron', TRUE);\n }\n }\n\n\n }",
"public function getCorreta()\n {\n return $this->correta;\n }",
"private function pendientesPorPlaza(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n\n /*\n * Query viejo, cuenta por servicios.*\n\n $queryConceptos=\" select\".\n \" C1.CONCEPTO_ID\".\n \" , count(*) as CANTIDAD\".\n \" , sum(if(C1.RANGO_PENDIENTE='Entre 0-2', 1,0)) as 'Entre02',\".\n \" sum(if(C1.RANGO_PENDIENTE='Entre 3-4', 1,0)) as 'Entre34', \".\n \" sum(if(C1.RANGO_PENDIENTE='Entre 5-6', 1,0)) as 'Entre56', \".\n \" sum(if(C1.RANGO_PENDIENTE='Entre 7-12', 1,0)) as 'Entre712', \".\n \" sum(if(C1.RANGO_PENDIENTE='Entre 13-24', 1,0)) as 'Entre1324', \".\n \" sum(if(C1.RANGO_PENDIENTE='Entre 25-48', 1,0)) as 'Entre2548', \".\n \" sum(if(C1.RANGO_PENDIENTE='Mas de 48', 1,0)) as 'Masde48' \".\n \" from (SELECT \".\n \" PP.`PEDIDO`, \".\n \" PP.`PEDIDO_ID`, \".\n \" PP.`FECHA_INGRESO`, \".\n \" PP.`FECHA_ESTADO`, \".\n \" case \".\n \" when PP.FUENTE='FENIX_NAL' and PP.CONCEPTO_ID='PETEC' then 'PETEC-NAL' \".\n \" when PP.FUENTE='FENIX_BOG' and PP.CONCEPTO_ID='PETEC' then 'PETEC-BOG' \".\n \" else PP.CONCEPTO_ID \".\n \" end as CONCEPTO_ID, \".\n \" PP.`MUNICIPIO_ID`, \".\n \" PP.`DIRECCION_SERVICIO`, \".\n \" PP.`FECHAINGRESO_SOLA`, \".\n \" PP.`HORAINGRESO`, \".\n \" DATE((PP.`FECHAESTADO_SOLA`)) as FECHAESTADO_SOLA, \".\n \" PP.`HORAESTADO`, \".\n \" PP.`DIANUM_ESTADO`, \".\n \" PP.`DIANOM_ESTADO`, \".\n \" PP.`RANGO_CARGA`, \".\n \" PP.`FECHA_CARGA`, \".\n \" DATE_FORMAT((PP.FECHA_CARGA),'%H') AS HORA_CARGA, \".\n \" PP.`DIA_CARGA`, \".\n \" PP.`MESNOMBRE_CARGA`, \".\n \" PP.`MESNUMERO_CARGA`, \".\n \" PP.`SEMANA_CARGA`, \".\n \" PP.`SEMANA_ANO_CARGA`, \".\n \" PP.`ANO_CARGA`, \".\n \" PP.`FUENTE`, \".\n \" PP.`STATUS`, \".\n \" PP.`VIEWS` \".\n \" , CAST(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO)) AS CHAR(255)) AS TIEMPO_PENDIENTE_FULL \".\n \" , CASE \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 0 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 2 THEN 'Entre 0-2' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 3 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 4 THEN 'Entre 3-4' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 5 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 6 THEN 'Entre 5-6' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 7 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 12 THEN 'Entre 7-12' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 13 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 24 THEN 'Entre 13-24' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) >= 25 and HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) <= 48 THEN 'Entre 25-48' \".\n \" WHEN HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) > 48 THEN 'Mas de 48' \".\n \" END AS RANGO_PENDIENTE \".\n \" FROM `portalbd`.`informe_petec_pendientesm` PP \".\n \" where (PP.STATUS= 'PENDI_PETEC' or PP.STATUS= 'MALO' ) and PP.FUENTE in ('FENIX_NAL','FENIX_BOG','EDATEL','SIEBEL')) C1\".\n \" group by C1.CONCEPTO_ID order by count(*) DESC\";\n */\n\n $queryConceptos=\"SELECT \".\n \" C2.CONCEPTO_ID \".\n \" , COUNT(*) AS CANTIDAD \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 0 AND (C2.RANGO_PENDIENTE) <= 2 THEN 1 ELSE 0 END) as 'Entre02' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 3 AND (C2.RANGO_PENDIENTE) <= 4 THEN 1 ELSE 0 END) as 'Entre34' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 5 AND (C2.RANGO_PENDIENTE) <= 6 THEN 1 ELSE 0 END) as 'Entre56' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 7 AND (C2.RANGO_PENDIENTE) <= 12 THEN 1 ELSE 0 END) as 'Entre712' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 13 AND (C2.RANGO_PENDIENTE) <= 24 THEN 1 ELSE 0 END) as 'Entre1324' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 25 AND (C2.RANGO_PENDIENTE) <= 48 THEN 1 ELSE 0 END) as 'Entre2548' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) > 48 THEN 1 ELSE 0 END) as 'Masde48' \".\n \" FROM(SELECT \".\n \" C1.PEDIDO_ID \".\n \" , MAX(C1.CONCEPTO_ID) AS CONCEPTO_ID \".\n \" , MAX(C1.RANGO_PENDIENTE) AS RANGO_PENDIENTE \".\n \" FROM(select \".\n \" PP.PEDIDO_ID \".\n \" , case \".\n \" when PP.FUENTE='FENIX_NAL' and PP.CONCEPTO_ID='PETEC' AND PP.STATUS!='MALO' then 'PETEC-NAL' \".\n \" when PP.FUENTE='FENIX_BOG' and PP.CONCEPTO_ID='PETEC' AND PP.STATUS!='MALO' then 'PETEC-BOG' \".\n \" WHEN PP.STATUS='MALO' THEN 'MALO' \".\n \" else PP.CONCEPTO_ID \".\n \" end as CONCEPTO_ID \".\n \" , HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(PP.FECHA_ESTADO))) AS RANGO_PENDIENTE \".\n \" FROM portalbd.informe_petec_pendientesm PP \".\n \" WHERE PP.STATUS IN ('PENDI_PETEC','MALO') ) C1 \".\n \" GROUP BY C1.PEDIDO_ID ) C2 \".\n \" GROUP BY C2.CONCEPTO_ID \".\n \" order by count(*) DESC \";\n $rr = $this->mysqli->query($queryConceptos) or die($this->mysqli->error.__LINE__);\n\n $queryConceptos = array();\n if($rr->num_rows > 0){\n\n while($row = $rr->fetch_assoc()){\n //$row['label']=\"Concepto \".$row['label'];\n $row['CONCEPTO_ID']=utf8_encode($row['CONCEPTO_ID']);\n $queryConceptos[] = $row;\n }\n }\n\n $queryConceptosNUEVO=\" SELECT \".\n \" C2.CONCEPTO_ID \".\n \" , COUNT(*) AS CANTIDAD \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 0 AND (C2.RANGO_PENDIENTE) <= 2 THEN 1 ELSE 0 END) as 'Entre02' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 3 AND (C2.RANGO_PENDIENTE) <= 4 THEN 1 ELSE 0 END) as 'Entre34' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 5 AND (C2.RANGO_PENDIENTE) <= 6 THEN 1 ELSE 0 END) as 'Entre56' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 7 AND (C2.RANGO_PENDIENTE) <= 12 THEN 1 ELSE 0 END) as 'Entre712' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 13 AND (C2.RANGO_PENDIENTE) <= 24 THEN 1 ELSE 0 END) as 'Entre1324' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) >= 25 AND (C2.RANGO_PENDIENTE) <= 48 THEN 1 ELSE 0 END) as 'Entre2548' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) > 48 THEN 1 ELSE 0 END) as 'Masde48' \".\n \" FROM( \".\n \" SELECT \".\n \" C1.PEDIDO_ID \".\n \" , C1.CONCEPTO_ID \".\n \" , group_concat(DISTINCT C1.TIPO_TRABAJO order by 1 asc) AS TIPO_TRABAJO \".\n \" , group_concat(DISTINCT C1.FUENTE) AS FUENTE \".\n \" , group_concat(DISTINCT C1.RADICADO_TEMPORAL) AS RADICADO_TEMPORAL \".\n \" , MAX(C1.RANGO_PENDIENTE) as RANGO_PENDIENTE \".\n \" FROM ( \".\n \" SELECT \".\n \" PEDIDO_ID \".\n \" , SUBPEDIDO_ID \".\n \" , SOLICITUD_ID \".\n \" , CASE \".\n \" \twhen FUENTE='FENIX_BOG' and CONCEPTO_ID='PETEC' and STATUS!='MALO' then 'PETEC-BOG' \".\n \" when FUENTE='FENIX_NAL' and CONCEPTO_ID='PETEC' and STATUS!='MALO' then 'PETEC-NAL' \".\n \" when STATUS='MALO' then 'MALO' \".\n \" ELSE CONCEPTO_ID \".\n \" END AS CONCEPTO_ID \".\n \" , CASE \".\n /*\n \" \twhen DESC_TIPO_TRABAJO='NA NUEVO' then 'NUEVO' \".\n \" when DESC_TIPO_TRABAJO='MODIFICACION,NA NUEVO' then 'CAMBI,NUEVO' \".\n \" when TIPO_TRABAJO='CAMBIO' then 'CAMBI' \".\n \" when TIPO_TRABAJO='NUEVO,RETIR' then 'NUEVO' \".\n \" when TIPO_TRABAJO='8' then 'NUEVO' \".\n \" when TIPO_TRABAJO='CAMBI,NUEVO,RETIR' then 'CAMBI,NUEVO' \".\n \" when TIPO_TRABAJO='CAMBIO,VENTA' then 'CAMBI,NUEVO' \".\n */\n\n \" WHEN UPPER(TIPO_TRABAJO) like '%NUEVO%' OR UPPER(TIPO_TRABAJO) LIKE '%TRASL%' OR UPPER(TIPO_TRABAJO)='CAMBIO DE DOMICILIO' THEN 'NUEVO' \".\n \" else 'CAMBIO' \".\n \" end as TIPO_TRABAJO \".\n \" , FUENTE \".\n \" , RADICADO_TEMPORAL \".\n \" , HOUR(TIMEDIFF(CURRENT_TIMESTAMP(),(FECHA_ESTADO))) AS RANGO_PENDIENTE \".\n \" FROM portalbd.informe_petec_pendientesm \".\n \" where 1=1 \".\n \" and STATUS in ('PENDI_PETEC','MALO') \".\n \" and fuente in ('FENIX_NAL','FENIX_BOG','SIEBEL','EDATEL') \".\n \" and CONCEPTO_ID NOT IN ('OT-C11','OT-C08','OT-T01','OT-T04','OT-T05') )C1 \".\n \" GROUP BY C1.PEDIDO_ID, C1.CONCEPTO_ID ) C2 \".\n \" WHERE C2.TIPO_TRABAJO='NUEVO' \".\n \" GROUP BY C2.CONCEPTO_ID \".\n \" order by count(*) DESC\";\n //echo $queryConceptosNUEVO;\n\n $rr = $this->mysqli->query($queryConceptosNUEVO) or die($this->mysqli->error.__LINE__);\n\n $queryConceptosNUEVO = array();\n if($rr->num_rows > 0){\n\n while($row = $rr->fetch_assoc()){\n //$row['label']=\"Concepto \".$row['label'];\n $row['CONCEPTO_ID']=utf8_encode($row['CONCEPTO_ID']);\n $queryConceptosNUEVO[] = $row;\n }\n }\n\n /*\n * *Query viejo para sacar los pendientes segun su fecha cita por servicios\n $query= \" select \".\n \" C1.CONCEPTO_ID \".\n \" , count(*) as CANTIDAD \".\n \" , sum(if(C1.RANGO_PENDIENTE='Ayer', 1,0)) as 'Ayer', \".\n \" sum(if(C1.RANGO_PENDIENTE='Hoy', 1,0)) as 'Hoy', \".\n \" sum(if(C1.RANGO_PENDIENTE='Manana', 1,0)) as 'Manana', \".\n \" sum(if(C1.RANGO_PENDIENTE='Pasado Manana', 1,0)) as 'Pasado_Manana', \".\n \" sum(if(C1.RANGO_PENDIENTE='Mas de 3 dias', 1,0)) as 'Mas_de_3_dias', \".\n \" sum(if(C1.RANGO_PENDIENTE='Sin Fecha Cita', 1,0)) as 'Sin_Fecha_Cita', \".\n \" sum(if(C1.RANGO_PENDIENTE='Viejos', 1,0)) as 'Viejos' \".\n \" from (SELECT \".\n \" PP.PEDIDO, \".\n \" PP.PEDIDO_ID, \".\n \" PP.FECHA_INGRESO, \".\n \" PP.FECHA_ESTADO, \".\n \" PP.FECHA_CITA, \".\n \" case \".\n \" when PP.FUENTE='FENIX_NAL' and PP.CONCEPTO_ID='PETEC' then 'PETEC-NAL' \".\n \" when PP.FUENTE='FENIX_BOG' and PP.CONCEPTO_ID='PETEC' then 'PETEC-BOG' \".\n \" else PP.CONCEPTO_ID end as CONCEPTO_ID, \".\n \" PP.MUNICIPIO_ID, \".\n \" DATE((PP.FECHAESTADO_SOLA)) as FECHAESTADO_SOLA, \".\n \" DATE_FORMAT((PP.FECHA_CARGA),'%H') AS HORA_CARGA, \".\n \" PP.FUENTE, \".\n \" PP.STATUS \".\n \" , cast((CASE \".\n \" WHEN PP.FECHA_CITA= DATE_SUB(CURDATE() , INTERVAL 1 DAY) THEN 'Ayer' \".\n \" WHEN PP.FECHA_CITA=current_date() THEN 'Hoy' \".\n \" WHEN PP.FECHA_CITA=DATE_ADD(CURDATE(), INTERVAL 1 DAY) THEN 'Manana' \".\n \" WHEN PP.FECHA_CITA=DATE_ADD(CURDATE(), INTERVAL 2 DAY) THEN 'Pasado Manana' \".\n \" WHEN PP.FECHA_CITA='9999-00-00' OR PP.FECHA_CITA='0000-00-00' THEN 'Sin Fecha Cita' \".\n \" WHEN PP.FECHA_CITA>=DATE_ADD(CURDATE(), INTERVAL 3 DAY) THEN 'Mas de 3 dias' \".\n \" WHEN PP.FECHA_CITA<= DATE_SUB(CURDATE() , INTERVAL 1 DAY) THEN 'Viejos' \".\n \" else PP.FECHA_CITA \".\n \" END ) as char )AS RANGO_PENDIENTE \".\n \" FROM portalbd.informe_petec_pendientesm PP \".\n \" where (PP.STATUS= 'PENDI_PETEC' or PP.STATUS= 'MALO' ) and PP.FUENTE in ('FENIX_NAL','FENIX_BOG','EDATEL','SIEBEL')) C1 \".\n \" group by C1.CONCEPTO_ID order by count(*) DESC \";\n */\n //echo $query;\n $query=\"SELECT \".\n \" C2.CONCEPTO_ID \".\n \" , COUNT(*) AS CANTIDAD \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Ayer' THEN 1 ELSE 0 END) as 'Ayer' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Hoy' THEN 1 ELSE 0 END) as 'Hoy' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Manana' THEN 1 ELSE 0 END) as 'Manana' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Pasado_Manana' THEN 1 ELSE 0 END) as 'Pasado_Manana' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Mas_3dias' THEN 1 ELSE 0 END) as 'Mas_de_3_dias' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Sin_Agenda' THEN 1 ELSE 0 END) as 'Sin_Fecha_Cita' \".\n \" , sum( CASE WHEN (C2.RANGO_PENDIENTE) ='Viejos' THEN 1 ELSE 0 END) as 'Viejos' \".\n \" FROM(SELECT \".\n \" C1.PEDIDO_ID \".\n \" , MAX(C1.CONCEPTO_ID) AS CONCEPTO_ID \".\n \" , MAX(C1.RANGO_PENDIENTE) AS RANGO_PENDIENTE \".\n \" FROM(select \".\n \" PP.PEDIDO_ID \".\n \" , case \".\n \" when PP.FUENTE='FENIX_NAL' and PP.CONCEPTO_ID='PETEC' AND PP.STATUS!='MALO' then 'PETEC-NAL' \".\n \" when PP.FUENTE='FENIX_BOG' and PP.CONCEPTO_ID='PETEC' AND PP.STATUS!='MALO' then 'PETEC-BOG' \".\n \" WHEN PP.STATUS='MALO' THEN 'MALO' \".\n \" else PP.CONCEPTO_ID end as CONCEPTO_ID \".\n \" , cast((CASE \".\n \" WHEN PP.FECHA_CITA='9999-00-00' OR PP.FECHA_CITA='0000-00-00' THEN 'Sin_Agenda' \".\n \" WHEN PP.FECHA_CITA= DATE_SUB(CURDATE() , INTERVAL 1 DAY) THEN 'Ayer' \".\n \" WHEN PP.FECHA_CITA=current_date() THEN 'Hoy' \".\n \" WHEN PP.FECHA_CITA=DATE_ADD(CURDATE(), INTERVAL 1 DAY) THEN 'Manana' \".\n \" WHEN PP.FECHA_CITA=DATE_ADD(CURDATE(), INTERVAL 2 DAY) THEN 'Pasado_Manana' \".\n \" WHEN PP.FECHA_CITA>=DATE_ADD(CURDATE(), INTERVAL 3 DAY) THEN 'Mas_3dias' \".\n \" WHEN PP.FECHA_CITA<= DATE_SUB(CURDATE() , INTERVAL 1 DAY) THEN 'Viejos' \".\n \" else PP.FECHA_CITA \".\n \" END ) as char )AS RANGO_PENDIENTE \".\n \" FROM portalbd.informe_petec_pendientesm PP \".\n \" WHERE PP.STATUS IN ('PENDI_PETEC','MALO') ) C1 \".\n \" GROUP BY C1.PEDIDO_ID ) C2 \".\n \" GROUP BY C2.CONCEPTO_ID \".\n \" order by count(*) DESC \";\n $r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\n if($r->num_rows > 0){\n $queryConceptosFcita = array();\n while($row = $r->fetch_assoc()){\n //$row['label']=\"Concepto \".$row['label'];\n $queryConceptosFcita[] = $row;\n }\n $this->response($this->json(array('','',$queryConceptos,'',$queryConceptosFcita,$queryConceptosNUEVO)), 200); // send user details\n }\n\n $this->response('',204); // If no records \"No Content\" status\n\n }",
"function consultarRequisitosPlan() {\n $variables=array('codProyectoEstudiante'=>$this->datosEstudiante['codProyectoEstudiante'],\n 'planEstudioEstudiante'=>$this->datosEstudiante['planEstudioEstudiante']\n );\n $cadena_sql = $this->sql->cadena_sql(\"buscar_requisitos_plan\", $variables); \n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n if(is_array($resultado))\n {\n foreach ($resultado as $valor) {\n $resultadoCodigo[]=array('CODIGO_ESPACIO'=>$valor['COD_ASIGNATURA'],\n 'CODIGO_REQUISITO'=>$valor['COD_REQUISITO']);\n }\n }else\n {\n $resultadoCodigo=''; \n \n }\n return($resultadoCodigo) ;\n }",
"private function calcularFreteCorreios() {\n\t\tif ($this->peso < 30) {\n\t\t\t$altura \t = ($data['a'] < 12) ? 12 : $data['a']; //o minimo é 12cm\n\t\t\t$largura \t = ($data['l'] < 12) ? 12 : $data['l']; //o minimo é 12cm\n\t\t\t$comprimento = ($data['c'] < 16) ? 16 : $data['c']; //o minimo é 16cm\n\n\t\t\t$servicos = array();\n\n\t\t\tif ($comprimento <= 105 && $largura <= 105) $servicos[] = 41106; //pac\n\t\t\tif ($comprimento <= 60 && $largura <= 60) $servicos[] = 40010; //sedex\n\n\t\t\t$url = 'http://ws.correios.com.br/calculador/CalcPrecoPrazo.aspx';\n\n\t\t\t$qry['nCdServico'] = implode(',',$servicos);\n\t\t\t$qry['nCdFormato'] = '1';\n\t\t\t$qry['nCdEmpresa'] = '';\n\t\t\t$qry['sDsSenha'] = '';\n\t\t\t$qry['sCepOrigem'] = $this->origem;\n\t\t\t$qry['sCepDestino'] = $this->destino;\n\t\t\t$qry['nVlPeso'] = $this->peso;\n\t\t\t$qry['nVlComprimento'] = $comprimento;\n\t\t\t$qry['nVlAltura'] = $altura;\n\t\t\t$qry['nVlLargura'] = $largura;\n\t\t\t$qry['nVlDiametro'] = '0';\n\t\t\t$qry['nVlValorDeclarado'] = '200';\n\t\t\t$qry['sCdAvisoRecebimento'] = 'n';\n\t\t\t$qry['sCdMaoPropria'] = 'n';\n\t\t\t$qry['StrRetorno'] = 'xml';\n\t\t\t$qry = http_build_query($qry);\n\n\t $result = simplexml_load_file($url . '?' . $qry);\n\t \n\t foreach ($result->cServico as $srv) {\n\t\t if ($srv->Erro == 0) {\n\t\t \t$arr[] = array(\n\t\t \t\t'servico' => (string)($srv->Codigo == '40010' ? 'SEDEX' : 'PAC'),\n\t\t \t\t'preco' => (float)($srv->Valor+(0.1*$srv->Valor)), //valor mais 10%\n\t\t \t\t'prazo' => (int)$srv->PrazoEntrega,\n\t\t \t\t'mensagem' => null\n\t\t \t);\n\t\t }\n\t\t\t}\n\n\t\t\treturn $arr;\n\t\t}\n\t}",
"public function personalConContrato(){\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT P.*,C.* FROM CONTRATO C INNER JOIN PERSONAL P ON P.PERSCODIGO = C.PERSCODIGO WHERE P.ESTCODIGO='8' AND P.EMPCODIGO=C.EMPCODIGO ORDER BY P.PERSAPELLIDO_PATERNO, PERSAPELLIDO_MATERNO\";\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }",
"function presentarCreditosRegistradosPlan() {\r\n $mensajeEncabezado='CRÉDITOS APROBADOS POR VICERRECTORIA';\r\n $mensaje='Los créditos aprobados por vicerrectoría, corresponden a la suma de créditos de los espacios académicos<br>\r\n registrados por el coordinador y aprobados por vicerrectoría, para el plan de estudios.';\r\n $creditosAprobados=array(array('OB'=>$this->creditosOB,\r\n 'OC'=>$this->creditosOC,\r\n 'EI'=>$this->creditosEI,\r\n 'EE'=>$this->creditosEE,\r\n 'CP'=>$this->creditosCP,\r\n 'TOTAL'=>$this->creditosTotal,\r\n 'ENCABEZADO'=>$mensajeEncabezado,\r\n 'MENSAJE'=>$mensaje,\r\n 'PROPEDEUTICO'=>$this->datosPlan[0]['PLAN_PROPEDEUTICO']));\r\n $this->parametrosPlan->mostrarParametrosRegistradosPlan($creditosAprobados);\r\n $mensajeEncabezado='RANGOS DE CRÉDITOS INGRESADOS POR EL COORDINADOR *';\r\n $mensaje='*Los rangos de créditos, corresponden a los datos que el Coordinador registró como parámetros iniciales<br>\r\n del plan de estudio, según lo establecido en el artículo 12 del acuerdo 009 de 2006.';\r\n $parametrosAprobados=array(array('ENCABEZADO'=>$mensajeEncabezado,\r\n 'MENSAJE'=>$mensaje,\r\n 'PROPEDEUTICO'=>$this->datosPlan[0]['PLAN_PROPEDEUTICO']));\r\n $this->parametrosPlan->mostrarParametrosAprobadosPlan($this->datosPlan[0]['COD_PLAN_ESTUDIO'],$parametrosAprobados);\r\n }",
"public function getCorreo(){\r\n return $this->Correo;\r\n }",
"public function listarCorrespondenciasOtros()\n {\n $listar = $this->db->prepare(\"select correspondencia.id as corresid,correspondencia.radicado,juzgado.nombre as juzgadonom,correspondencia.esOficio_Telegrama,correspondencia.oficio_telegrama,\ncorrespondencia.destinatario, medio.nombre as medionot,correspondencia.notificado,correspondencia.direccion\nfrom correspondencia_otros as correspondencia\ninner join pa_juzgado as juzgado on (juzgado.id=correspondencia.idjuzgado)\ninner join pa_medionotificacion as medio on (medio.id=correspondencia.idmedionotificacion)\");\n $listar->execute();\n return $listar;\n }",
"function lista_consejoDisciplinario(){\n\t\t\t$sql=\"SELECT c.idCadete,c.paterno,c.materno,c.nombres,c.codigo,u.curso2,u.curso,f.idFalta,f.falta,t.clase,d.fechaIngreso,d.idRegistro,d.idConsejo,d.numero,d.gestion\n\t FROM cadetes c, registroCadetes r, gestion g, cursos u,consejoDisciplinario d, faltas f,tipoFaltas t\n\t\t WHERE r.idGestion=g.idGestion and c.idCadete=r.idCadete and u.idCurso=r.idCurso \n\t\t \t\tAND r.idRegistro=d.idRegistro AND f.idFalta=d.idFalta AND t.idTipoFalta=f.idTipoFalta AND d.baja='0'\n\t\t ORDER BY c.paterno\";\n return $this->select ($sql);\n\t}",
"public function paquetesEnTransito()\n {\n $sentencia = \"SELECT * FROM paquete\n JOIN transportista\n ON ci_transportista = cedula_transportista\n WHERE estado_paquete = 'en transito'\n ORDER BY fecha_entrega\";\n\n $this->conexionServidor();\n $this->conexionBaseDatos();\n $resultado = $this->ejecutarSentencia($sentencia);\n $this->cerrarConexion();\n\n $cantidadFilas = mysqli_num_rows($resultado);\n\n if ($cantidadFilas >= 1) // SI HAY MAS DE UN PAQUETE \"EN TRANSITO\"\n {\n // CREAMOS UN ARRAY PARA GUARDAR LOS PAQUETES \"EN TRANSITO\" Y SU TRANSPORTISTA\n $transportesActivos = array();\n\n // EXTRAEMOS LOS PAQUETES \"EN TRANSITO\" CON SU TRANSPORTISTA DEL RESULTADO, Y LOS AGREGAOS AL ARRAY\n for ($i = 0; $i < $cantidadFilas; $i++)\n {\n $paquete = new Paquete;\n $transportista = new Transportista;\n\n $fila = mysqli_fetch_assoc($resultado);\n\n $paquete->codigo = $fila['codigo'];\n $paquete->fechaYHoraAsignacion = $fila['fecha_hora_asignacion'];\n\n $transportista->cedula = $fila['cedula_transportista'];\n $transportista->nombre = $fila['nombre'];\n\n $transporte = array($paquete, $transportista);\n\n $transportesActivos[] = $transporte;\n }\n\n // RETORNAMOS EL ARRAY CON LOS PAQUETE Y SUS TRANSPORTISTAS\n return $transportesActivos;\n }\n else // SI NO HAY PAQUETES EN TRANSITO\n {\n // RETORNAMOS NULL\n return null;\n }\n }",
"function get_rechazadas() {\n\t\t$condicion = array(\n\t\t\t'pa_solicitudes.IdArea' => $this->session->userdata('id_area'),\n\t\t\t'pa_solicitudes.Estado' => '4'\n\t\t);\n\t\t$this->db->select('bc_documentos.IdDocumento,bc_documentos.Codigo,pa_solicitudes.IdSolicitud,pa_solicitudes.Estado,pa_solicitudes.Rechazo,bc_documentos.Fecha,pa_solicitudes.Causas,pa_solicitudes.Solicitud,pa_solicitudes.Observaciones');\n\t\t$this->db->join('bc_documentos','bc_documentos.IdDocumento = pa_solicitudes.IdDocumento');\n\t\t$consulta = $this->db->get_where('pa_solicitudes', $condicion );\n\t\t\n\t\treturn $consulta;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new set of values to create a new query term. | function _query_interface_extract_new_query_term_values( $query, $variable ) {
$values = array();
$values['query_id'] = $query->id;
$values['variable_id'] = $variable->nid;
$values['weight'] = 0;
return $values;
} | [
"abstract protected function createTerm( $name, $type, $value );",
"function tripal_rnaseq_add_cvterms() {\n\n $expression_term = array(\n 'raw_count' => 'raw count number of reads',\n 'RPKM' => 'Reads Per Kilobase of transcript per Million', \n 'FPKM' => 'Fragments Per Kilobase of transcript per Million',\n 'RPM' => 'Reads per Million',\n\t'SD_raw_count' => 'SD for error bar of raw count',\n 'SD_RPKM' => 'SD for error bar of RPKM',\n 'SD_FPKM' => 'SD for error bar of FPKM',\n 'SD_RPM' => 'SD for error bar of RPM'\n );\n\n tripal_insert_cv(\n 'tripal_rnaseq',\n 'Contains property terms for tripal rnaseq.'\n );\n\n foreach ($expression_term as $term => $description) {\n tripal_insert_cvterm(array(\n 'name' => $term,\n 'definition' => $description,\n 'cv_name' => 'tripal_rnaseq',\n 'db_name' => 'tripal_sra',\n ));\n }\n}",
"function drush_behat_op_create_term($term) {\n $term->vid = $term->vocabulary_machine_name;\n\n // Attempt to decipher any fields that may be specified.\n _drush_behat_expand_entity_fields('taxonomy_term', $term);\n\n $entity = entity_create('taxonomy_term', (array)$term);\n $entity->save();\n\n $term->tid = $entity->id();\n return $term;\n}",
"function add_term($name, $start, $end, $due, $mentor=false) {\n // Assumes we want the default values for visible and editable fields\n $query = \"INSERT INTO term (term_name, start_date, end_date, due_date, mentoring) VALUES($1, $2, $3, $4, $5)\";\n\n return pg_query_params($GLOBALS['CONNECTION'], $query, array($name, $start->format(\"Y-m-d\"), $end->format(\"Y-m-d\"), $due->format(\"Y-m-d\"), var_export($mentor, true)));\n}",
"public function createTerm(\\stdClass $term);",
"function wps_add_term(){\n\n\n // Product IDs\n $ids = $_REQUEST['ids'];\n $slug = $_REQUEST['slug'];\n $title = $_REQUEST['title'];\n\n if( !$ids ){\n echo '<li>No products in collection ' . $title . ' found, continuing...</li>';\n die();\n }\n\n $ids = explode(',', $ids);\n $term = get_term_by('slug', $slug, 'wps_collection');\n\n foreach( $ids as $id ){\n\n $args = array(\n \t'posts_per_page' => 1,\n \t'post_type' => 'wps-product',\n \t'meta_key' => '_wshop_product_id',\n \t'meta_value' => $id\n );\n $target_post = reset(get_posts( $args ));\n\n wp_set_object_terms( $target_post->ID, $slug, 'wps_collection', true );\n\n echo '<li>Added collection ' . $title . ' to product ' . $target_post->post_title . '...</li>';\n\n }\n\n die();\n\n }",
"public function createTerms(): self\n {\n $this->config->set('add_term', true);\n\n return $this;\n }",
"private function set_queried_terms(){\n\n\t\t$queried_terms = array();\n\n\t\t// Add terms as taxonomy => array( terms )\n\t\t// TODO: extend for other query parameters, e.g. author, meta\n\t\tforeach ( $this->query_vars['tax_query'] as $query_var => $var_data ) {\n\t\t\t$queried_terms[ $var_data['taxonomy'] ] = $var_data['terms'];\n\t\t}\n\n\t\t$this->queried_terms = $queried_terms;\n\n\t}",
"public function append_terms($terms){\r\n $stmt = $this->prepare('INSERT INTO dictionary (term) VALUES (:term)');\r\n if(!$stmt){\r\n throw(new Exception($this->lastErrorMsg()));\r\n }\r\n foreach ($terms as $term){\r\n $term = rtrim($term);\r\n $stmt->bindValue(':term', $term, SQLITE3_TEXT);\r\n $result = $stmt->execute();\r\n if(!$result){\r\n throw(new Exception($this->lastErrorMsg()));\r\n }\r\n }\r\n }",
"private static function create_terms() {\n $default_product_types = jpid_default_product_types();\n\n foreach ( $default_product_types as $product_type => $slug ) {\n if ( ! get_term_by( 'slug', $slug, 'jpid_product_type' ) ) {\n wp_insert_term( $product_type, 'jpid_product_type', array( 'slug' => $slug ) );\n }\n }\n }",
"function setQuery($set) {\n return 't.term_taxonomy_id IN (' . $set . \")\";\n }",
"public function setTerms(array $terms) {\n\t\t$this->itsTerms = Term::__createCollection($terms);\n\t\t\n\t\treturn $this;\n\t}",
"protected function createTerm( $name, $type, $value )\n\t{\n\t\t$escaped = $this->escape( $this->getOperator(), $type, $value );\n\t\treturn $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $escaped;\n\t}",
"public function setTermIds($val)\n {\n $this->_propDict[\"termIds\"] = $val;\n return $this;\n }",
"function termSelectBuilder()\n {\n if( !isset($GLOBALS['BannerStudent']) ){\n require_once('BannerStudent.class.php');\n $GLOBALS['BannerStudent'] = new BannerStudent( PSU::db('banner') );\n }\n\n $ugterm = $GLOBALS['BannerStudent']->reslifeCurrentTerm('UG');\n $gterm = $GLOBALS['BannerStudent']->reslifeCurrentTerm('GR');\n\n $label = $this->getSemName($ugterm);\n\n $currentArray[$ugterm.\"/\".$gterm] = 'Current: '.$label;\n\n $past = $this->oldTerms();\n $future = $this->nextTerms();\n return array_merge($currentArray, $future, $past);\n }",
"public function testGetSetForTerm()\n {\n $subject = $this->createInstance();\n\n $set1 = $this->createSynonymSet(array('apple', 'banana', 'orange'));\n $set2 = $this->createSynonymSet(array('tomato', 'cucumber', 'radish'));\n $subject->addMany(array($set1, $set2));\n\n $this->assertTrue($subject->getSetForTerm('banana') === $set1, 'Incorrect set retrieved for fruit term');\n $this->assertTrue($subject->getSetForTerm('cucumber') === $set2, 'Incorrect set retrieved for vegetable term');\n\n $animal = 'cat';\n $animalSet = $subject->getSetForTerm($animal);\n $this->assertTrue(iterator_to_array($animalSet) == array($animal), 'Incorrect set retrieved for animal term');\n }",
"public function createTerms($options = null): \\Solarium\\QueryType\\Terms\\Query;",
"public function setToTerm($val)\n {\n $this->_propDict[\"toTerm\"] = $val;\n return $this;\n }",
"function __clone()\r\n {\r\n $newTerms = array();\r\n foreach ($this->Terms as $term)\r\n {\r\n $newTerms[] = clone $term;\r\n }\r\n $this->Terms = $newTerms;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.